Skip to content Skip to sidebar Skip to footer

Cannot Delete From Mongodb Collection Angular Mean Stack

Im trying to delete a record from my mongodb collection 'setlist' in a MEAN stack application. index.html <

Solution 1:

Two possible issues here.

First and most likely your remove query {_id: mongojs.ObjectId(id)} dont match any document in DB.

Second you have some error during remove stage.

So i suggest following. Check if remove query actually have documents to remove by doing like this find({_id: mongojs.ObjectId(id)}). If documents will be found then try print err and see what you have there.

Docs https://docs.mongodb.com/manual/reference/method/db.collection.remove/

Hope this helps.

Post a Comment for "Cannot Delete From Mongodb Collection Angular Mean Stack"