Skip to content

[Refactor] Move Model.prototype.method into Document.prototype.method #8959

Description

@AbdelrahmanHafez

We currently have functions defined on Model.prototype which can be confusing to people looking at the docs, expecting a specific function to be on the Document section.

AFAICT there is virtually no benefit to defining methods on Model.prototype since Model returns a Document instance, we should define only statics on Model, and leave prototype methods to Document.

Am I missing something here? Let me know if those changes sound reasonable, and I'll put in a PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    discussionIf you have any thoughts or comments on this issue, please share them!refactorThis is a purely internal change for making Mongoose internals easier to understand and work with

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions