如何获取节点中 couchbase 对象的元数据?

How can I get the metadata of a couchbase object in node?

我在 couchbase 中对我的用户使用一个月的 TTL,并在本月内每次再次看到时使用 "touch" 更新此 TTL。

我需要检查用户的 TTL,以便在他们变老时执行特殊操作。

我不能在对象中使用 "updated_at" 字段,因为它不会通过触摸方法更新,我更喜欢使用触摸来最小化服务之间的性能问题交互。

这可以做到吗?

目前还不可能。

来自 couchbase 论坛的回答:https://forums.couchbase.com/t/how-can-i-get-the-metadata-of-a-couchbase-object-in-node/13630

Unfortunately it is not currently possible to reliably fetch the current TTL of an item. The upcoming Couchbase Server release should be able to fetch this information using a new virtual attribute fetch, but this was not yet available in currently released versions. In the meantime, we do suggest performing a subdocument upsert to update a field within the document with an updated timestamp.