ANY or SOME, EVERY, and ANY AND EVERY or SOME AND EVERY
Range predicates (ANY or SOME, EVERY, and ANY AND EVERY or SOME AND EVERY) allow you to test a boolean condition over the elements or attributes of a collection or object(s). They each evaluate to a boolean value.
ANY or SOME is TRUE if the collection is non-empty and at least one element matches.
EVERY is TRUE if the collection is empty, or if the collection is non-empty and every element matches.
ANY AND EVERY or SOME AND EVERY is TRUE if the collection is non-empty and every element matches.
If you need to query array that contains “tag1” OR “tag2”, You should do the following query (As you are looking for more than one item is present at different array positions you need to use separate ANY clause)
SELECT *
FROM bucket
WHERE _class = “some.package.Class”
AND ANY t IN tags SATISFIES t IN ["tag1", "tag2"] END
LIMIT 16
If you need to query array that contains both “tag1” AND “tag2”, You should do the following query
SELECT *
FROM bucket
WHERE _class = “some.package.Class”
AND ANY t IN tags SATISFIES t = "tag1" END
AND ANY t IN tags SATISFIES t = "tag2" END
LIMIT 16