               (->Eduction (filter (fn [^Datom d] (= tx (datom-tx d))))))
          (set/slice eavt (datom e a nil tx0) (datom e a nil txmax))           ;; e a _ _
          (->> (set/slice eavt (datom e nil nil tx0) (datom e nil nil txmax))  ;; e _ v tx
-              (->Eduction (filter (fn [^Datom d] (and (= v (.-v d))
+              (->Eduction (filter (fn [^Datom d] (and #?(:clj (pred (.-v d))
+                                                        :cljs (= v (.-v d)))
                                           (= tx (datom-tx d)))))))
          (->> (set/slice eavt (datom e nil nil tx0) (datom e nil nil txmax))  ;; e _ v _
-              (->Eduction (filter (fn [^Datom d] (= v (.-v d))))))
+              (->Eduction (filter (fn [^Datom d] #?(:clj (pred (.-v d))
+                                                   :cljs (= v (.-v d)))))))
          (->> (set/slice eavt (datom e nil nil tx0) (datom e nil nil txmax))  ;; e _ _ tx
               (->Eduction (filter (fn [^Datom d] (= tx (datom-tx d))))))
          (set/slice eavt (datom e nil nil tx0) (datom e nil nil txmax))       ;; e _ _ _

    (update :aevt persistent!)
    (update :avet persistent!)))

(defrecord-updatable DB [schema eavt aevt avet max-eid max-tx rschema pull-patterns pull-attrs hash]
  #?@(:cljs
      [IHash                (-hash  [db]        (hash-db db))

          eavt       (.-eavt db)
          aevt       (.-aevt db)
          avet       (.-avet db)
          #?@(:clj [pred (vpred v)])
          multival?  (contains? (-attrs-by db :db.cardinality/many) a)]
      (case-tree [e a (some? v) tx]
        [(set/slice eavt (datom e a v tx) (datom e a v tx))                   ;; e a v tx
