Complete the code to create a new collection named 'users'.
const usersCollection = firestore.collection('[1]');
The collection name must be 'users' to create the correct collection.
Complete the code to add a new document with ID 'user123' to the 'users' collection.
firestore.collection('users').doc('[1]').set({ name: 'Alice' });
The document ID must be 'user123' to match the intended document.
Fix the error in the code to correctly add a document with auto-generated ID.
firestore.collection('users').[1]({ name: 'Bob' });
The 'add' method creates a new document with an auto-generated ID.
Fill both blanks to create a document reference and set data in it.
const docRef = firestore.collection('[1]').doc('[2]'); docRef.set({ age: 30 });
The collection is 'employees' and the document ID is 'emp001' as required.
Fill all three blanks to create a nested collection and add a document with data.
const docRef = firestore.collection('[1]').doc('[2]').collection('[3]'); docRef.add({ status: 'active' });
The code creates a 'tasks' collection inside the 'projA' document of 'projects' collection.
