Predicates "any" should return documents that match NONE of the values?

I am using the "any" predicate to fetch documents which belong to a relationship. I have a custom type called "Category" and have documents which can belong to none or one category. I thought using "any" would allow me to return documents that are either not categorised or are categories.

Predicates::any("my.{$type}.category", $categories);
Returns 0 documents.

Predicates::any("my.{$type}.category", []);
Returns 1 document.

Is it a case that I'd need to query twice and merge the results?

Hi Stefan,

When querying with the any predicate you are restricted to the fields:

Key Text

as described here:

What you will want to do is query by a content relationship which uses the at predicate:


1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.