Firebase V9 Firestore Update Document Data Using setDoc()

Raja Tamil
4 min readJul 11, 2022

There are two methods you can use to update an existing document in Firebase Version 9 Cloud Firestore.

Note: Before going any 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

Using the setDoc() method, you can update

In addition to that, you can also add a brand new document to a collection using setDoc() method.

Firestore Update Entire Document

Here is the sample data stored in the Cloud Firestore.

Let’s update an entire document using the setDoc() method.

In order to update data entirely using the setDoc() method, we need three methods.

  • getDatabase() → where we want to update a…

--

--

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