public final class UniqueKey extends Object
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.
UniqueKeyPolicy
Constructor and Description |
---|
UniqueKey(List<String> paths)
Instantiates a new Unique key with paths.
|
Modifier and Type | Method and Description |
---|---|
List<String> |
getPaths()
Gets the paths, a set of which must be unique for each item in the Azure Cosmos DB service.
|
UniqueKey |
setPaths(List<String> paths)
Sets the paths, a set of which must be unique for each item in the Azure Cosmos DB service.
|
public List<String> getPaths()
The paths to enforce uniqueness on. Each path is a rooted path of the unique property in the item, such as "/name/first".
public UniqueKey setPaths(List<String> paths)
The paths to enforce uniqueness on. Each path is a rooted path of the unique property in the item, such as "/name/first".
paths
- the unique paths.Copyright © 2021 Microsoft Corporation. All rights reserved.