Package com.azure.data.cosmos
Class CompositePath
- java.lang.Object
-
- com.azure.data.cosmos.JsonSerializable
-
- com.azure.data.cosmos.CompositePath
-
public class CompositePath extends JsonSerializable
Represents a composite path of the IndexingPolicy in the Azure Cosmos DB database service. A composite path is used in a composite index. For example if you want to run a query like "SELECT * FROM c ORDER BY c.age, c.height", then you need to add "/age" and "/height" as composite paths to your composite index.
-
-
Constructor Summary
Constructors Constructor Description CompositePath()
Constructor.CompositePath(String jsonString)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CompositePathSortOrder
order()
Gets the sort order for the composite path.CompositePath
order(CompositePathSortOrder order)
Gets the sort order for the composite path.String
path()
Gets path.CompositePath
path(String path)
Sets path.-
Methods inherited from class com.azure.data.cosmos.JsonSerializable
get, getBoolean, getCollection, getDouble, getInt, getList, getLogger, getLong, getMap, getObject, getObjectByPath, getString, has, toJson, toJson, toObject, toString
-
-
-
-
Constructor Detail
-
CompositePath
public CompositePath()
Constructor.
-
CompositePath
public CompositePath(String jsonString)
Constructor.- Parameters:
jsonString
- the json string that represents the included path.
-
-
Method Detail
-
path
public String path()
Gets path.- Returns:
- the path.
-
path
public CompositePath path(String path)
Sets path.- Parameters:
path
- the path.- Returns:
- the CompositePath.
-
order
public CompositePathSortOrder order()
Gets the sort order for the composite path. For example if you want to run the query "SELECT * FROM c ORDER BY c.age asc, c.height desc", then you need to make the order for "/age" "ascending" and the order for "/height" "descending".- Returns:
- the sort order.
-
order
public CompositePath order(CompositePathSortOrder order)
Gets the sort order for the composite path. For example if you want to run the query "SELECT * FROM c ORDER BY c.age asc, c.height desc", then you need to make the order for "/age" "ascending" and the order for "/height" "descending".- Parameters:
order
- the sort order.- Returns:
- the CompositePath.
-
-