Skip to content

Commit a9fbf83

Browse files
Merge pull request #114151 from SnehaGunda/tabbedconceptual
Adding tabs
2 parents b76fb8c + aa89768 commit a9fbf83

File tree

4 files changed

+127
-41
lines changed

4 files changed

+127
-41
lines changed

articles/cosmos-db/how-to-define-unique-keys.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@ This article presents the different ways to define [unique keys](unique-keys.md)
3434

3535
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)
3636

37-
## Use the .NET SDK V2
37+
## Use the .NET SDK
38+
39+
# [.NET SDK V2](#tab/dotnetv2)
3840

3941
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.
4042

@@ -54,7 +56,7 @@ client.CreateDocumentCollectionAsync(UriFactory.CreateDatabaseUri("database"), n
5456
});
5557
```
5658

57-
## Use the .NET SDK V3
59+
# [.NET SDK V3](#tab/dotnetv3)
5860

5961
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.
6062

@@ -70,6 +72,7 @@ await client.GetDatabase("database").DefineContainer(name: "container", partitio
7072
.Attach()
7173
.CreateIfNotExistsAsync();
7274
```
75+
---
7376

7477
## Use the Java SDK
7578

articles/cosmos-db/how-to-manage-indexing-policy.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,9 @@ To create a container with a custom indexing policy see, [Create a container wit
366366

367367
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)
368368

369-
## Use the .NET SDK V2
369+
## <a id="dotnet-sdk"></a> Use the .NET SDK
370+
371+
# [.NET SDK V2](#tab/dotnetv2)
370372

371373
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`.
372374

@@ -396,7 +398,7 @@ ResourceResponse<DocumentCollection> container = await client.ReadDocumentCollec
396398
long indexTransformationProgress = container.IndexTransformationProgress;
397399
```
398400

399-
## Use the .NET SDK V3
401+
# [.NET SDK V3](#tab/dotnetv3)
400402

401403
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`.
402404

@@ -452,6 +454,7 @@ await client.GetDatabase("database").DefineContainer(name: "container", partitio
452454
.Attach()
453455
.CreateIfNotExistsAsync();
454456
```
457+
---
455458

456459
## Use the Java SDK
457460

@@ -605,7 +608,9 @@ const containerResponse = await client.database('database').container('container
605608
const indexTransformationProgress = replaceResponse.headers['x-ms-documentdb-collection-index-transformation-progress'];
606609
```
607610

608-
## Use the Python SDK V3
611+
## Use the Python SDK
612+
613+
# [Python SDK V3](#tab/pythonv3)
609614

610615
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.
611616

@@ -669,7 +674,7 @@ Update the container with changes
669674
response = client.ReplaceContainer(containerPath, container)
670675
```
671676

672-
## Use the Python SDK V4
677+
# [Python SDK V4](#tab/pythonv4)
673678

674679
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.
675680

@@ -734,6 +739,7 @@ Update the container with changes
734739
```python
735740
response = database_client.replace_container(container_client, container['partitionKey'], indexingPolicy)
736741
```
742+
---
737743

738744
## Next steps
739745

0 commit comments

Comments
 (0)