如何从Couchbase查询商品的元数据? [英] How to query item's metadata from Couchbase?

查看:75
本文介绍了如何从Couchbase查询商品的元数据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将一些数据放入CouchBase 1.8.1,并使其成功.但是我想查询其元数据,如到期时间和att_reason(非json或json).在某些文档中,它以json格式列出了元数据,例如:

I put some data to CouchBase 1.8.1,and get it successful.But I want to query its metadata,as expiration and att_reason(non-json or json).In some document,it list the metadata with json format,for example:

{
 "_id" : "contact_475",
 "_rev" : "1-AB9087AD0977F089",
 "_bin" : "...",
 "$flags" : 0,
 "$expiration" : 0,
 "name" : "Fred Bloggs",
}

如何查询项目的元数据?

How can I query item's metadata?

推荐答案

如果您只想使用

If you want to query only meta data using N1QL you could run below query, it will return all meta data about document :

select meta(bucket_name) from bucket_name

但是,如果您想从获取这些信息Sync Gateway ,它将通过 REST API ,REST API还包括在这些元数据上方的一些过滤.

But if you want to get these information from Sync Gateway it will return to you by every GET request using REST API, the REST API also include some filtering above these meta data.

这篇关于如何从Couchbase查询商品的元数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆