Set Item
The Set Item
method works similarly to the Create Item method but performs upserting instead.
If the document already exists, the Set Item
method will overwrite the existing document with the new data provided or merge the new data with the existing data in the document, depending on whether the Merge Fields
option is active.
If the document does not exist, the Set Item
method will create a new document with the provided data.
Example Request
- Open the request panel and click on the
+
button to add a new request. - Fill in an appropriate name for the request and select the Firebase app to be used for the request. Then, under the method, choose
Set Item
. - Under the
Path
, fill in the full path to the document in your Cloud Firestore database. - Fill in the key-value pairs with the data to be set.