Created
November 4, 2019 16:21
-
-
Save sbatson5/c20e4cf90ea9049449c04251757bdcab to your computer and use it in GitHub Desktop.
Example of add to firebase
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const firebase = require('firebase'); | |
const db = firebase.firestore(); | |
db.collection("users").add({ | |
first: "Ada", | |
last: "Lovelace", | |
born: 1815 | |
}) | |
.then(function(docRef) { | |
console.log("Document written with ID: ", docRef.id); | |
}) | |
.catch(function(error) { | |
console.error("Error adding document: ", error); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment