flutterfire icon indicating copy to clipboard operation
flutterfire copied to clipboard

[📚] Document query rules

Open rrousselGit opened this issue 3 years ago • 2 comments

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 if startAt was already specified
  • collection.startAt() The issue: startAt requires an orderBy query
  • where('foo', >=).where('bar', >=) The issue: when using certain where operators, subsequent where usages must be applied to the same property

This other list contains ODM-specific points:

  • orderByA().orderByB(startAt: )

rrousselGit avatar Jul 20 '22 12:07 rrousselGit

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 avatar Sep 23 '22 19:09 MatthewSchleder

@MatthewSchleder you can execute 2 separate queries where('lat' >=).where('lat' <=) where('long' >=).where('long' <=) and intersect their results

ahmednfwela avatar Mar 10 '23 04:03 ahmednfwela

Copied to: https://github.com/FirebaseExtended/firestoreodm-flutter/issues/29

Lyokone avatar Jul 08 '24 09:07 Lyokone