datomic

Ask questions on the official Q&A site at https://ask.datomic.com!
mafcocinco 2020-08-08T04:58:14.135600Z

Random newb question: If an entity is retracted, are all references to that entity automatically retracted as well or are those retractions explicitly required?

2020-08-08T14:18:38.136200Z

> It retracts all the attribute values where the given id is either the entity or value, effectively retracting the entity’s own data and any references to the entity as well. https://docs.datomic.com/on-prem/transactions.html#dbfn-retractentity

mafcocinco 2020-08-10T02:33:19.150100Z

cool. Just a point of clarification. If I have a V shaped relationship like this:

A    B
 \  /
  C
And I retract the entity A using :db/retractEntity, assuming A and B both have references to C, will Bs reference to C be removed as part of the recursive retraction? The path of least surprise would tell me yes but I just wanted to confirm.

2020-08-10T04:15:44.151400Z

You can try it 🙂

2020-08-10T04:16:16.151600Z

But yes. Facts B and C will also be retracted.

mafcocinco 2020-08-10T12:50:06.152Z

Thanks!

2020-08-08T14:19:29.137100Z

It’s just a shorthand for retracting all facts involving that entity.