delete script

This commit is contained in:
Tyrel Souza 2017-11-29 21:44:37 -05:00
parent 20a085da93
commit bb4943bd0e

View File

@ -21,6 +21,13 @@ MongoClient.connect(mongoUrl, (err, db) => {
var todo = db.collection("Todos").findOneAndDelete({text: "Something to do"}).then((result) => {
console.log(result);
});
db.collection('Users').deleteMany({name: 'Tyrel'}).then((results) => {
console.log(JSON.stringify(results, null, 2));
})
db.collection('Users').findOneAndDelete({_id: new ObjectID('5a1e463bf08a5672016ddd88')}).then((results) => {
console.log(JSON.stringify(results, null, 2));
})
// db.close();
})