Index 类

定义

Represents the index of a collection in the Azure Cosmos DB database service.

public class Index extends JsonSerializable
继承
java.lang.Object
Serializable
Index

继承成员

构造函数

Index(IndexKind indexKind)

Constructor.

Index(JSONObject jsonObject, IndexKind indexKind)

Constructor.

Index(String jsonString, IndexKind indexKind)

Constructor.

方法

getKind()

Gets index kind.

Hash(DataType dataType)

Returns an instance of HashIndex class with specified DataType.

Here is an example to create HashIndex instance passing in the DataType:

HashIndex hashIndex = Index.Hash(DataType.String);
</code></pre></p>

Hash(DataType dataType, int precision)

Returns an instance of HashIndex class with specified DataType and precision.

Here is an example to create HashIndex instance passing in the DataType and precision:

HashIndex hashIndex = Index.Hash(DataType.String, 3);

Range(DataType dataType)

Returns an instance of RangeIndex class with specified DataType.

Here is an example to create RangeIndex instance passing in the DataType:

RangeIndex rangeIndex = Index.Range(DataType.Number);
</code></pre></p>

Range(DataType dataType, int precision)

Returns an instance of RangeIndex class with specified DataType and precision.

Here is an example to create RangeIndex instance passing in the DataType and precision:

RangeIndex rangeIndex = Index.Range(DataType.Number, -1);
</code></pre></p>

Spatial(DataType dataType)

Returns an instance of SpatialIndex class with specified DataType.

Here is an example to create SpatialIndex instance passing in the DataType:

SpatialIndex spatialIndex = Index.Spatial(DataType.Point);

适用于