Skip to content

Proper setup for instance methods with Typescript #11682

@ShaneKeney

Description

@ShaneKeney

Do you want to request a feature or report a bug?
Help.

What is the current behavior?
Following is specified in mongoose documentation: "We recommend your document interface contain the properties defined in your schema and line up with what your documents look like in MongoDB. Although you can add instance methods to your document interface, we do not recommend doing so."

What is the recommended way for proper compatibility with Typescript project if extends Document is also discouraged. This is specifically being asked in reference to instance methods such that TS can check properly when such methods are being used elsewhere in the project.

What is the expected behavior?

What are the versions of Node.js, Mongoose and MongoDB you are using? Note that "latest" is not a version.
Version of "mongoose": "^6.0.12",

Metadata

Metadata

Assignees

No one assigned

    Labels

    docsThis 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