Closed
Description
openedon Aug 22, 2024
Prerequisites
- I have written a descriptive issue title
- I have searched existing issues to ensure the bug has not already been reported
Mongoose version
8.5.3
Node.js version
22.5.1
MongoDB server version
5.0
Typescript version (if applicable)
4.9.5
Description
The Typescript type for populate
's return value:
const result = await SomeModel.findOne().populate<{ otherInfo: string }>("other");
includes MergeType<{ [x: string]: NativeDate; } & ...
.
This causes later code to assume every property is of type NativeDate
.
This was observed after upgrading from mongoose 6.12.0 to 8.5.3.
Steps to Reproduce
- Create any model.
- Call
findOne
, followed bypopulate
with a type parameter.
Expected Behavior
The types to be properly merged without { [x: string]: NativeDate; }
being included.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Metadata
Assignees
Labels
No labels