Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[Docs] Contradiction in docs/middleware.md #12113

Copy link
Copy link
Closed
@RobbyCBennett

Description

@RobbyCBennett
Issue body actions

Prerequisites

  • I have written a descriptive issue title
  • I have searched existing issues to ensure the issue has not already been raised

Issue

Here's the page.

I ran into this issue while trying to use pre/post middleware with Model.save().

According to the top of the doc, save middleware is only supported for the Document class.

However, the section Define Middleware Before Compiling Models shows that save middleware is supported for Model.

The code snippets in the section don't work for me, but save should be a basic supported feature. For example, pre middleware to save a user can encrypt a password.

Metadata

Metadata

Assignees

No one assigned

    Labels

    docsThis issue is due to a mistake or omission in the mongoosejs.com documentationThis issue is due to a mistake or omission in the mongoosejs.com documentation

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.