Recall & Review
beginner
What does CRUD stand for in Cloud Firestore?
CRUD stands for Create, Read, Update, and Delete. These are the four basic operations you can perform on data in Cloud Firestore.
Click to reveal answer
beginner
How do you add a new document to a Firestore collection in Flutter?
Use the
add() method on a collection reference. For example: FirebaseFirestore.instance.collection('users').add({'name': 'Anna', 'age': 25});Click to reveal answer
beginner
What method is used to read a single document from Firestore in Flutter?
Use the
doc().get() method. For example: FirebaseFirestore.instance.collection('users').doc('userId').get(); This fetches the document data once.Click to reveal answer
intermediate
How do you update a document in Firestore without overwriting the entire document?
Use the
update() method on a document reference. It changes only the specified fields. Example: docRef.update({'age': 30});Click to reveal answer
intermediate
What happens if you try to delete a document that does not exist in Firestore?
Deleting a non-existing document does not cause an error. Firestore treats it as a successful operation because the document is effectively gone.
Click to reveal answer
Which Firestore method adds a new document with an auto-generated ID?
✗ Incorrect
The
add() method adds a new document with a unique ID automatically generated by Firestore.How do you read all documents from a Firestore collection in Flutter?
✗ Incorrect
Use
collection().get() to fetch all documents in a collection at once.Which method updates only specific fields of a Firestore document?
✗ Incorrect
The
update() method changes only the fields you specify without overwriting the whole document.What does the
set() method do if the document already exists?✗ Incorrect
By default,
set() replaces the whole document unless you use merge: true.What is the correct way to delete a document in Firestore using Flutter?
✗ Incorrect
Use
doc().delete() to remove a specific document from Firestore.Explain the four CRUD operations in Cloud Firestore and how you perform each in Flutter.
Think about how you add, read, change, and remove data in Firestore.
You got /4 concepts.
Describe the difference between set() and update() methods in Firestore when modifying documents.
Consider what happens to the document data after each method.
You got /3 concepts.