Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

508
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda