Skip to main content

Delete

deleteOne()

  • Syntax - deleteOne(filter)
  • Deletes the first document matching the filter
db.games.deleteOne({ _id: 30  })

deleteMany()

  • Same as deleteOne(), but deletes ALL documents matching the filter
db.games.deleteMany({ platform: "Orion"  })