Diego D
Diego D

Reputation: 1755

Set TTL to millions of Couchbase Documents

I have a Couchbase 4.5.1 bucket with millions of documents, which do not have an expiration time. Is there a way to put TTL with a N1QL query, REST api or something? I have not found a way to do it.

Upvotes: 0

Views: 217

Answers (1)

Keshav Murthy
Keshav Murthy

Reputation: 134

You can get the full list of document keys using N1QL (SELECT META().id FROM mybucket;) and then SET the TTL for each document using KV API.

You can't set the TTL via N1QL.

Upvotes: 0

Related Questions