A. The operator should be '==' not '=' in the where clause.
B. The collection name is incorrect.
C. You must call filter instead of where.
D. The get() method is missing parentheses.
Solution
Step 1: Check the where clause syntax
Firebase requires the equality operator to be '==' not '=' in queries.
Step 2: Understand impact of wrong operator
Using '=' is invalid and causes Firebase to ignore the filter, reading all documents.
Final Answer:
The operator should be '==' not '=' in the where clause. -> Option A
Quick Check:
Use '==' for equality in Firebase queries [OK]
Hint: Use '==' not '=' in Firebase where filters [OK]
Common Mistakes:
Using single '=' instead of '=='
Confusing filter and where methods
Forgetting parentheses on get()
5. You want to design a Firebase data structure to efficiently read user profiles by country without reading the entire users collection. Which approach is best?
hard
A. Store all users in one collection and filter by country using a query.
B. Store users in one collection but duplicate country data in each document.
C. Create separate collections for each country containing only that country's users.
D. Use a single document with all users nested inside.
Solution
Step 1: Consider read efficiency
Reading a smaller collection per country avoids scanning the entire users collection.
Step 2: Evaluate data structure options
Separate collections per country limit reads to only relevant users, improving speed and cost.
Final Answer:
Create separate collections for each country containing only that country's users. -> Option C
Quick Check:
Separate collections = efficient country-based reads [OK]
Hint: Split data by query needs to reduce read size [OK]
Common Mistakes:
Relying on filtering large collections only
Duplicating data without structure change
Nesting all users in one document causing large reads
Recommended
Ready to prove it?
Pass the test and this pattern moves unknownstrongwhile earning +1 Grip toward your certificate.