Imagine that I have the following document stored in my Firestore.
collection: "myColection"
document: "myDocument"
fields:
someBoolean: true
someArray: ['a','b','c']
etc
QUESTION
What's the difference between doing the following methods to toggle the someBoolean
field:
OPTION 1
const docRef = db.collection('myCollection').doc('myDocument');
await docRef.set({
someBoolean: false
},
{merge: true});
OPTION 2
const docRef = db.collection('myCollection').doc('myDocument');
await docRef.update({
someBoolean: false
});