Fork me on GitHub
#datomic
<
2015-06-29
>
samflores13:06:46

I have an attribute that uses the idiomatic way of representing enums (a :db.valueType/ref attribute “pointing” to values with :db/ident). When I use the pull API with [:foo/enumerated-field] it returns {:foo/enumerated-field {:db/id 999}} (which I understand perfectly) and if I use the pattern [{:foo/enumerated-field [:db/ident]}] the return value is nicer: {:foo/enumerated-field {:db/ident :foo.enum/cool-name}}. The question is: is there a convenient/idiomatic/built-in way to return it as {:foo/enumerated-field :foo.enum/cool-name}?

tcrayford14:06:22

the only reason I ain't used the pull api yet 😉

robert-stuttaford18:06:50

makes sense why. if they collapsed it, you can’t easily get at anything else on the enum entity

tcrayford19:06:03

@robert-stuttaford: oh for sure. But it defeats the point of pull - to be able to declaratively define the shape you want, with no munging afterwards