node.js - 如何获取 Node 中 couchbase 对象的元数据?

标签 node.js metadata couchbase

我对 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.

关于node.js - 如何获取 Node 中 couchbase 对象的元数据?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45328053/

相关文章:

memcached - 什么可以用于(可靠地)测试 Couchbase 延迟?

go - 在 Couchbase 中插入只读文档

couchbase - 沙发底座中的 throttle XDCR

xml - 在 node.js 中将 xml 转换为 json

javascript - 保护 Node js 运行时或禁用调试/检查

sql-server - 另一个数据库中对象的 OBJECT_ID - 如何查找数据库 ID 或名称/完全限定的对象名称?

java - 用java获取文件属主元数据信息

ASP.NET 连接字符串元数据语法

node.js - 如何在 Mongoose 中聚合和分组

javascript - After Effects 作为后端电影引擎?