This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-02-18
Channels
- # admin-announcements (3)
- # announcements (7)
- # aws (1)
- # beginners (76)
- # boot (340)
- # cider (9)
- # clara (35)
- # cljs-dev (7)
- # cljsjs (16)
- # cljsrn (11)
- # clojars (1)
- # clojure (192)
- # clojure-dev (6)
- # clojure-madison (8)
- # clojure-russia (373)
- # clojurebridge (1)
- # clojured (9)
- # clojurescript (172)
- # community-development (1)
- # core-async (2)
- # cursive (7)
- # data-science (2)
- # datomic (12)
- # devcards (1)
- # dirac (63)
- # emacs (3)
- # events (10)
- # gsoc (3)
- # hoplon (1)
- # jobs (1)
- # juxt (20)
- # ldnclj (4)
- # lein-figwheel (12)
- # leiningen (1)
- # off-topic (21)
- # om (232)
- # onyx (64)
- # parinfer (8)
- # proton (21)
- # re-frame (8)
- # reagent (1)
- # ring (3)
- # ring-swagger (3)
- # slack-help (4)
- # spacemacs (6)
- # testing (3)
When i want to replace an entity with a new version of the same entity, but still be able to see the old version of the entity in the history, how do I go about doing this?
And by replace i mean that: cardinality many entities should be replaced (not added to), and values not present in the new version not be present after the replace.
I was thinking to retractEntity before asserting the new in the same transaction, but I am getting a :db.error/datoms-conflict Two datoms in the same transaction conflict
I guess I could write a transaction function that finds out which fields to add and which fields to retract. Just seems like an obvious use case that might already be present.
or you could do two transactions - db.fn/retractEntity followed by asserting all the new facts
you can put lots of data into a single transaction, but you can’t make multiple conflicting alterations to a single entity in one go
e.g. assert a two new values for a cardinality/one attr