Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

issue with delete #155

Open
mike-aungsan opened this issue Feb 3, 2015 · 2 comments
Open

issue with delete #155

mike-aungsan opened this issue Feb 3, 2015 · 2 comments

Comments

@mike-aungsan
Copy link

Cannot run delete.

mongoskinDbObj.mongoskinDb.collection(mongoskinDbObj.collectClient)
.delete({deletes: [ { q: {'serial_no': serial_no} } ]}, function(err, result) {
if (err) {
console.log(err);
}
else {
console.log(result);
}
});

@perfaram
Copy link
Contributor

Simply put, you're doing it wrong : You don't have to add "deletes:" in the JSON (unless you DB schema is really, really weird). And you should use "remove", not "delete".
What you should do :

[yourDBObject].[yourCollection].remove({'serial_no': serial_no}, function(err, result) {
    if (err) {
        console.log(err);
    } else {
        console.log(result);
    }
});

@perfaram
Copy link
Contributor

Moreover, what error do you run into ? Your message is too imprecise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants