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

262
Views
Error: Value for argument "value" is not a valid query constraint. "undefined" values are only ignored inside of objects

Whenever I am trying to execute one query as follows :

const user = {
        userHandle: req.body.userHandle
    };

    db.collection('todos')
        .where('userHandle', '==', user.userHandle)
        .get()
        .then((data) => {
            let todos = [];
            data.forEach((doc) => {
                todos.push({
                    todoId: doc.id,
                    body: doc.data().body,
                    isDone: doc.data().isDone,
                    userHandle: doc.data().userHandle,
                });
            });
            return res.json(todos);
        })
        .catch((err) => {
            console.error(err);
            res.status(500).json({ error: err });
        });
}

I get the below mentioned error in my google cloud console :

Error: Value for argument "value" is not a valid query constraint. "undefined" values are only ignored inside of objects.

at .Object.validateUserInput ( /workspace/node_modules/@google-cloud/firestore/build/src/serializer.js:274 )
at .validateQueryValue ( /workspace/node_modules/@google-cloud/firestore/build/src/reference.js:2230 )
at .CollectionReference.where ( /workspace/node_modules/@google-cloud/firestore/build/src/reference.js:1061 )
at exports.getAllTodoForOneUser ( /workspace/handlers/todos.js:29 )
at .Layer.handle ( /workspace/node_modules/express/lib/router/layer.js:95 )
at .next ( /workspace/node_modules/express/lib/router/route.js:137 )
at .Route.dispatch ( /workspace/node_modules/express/lib/router/route.js:112 )
at .Layer.handle ( /workspace/node_modules/express/lib/router/layer.js:95 )
at undefined. ( /workspace/node_modules/express/lib/router/index.js:281 )
at .Function.process_params ( /workspace/node_modules/express/lib/router/index.js:341 )

Also I am trying to query with the body using POSTMAN as follows :

{ "userHandle": "qmfUXw6YDwO9PQx1n13DjvPi2D23" }

The following is the screenshot of my firebase db.

enter image description here

about 4 years ago · Juan Pablo Isaza
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!