Overview - Adding documents (add vs set)
What is it?
Adding documents in Firebase Firestore means saving data into the database. You can do this using two main methods: 'add' and 'set'. 'Add' creates a new document with a unique ID automatically, while 'set' writes data to a specific document ID you choose. Both methods store your data but work slightly differently.
Why it matters
This exists to help you save and organize data in your app's database easily. Without clear ways to add documents, managing data would be confusing and error-prone. Choosing between 'add' and 'set' affects how your data is structured and updated, which impacts your app's reliability and user experience.
Where it fits
Before learning this, you should understand basic Firebase Firestore concepts like collections and documents. After this, you can learn about updating, deleting documents, and querying data to build full database interactions.