datascript

Immutable database and Datalog query engine for Clojure, ClojureScript and JS
akond 2019-08-01T14:10:41.004600Z

how do i remove an attribute+value from database? [[:db/add [:app/form id] :form/stage nil]] does not work because it does not accept nil as a value.

dpsutton 2019-08-01T14:13:42.004800Z

[:db/retract entity-id attribute value]

akond 2019-08-01T14:15:31.005300Z

i have to know what the value is?

ncg 2019-08-01T14:48:32.005700Z

[[:db.fn/retractAttribute eid attribute]]

ncg 2019-08-01T14:49:04.006100Z

There is also a built-in function to retract an entire entity, aptly named :db.fn/retractEntity

akond 2019-08-01T15:02:05.006500Z

i want to keep the entity

akond 2019-08-01T15:02:32.006900Z

just one attribute

ncg 2019-08-01T15:12:52.007200Z

then it's the above :db.fn/retractAttribute

akond 2019-08-01T15:22:52.007500Z

@niko963 thank you