This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-03-12
Channels
- # announcements (19)
- # babashka (33)
- # beginners (96)
- # bitcoin (6)
- # cider (11)
- # circleci (5)
- # clj-kondo (22)
- # cljs-dev (4)
- # cljsjs (2)
- # clojure (65)
- # clojure-australia (9)
- # clojure-berlin (1)
- # clojure-europe (53)
- # clojure-italy (2)
- # clojure-nl (2)
- # clojure-uk (42)
- # clojurescript (9)
- # conjure (1)
- # cursive (33)
- # data-oriented-programming (1)
- # data-science (6)
- # datomic (12)
- # emacs (12)
- # fulcro (7)
- # graphql (4)
- # honeysql (5)
- # jobs (2)
- # juxt (8)
- # lsp (30)
- # malli (9)
- # off-topic (9)
- # other-languages (1)
- # re-frame (17)
- # reagent (11)
- # reitit (5)
- # releases (2)
- # remote-jobs (3)
- # shadow-cljs (39)
- # spacemacs (6)
- # sql (2)
- # testing (3)
- # tools-deps (43)
- # vim (5)
- # xtdb (11)
I’m also having some general problems with :crux.tx/match
. Here’s an example:
• I create a doc
• I check that it’s there
• I try to delete it with a simple match on id placed before the delete
• Check to see if it’s still there (it is)
• Try to delete it without the match
• Check to see if it’s still there (It isn’t)
I’m using uuid
for the id, so I’m wondering if the bug is somewhere there
posted this one here: https://github.com/juxt/crux/issues/1455
Can you try either calling [:crux.tx/match test-id]
or [:crux.tx/match test-id {:crux.db/id test-id :test "1234"}]
? Matching on nil
or an incomplete document will not satisfy match
so the delete should not execute in either of the cases in your screenshots.
@U01AVNG2XNF I tried both. I just tested with nil after my first try I’ll update the issue with that example instead though so it isn’t lost in translation
That being said, are you saying that I have to supply exact match for the document? Meaning no partial matches? That’s just good to know in general, but isn’t the reason for what I’m experiencing
Updated the github issue
I've never used match
transactions, but the documentation seems to imply nil
is the opposite of what you want: https://opencrux.com/reference/21.02-1.15.0/transactions.html#match says If the document supplied is nil, the match only passes if there does not exist a Document with the given ID.
The documentation for the Java API (which just calls the Clojure API under the covers, as far as I know) is a bit more precise: Passes if document1 is exactly present now
... I would assume "exactly present" means you can't do a partial match.
Sorry I'm not more help here. I'll have to try these myself to see if I can reproduce the strange behaviour you're seeing.
ohhh… That’s totally on me. I completely missed that in the documentation. But it seems this made me hit the “Lucene” error.