Is there a batch method corresponding to the javascript set with merge option?
I was looking at the documents, but couldn't find anything on this. If not, what is the current official approach to merging items in a batch?
After some time, I found out that you can achive that using:
batch.set(db.doc(t.ref.toString()), { field: admin.firestore.FieldValue.delete() }, { merge: true }))
If you're using Python just use:
batch.set("path/to/document", data, merge=True)
Firebase documentation - addition of data says that we can add a parameter "merge=True" for setting with merge. The same applies to batch updates and works fine when tested on Python3.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With