Class RangeIndex
Specifies an instance of the RangeIndex class in the Azure Cosmos DB service.
public sealed class RangeIndex : Index, ICloneable
- Inheritance
-
RangeIndex
- Implements
- Inherited Members
- Extension Methods
Remarks
Can be used to serve queries like: SELECT * FROM docs d WHERE d.prop > 5.
Constructors
RangeIndex(DataType)
Initializes a new instance of the RangeIndex class with specified DataType for the Azure Cosmos DB service.
public RangeIndex(DataType dataType)
Parameters
dataType
DataTypeSpecifies the target data type for the index path specification.
Examples
Here is an example to instantiate RangeIndex class passing in the DataType:
RangeIndex rangeIndex = new RangeIndex(DataType.Number);
- See Also
RangeIndex(DataType, short)
Initializes a new instance of the RangeIndex class with specified DataType and precision for the Azure Cosmos DB service.
public RangeIndex(DataType dataType, short precision)
Parameters
dataType
DataTypeSpecifies the target data type for the index path specification.
precision
shortSpecifies the precision to be used for the data type associated with this index.
Examples
Here is an example to instantiate RangeIndex class passing in the DataType and precision:
RangeIndex rangeIndex = new RangeIndex(DataType.Number, -1);
- See Also
Properties
DataType
Gets or sets the data type for which this index should be applied in the Azure Cosmos DB service.
public DataType DataType { get; set; }
Property Value
- DataType
The data type for which this index should be applied.
Remarks
Refer to http://azure.microsoft.com/documentation/articles/documentdb-indexing-policies/#ConfigPolicy for valid ranges of values.
Precision
Gets or sets the precision for this particular index in the Azure Cosmos DB service.
public short? Precision { get; set; }
Property Value
- short?
The precision for this particular index. Returns null, if not set.
Remarks
Refer to http://azure.microsoft.com/documentation/articles/documentdb-indexing-policies/#ConfigPolicy for valid ranges of values.
Methods
Clone()
Creates a copy of the range index for the Azure Cosmos DB service.
public object Clone()
Returns
- object
A clone of the range index.