0
    let query = db.collectionGroup('volumes')
    query = query.where('days', 'array-contains', day)
    query = query.where('start_time', '<', time)
    query = query.where('end_time', '>', time)
    snapshot = await query.get().catch(e => console.log(e))
    snapshot.forEach(doc => {
        console.log(doc.data())
    })

returns:

code: 2, details: '', metadata: Metadata { internalRepr: Map { 'content-type' => [Array] }, options: {} }

If I use only one "where" clauses its works just fine.

For me its not working... Firestore: Multiple conditional where clauses

3
  • Did you try instructions mentioned in firebase.google.com/docs/firestore/security/… Commented Sep 7, 2020 at 11:59
  • Its still raising the same error :\ Commented Sep 7, 2020 at 12:15
  • can you show the complete logs from firebase --debug emulators:start including the failed transaction? Also is there anything in firestore-debug.log? Commented Sep 7, 2020 at 17:27

1 Answer 1

1

The query you're trying to perform is not supported by Firestore. You can't have multiple range queries on different fields. Be sure to read of the documentation on query limitations. Specifically:

Queries can only perform range filters (>, <, etc) on a single field. Queries with range filters on multiple fields are not supported.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.