Skip to content

Instantly share code, notes, and snippets.

@markreale
Last active May 28, 2019 12:07
Show Gist options
  • Save markreale/fd914f9b8e49a2b086ca5c2a760f8261 to your computer and use it in GitHub Desktop.
Save markreale/fd914f9b8e49a2b086ca5c2a760f8261 to your computer and use it in GitHub Desktop.
Firestore - Updating data (Updating Documents in Collections)
return db.collection("[YOUR_COLLECTION]").doc("[YOUR_DOCUMENT]").update({
[YOUR_PROPERTY]: "[YOUR_UPDATED_VALUE]"
})
.then(function() {
console.log("Document successfully updated!");
})
.catch(function(error) {
console.error("Error updating document: ", error);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment