Model.deleteMany()

Parameters
Returns:
  • «Query»

Deletes all of the documents that match conditions from the collection. Behaves like remove(), but deletes all documents that match conditions regardless of the single option.

Example:

  1. await Character.deleteMany({ name: /Stark/, age: { $gte: 18 } });

Note:

This function triggers deleteMany query hooks. Read the middleware docs to learn more.