6

I am using Couchbase 4.0 beta with java-client 2.1.3.

The Bucket.get(id) returns JsonDocument from which I can get id and cas as well as the content. Now I want to query on secondary indices using N1QL (select *). However, the QueryResult only returns rows of JsonObjects which are just the document contents. Is there anyway I can get the meta data (id and cas) too?

4

1 回答 1

9

您可以执行以下操作:

SELECT b, meta(b) AS meta FROM my_bucket b;
于 2015-06-25T18:11:47.857 回答