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: modules/concept-docs/pages/data-durability-acid-transactions.adoc
+12-7Lines changed: 12 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -250,7 +250,7 @@ xref:howtos:concurrent-document-mutations.adoc#pessimistic-locking[Pessimistic L
250
250
251
251
The expiration setting for a document determines if and when it expires.
252
252
When a document expires, Couchbase Server removes it.
253
-
You can set a maximum time to live (`maxTTL`) value on buckets and collections that imposes a default expiration on their documents.
253
+
You can set a maximum time to live (`maxExpiry`) value on buckets and collections that imposes a default expiration on their documents.
254
254
It also imposes an upper limit on explicitly-set expiration times.
255
255
256
256
You can set an expiration value on an individual document either when you create it or when you mutate it.
@@ -259,24 +259,29 @@ You can change this value later in case you want extend the life of the document
259
259
260
260
As there could be cost implications for storing ephemeral data past its usable life --
261
261
or even legal implications about keeping data under GDPR and other privacy legislation --
262
-
you should be clear about the interactions between setting `maxTTL` at different levels can have.
262
+
you should be clear about the interactions between setting `maxExpiry` at different levels can have.
263
263
264
-
For example, setting a collection's `maxTTL` to `0` (the default) means it will inherit the bucket's `maxTTL` value;
265
-
setting a bucket's `maxTTL` to `0` (the default) means it will never expire.
264
+
For example, setting a collection's `maxExpiry` to `0` (the default) means it will inherit the bucket's `maxExpiry` value;
265
+
setting a bucket's `maxExpiry` to `0` (the default) means it will never expire.
266
266
The table in the xref:{version-server}@server:learn:data/expiration.adoc#expiration-setting-priorities[expiration documentation]
267
-
covers the interaction between a document’s expiration setting and the `maxTTL` settings of the collection and bucket that contain it.
267
+
covers the interaction between a document’s expiration setting and the `maxExpiry` settings of the collection and bucket that contain it.
268
+
269
+
TIP: In earlier releases of the SDK, `maxTTL` was used for setting the time to live.
270
+
This method has been deprecated.
271
+
Please use `maxExpiry` at the bucket and collection level.
268
272
269
273
// TODO check they all use MAX32INT -- 2147483648 seconds
270
274
271
275
=== Collection No-Expiry Option
272
276
273
-
From Java SDK 3.5.3 with Capella (and self-managed Server from 7.6.0), setting a `maxTTL` of `-1` on a collection will prevent it from expiring, even when its containing bucket has reached expiry time.
277
+
From Java SDK 3.5.3 with Capella (and self-managed Server from 7.6.0), setting a `maxExpiry` of `-1` on a collection will prevent it from expiring, even when its containing bucket has reached expiry time.
274
278
Again, see the table in the xref:{version-server}@server:learn:data/expiration.adoc#expiration-setting-priorities[expiration documentation].
275
279
276
280
=== Changing a Document, but Not the Expiry
277
281
278
282
By default, changing a document also changes its expiry.
279
-
If you do not pass a value for expiry, the document does not expire, even if the document previously had an expiry. If this is not what you want, you must tell Couchbase to keep the document’s expiry.
283
+
If you do not pass a value for expiry, the document does not expire, even if the document previously had an expiry.
284
+
If this is not what you want, you must tell Couchbase to keep the document’s expiry.
280
285
281
286
With the mutation operation on a document (say a `replace` or an `upsert`), use `preserveExpiry = true` --
282
287
and consider using optimistic locking if two threads could be changing the same document and one is not necessarily passing in `preserveExpiry = true`.
0 commit comments