Please try to answer the following questions (when in doubt, have a look at the content in the chapter itself—you'll find all the answers there!):
- In a Cloud Firestore database, what's the difference between a document and a collection? And can a document contain a collection?
- Can you name three of the main differences between a SQL and a NoSQL database?
- Consider the following code:
docs = await db.collection('favourites')
.where('userId', isEqualTo: uid).getDocuments();
What does this query perform? And which data type is the docs variable?
- In a Cloud Firestore database, is it possible to allow data access only to authenticated users? If so, how can you achieve that?
- How can you create an instance of a FirebaseAuth class?
- Consider the following code:
var result = db.collection('favourites').add(fav.toMap()
.then((value) => print(value.documentID))
.catchError((error)=> print (error));
Can you explain what these instructions perform?
- When would you create a getter method for a property in a class? And how do you write the code to create it?
- When do you need a Map object to interact with a Cloud Firestore database?
- How do you delete a document from a Cloud Firestore database?
- How do you pass data from one screen to another?