Couchbase lite expiry

Hi

Is there any way to set the document expiry locally on in couchbase lite in a way that syncs to the server ?
I am using couchbase lite 3.0.0 and sync gateway 3 aswell.

Thank you for the assistance.

Hi @meirrosendorff.
Document expiration simply purges a document from the local database (as you probably realize).

There is no direct way to force a document to be deleted at a time in the future, from the Mobile platform. @JFlath informs me that there is a way to do this from either the SyncGateway, or from the Server. Tag him and he can chime in with details.

Hi Blake
Thank you for the response, Yes I have been able to do it from the sync gateway but I was hoping to move the responsibility to the mobile device.

I guess it will have to stay on the server.

Ping @JFlath. He told me: “If you want to flick the first domino from CBL, you can set a field in the doc that the Sync Fn looks for and calls expiry() on”, so perhaps there is at least some partial measure.

Howzit Blake
Thanks so much, thats not a bad idea.
We ended up going with something similar, we create a new document that acts as an instruction to the server expire documents.

1 Like