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

genericUser
  • 4,417
  • 1
  • 28
  • 73
  • Did you try instructions mentioned in https://firebase.google.com/docs/firestore/security/rules-query#secure_and_query_documents_based_on_collection_groups – Codex Sep 07 '20 at 11:59
  • Its still raising the same error :\ – genericUser Sep 07 '20 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? – Samuel Romero Sep 07 '20 at 17:27

1 Answers1

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.

Doug Stevenson
  • 297,357
  • 32
  • 422
  • 441