This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-12-23
Channels
- # 100-days-of-code (1)
- # adventofcode (13)
- # aleph (1)
- # beginners (48)
- # boot (10)
- # calva (52)
- # cider (18)
- # cljsrn (23)
- # clojure (68)
- # clojure-uk (9)
- # clojurescript (5)
- # cursive (3)
- # datomic (4)
- # figwheel (7)
- # fulcro (14)
- # hoplon (2)
- # leiningen (5)
- # lumo (3)
- # off-topic (87)
- # overtone (5)
- # reitit (5)
- # rum (8)
- # shadow-cljs (7)
- # spacemacs (15)
Say I have an account model with cardinality-many attribute:
{:db/ident :account/id
:db/valueType :db.type/long
:db/cardinality :db.cardinality/one
:db/unique :db.unique/identity}
{:db/ident :account/interests
:db/valueType :db.type/string
:db/index true
:db/cardinality :db.cardinality/many}
Now I’d like to update the account with new interests. I don’t want to merge them but replace old interests with new ones. Is there a quick and simple way to do that? I found a SO answer but the explanation looks a bit vague to me.
https://stackoverflow.com/questions/42786046/how-to-update-overwrite-a-ref-attribute-with-cardinality-many-in-datomicYou can get inspiration from this https://github.com/vvvvalvalval/datofu#resetting-to-many-relationships