Answers for "how to insert field in node in firebase"

12

firebase deploy only function

firebase deploy --only functions:functionNameHere
Posted by: Guest on August-21-2020
1

firestore create document with auto id

// Add a new document with a generated id.
db.collection("cities").add({
    name: "Tokyo",
    country: "Japan"
})
.then(function(docRef) {
    console.log("Document written with ID: ", docRef.id);
})
.catch(function(error) {
    console.error("Error adding document: ", error);
});
---------------------------
//If you want to specify id then use .set() 
// e.x   \/
db.collection("cities").doc("TYO").set({
    name: "Tokyo",
    country: "Japan"
})
Posted by: Guest on January-16-2021

Code answers related to "how to insert field in node in firebase"

Browse Popular Code Answers by Language