The \'Embedded\' section of the Datomic Queries and Rules document says:
Query languages like SQL are oriented around a client-server model where, in a
Having the entity (id) from query like:
=> (def eid (d/q '[:find ?e :where [?e :myapp/name "Fred"]] (db conn)))
you can get the EntityMap:
=> (def ent (d/entity (db conn) (ffirst eid)))
so you can access fields/attributes without making additional query:
=> (seq ent)
;; ([:myapp/name "Fred"] [:myapp/age 16] [:myapp/email "fred@email.com"])
however it may be easier to get the keys first:
=> (keys ent)
;; (:myapp/name :myapp/age :myapp/email)
You can even get reverse keys ("foreign" ref attributes that point to this entity) using the following trick:
=> (.touch ent)
=> (keys (.cache ent))