This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-07-18
Channels
- # announcements (35)
- # babashka (14)
- # beginners (23)
- # calva (5)
- # cljsrn (3)
- # clojure (154)
- # clojure-europe (12)
- # clojure-losangeles (2)
- # clojure-uk (5)
- # clojurescript (42)
- # conjure (3)
- # cursive (10)
- # datomic (3)
- # emacs (6)
- # events (1)
- # graalvm (1)
- # helix (1)
- # honeysql (1)
- # hyperfiddle (1)
- # jobs-discuss (1)
- # lsp (8)
- # malli (54)
- # meander (1)
- # membrane (1)
- # off-topic (246)
- # polylith (4)
- # practicalli (1)
- # re-frame (14)
- # releases (1)
- # shadow-cljs (21)
- # sql (58)
- # vim (1)
- # vrac (2)
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?
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.
thanks @U09R86PA4 - will note your answer on my http://forum.datomic.com post and suggest an addition to the docs 🙂