Reputation: 7246
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
Upvotes: 0
Views: 565
Reputation: 317948
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.
Upvotes: 1