InferSchemaType: array of subdocuments with a "type" key is not correctly inferred #12882
Closed
2 tasks done
Labels
typescript
Types or Types-test related issue / Pull Request
Prerequisites
Mongoose version
6.8.2
Node.js version
16.17.1
MongoDB server version
4.4
Typescript version (if applicable)
No response
Description
If I have an array of objects containing a key named "type": InferSchemaType does not correctly infer it.
Steps to Reproduce
Expected Behavior
I should get the following type inferred:
Instead I get:
The text was updated successfully, but these errors were encountered: