delete script
This commit is contained in:
parent
20a085da93
commit
bb4943bd0e
@ -21,6 +21,13 @@ MongoClient.connect(mongoUrl, (err, db) => {
|
|||||||
var todo = db.collection("Todos").findOneAndDelete({text: "Something to do"}).then((result) => {
|
var todo = db.collection("Todos").findOneAndDelete({text: "Something to do"}).then((result) => {
|
||||||
console.log(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();
|
// db.close();
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user