Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@YerlinMatu
Last active March 24, 2019 21:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save YerlinMatu/01ea82e3e0a6168a830aca1b49cd00c6 to your computer and use it in GitHub Desktop.
Save YerlinMatu/01ea82e3e0a6168a830aca1b49cd00c6 to your computer and use it in GitHub Desktop.
async function addUser(){
let userData = {
name: "Andres 2",
lastName: "Sanabria",
birthdate: firebase.firestore.FieldValue.serverTimestamp(),
email: "email@gmail.com",
profession: "UX/UI Designer"
}
let newDocID = await firebase.firestore().collection("users").add(userData).then(doc => doc.id);
console.log("Saved: ", newDocID);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment