Skip to content

DocumentArray.discriminator return type #8287

@hasezoey

Description

@hasezoey

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

docs / bug

What is the current behavior?

no return type is documented in https://github.com/Automattic/mongoose/blob/master/lib/schema/documentarray.js#L153

and it does not return an instance of mongoose.Model (what @types/mongoose suggests it does)

If the current behavior is a bug, please provide the steps to reproduce.

look at the documentation, and model.discriminator returns a model and DocumentArray.discriminator returns an constructor (that is not a model)?

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.

mongoose: 5.7.7
node: 12.13.0
mongo: 4.2-bionic (docker)

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