-
-
Notifications
You must be signed in to change notification settings - Fork 596
Aggregate query with null value returns incorrect results #920
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
Comments
I recently had a similar issue in parse-server 4.4.0 which was related to the type of the field.
but if the field type is Date, the same query will not work as expected:
but it's still working in mongo db shell though so I am sure there is a bug that is not fixed by the PR for this issue:
|
Even I tried to find those documents by comparing by their types like below examples:
although these are working in mongo db shell, none of the above cases worked in parse server, and in all cases, I've got the following console error in an interval without crashing the app:
|
in case if someone else finds this thread, I solved my problem with the approach below:
|
Issue Description
An aggregate query with
$in
that contains anull
value does not return the correct results.Steps to reproduce
This MongoDB query executes fine in the shell:
The query returns documents where the language field is missing or has value null or en.
The same query with the Parse SDK in Javascript does not yield the same results:
The query returns only documents where the language field has value en, but not where the field is missing or the the field value is
null
.Expected Results
The query with Parse SDK should return the same results as the MongoDB shell query.
Actual Outcome
The query returns only documents where the language field has value en, but not where the field is missing or the the field value is
null
.Environment Setup
Server
JS SDK
Logs/Trace
The text was updated successfully, but these errors were encountered: