I'm having an issue with a basic xtql query, and I'm not sure why. I'm following through the docs to learn xtql, and the parameterized example on that page is working, but my code isn't working.
(xt/q node '(from :users [{:person/email $email}])
{:args {:email ""}})
I expected this to limit to the user with the email "<mailto:user@email.com|user@email.com>", but it returns all my users.yep, I neglected to include that in the docs, sorry folks π³ fixed now
thanks both π
I didn't manage to repro this locally - what I tried:
β’ docker run on the repro repo didn't have a version specified, so will implicitly be running against latest - I tried it against both latest (beta8) and beta6 explicitly
β¦ beta8 did return all the rows - this is because of the breaking XTQL change in beta8 (updated code to follow)
β¦ beta6 returned 0 rows as expected
β’ migrating the code to beta8 also returned 0 rows
@brandon149 could you check your Docker log for the Starting XTDB 2.x @ 2.0.0-beta8 @ 9323479 ... line?
> because of the breaking XTQL change in beta8 Ah, I missed that the Clojure API for querying was also affected by this parameter / fn change!
The docs need updating to reflect this, yes?
It looks okay to me. Does it work if you put the string value directly into the query like this:
(xt/q node '(from :users [{:person/email "user@email.com"}]))That works as expected, yes
What version of XTDB are you using?
2.0.0-beta6
Hmm, I don't see anything in beta 7 or 8 that would invalidate that so... I don't know what I'm missing there...
Itβs especially strange to me cause itβs working on the tutorial data.
Ah, so are you getting back docs that have :person/email that doesn't match the args email value? Or docs that don't have :person/email at all?
If you can put together a GitHub repo that is self-contained with instructions on how to repro, that would help...
I get all docs back. There is no filtering applied. Iβll put one up once Iβm back in front of a computer.
This repo should do it https://github.com/bolivier/xtdb-reproduction
The xtql tutorial uses an in-memory db, and that works as expected, but when I replaced it with my running docker instance of xtdb, I see the same bad behavior.