Complete the code to get a reference to a subcollection named 'orders' inside a document.
const ordersRef = firestore.collection('users').doc('user123').[1]('orders');
To access a subcollection, use collection on a document reference.
Complete the code to add a new document to the 'orders' subcollection.
firestore.collection('users').doc('user123').collection('orders').[1]({ item: 'book', quantity: 1 });
Use add() to create a new document with an auto-generated ID in a collection.
Fix the error in the code to correctly get a document from a subcollection.
const orderDoc = firestore.collection('users').[1]('user123').collection('orders').doc('order456');
Use doc() to get a specific document by ID inside a collection.
Fill both blanks to query all documents in the 'comments' subcollection of a post.
const commentsQuery = firestore.collection('posts').doc('post789').[1]('comments').[2]();
First get the 'comments' subcollection, then call get() to fetch all documents.
Fill all three blanks to update a field in a document inside a subcollection.
firestore.collection('[1]').doc('[2]').collection('[3]').doc('doc001').update({ status: 'completed' });
Update a document in the 'tasks' subcollection of the 'proj123' document inside 'projects' collection.