deleteOne()
Delete a item from a collection
Example
db.collection("users").deleteOne({
banned: false,
accountCreated: "13/02/2023"
}).then(() => {
//Item deleted from db;
}).catch(error => {
console.log("error:", error);
});
deleteOne(<filter>)
Parameter
Description
filter
The filter used to select the item to remove
Last updated
Was this helpful?