Complete the code to get a reference to the 'users' collection.
const usersRef = firestore.collection([1]);The collection name must be exactly 'users' to reference the correct data.
Complete the code to filter users where age is greater than 18.
const adultUsersQuery = usersRef.where('age', [1], 18);
The '>' operator filters documents where the 'age' field is greater than 18.
Fix the error in the query to order users by their 'score' in descending order.
const topUsersQuery = usersRef.orderBy('score', [1]);
The correct string for descending order in Firestore is 'desc'.
Fill both blanks to create a query that filters users with 'status' equal to 'active' and orders by 'lastLogin' ascending.
const activeUsersQuery = usersRef.where('status', [1], [2]).orderBy('lastLogin', 'asc');
The 'where' clause uses '==' to check equality with the string 'active'.
Fill all three blanks to create a query that filters users with age greater than 21, status equal to 'active', and orders by 'signupDate' descending.
const filteredUsersQuery = usersRef.where('age', [1], 21).where('status', [2], [3]).orderBy('signupDate', 'desc');
The query filters users older than 21 with status 'active' and orders by signupDate descending.
