Firebase V9 Firestore Add Document Data Using addDoc() [2022]

Raja Tamil
4 min readJul 4, 2022

There are two methods that we can use to add document data to the Firebase Version 9 Cloud Firestore.

Other Firebase 9 Tutorials in this series:

Note: Before going further, you’ll need to do three things:

  1. Create A Firebase Project from Firebase Console
  2. Register an app for Web (JavaScript)
  3. Add Firebase SDK to JavaScript Web app

In order to use the addDoc() method, we need to import three methods from the Firebase Firestore import statement.

  1. getDatabase() → Firestore database where we want to add data as a document.
  2. collection() → Where we want to add collection name and database references.
  3. addDoc() → Where we actually pass our data along with the collection name and db references.

--

--

Raja Tamil
Raja Tamil

Written by Raja Tamil

👇click the link and get 80% OFF on the premium web development courses (HTML5, CSS3, JavaScript ES6, Vue JS 3 & Firebase 10 https://softauthor.com

No responses yet