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

**URL:** <https://community.fibery.io/t/entity-api-how-to-query-q-where-for-empty-collection-field/6683>\
**Category:** Get Help\
**Tags:** api\
**Created:** [September 20, 2024, 4:52pm UTC](https://community.fibery.io/t/entity-api-how-to-query-q-where-for-empty-collection-field/6683 "2024-09-20T16:52:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Matt\_Blais](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/matt_blais/32/1464_2.png) [@Matt\_Blais](https://community.fibery.io/u/Matt_Blais)\
**Post date:** [September 20, 2024, 4:52pm UTC](https://community.fibery.io/t/entity-api-how-to-query-q-where-for-empty-collection-field/6683/1 "2024-09-20T16:52:50Z")

</div>

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

I.e., something like:

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

```

With the graphQL API we can do this with:

```auto
  collectionField: {isEmpty: true}

```

---

<div class="post-metadata">

**Author:** ![Chr1sG](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/chr1sg/32/3941_2.png) [@Chr1sG](https://community.fibery.io/u/Chr1sG)\
**Post date:** [September 20, 2024, 5:12pm UTC](https://community.fibery.io/t/entity-api-how-to-query-q-where-for-empty-collection-field/6683/2 "2024-09-20T17:12:00Z")

</div>

Something like this should work:

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

```

where

```auto
params: {"$param": 0}

```
