This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-10-09
Channels
- # announcements (23)
- # asami (25)
- # babashka (38)
- # beginners (53)
- # calva (17)
- # clara (5)
- # clj-commons (1)
- # clj-kondo (18)
- # clojure (11)
- # clojure-europe (17)
- # clojure-france (1)
- # clojure-germany (5)
- # clojure-nl (2)
- # clojure-sg (4)
- # conjure (3)
- # deps-new (6)
- # fulcro (16)
- # off-topic (46)
- # pedestal (11)
- # react (2)
- # reagent (5)
- # reclojure (7)
- # rewrite-clj (1)
- # sci (18)
- # shadow-cljs (75)
- # sql (3)
- # xtdb (12)
No sure if it's a bug or not, if a document's id is URL, it can't be queried through xt/q
, can only be found through xt/entity
?
I'm not sure that's right. Do you have an example query? Are you expecting a coercion to occur?
start xtdb node with this function, found in the tutorial
(defn start-xtdb!
[]
(letfn [(kv-store [dir]
{:kv-store {:xtdb/module 'xtdb.rocksdb/->kv-store,
:db-dir (io/file dir),
:sync? true}})]
(xt/start-node
{:xtdb/tx-log (kv-store "data/dev/tx-log"),
:xtdb/document-store (kv-store "data/dev/document-store"),
:xtdb/index-store (kv-store "data/dev/index-store")})))
and the code and output
(->> (xt/submit-tx @node [[::xt/put {:xt/id (URL. "") :a/b 1}]])
(xt/await-tx @node))
;; => #:xtdb.api{:tx-time #inst "2021-10-09T10:17:02.304-00:00", :tx-id 0}
(->> (xt/submit-tx @node [[::xt/put {:xt/id "xyz" :a/b 1}]])
(xt/await-tx @node))
;; => #:xtdb.api{:tx-time #inst "2021-10-09T10:17:04.240-00:00", :tx-id 1}
(xt/entity (xt/db @node) (URL. ""))
;; => {:a/b 1, :xt/id #object[java.net.URL 0x10157555 ""]}
(xt/entity (xt/db @node) "xyz")
;; => {:a/b 1, :xt/id "xyz"}
(xt/q (xt/db @node) '{:find [?e] :where [[?e :a/b 1]]})
;; => #{["xyz"]}
Thanks. That doesn't look right to me either. Really helpful to have this failing case. Could you paste this to a new issue on github?
Hi @U0NBGRGD6 I am able to reproduce this and it looks like a bug to me - sorry about that, but thank you for reporting it. Are you able to use URIs instead? I just checked that URIs work as expected