select _id,categories from content
WHERE _type=“question” AND active=true AND userId= “abcdefghijklmnop”
AND (ANY catg IN IFMISSINGORNULL([[“ALL”, “Math”]],[ ]) SATISFIES catg = categories END)
order by modifiedAt DESC limit 25 offset 0
For the above N1Ql query “categories” field is an array which contains strings .When the input strings matches it should return some result. But it is returning nothing. In couchbase I have many records which contains the following data in “categories”
“categories”: [
“All”
“Math”
“English”
“Magic”
]
How should I query it so that it will return all the records if there is atleast one element matches the "categories " field
SELECT _id, categories
FROM content
WHERE _type = "question" AND active = true AND userId = "abcdefghijklmnop"
AND (ANY catg IN categories SATISFIES catg IN ["ALL", "Math"] END)
ORDER BY modifiedAt DESC
OFFSET 0
LIMIT 25;
The query is working fine, but it is not returning any data in one particular case. There are many records where “categories”: [“All”].When I am writing the query as
SELECT _id, categories FROM content WHERE _type = “question” AND active = true AND userId = “abcdefghijklmnop”
AND (ANY catg IN categories SATISFIES catg IN [“ALL”] END)
ORDER BY modifiedAt DESC OFFSET 0 LIMIT 25;
I am not getting any value. Can you plzz suggest a solution for this?