Skip to content

Instantly share code, notes, and snippets.

@markreale
Created May 28, 2019 12:21
Show Gist options
  • Save markreale/0d63b9025cfb73df039e3a6ea895fe46 to your computer and use it in GitHub Desktop.
Save markreale/0d63b9025cfb73df039e3a6ea895fe46 to your computer and use it in GitHub Desktop.
Firestore - Creating a new entry (Document in a Collection) with a custom Document ID
db.collection("[YOUR_COLLECTION]").doc("[YOUR_DOCUMENT]").set({
[YOUR_PROPERTY]: "[YOUR_UPDATED_VALUE]"
})
.then(function() {
console.log("Document successfully written!");
})
.catch(function(error) {
console.error("Error writing document: ", error);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment