Skip to content

Commit 6cc5dca

Browse files
committed
fix format tab
1 parent 0a56381 commit 6cc5dca

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

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

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,20 @@ UserSession item = new UserSession()
252252
ItemResponse<UserSession> createResponse = await container.CreateItemAsync(item);
253253
```
254254

255+
##### [Java SDK v4](#tab/java-v4)
256+
257+
```java
258+
// Create a new item
259+
UserSession item = new UserSession();
260+
item.setId("f7da01b0-090b-41d2-8416-dacae09fbb4a");
261+
item.setTenantId("Microsoft");
262+
item.setUserId("8411f20f-be3e-416a-a3e7-dcd5a3c1f28b");
263+
item.setSessionId("0000-11-0000-1111");
264+
265+
// Pass in the object, and the SDK automatically extracts the full partition key path
266+
Mono<CosmosItemResponse<UserSession>> createResponse = container.createItem(item);
267+
```
268+
255269
##### [Javascript SDK v4](#tab/javascript-v4)
256270

257271
```javascript
@@ -267,11 +281,8 @@ const item: UserSession = {
267281
const { resource: document } = await = container.items.create(item);
268282

269283
```
270-
271284
---
272285

273-
// Pass in the object, and the SDK automatically extracts the full partition key path
274-
const { resource: document } = await = container.items.create(it
275286
#### Manually specify the path
276287

277288
The `PartitionKeyBuilder` class in the SDK can construct a value for a previously defined hierarchical partition key path. Use this class when you add a new item to a container that has subpartitioning enabled.
@@ -323,8 +334,6 @@ PartitionKey partitionKey = new PartitionKeyBuilder()
323334
Mono<CosmosItemResponse<UserSession>> createResponse = container.createItem(item, partitionKey);
324335
```
325336

326-
---
327-
328337
##### [Javascript SDK v4](#tab/javascript-v4)
329338

330339
```javascript
@@ -344,7 +353,7 @@ const partitionKey: PartitionKey = new PartitionKeyBuilder()
344353

345354
// Create the item in the container
346355
const { resource: document } = await container.items.create(item, partitionKey);
347-
356+
```
348357
---
349358

350359
### Perform a key/value lookup (point read) of an item

0 commit comments

Comments
 (0)