How can I get TTL of document when
- I use
lookupIn
- I use
get
How can I get TTL of document when
lookupIn
get
Any idea? Is it possible?
Hey @socketman2016,
It is unfortunately not possible to fetch the TTL of the document when performing a standard get
operation, as this is usually maintained as internal state only. It is however possible to fetch the expiry using our subdocument API.
Something like this should work:
bucket.lookupIn('my_document')
.get('$document.exptime', {xattrMacro: true})
.execute((error, result) =>{
// ...
});
Cheers, Brett