Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

editting collection in firebase firestore

Updating single document in  firestore
// imports
import { db } from " Relative path of your firebase config file";
import { doc, setDoc } from "firebase/firestore";

// code in component
const updateData = async () => {
	const docRef = doc(db, "collectionName", "documentId");
    const payload = { whatever your payload is };
    await setDoc(docRef, payload);
}
 
PREVIOUS NEXT
Tagged: #editting #collection #firebase #firestore
ADD COMMENT
Topic
Name
2+2 =