When should I use UNNEST vs ANY…SATISFIES in N1ql?
问题 I want to query (or index) an array-valued field. As an example, say I want to retrieve this document { "myarray": [ 1, 2, 3]} . I can do this with ANY...SATISFIES or with UNNEST . From the documentation, these seem functionally the same. SELECT * FROM `bucket` AND ANY v in myarray SATISFIES v=3 END; SELECT * FROM `bucket` UNNEST myarray v WHERE v=3 What are the use cases for each? 回答1: For those two queries, they do similar things, but both of these approaches provide other functionality.