# Entity existence check documentation clarification

**URL:** <https://forum.datomic.com/t/entity-existence-check-documentation-clarification/2278>\
**Category:** Datomic Pro\
**Created:** [June 25, 2023, 1:22pm UTC](https://forum.datomic.com/t/entity-existence-check-documentation-clarification/2278 "2023-06-25T13:22:58Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![lgrapenthin](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.datomic.com/lgrapenthin/32/150_2.png) [@lgrapenthin](https://forum.datomic.com/u/lgrapenthin)\
**Post date:** [June 25, 2023, 1:22pm UTC](https://forum.datomic.com/t/entity-existence-check-documentation-clarification/2278/1 "2023-06-25T13:22:58Z")

</div>

[Entities | Datomic](https://docs.datomic.com/pro/overview/entities.html) states that " Entities are not suitable for existence tests, which should typically be performed via lookup of a [unique identity](https://docs.datomic.com/pro/schema/identity.html)."

However, for years I used (empty? (d/entity …)) as a very successful “existence test”. Is that not reliable or unstable?

---

<div class="post-metadata">

**Author:** ![chpill](https://avatars.discourse-cdn.com/v4/letter/c/eb8c5e/32.png) [@chpill](https://forum.datomic.com/u/chpill)\
**Post date:** [July 13, 2024, 1:38pm UTC](https://forum.datomic.com/t/entity-existence-check-documentation-clarification/2278/2 "2024-07-13T13:38:42Z")

</div>

I’ve only done some very light testing, but it seems that the more attributes an entity has, the more expensive it is to call `empty?` on it.

Still, I’m very interested in the answer to your question, because I tend to existential checks using a lookup ref `(d/entity db [:a-unique-attribute ...])`, which as far as I can tell will return `nil` if the entity does not exist.

Have you found a better way to do this?
