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, e.g.:
{:account/id 42
:account/interests ["run" "swim"]}
So now the account #42 has only ["run" "swim"]
interests but nothing else.
Is there a quick and simple way to do that? I found a SO answer but the explanation looks a bit vague to me.