test data
{ "test" : "1", "values": [ { "1":{ "a" :1, "b" :2 }, "2":{ "a" :3, "b" :4 } } ] }
I want to query values where ‘a’ equals 1
SELECT * FROM theCollection WHERE ANY x IN `values` SATISFIES -- array elements ANY n:v IN x SATISFIES v.a = 1 END -- object fields within array element END
Ref: https://docs.couchbase.com/server/current/n1ql/n1ql-language-reference/collectionops.html
HTH.
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.