Complete the code to read data efficiently from Firebase.
const docRef = db.collection('users').doc([1]);
We need to specify the exact document ID to read efficiently, so 'userId123' is correct.
Complete the code to fetch only the needed fields from a document.
docRef.get().then(snapshot => { const data = snapshot.[1](); });The method to get document data from a snapshot is data().
Fix the error in the query to limit reads to 10 documents.
db.collection('posts').[1](10).get();
The correct method to limit the number of documents read is limit().
Fill both blanks to create a query that reads only active users and limits to 5 results.
db.collection('users').[1]('status', '==', 'active').[2](5).get();
Use where() to filter active users and limit() to restrict to 5 reads.
Fill all three blanks to read documents ordered by timestamp, filtered by type, and limited to 3.
db.collection('events').[1]('type', '==', 'click').[2]('timestamp').[3](3).get();
Use where() to filter by type, orderBy() to sort by timestamp, and limit() to restrict reads.
