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

782
Views
No se puede usar "indefinido" como valor de Firestore. Si desea ignorar valores indefinidos, habilite `ignoreUndefinedProperties`

estoy recibiendo este error

 error is here: Error: Value for argument "value" is not a valid query constraint. Cannot use "undefined" as a Firestore value. If you want to ignore undefined values, enable `ignoreUndefinedProperties`.

en mi función javascript de Firebase y no tengo idea de cómo resolverlo. Descubrí que en mecanografiado ocurre este error. Pero, ¿qué significa este error en javascript?

esta es mi funcion

 import * as functions from "firebase-functions"; import admin from "firebase-admin"; import { deleteCollection, deleteQuery, deleteUserData, } from "../utils/deletion"; export default functions.firestore .document("deletions/{userUid}") .onDelete(async (snap, context) => { const db = admin.firestore(); const { userUid } = context.params; const { uid } = userUid; //dont forget to delete storage files try { await db.doc(`deletions/${userUid}/meinprofilsettings/${uid}`).delete(); await deleteQuery(db, db.collection(`deletions/${userUid}/videos`).where("uid", "==", uid));

La línea es await deleteQuery...

Las funciones deleteQuery se ven así

 async function deleteQuery(db, query, batchSize = 100) { const q = query.limit(batchSize); return new Promise((resolve, reject) => { deleteQueryBatch(db, q, resolve).catch(reject); }); } async function deleteQueryBatch(db, query, resolve) { const snapshot = await query.get(); const batchSize = snapshot.size; if (batchSize === 0) { // When there are no documents left, we are done resolve(); return; } // Delete documents in a batch const batch = db.batch(); snapshot.docs.forEach((doc) => { batch.delete(doc.ref); }); await batch.commit(); // Recurse on the next process tick, to avoid // exploding the stack. process.nextTick(() => { deleteQueryBatch(db, query, resolve); }); }
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Error: el valor del argumento "valor" no es una restricción de consulta válida. No se puede usar "indefinido" como valor de Firestore. Si desea ignorar valores indefinidos, habilite ignoreUndefinedProperties .

Esto significa que tiene un valor 'indefinido' en su lista. Firebase no admite valores indefinidos en su lista, verifique su lista y vea si algo no está undefined . Puede evitar esto usando ignoreUndefinedProperties . Aquí hay un ejemplo de cómo puedes lograr esto:

 import * as firestore from "firebase-admin";

Entonces solo necesitas tener algo como esto:

 const db = firestore.firestore(); db.settings({ ignoreUndefinedProperties: true })
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!