Document CAS values in n1ql

Hi,

What would be the best approach to bring back CAS value along with each document (which is n1ql query result)? Suppose I have such query (which selects documents if they have “x_val” value in “some_array”):

select * from default unnest default.some_array as x where x in [“x_val”]

This brings back the documents, but how would I add CAS of each document along? Having META() along * doesn’t play very well.

Thanks in advance.

Hi,

We will add CAS to the META() object. So your query should be:

select *, meta(default).cas from default unnest default.some_array as x where …

or

select *, meta(d).cas from default d unnest d.some_array as x where …