datascript
datascript copied to clipboard
Datoms that differ only by :added key are considered equal
(= (datascript.core/datom 1 :a "v" 500 true) (datascript.core/datom 1 :a "v" 500 false))
;; => true
Is this expected?
I don’t remember at this point. What does Datomic do?
Datomic doesn't make them equal unless the T is also equal:
(:import (datomic.db Datum))
(=
(Datum. 0 5 "f" 1)
(Datum. 0 5 "f" 3))
;; => false
Notable: It uses the :db/id of the attribute in the Datom. And they use the lowest bit to encode assertion vs retraction.