Created
July 30, 2021 13:32
-
-
Save Chizaram-Igolo/aa6788de4ef94156ea5495e27231012b to your computer and use it in GitHub Desktop.
This file contains 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
// Add a first document with a generated ID. | |
db.collection("users").add({ | |
first: "Ada", | |
last: "Lovelace", | |
born: 1815 | |
}) | |
.then((docRef) => { | |
console.log("Document written with ID: ", docRef.id); | |
}) | |
.catch((error) => { | |
console.error("Error adding document: ", error); | |
}); | |
// Add a second document with a generated ID. | |
db.collection("users").add({ | |
first: "Alan", | |
middle: "Mathison", | |
last: "Turing", | |
born: 1912 | |
}) | |
.then((docRef) => { | |
console.log("Document written with ID: ", docRef.id); | |
}) | |
.catch((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