Entity API: How to query 'q/where' for empty collection field?

With the entity API, how to construct a “q/where” clause that selects entities with an empty collection field?

I.e., something like:

  'q/where': ['q/empty', [Collection_Field]],

With the graphQL API we can do this with:

  collectionField: {isEmpty: true}

Something like this should work:

'q/where': ['=', ['q/count', [Collection_Field, "fibery/id"]], "$param"]

where

params: {"$param": 0}
1 Like