This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-02-16
Channels
- # aws (6)
- # beginners (129)
- # calva (9)
- # cider (4)
- # cljs-dev (2)
- # clojure (41)
- # clojure-beijing (2)
- # clojure-dev (3)
- # clojure-spec (23)
- # clojure-uk (46)
- # clojurescript (38)
- # community-development (20)
- # core-async (4)
- # cursive (12)
- # data-science (7)
- # datascript (13)
- # datomic (15)
- # duct (11)
- # emacs (18)
- # figwheel-main (5)
- # fulcro (26)
- # off-topic (4)
- # pathom (28)
- # pedestal (3)
- # reagent (8)
- # reitit (6)
- # shadow-cljs (32)
- # specter (3)
I have a field in my schema defined as {:db/valueType :db.type/ref :db/cardinality :db.cardinality/many}
[:db/add eid :thing/tagged [:tag/name ["foo" "bar"]]]
and [:db/add eid :thing/tagged [[:tag/name "foo"] [:tag/name "bar"]]]
and neither seem to work
(let [schema {:thing {:db/valueType :db.type/ref
:db/cardinality :db.cardinality/many}
:other {:db/unique :db.unique/value}}
conn (d/create-conn schema)]
(d/transact! conn [{:other "thing-1"}
{:other "thing-2"}])
(let [{:keys [tempids]} (d/transact! conn [{:main "thing"
:db/id "temp"}])]
(d/transact! conn [[:db/add (get tempids "temp") :thing [:other "thing-1"]]
[:db/add (get tempids "temp") :thing [:other "thing-2"]]])
(d/pull (d/db conn) [:main
{:thing [:other]}] (get tempids "temp"))))
;; => {:main "thing", :thing [{:other "thing-1"} {:other "thing-2"}]}