Skip to content Skip to sidebar Skip to footer

Delete Item From Nested Array In Schema Using Moongoose

I need help with removing this item from nested array. I tried used $http.delete but this method deleted whole ObjectID from database, and second problem is that I can't connect th

Solution 1:

Please try console.log(req.params.description) Before the Mongoose update query and check if the output is indeed a valid ObjectId.

If the console output is not showing the valid uid, then the problem is in the angular code. Most probably in editProduct.deleteDescription(item) function. Check if you are making Http Request by passing the correct Description Id as the parameter. Thats probably something like item.descriptionId or item.id. Debug thoroughly.

Post a Comment for "Delete Item From Nested Array In Schema Using Moongoose"