Fork me on GitHub
#xtdb
<
2021-03-12
>
Aleksander Rendtslev01:03:28

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

Steven Deobald01:03:43

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.

Aleksander Rendtslev01:03:35

@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

Aleksander Rendtslev01:03:25

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

Aleksander Rendtslev01:03:33

Updated the github issue

Steven Deobald02:03:42

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.

Steven Deobald02:03:32

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.

Steven Deobald02:03:25

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.

Aleksander Rendtslev02:03:58

ohhh… That’s totally on me. I completely missed that in the documentation. But it seems this made me hit the “Lucene” error.

Aleksander Rendtslev02:03:46

Closing this issue but leaving the Lucene one open

👍 3