# Entity api - ref attribute returning keyword not another Entity

**URL:** <https://forum.datomic.com/t/entity-api-ref-attribute-returning-keyword-not-another-entity/1903>\
**Category:** Datomic Pro\
**Created:** [July 18, 2021, 1:15pm UTC](https://forum.datomic.com/t/entity-api-ref-attribute-returning-keyword-not-another-entity/1903 "2021-07-18T13:15:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![xlfe](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.datomic.com/xlfe/32/509_2.png) [@xlfe](https://forum.datomic.com/u/xlfe)\
**Post date:** [July 18, 2021, 1:15pm UTC](https://forum.datomic.com/t/entity-api-ref-attribute-returning-keyword-not-another-entity/1903/1 "2021-07-18T13:15:39Z")

</div>

Using the Entity api, if I call get on a ref attribute I expect to get the referenced Entity (or a set of the same), but seemingly when the ref attribute points to an Entity with a db/ident I’m just getting a keyword (the ident) instead of an Entity object.

This appears at odds with the Entity documentation though?

> If an attributes points to another entity through a cardinality-many attribute, _get_ will return a _Set_ of entity instances.

Presumably, I could call db on the original entity and then d/entity again on the keyword/ident, but is that the suggested method?

---

<div class="post-metadata">

**Author:** ![xlfe](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.datomic.com/xlfe/32/509_2.png) [@xlfe](https://forum.datomic.com/u/xlfe)\
**Post date:** [July 19, 2021, 11:32pm UTC](https://forum.datomic.com/t/entity-api-ref-attribute-returning-keyword-not-another-entity/1903/2 "2021-07-19T23:32:24Z")

</div>

@favila helpfully replied on Slack

> This is by design. The documentation you quote is just imprecise. This behavior is so “enum entities” are easier to work with. Your workaround is fine. Note the d/entity-db function which may make your implementation cleaner. The pull api does not do this so consider using it instead.
