Closed miikka closed 2 years ago
Expanding on #411:
(require '[datascript.core :as d]) (def conn (d/create-conn {:uuid {:db/unique :db.unique/identity} :child1 {:db/valueType :db.type/ref :db/isComponent true} :child2 {:db/valueType :db.type/ref :db/isComponent true}})) (d/transact! conn [{:uuid "parent" :child1 {:uuid "child1"} :child2 {:uuid "child2"}} {:uuid "child1"} {:uuid "child2"}])
Now pulling with DataScript 1.3.1:
(d/pull @conn '[* :_child1 :_child2] [:uuid "child1"]) => {:db/id 2, :uuid "child1", :_child1 #:db{:id 1}} (d/pull @conn '[* :_child1 :_child2] [:uuid "child2"]) => {:db/id 3, :uuid "child2", :_child1 #:db{:id 1}, :_child2 #:db{:id 1}}
I'm new to DataScript, but having a result for :_child1 when pulling with [:uuid "child2"] does not look right to me. For comparison, here's what I get with DataScript 1.2.10:
:_child1
[:uuid "child2"]
(d/pull @conn '[* :_child1 :_child2] [:uuid "child1"]) => {:db/id 2, :uuid "child1", :_child1 #:db{:id 1}} (d/pull @conn '[* :_child1 :_child2] [:uuid "child2"]) => {:db/id 3, :uuid "child2", :_child2 #:db{:id 1}}
Thank you, it was a bug! Fixed in 1.3.2
Expanding on #411:
Now pulling with DataScript 1.3.1:
I'm new to DataScript, but having a result for
:_child1
when pulling with[:uuid "child2"]
does not look right to me. For comparison, here's what I get with DataScript 1.2.10: