Hi,
I have a product document like this:
{
name: 'Product1',
categories: ['test'],
coupon: {
start: Date,
end: Date
}
}
I want to set a TTL at coupon is that possible ?
Hi,
I have a product document like this:
{
name: 'Product1',
categories: ['test'],
coupon: {
start: Date,
end: Date
}
}
I want to set a TTL at coupon is that possible ?
No. coupon
in your example is a field (type: object), not a document. TTL applies only to whole documents.
Ref: https://docs.couchbase.com/server/current/learn/data/expiration.html
HTH.
Okey thanks, what then the use case for TTLs ?
Any time you want an entire document to expire. For example you may perhaps have certain user data that for regulatory compliance must not be kept beyond a specified period. You could store that in documents in a bucket with an appropriate TTL. etc.