You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/cosmos-db/how-to-define-unique-keys.md
+5-2Lines changed: 5 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -34,7 +34,9 @@ This article presents the different ways to define [unique keys](unique-keys.md)
34
34
35
35
To create a container with unique keys see, [Create an Azure Cosmos container with unique key and TTL](manage-with-powershell.md#create-container-unique-key-ttl)
36
36
37
-
## Use the .NET SDK V2
37
+
## Use the .NET SDK
38
+
39
+
# [.NET SDK V2](#tab/dotnetv2)
38
40
39
41
When creating a new container using the [.NET SDK v2](https://www.nuget.org/packages/Microsoft.Azure.DocumentDB/), a `UniqueKeyPolicy` object can be used to define unique key constraints.
40
42
@@ -54,7 +56,7 @@ client.CreateDocumentCollectionAsync(UriFactory.CreateDatabaseUri("database"), n
54
56
});
55
57
```
56
58
57
-
## Use the .NET SDK V3
59
+
#[.NET SDK V3](#tab/dotnetv3)
58
60
59
61
When creating a new container using the [.NET SDK v3](https://www.nuget.org/packages/Microsoft.Azure.Cosmos/), use the SDK's fluent API to declare unique keys in a concise and readable way.
Copy file name to clipboardExpand all lines: articles/cosmos-db/how-to-manage-indexing-policy.md
+10-4Lines changed: 10 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -366,7 +366,9 @@ To create a container with a custom indexing policy see, [Create a container wit
366
366
367
367
To create a container with a custom indexing policy see, [Create a container with a custom index policy using Powershell](manage-with-powershell.md#create-container-custom-index)
368
368
369
-
## Use the .NET SDK V2
369
+
## <aid="dotnet-sdk"></a> Use the .NET SDK
370
+
371
+
# [.NET SDK V2](#tab/dotnetv2)
370
372
371
373
The `DocumentCollection` object from the [.NET SDK v2](https://www.nuget.org/packages/Microsoft.Azure.DocumentDB/) exposes an `IndexingPolicy` property that lets you change the `IndexingMode` and add or remove `IncludedPaths` and `ExcludedPaths`.
The `ContainerProperties` object from the [.NET SDK v3](https://www.nuget.org/packages/Microsoft.Azure.Cosmos/) (see [this Quickstart](create-sql-api-dotnet.md) regarding its usage) exposes an `IndexingPolicy` property that lets you change the `IndexingMode` and add or remove `IncludedPaths` and `ExcludedPaths`.
When using the [Python SDK V3](https://pypi.org/project/azure-cosmos/) (see [this Quickstart](create-sql-api-python.md) regarding its usage), the container configuration is managed as a dictionary. From this dictionary, it is possible to access the indexing policy and all its attributes.
611
616
@@ -669,7 +674,7 @@ Update the container with changes
When using the [Python SDK V4](https://pypi.org/project/azure-cosmos/), the container configuration is managed as a dictionary. From this dictionary, it is possible to access the indexing policy and all its attributes.
675
680
@@ -734,6 +739,7 @@ Update the container with changes
0 commit comments