Fork me on GitHub
#asami
<
2021-12-19
>
zeitstein19:12:21

@quoll, how should I append entity reference to an array of such references? None of the below work:

;; initial
  (d/transact conn [{:id 1}
                    {:id 0 :array [{:id 1}]}])

  (d/transact conn [{:id "new"}
                    {:id 0 :array+ {:id "new"}}])

  (d/transact conn [{:id "new"}
                    {:id 0 :array+ [:id "new"]}])

  (d/transact conn [{:id "new2"}
                    {:id 0 :array+ "new2"}])

  (d/transact conn [{:id "new3" :db/id -1}
                    {:id 0 :array+ -1}])
The only way it works is:
(d/transact conn [{:db/id :tg/node-1}
                    {:db/id :tg/node-0 :array [{:db/id :tg/node-1}]}])

  (d/transact conn [{:db/id :tg/node-new}
                    {:db/id :tg/node-0 :array+ :tg/node-new}])
https://github.com/threatgrid/asami/issues/225 about this a while back. If you have time, of course :)

quoll20:12:33

I can't this week! I’m on the road (18 hours so far) and don't have a computer with me