0

I am working on a small project and I am stuck from last month and looking for an exact query to update my document at the exact location...I did my best but didn't get my goal....Please help.

My Current Query

await test.update(
{
   "subtests.uuid": req.query.sub_uuid
},
{
   $set: {
      $push:
            {
               "subtests.$[element].subtests": req.body
            }
         }
},
{
      arrayFilters: [
         {
            "element.uuid": req.query.sub_uuid
         }
      ]
});

With this query, I am getting an error saying (Typeerror: Callback.apply is not a function)

MongoDb Document Image

enter image description here

Error

enter image description here

Thank You to everyone who holds my hand in this complex query (for me it very complex because I am trying to solve it from the month)

5
  • Query looks good check playground, there would be some client side error. Commented Nov 24, 2020 at 18:22
  • @turivishal no...with this query say callback.apply is not a fucntion Commented Nov 24, 2020 at 18:23
  • @turivishal server side error Commented Nov 24, 2020 at 18:23
  • @turivishal I am posting an image to exact error...please check that...Thanks Commented Nov 24, 2020 at 18:29
  • You are passing extra arguments in update function check this related errors too: question1, question2, check the documentation of update function in mongoose of your related version. Commented Nov 24, 2020 at 18:33

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.