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>)

ParameterDescription

filter

The filter used to select the item to remove

Last updated