Delete the documents into collection

deleteMany()=>db.COLLECTION_NAME.deleteMany(DELLETION_CRITTERIA)
1.Delete the field with the role matches "backend"
> db
test
> db.test.find().pretty()
{
        "_id" : ObjectId("61cabea123c54413fe585b4a"),
        "name" : "shreyash",
        "email" : "sk@gmail.com"
}
{
        "_id" : ObjectId("61cabfab23c54413fe585b4b"),
        "name" : "shreyash",
        "sirname" : "kolhe",
        "role" : "front-end",
        "email" : "shreyashkolhe2001@gmail.com"
}
{
        "_id" : ObjectId("61cabfab23c54413fe585b4c"),
        "name" : "vabhav",
        "sirname" : "bandal",
        "role" : "front-end",
        "email" : "shreyashkolhe2001@gmail.com"
}
{
        "_id" : ObjectId("61cabfab23c54413fe585b4d"),
        "name" : "shubham",
        "sirname" : "gawali",
        "role" : "backend",
        "email" : "skd@gmail.com"
}
{
        "_id" : ObjectId("61cabfab23c54413fe585b4e"),
        "name" : "xyh",
        "sirname" : "xyz",
        "role" : "front-end",
        "email" : "shreyashkolhe2001@gmail.com"
}
> db.test.deleteMany({role:"backend"})
{ "acknowledged" : true, "deletedCount" : 1 }
> db.test.find().pretty()
{
        "_id" : ObjectId("61cabea123c54413fe585b4a"),
        "name" : "shreyash",
        "email" : "sk@gmail.com"
}
{
        "_id" : ObjectId("61cabfab23c54413fe585b4b"),
        "name" : "shreyash",
        "sirname" : "kolhe",
        "role" : "front-end",
        "email" : "shreyashkolhe2001@gmail.com"
}
{
        "_id" : ObjectId("61cabfab23c54413fe585b4c"),
        "name" : "vabhav",
        "sirname" : "bandal",
        "role" : "front-end",
        "email" : "shreyashkolhe2001@gmail.com"
}
{
        "_id" : ObjectId("61cabfab23c54413fe585b4e"),
        "name" : "xyh",
        "sirname" : "xyz",
        "role" : "front-end",
        "email" : "shreyashkolhe2001@gmail.com"
}

We also have the remove() method to perform the delete operation but it's deprecated as per document.
If we want to delete all the document at once than we can pass on empty object inside the deleteMany() method.

db.test.deleteMany({})