Document.prototype.$op

Type:
  • «property»

A string containing the current operation that Mongoose is executing on this document. May be null, 'save', 'validate', or 'remove'.

Example:

  1. const doc = new Model({ name: 'test' });
  2. doc.$op; // null
  3. const promise = doc.save();
  4. doc.$op; // 'save'
  5. await promise;
  6. doc.$op; // null