Fork me on GitHub
#datascript
<
2020-01-05
>
Filipe Silva15:01:14

does anyone know if the order of datoms in a tx matters?

Filipe Silva15:01:25

I have a bunch of datoms in the operation format (`[:db/add 1 :prop "value]`)

Filipe Silva15:01:20

if it helps, I know these are already normalised because I got them off a tx-report

Filipe Silva15:01:01

I'd like to know if I could transact them in a new tx but in random order, and if that'd always yield the same db

hiredman19:01:25

I suspect the order of :db/add and :db/retract in a transaction will matter if they refer to the same attribute of the same entity

Filipe Silva19:01:27

yes that sounds likely...

Filipe Silva19:01:04

I also tried making the order not matter and that make some pulls present varying order on ref arrays

kenny19:01:28

@filipematossilva fwiw, I believe the behavior of datascript & datomic differ in behavior for this case. https://github.com/tonsky/datascript/issues/172

Filipe Silva22:01:17

that definitely answers my question

Filipe Silva22:01:29

so yeah, order matters a lot