Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

504
Views
Property 'update' does not exist on type 'DocumentReference<DocumentData>' Typescript

I am trying to do an update to a Firebase firestore document. However, I am getting the error

Property 'update' does not exist on type 'DocumentReference'

    const Firestore = initializeFirestore(Firebase);

    const vendorsRef = collection(Firestore, '/vendors');
    const q = query(vendorsRef, where("uuid", "==", vendorUuid))
    const querySnapshot = await getDocs(q);
    
    querySnapshot.forEach(async (doc) => {
      const delRes = await doc.ref.update({deleted: '06-02-2022'});  // doing soft delete
    });

Any suggestions as to why this is? When I did into the node_modules, the update function appears to be there. Seems like a typescript issue maybe? I have also tried doing it the other style I've found where I use

Firestore.collection('vendors').doc('something').set(data);

But in that style, it tells me that Property 'collection' does not exist on type 'Firestore'

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

The error is telling you that there is no method "update" on v9 DocumentReference. If you look through the linked API doc, you will see that is definitely the case.

It seems you are maybe mixing up the JavaScript v8 and v9 APIs. v8 does have update as a method on DocumentReference but v9 does not. If you want to update a document using v9 as you are currently using, you should follow the documentation for that and use the updateDoc function.

import { updateDoc } from "firebase/firestore";

await updateDoc(doc.ref, {deleted: '06-02-2022'});
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!