We are implementing a custom REST endpoint in magnolia that queries for pages and it should be able to filter by categories. I found the JCR Query Cheat Sheet, but I could not see an example about filtering a multivalued field. In our case, we have a categories
field with an array of category UUIDs and I want all pages having a certain category uuid. It works with using a like query (lets say 123-456 is a uuid) such as:
"SELECT * FROM [mgnl:page] p where p.[categories] like '%123-456%'
Is there a better approach without using (possible slow) LIKE
queries to explicitly check for an intersection with the categories array? Are there any SET/ARRAY functions to use in where conditions for such filtering?