-
Notifications
You must be signed in to change notification settings - Fork 9
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
Query a field with the condition "isGraterThan" #229
Comments
Thank you for your message @HaniMontana ! Let me check the issue! If possible, could you share the minimal reproducible code sample? Thank you, |
As you see the following part: I think the query executed in the end is going to like this: FirebaseFirestore.instance.collection('locations')
.where('lastUpdateTimestamp', isGreaterThan: someTimestamp)
.orderBy('lastUpdateTimestamp')
.orderBy('position.geohash')
.startAt(['someStartGeohash'])
.endAt(['someEndGeohash']) It requires composite index, but do you create the index, probably clicking the console error URL link or from the Cloud Firestore console? |
Hi @kosukesaigusa In the following you can finde the code snippet. I hope it helps.
I tried with both orderby, but it thows an error: When I only use on orderby, there is no error, but there is no data. And the point with .startAt(['someStartGeohash']).endAt(['someEndGeohash']) I didnt get how to use it... |
Hello,
I am using this pluggin and my target is to get the nearby documents AND to additionally filter based on a timestamp (if the upload of the location is old I would like to ignore it).
Everything is working greate and also if I use the isEqualTo condition it can filter out the required document. Once I add a condition like isGreaterThan it is first of all throwing an error:
package:cloud_firestore/src/query.dart': Failed assertion: line 492 pos 13: 'conditionField == orders[0][0]': The initial orderBy() field "[[FieldPath([position, geohash]), false]][0][0]" has to be the same as the where() field parameter "FieldPath([lastpositionupdate])" when an inequality operator is invoked
After that I just added .orderBy and the error is gone, but I am not able to find any document.
Is this the orderBy limitation of the Plugin or did I miss something.
Thank you!
The text was updated successfully, but these errors were encountered: