-
Notifications
You must be signed in to change notification settings - Fork 4k
🐛 [firestore] Not able to filter/query on fields that are null #11874
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 believe there's a specific isNull named argument for this. The reason was that there's no concept of undefined in Dart, so it had to be specific when you want to filter by null |
Thanks Elliot! Undefined and |
Hi @puf, should this be treated as a feature request? |
Hey @puf, you have to use flutterfire/packages/cloud_firestore/cloud_firestore/lib/src/query.dart Lines 658 to 659 in e51d2a2
If the value is Firestore doesn't allow |
Thanks for clarifying Russel. Do any of our SDKs for other languages drop |
It is more an issue with the way the API was initially designed. In an ideal world, the operator and the value would be separate arguments. This would allow |
Hmmm, I've done a little bit of digging into this and there might be a way around it. I'll see what we can do 🤔 |
Could we make the default values of each argument a const/symbol which is internal, and if it's that value, skip it? |
We use a sentinel to check if the value was set by the user: https://github.com/firebase/flutterfire/pull/11896/files#diff-c388154c29616d9c4eff4b583681b56e75ae1f0291f6c31db037d3d1e85fdd65R9 |
Bug report
I have a query that tries to retrieve documents with a (date) field that has a null value.
The Flutter code (when run on web, I didn't test other platforms) incorrectly returns documents with an actual date value, while the corresponding JavaScript code does not return these documents.
Steps to reproduce
date
andstring
), both of which have a value.date
fieldExpected behavior
I expect the Flutter and JavaScript projects to show the same result, given that they run an equivalent query on the same data.
Additional context
Originally reported here: https://stackoverflow.com/q/77468864
The text was updated successfully, but these errors were encountered: