-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
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
Schema definition Types error when property type
is an array of another schema
#9962
Labels
typescript
Types or Types-test related issue / Pull Request
Milestone
Comments
ahmednaser94
changed the title
Schema definition Types error when property
Schema definition Types error when property Feb 22, 2021
type
is array of another schematype
is an array of another schema
IslandRhythms
added
typescript
Types or Types-test related issue / Pull Request
has repro script
There is a repro script, the Mongoose devs need to confirm that it reproduces the issue
labels
Feb 22, 2021
vkarpov15
removed
the
has repro script
There is a repro script, the Mongoose devs need to confirm that it reproduces the issue
label
Mar 5, 2021
This was referenced Mar 5, 2021
This was referenced Mar 12, 2021
Closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Do you want to request a feature or report a bug?
bug
What is the current behavior?
the schema definition must match EXACTLY as the interface in case of array
It does not complain when it is array like this, but if it was an object with
type: [HistoryUpdateRecordSchema]
it gives type error!!If the current behavior is a bug, please provide the steps to reproduce.
https://gist.github.com/ahmednaser94/5a6288614fa29eea30f15a7ee1a42a22
What is the expected behavior?
It should not complain about type as any other property
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: