Firestore automatically updates data in real time, so apps stay current without manual refresh.
Step 2: Recognize offline support and automatic scaling
Firestore works offline and scales automatically, making it easy to use and reliable.
Final Answer:
Because it updates data in real time and works offline -> Option C
Quick Check:
Real-time + offline = Firestore primary [OK]
Hint: Remember Firestore updates live and works offline [OK]
Common Mistakes:
Thinking Firestore needs manual scaling
Believing Firestore lacks security rules
Confusing Firestore with temporary storage
2. Which of the following is the correct way to define a Firestore collection reference in Firebase SDK?
easy
A. const ref = firestore.collection('users');
B. const ref = firestore.getCollection('users');
C. const ref = firestore.users.collection();
D. const ref = firestore.collection.users();
Solution
Step 1: Recall Firestore collection syntax
The correct method to get a collection reference is firestore.collection('collectionName').
Step 2: Check each option's syntax
Only const ref = firestore.collection('users'); uses the correct method name and syntax.
Final Answer:
const ref = firestore.collection('users'); -> Option A
Quick Check:
Use .collection('name') to get collection [OK]
Hint: Use .collection('name') to get Firestore collections [OK]
Common Mistakes:
Using getCollection instead of collection
Accessing collection as a property
Calling collection as a method on collection
3. Given this Firestore query code, what will be the output if the 'users' collection has documents with fields {name: 'Alice', age: 30} and {name: 'Bob', age: 25}?