Query Where Relationship Does Not Exist

Try this - it might work. I still have doubts on the way this feature works.

/api/categories?populate=parent&filters[parent][id][$null]=true
or
/api/categories?populate=parent&filters[parent][id][$null]=false

In my case, I figured that it works the opposite way of how it’s supposed to work.

If I am looking for “null” values it should be “…[$null]=true”. However, the api fetched records that are not “not null” (in the “parent” field in this example).

PS: I am using Strapi 4, FYI.

2 Likes