Search
 
SCRIPT & CODE EXAMPLE
 

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);
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: java json string to map 
Javascript :: while and do while loop in javascript 
Javascript :: a.reduce 
Javascript :: Redirect to any page after 5 seconds in Javascript 
Javascript :: react testing library for hooks 
Javascript :: elastic get data from specific fields 
Javascript :: js if string not empty 
Javascript :: javascript split regex new line 
Javascript :: nextjs open browser automatically 
Javascript :: javascript duplicate an array 
Javascript :: merge 2 array of object by key 
Javascript :: open folder node js 
Javascript :: replace last element of array javascript 
Javascript :: photo in React native 
Javascript :: material app routes 
Javascript :: react native custom debounce input 
Javascript :: what is node.js 
Javascript :: jquery code to make click function 
Javascript :: debug.xcconfig: unable to open file react native 
Javascript :: dropzone csrf codeigniter 
Javascript :: how to route react from laravel 
Javascript :: filter parameters in javascript 
Javascript :: http requests in vue 3 
Javascript :: js canvas draw image 
Javascript :: jquery: get checkbox from each row of the table and select it 
Javascript :: jqeury input checkbox listener not working 
Javascript :: find object in json array 
Javascript :: node.js copy to clipboard 
Javascript :: jquery add option if not exist 
Javascript :: how to get array from object in javascript 
ADD CONTENT
Topic
Content
Source link
Name
2+1 =