Skip to content

Commit 2759a04

Browse files
authored
Merge pull request #89526 from j82w/patch-4
Update large-partition-keys.md to include v3 SDK
2 parents d85fe14 + 63a5e55 commit 2759a04

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

articles/cosmos-db/large-partition-keys.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,22 @@ Azure Cosmos DB uses hash-based partitioning scheme to achieve horizontal scalin
1414

1515
Large partition keys are supported by using the functionality of an enhanced version of the hash function, which can generate a unique hash from large partition keys up to 2 KB. This hash version is also recommended for scenarios with high partition key cardinality irrespective of the size of the partition key. A partition key cardinality is defined as the number of unique logical partitions, for example in the order of ~30000 logical partitions in a container. This article describes how to create a container with a large partition key using the Azure portal and different SDKs.
1616

17-
## Create a large partition key (.Net SDK V2)
17+
## Create a large partition key (.Net SDK)
1818

1919
To create a container with a large partition key using the .NET SDK, specify the `PartitionKeyDefinitionVersion.V2` property. The following example shows how to specify the Version property within the PartitionKeyDefinition object and set it to PartitionKeyDefinitionVersion.V2.
2020

21+
### v3 .NET SDK
22+
23+
```csharp
24+
await database.CreateContainerAsync(
25+
new ContainerProperties(collectionName, $"/longpartitionkey")
26+
{
27+
PartitionKeyDefinitionVersion = PartitionKeyDefinitionVersion.V2,
28+
})
29+
```
30+
31+
### v2 .NET SDK
32+
2133
```csharp
2234
DocumentCollection collection = await newClient.CreateDocumentCollectionAsync(
2335
database,

0 commit comments

Comments
 (0)