Firestore queries have some limitations. Which of the following is NOT a Firestore query limitation?
Think about what Firestore allows in ordering and filtering.
Firestore allows ordering by fields even if they are not filtered, but it requires indexes for certain queries. Multiple inequality filters on different fields and direct 'OR' queries are not supported.
You want to query documents where status is 'active' OR priority is 'high'. Firestore does not support 'OR' queries directly. Which approach correctly implements this?
Consider how Firestore handles multiple queries and client-side merging.
Firestore does not support 'OR' queries directly. The common workaround is to run multiple queries and merge results on the client side.
You have a Firestore query filtering by category and ordering by timestamp. The query fails due to missing index. Which index configuration is required?
collection: products
fields:
- fieldPath: category
order: ASCENDING
- fieldPath: timestamp
order: DESCENDINGCheck the order directions in the query and index.
Firestore requires a composite index matching the filter and order directions exactly.
What happens if you try to run a Firestore query with inequality filters on two different fields, for example age > 20 and score < 50?
Recall Firestore's rules on inequality filters.
Firestore does not allow inequality filters on more than one field in a single query.
You want to secure a Firestore collection so users can only read documents where ownerId equals their user ID. You write a security rule using request.auth.uid == resource.data.ownerId. Which query limitation must you consider to ensure the query passes the security rules?
Think about how Firestore security rules interact with queries.
Firestore requires queries to include filters matching security rules to avoid returning unauthorized data.