Bird
0
0

What happens if you try to run a Firestore query with multiple inequality filters on different fields without a composite index?

easy📝 Conceptual Q1 of 15
GCP - Cloud Firestore and Bigtable
What happens if you try to run a Firestore query with multiple inequality filters on different fields without a composite index?
AThe query will fail and Firestore will prompt to create a composite index.
BThe query will succeed but return incomplete results.
CThe query will ignore all inequality filters except the first.
DThe query will automatically create the needed index.
Step-by-Step Solution
Solution:
  1. Step 1: Understand Firestore's index requirements for inequality filters

    Firestore requires composite indexes for queries with inequality filters on multiple fields.
  2. Step 2: Behavior when missing composite index

    If the index is missing, Firestore returns an error with a link to create the index.
  3. Final Answer:

    The query will fail and Firestore will prompt to create a composite index. -> Option A
  4. Quick Check:

    Missing composite index = query fails with prompt [OK]
Quick Trick: Multiple inequality filters need composite indexes [OK]
Common Mistakes:
  • Assuming query runs without index
  • Thinking Firestore auto-creates indexes
  • Ignoring error messages about indexes

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More GCP Quizzes