Package com.azure.cosmos.models
Class UniqueKey
java.lang.Object
com.azure.cosmos.models.UniqueKey
Represents a unique key on that enforces uniqueness constraint on items in the container in the Azure Cosmos
DB service.
1) For containers, the value of partition key is implicitly a part of each unique key.
2) Uniqueness constraint is also enforced for missing values.
For instance, if unique key policy defines a unique key with single property path, there could be only one item that has missing value for this property.
- See Also:
-
Constructor Summary
-
Method Summary
-
Constructor Details
-
UniqueKey
Instantiates a new Unique key with paths.- Parameters:
paths
- the unique paths.
-
-
Method Details
-
getPaths
Gets the paths, a set of which must be unique for each item in the Azure Cosmos DB service.The paths to enforce uniqueness on. Each path is a rooted path of the unique property in the item, such as "/name/first".
- Returns:
- the unique paths.
-
setPaths
Sets the paths, a set of which must be unique for each item in the Azure Cosmos DB service.The paths to enforce uniqueness on. Each path is a rooted path of the unique property in the item, such as "/name/first".
- Parameters:
paths
- the unique paths.- Returns:
- the Unique Key.
-