Fork me on GitHub
#datomic
<
2018-12-23
>
igrishaev08:12:11

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-datomic

igrishaev11:12:40

looks nice, just to clarify: what is the meaning of the last boolean flag of clear-to-many function? It’s a bit unclear to me

igrishaev11:12:38

nervermind, that’s clear now. Thank you!