Skip to content

Creating array discriminators only takes two parameters? #8164

@chaeron

Description

@chaeron

When you create an array discriminator, you do something like this:

var Clicked = docArray.discriminator('Clicked', clickedSchema);

But if you do a model discriminator you can add a third parameter to specify the discriminator key value:

var Clicked = Event.discriminator('Clicked', clickedSchema, "clicked");

Just wondering why we can't use a 3rd discriminator key parameter when we use array discriminators? I'm assuming the first parameter is still the model name, so it would be nice to have the ability to specify the key value if you want it to be different from the Model name.

Thanks!

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