I’d rather a query for that, though you’d get :db/id values rather than :id
(into {} (q '[:find ?attr ?val :where [?e :id 0] [?e ?a ?val] [?a :db/ident ?attr]] the-db))
That would work too, although queries are much slower
is there a way to quickly lookup an entity via ref like [:id 0] and get a map of all attrs?
ah nice, thanks!
Entities are not well-suited for that type of problem. Better use pull:
(d/pull db '[*] [:id 0])
I'm running into issues using entity because it doesn't implement empty
and I'm trying to walk it
it's totally fine if it doesn't resolve references to other entities, as long as it contains the refs. e.g.
{:id 0
:refs #{[:id 1] [:id 2]}}