flutterfire
flutterfire copied to clipboard
[📚] Document query rules
This issue is for tracking the various query "edge-cases" that are probably worth documenting
The following is a non-exhaustive list of points to cover:
.orderBy().startAt().orderBy()The issue: orderBy cannot be used ifstartAtwas already specifiedcollection.startAt()The issue: startAt requires an orderBy querywhere('foo', >=).where('bar', >=)The issue: when using certainwhereoperators, subsequentwhereusages must be applied to the same property
This other list contains ODM-specific points:
orderByA().orderByB(startAt: )
where('foo', >=).where('bar', >=) The issue: when using certain where operators, subsequent where usages must be applied to the same property
A project that I’m working on utilizes a lat/long combination. To map a point on a map, I was hoping to have a where(‘lat’ >=).where(‘lat’ <=).where(‘long’ >=).where(‘long’ <=) to encompass an area.
Is there a recommended approach? Even if it doesn’t utilize the ODM?
@MatthewSchleder you can execute 2 separate queries
where('lat' >=).where('lat' <=)
where('long' >=).where('long' <=)
and intersect their results
Copied to: https://github.com/FirebaseExtended/firestoreodm-flutter/issues/29