# How to get all entities of a database?

**URL:** <https://community.fibery.io/t/how-to-get-all-entities-of-a-database/8224>\
**Category:** Ideas & Features\
**Tags:** automations\
**Created:** [February 6, 2025, 8:46am UTC](https://community.fibery.io/t/how-to-get-all-entities-of-a-database/8224 "2025-02-06T08:46:30Z")\
**Posts on this page:** 1\
**Showing post:** 10

<div class="post-metadata">

**Author:** ![Ooker](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/ooker/32/7033_2.png) [@Ooker](https://community.fibery.io/u/Ooker)\
**Post date:** [February 7, 2025, 3:39pm UTC](https://community.fibery.io/t/how-to-get-all-entities-of-a-database/8224/10 "2025-02-07T15:39:09Z")

</div>

> [@Chr1sG](#):
>
> Where did the list of ids to be deleted come from?

If you remember [my previous question](https://community.fibery.io/t/how-to-get-the-list-of-entities-in-an-relation-field/8218), in db A I have a many-to-one relation field with db B. So I get the list of ids of B entities my querying on A:

```js
const bEntities = (await fibery.getEntityById(dbA, aEntityId, ["field"]))["field"]
const ids = bEntities.map(({ Id }) => Id)

```

Any idea on how to fix this code?

> [@Ooker](#):
>
> ```auto
> const fibery = context.getService("fibery");
> const query = '{findKyPhis {id, name}}'
> const graphql = await fibery.graphql("Kỳ phí", query)
> console.log(graphql)
> 
> ```

---

_[View the full topic](https://community.fibery.io/t/how-to-get-all-entities-of-a-database/8224)._
