Answers for "Adding in firestore"

0

Adding in firestore

// Add a new document in collection "cities"
db.collection("cities").doc("LA").set({
    name: "Los Angeles",
    state: "CA",
    country: "USA"
})
.then(() => {
    console.log("Document successfully written!");
})
.catch((error) => {
    console.error("Error writing document: ", error);
});
Posted by: Guest on June-13-2021

Browse Popular Code Answers by Language