Complete the code to create a Firestore query that filters documents where the field 'status' equals 'active'.
db.collection('users').where('status', '==', [1])
The query filters documents where the 'status' field is exactly 'active'.
Complete the code to order Firestore query results by the 'createdAt' timestamp in descending order.
db.collection('posts').orderBy('createdAt', [1])
Using 'desc' orders the results from newest to oldest based on 'createdAt'.
Fix the error in the Firestore query that tries to filter by two different fields without an index.
db.collection('orders').where('status', '==', 'shipped').where('[1]', '==', 'priority')
The query filters orders where 'status' is 'shipped' and 'priority' is 'priority'. This requires a composite index on 'status' and 'priority'.
Fill both blanks to create a Firestore query that limits results to 10 and starts after a given document snapshot.
db.collection('messages').orderBy('timestamp').[1](10).[2](lastVisible)
The query limits results to 10 documents and starts after the last visible document for pagination.
Fill all three blanks to create a Firestore query that filters by 'category', orders by 'price', and limits to 5 results.
db.collection('products').where('category', '==', [1]).orderBy([2]).[3](5)
The query filters products in the 'electronics' category, orders them by 'price', and limits the results to 5.