Model.deleteOne()

Parameters
Returns:
  • «Query»

Deletes the first document that matches conditions from the collection. Behaves like remove(), but deletes at most one document regardless of the single option.

Example:

  1. await Character.deleteOne({ name: 'Eddard Stark' });

Note:

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