Skip to content
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

orderBy inside inner query doesn't work #41

Closed
iamswain25 opened this issue Oct 6, 2018 · 1 comment
Closed

orderBy inside inner query doesn't work #41

iamswain25 opened this issue Oct 6, 2018 · 1 comment
Assignees
Labels
bug Something isn't working wontfix This will not be worked on

Comments

@iamswain25
Copy link

iamswain25 commented Oct 6, 2018

this one works
const query = ref => ref.limit(4)
const geoQuery = geofirestore.query({ center, radius, query })

this one doesn't
const query = ref => ref.orderBy('d.createdAt', 'desc')
const geoQuery = geofirestore.query({ center, radius, query })

nothing comes through key_entered event listener
I set the indexing on firestore as it advises me to: d.createdAt DESC g ASC

@MichaelSolati MichaelSolati self-assigned this Oct 7, 2018
@MichaelSolati MichaelSolati added the bug Something isn't working label Oct 7, 2018
@MichaelSolati
Copy link
Owner

So ref.limit will not really work all the time... It's a side effect of how the service works, you can see an explanation here.

Anyway, I did some digging and testing, and here are a few issues regarding Firestore queries and GeoFirestore (and the docs should and will be updated to reflect this).

  1. You can not use startAt or similar modifiers (startAfter, endBefore, endAt) with GeoFirestore since we append the geo based modifiers to the end of a query and you cannot specify an orderBy() constraint after calling startAt(), startAfter(), endBefore() or endAt().
  2. It looks like while Firestore could support two orderBys, it can not support two orderBys AND two of the previously mentioned modifiers (startAt, startAfter, endBefore, endAt). It seems as if it has been somewhat documented as an issue here by a member of the Firebase team.

I'll be updating the docs to reflect this.

@MichaelSolati MichaelSolati added the wontfix This will not be worked on label Oct 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants