Can I use TTL by a row?


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.



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.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.