This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2015-06-29
Channels
- # admin-announcements (25)
- # announcements (1)
- # beginners (29)
- # boot (2)
- # cider (4)
- # clojure (92)
- # clojure-berlin (1)
- # clojure-france (45)
- # clojure-germany (3)
- # clojure-india (1)
- # clojure-japan (4)
- # clojure-russia (78)
- # clojure-uk (11)
- # clojurebridge (7)
- # clojurescript (73)
- # datomic (6)
- # editors (39)
- # euroclojure (83)
- # jobs (3)
- # ldnclj (80)
- # om (9)
- # onyx (7)
- # reading-clojure (1)
- # reagent (2)
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}
?
thanks, @stuartsierra
makes sense why. if they collapsed it, you can’t easily get at anything else on the enum entity
@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