Introduction
When you want to save information in Firebase Firestore, you can add new documents in two main ways: using add or set. Both save data but work a bit differently on how they create or update documents.
When you want Firebase to create a new document with a unique ID automatically.
When you want to specify the exact ID for the document you are saving.
When you want to add a new document without worrying about overwriting existing data.
When you want to update or replace data in a document with a known ID.
When you want to merge new data into an existing document without deleting other fields.