3
votes

I am using Spring-Data Couchbase project (1.1.1.RELEASE) over a Couchbase Cluster in version 2.2.

I need to set up some Time To Live properties on my documents.

I know how to do it with CouchbaseClient object but I don't know how to do it using Spring-Data Couchbase abstraction.

Thanks for your help.

1
Do you mean 'Time to Live' instead of 'Time to Leave'? - Austin Moore
Yes I do mean Time To Live, sorry, it's a misspell :) - Hervé Darritchon

1 Answers

1
votes

To set a TTL you set the expiry value on the document:

@Document(expiry = 10)

This will set the TTL to 10 seconds. The Spring-Data Couchbase reference guide covers this in more details.