I'm amazed that I can't seem to find a straight answer for this. I SIMPLY want to delete a document from a collection (like deleting a record from a table in mysql). Here is what I have tried:
People.find(
{key: req.params.key},
function(err, data) {
if (err) {
next(err);
}
if (data) {
data.remove(callback);
}
});
function callback() {
// do something
}
I keep getting this error in the console: "TypeError: Object has no method 'remove'". What am I doing wrong?