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

790
Views
Cannot use "undefined" as a Firestore value. If you want to ignore undefined values, enable `ignoreUndefinedProperties`

Im getting this 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`. 

in my firebase javascript function and I have no idea how to solve it . I found out that in typescript this error happens . But what does this error means in javascript ?

This is my function

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));

The line is the await deleteQuery...

The deleteQuery functions looks like this

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: 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.

This means that you have an ‘undefined’ value in your list. Firebase does not support undefined values in your list, check your list and see if something is undefined. You can avoid this by using ignoreUndefinedProperties. Here is an example of how you can achieve this:

import * as firestore from "firebase-admin";

Then just need to have something like this:

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!