Difference Between Firestore Set with {merge: true} and Update

In Cloud Firestore there are three write operations:

  1. add()
  2. set()
  3. update()

In the docs it says that using set(object, { merge: true }) will merge the given object with the existing document.

The same happens when you use update(object)… so what is the difference? It seems strange that google would duplicate functionality like this.

5 Answers
5

Leave a Comment