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.

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

However:
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:

UID
Key Text
Select
Number
Date

as described here:

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

Thanks.

1 Like

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