Firestore Find Doc And Set Data Code Example

Snippet 1

  var washingtonRef = db.collection("cities").doc("DC");// Atomically add a new region to the "regions" array field.washingtonRef.update({    regions: firebase.firestore.FieldValue.arrayUnion("greater_virginia")});// Atomically remove a region from the "regions" array field.washingtonRef.update({    regions: firebase.firestore.FieldValue.arrayRemove("east_coast")}); 

Snippet 2

  firebase deploy --only functions:functionNameHere 

Copyright © Code Fetcher 2020

 

 

Published

Leave a comment

Your email address will not be published. Required fields are marked *