clojure - Datomic enum as key in map -
I have a dynamic database that includes the following enum
{: db / id #db / id [: db pert / db]: db / identity: demographics / gender: db / value type: db Type / Ref: DB / Cardinality: DB Cordillality / A: DB / Doctor "One Person's Gender Enam Reference": Db.install / _attribute: db.part / db} ;; : Demographics / gender values values {: db / id # db / id [: db.part / user]: db / ident: demographics.gender / male} {: db / id # db / id [: db perts / user] : DB / ID: Demographic Gender / Female} {: DB / ID # DB / ID [: DB PART / User]: DB / ID: Demographic Generator / Other} is now called That I do:
(d / entity db ...) and get a lazy map that has a unit and its properties, above Up enum included. Now I want to get the string representation of the enum value which I get in response to my query. My idea was to do this:
(def ^: private gender map {demographic generator / male "male": demographic female / female "female": demographic generator / other "other"}) and then it
(gender-map (lazy-map: demographics / gender)) though What was the right way to do that, he was not working?
Thanks
lazy-map in your example is not defined. If this result returned from the (d / entity ...) , check that it has valid : demographics / gender entry.
Comments
Post a Comment