Complete the code to create a Firestore document reference.
doc_ref = db.collection('users').[1]('user123')
The document method creates a reference to a specific document in a collection.
Complete the code to add a new document with an auto-generated ID.
db.collection('orders').[1]({'item': 'book', 'qty': 3})
The add method adds a new document with an auto-generated ID to the collection.
Fix the error in the code to update a document field.
db.collection('products').doc('prod1').[1]({'price': 20})
The update method modifies specific fields of an existing document without overwriting the whole document.
Fill both blanks to query documents where age is greater than 25.
results = db.collection('employees').where('age', [1], [2]).get()
The where method filters documents. Use '>' to find ages greater than 25.
Fill all three blanks to create a dictionary of user names and their emails for users older than 30.
user_emails = {user.[1]: user.[2] for user in users if user.[3] > 30}This dictionary comprehension maps user names to emails only if their age is over 30.