Skip to content

Commit 9e1524c

Browse files
maxTTL --> maxExpiry
1 parent 3ab8472 commit 9e1524c

1 file changed

Lines changed: 12 additions & 7 deletions

File tree

modules/concept-docs/pages/data-durability-acid-transactions.adoc

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ xref:howtos:concurrent-document-mutations.adoc#pessimistic-locking[Pessimistic L
250250

251251
The expiration setting for a document determines if and when it expires.
252252
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.
254254
It also imposes an upper limit on explicitly-set expiration times.
255255

256256
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
259259

260260
As there could be cost implications for storing ephemeral data past its usable life --
261261
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.
263263

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.
266266
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.
268272

269273
// TODO check they all use MAX32INT -- 2147483648 seconds
270274

271275
=== Collection No-Expiry Option
272276

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.
274278
Again, see the table in the xref:{version-server}@server:learn:data/expiration.adoc#expiration-setting-priorities[expiration documentation].
275279

276280
=== Changing a Document, but Not the Expiry
277281

278282
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.
280285

281286
With the mutation operation on a document (say a `replace` or an `upsert`), use `preserveExpiry = true` --
282287
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

Comments
 (0)