-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MongoDB like operator not working properly #9219
Comments
/cc @loicmathieu |
@Serkan80 as I understand it, using
Generates
Where it should be
|
No not correct, it should be either like this: No single quotes on the value of the regex (/.harr./i). |
@Serkan80 escaping with single quotes the operator is not the issue.
We automatically escape the value of the parameter so you can ony use regular String for the moment. |
So, to fix this we need, for the |
Ok, then you need to document this well, because people have to know that you can use 2 types of regex. And only the JS one support case-insensitivity (and other options). It would be nice to do it just 1 way with the options support. For example:
And when you see that there are options provided, you just generare the JS variant, otherwise the default/current one. |
I guess that if people try to use one form or the other it's because they know they exist ;) Unfortunatly, we cannot easily add options to the So the best I can propose is to check if it's a JavaScript regex and don't escape in this case. |
Describe the bug
I have the following Books in my collection:
And when I do the following query:
I see the following on my console printed out:
And I get 0 result back.
Expected behavior
I expect 1 result.
Environment (please complete the following information):
158816988320.04~bbe668a-Ubuntu SMP Wed Apr 29 21:00:02 UTC x86_64 x86_64 x86_64 GNU/Linux.OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.7+10)
OpenJDK 64-Bit Server VM AdoptOpenJDK (build 11.0.7+10, mixed mode)
Additional context
The problem lies in the generated query.
If I write the following query, then it works:
Notice the quotes !
See also:
https://stackoverflow.com/questions/61732717/mongodb-panache-queries-not-returning-any-result/61733115
The text was updated successfully, but these errors were encountered: