Closed EwenG closed 10 years ago
Hello,
I have an error while querying a database with retracted data.
Here is the code I am executing with datascript 0.1.4:
(let [db (-> (ds/empty-db {:aka {:db/cardinality :db.cardinality/many}}) (ds/with [[:db/add 1 :name "Ivan"]]) (ds/with [[:db/add 1 :name "Petr"]]) (ds/with [[:db/add 1 :aka "Devil"]]) (ds/with [[:db/add 1 :aka "Tupen"]]))] (ds/entity db 1))
=> {:db/id 1, :aka ("Devil" "Tupen"), :name "Petr"}
(let [db (-> (ds/empty-db {:aka {:db/cardinality :db.cardinality/many}}) (ds/with [[:db/add 1 :name "Ivan"]]) (ds/with [[:db/add 1 :name "Petr"]]) (ds/with [[:db/add 1 :aka "Devil"]]) (ds/with [[:db/add 1 :aka "Tupen"]]))] (let [db (-> db (ds/with [[:db/retract 1 :name "Petr"]]) (ds/with [[:db/retract 1 :aka "Devil"]]))] (ds/entity db 1)))
=> TypeError: Cannot read property 'v' of null
Turned out to be a bug in entity call, thx!
Hello,
I have an error while querying a database with retracted data.
Here is the code I am executing with datascript 0.1.4:
=> {:db/id 1, :aka ("Devil" "Tupen"), :name "Petr"}
=> TypeError: Cannot read property 'v' of null