Complete the code to get a reference to the Firestore collection named 'users'.
const usersCollection = firestore.collection('[1]');
The collection name is 'users', so you must pass 'users' to the collection() method.
Complete the code to get a reference to a document with ID 'user123' inside the 'users' collection.
const userDoc = firestore.collection('users').[1]('user123');
To reference a specific document by ID, use the doc() method with the document ID as argument.
Fix the error in the code to add a new document with data to the 'orders' collection.
firestore.collection('orders').[1]({ item: 'book', quantity: 3 });
To add a new document with an auto-generated ID, use the add() method with the data object.
Fill both blanks to update the 'status' field to 'shipped' in the document with ID 'order456' in the 'orders' collection.
firestore.collection('[1]').[2]('order456').update({ status: 'shipped' });
You must specify the 'orders' collection and then get the document reference with doc('order456') before calling update().
Fill all three blanks to delete the document with ID 'session789' from the 'sessions' collection.
firestore.[1]('[2]').[3]('session789').delete();
First get the collection 'sessions', then get the document 'session789' with doc(), then call delete() to remove it.