We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Do you want to request a feature or report a bug?
Feature
What is the current behavior? Assigning a readonly array to the enum value is not allowed.
import type { SchemaDefinition, DocumentDefinition } from 'mongoose'; enum Color { RED = 'red', GREEN = 'green', BLUE = 'blue' } const colors: ReadonlyArray<Color> = [Color.RED, Color.GREEN, Color.BLUE]; interface ColorEntity { color: Color; } const colorEntitySchemaDefinition: SchemaDefinition<DocumentDefinition<ColorEntity>> = { color: { type: String, enum: colors, required: true, } }
What is the expected behavior?
The SchemaDefinition should allow passing ReadonlyArrays for the enum values.
SchemaDefinition
What are the versions of Node.js, Mongoose and MongoDB you are using? Note that "latest" is not a version.
node -v v14.15.5
mongoose -v v5.12.9
The text was updated successfully, but these errors were encountered:
4398aaa
No branches or pull requests
Do you want to request a feature or report a bug?
Feature
What is the current behavior?
Assigning a readonly array to the enum value is not allowed.
What is the expected behavior?
The
SchemaDefinition
should allow passing ReadonlyArrays for the enum values.What are the versions of Node.js, Mongoose and MongoDB you are using? Note that "latest" is not a version.
The text was updated successfully, but these errors were encountered: