This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-08-22
Channels
- # aws (12)
- # babashka (24)
- # beginners (51)
- # biff (2)
- # cherry (4)
- # cider (2)
- # clj-kondo (4)
- # cljs-dev (19)
- # clojure (70)
- # clojure-australia (4)
- # clojure-europe (39)
- # clojure-nl (4)
- # clojure-norway (6)
- # clojure-spec (9)
- # clojurescript (21)
- # component (6)
- # cursive (18)
- # data-science (9)
- # datomic (18)
- # events (2)
- # expound (4)
- # fulcro (15)
- # graalvm (2)
- # graphql (5)
- # jobs (1)
- # juxt (2)
- # leiningen (8)
- # malli (4)
- # meander (21)
- # nrepl (3)
- # observability (14)
- # off-topic (49)
- # other-languages (1)
- # pathom (13)
- # pedestal (7)
- # rdf (5)
- # re-frame (10)
- # reitit (1)
- # sql (4)
- # squint (30)
- # tools-deps (1)
- # vim (11)
Hi, I’m trying to understand the details of using [:db/lookup {:key "value"}]
in a :db/op :update
/ :db/op :merge
operation, when performing biff/submit-tx
.
It seems that a new document with {:xt/id {:key "value"}, :db/owned-by ...}
is always created (whether the document with {:key "value"}
existed or not).
Are these documents with the {:db/owned-by …}
key a pure internal biff thing that is used internally to e.g. help to (try to) look up the document(s) containing {:key "value"}
? Or am I (the developer) expected (/ permitted) to make use of these documents as well? If so, then what would be the use case?
They're just intended as an internal biff thing. it's basically a way to perform an upsert in XTDB without needing to register a transaction function first. you could use those docs in your own code to fetch documents by the given key faster, though I've personally always just used q
like normal.
in the future I might replace the :db/lookup
thing with a transaction function. haven't decided yet.