Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

firestore add document

import { doc, setDoc } from "firebase/firestore"; 

// Add a new document in collection "cities"
await setDoc(doc(db, "cities", "LA"), {
  name: "Los Angeles",
  state: "CA",
  country: "USA"
});
Source by firebase.google.com #
 
PREVIOUS NEXT
Tagged: #firestore #add #document
ADD COMMENT
Topic
Name
1+5 =