Fork me on GitHub
#datalevin
<
2021-12-21
>
Ian Chow04:12:13

Is it possible to delete sub entities by "upserting"? Example:

(transact! conn [{:db/id 1 :friends [{:db/id 2} {:db/id 3}]}])

(pull conn '[*] 1) ; result: {:db/id 1 :friends [{:db/id 2} {:db/id 3}]}

(transact! conn [{:db/id 1 :friends [{:db/id 2}]}])

(pull conn '[*] 1) ; result: {:db/id 1 :friends [{:db/id 2}]}