@@ -70,7 +70,7 @@ await client.GetDatabase("database").CreateContainerAsync(new ContainerPropertie
70
70
});
71
71
```
72
72
73
- ### <a id =" java -enable-noexpiry" ></a >Java SDK V4 (Maven com.azure::azure-cosmos)
73
+ ### <a id =" java4 -enable-noexpiry" ></a >Java SDK V4 (Maven com.azure::azure-cosmos)
74
74
75
75
``` java
76
76
CosmosAsyncContainer container;
@@ -81,7 +81,7 @@ containerProperties.setDefaultTimeToLiveInSeconds(-1);
81
81
container = database. createContainerIfNotExists(containerProperties, 400 ). block(). getContainer();
82
82
```
83
83
84
- ### <a id =" java -enable-noexpiry" ></a >Java SDK V3 (Maven com.microsoft.azure::azure-cosmos)
84
+ ### <a id =" java3 -enable-noexpiry" ></a >Java SDK V3 (Maven com.microsoft.azure::azure-cosmos)
85
85
86
86
``` java
87
87
CosmosContainer container;
@@ -136,23 +136,23 @@ async function createcontainerWithTTL(db: Database, containerDefinition: Contain
136
136
}
137
137
```
138
138
139
- ### <a id="java -enable-noexpiry "></a>Java SDK V4 (Maven com.azure::azure-cosmos)
139
+ ### <a id="java4 -enable-defaultexpiry "></a>Java SDK V4 (Maven com.azure::azure-cosmos)
140
140
141
141
```java
142
142
CosmosAsyncContainer container ;
143
143
144
- // Create a new container with TTL enabled and without any expiration value
144
+ // Create a new container with TTL enabled with default expiration value
145
145
CosmosContainerProperties containerProperties = new CosmosContainerProperties (" myContainer" , " /myPartitionKey" );
146
146
containerProperties .setDefaultTimeToLiveInSeconds (90 * 60 * 60 * 24 );
147
147
container = database .createContainerIfNotExists (containerProperties , 400 ).block ().getContainer ();
148
148
```
149
149
150
- ### <a id="java -enable-noexpiry "></a>Java SDK V3 (Maven com.microsoft.azure::azure-cosmos)
150
+ ### <a id="java3 -enable-defaultexpiry "></a>Java SDK V3 (Maven com.microsoft.azure::azure-cosmos)
151
151
152
152
```java
153
153
CosmosContainer container ;
154
154
155
- // Create a new container with TTL enabled and without any expiration value
155
+ // Create a new container with TTL enabled with default expiration value
156
156
CosmosContainerProperties containerProperties = new CosmosContainerProperties (" myContainer" , " /myPartitionKey" );
157
157
containerProperties .defaultTimeToLive (90 * 60 * 60 * 24 );
158
158
container = database .createContainerIfNotExists (containerProperties , 400 ).block ().container ();
@@ -235,7 +235,7 @@ const itemDefinition = {
235
235
};
236
236
```
237
237
238
- ### <a id="java -enable-noexpiry "></a>Java SDK V4 (Maven com.azure::azure-cosmos)
238
+ ### <a id="java4 -enable-itemexpiry "></a>Java SDK V4 (Maven com.azure::azure-cosmos)
239
239
240
240
```java
241
241
// Include a property that serializes to "ttl" in JSON
@@ -270,7 +270,7 @@ SalesOrder salesOrder = new SalesOrder(
270
270
271
271
```
272
272
273
- ### <a id="java -enable-noexpiry "></a>Java SDK V3 (Maven com.microsoft.azure::azure-cosmos)
273
+ ### <a id="java3 -enable-itemexpiry "></a>Java SDK V3 (Maven com.microsoft.azure::azure-cosmos)
274
274
275
275
```java
276
276
// Include a property that serializes to "ttl" in JSON
@@ -334,7 +334,7 @@ itemResponse.Resource.ttl = 60 * 30 * 30; // update time to live
334
334
await client .GetContainer (" database" , " container" ).ReplaceItemAsync (itemResponse .Resource , " SO05" );
335
335
```
336
336
337
- ### <a id="java -enable-noexpiry "></a>Java SDK V4 (Maven com.azure::azure-cosmos)
337
+ ### <a id="java4 -enable-modifyitemexpiry "></a>Java SDK V4 (Maven com.azure::azure-cosmos)
338
338
339
339
```java
340
340
// This examples leverages the Sales Order class above.
@@ -347,7 +347,7 @@ CosmosAsyncItemResponse<SalesOrder> itemResponse = container.readItem("SO05", ne
347
347
}).block ();
348
348
```
349
349
350
- ### <a id="java -enable-noexpiry "></a>Java SDK V3 (Maven com.microsoft.azure::azure-cosmos)
350
+ ### <a id="java3 -enable-modifyitemexpiry "></a>Java SDK V3 (Maven com.microsoft.azure::azure-cosmos)
351
351
352
352
```java
353
353
// This examples leverages the Sales Order class above.
@@ -395,7 +395,7 @@ itemResponse.Resource.ttl = null; // inherit the default TTL of the container
395
395
await client .GetContainer (" database" , " container" ).ReplaceItemAsync (itemResponse .Resource , " SO05" );
396
396
```
397
397
398
- ### <a id =" java -enable-noexpiry " ></a >Java SDK V4 (Maven com.azure::azure-cosmos)
398
+ ### <a id =" java4 -enable-itemdefaultexpiry " ></a >Java SDK V4 (Maven com.azure::azure-cosmos)
399
399
400
400
``` java
401
401
// This examples leverages the Sales Order class above.
@@ -408,7 +408,7 @@ CosmosAsyncItemResponse<SalesOrder> itemResponse = container.readItem("SO05", ne
408
408
}). block();
409
409
```
410
410
411
- ### <a id =" java -enable-noexpiry " ></a >Java SDK V3 (Maven com.microsoft.azure::azure-cosmos)
411
+ ### <a id =" java3 -enable-itemdefaultexpiry " ></a >Java SDK V3 (Maven com.microsoft.azure::azure-cosmos)
412
412
413
413
``` java
414
414
// This examples leverages the Sales Order class above.
@@ -450,7 +450,7 @@ containerResponse.Resource.DefaultTimeToLive = null;
450
450
await client .GetContainer (" database" , " container" ).ReplaceContainerAsync (containerResponse .Resource );
451
451
```
452
452
453
- ### <a id =" java -enable-noexpiry " ></a >Java SDK V4 (Maven com.azure::azure-cosmos)
453
+ ### <a id =" java4 -enable-disableexpiry " ></a >Java SDK V4 (Maven com.azure::azure-cosmos)
454
454
455
455
``` java
456
456
CosmosContainerProperties containerProperties = new CosmosContainerProperties (" myContainer" , " /myPartitionKey" );
@@ -460,7 +460,7 @@ containerProperties.setDefaultTimeToLiveInSeconds(null);
460
460
container. replace(containerProperties). block();
461
461
```
462
462
463
- ### <a id =" java -enable-noexpiry " ></a >Java SDK V3 (Maven com.microsoft.azure::azure-cosmos)
463
+ ### <a id =" java3 -enable-disableexpiry " ></a >Java SDK V3 (Maven com.microsoft.azure::azure-cosmos)
464
464
465
465
``` java
466
466
CosmosContainer container;
0 commit comments