|
Download tasks/format-code-task-000026/instruction.md from FineEnvs/MiMo-V2.6-RL-harbor-code: direct link, hf CLI and curl.
- Browser
- Download file 1.45 kB
-
https://huggingface.co/datasets/FineEnvs/MiMo-V2.6-RL-harbor-code/resolve/main/tasks/format-code-task-000026/instruction.md
- Command line
-
hf download hf://datasets/FineEnvs/MiMo-V2.6-RL-harbor-code/tasks/format-code-task-000026/instruction.md
-
curl -L -o instruction.md https://huggingface.co/datasets/FineEnvs/MiMo-V2.6-RL-harbor-code/resolve/main/tasks/format-code-task-000026/instruction.md
1.45 kB
Fix the following issue:
Typescript: Wrong return type when using lean in different way
Prerequisites
- I have written a descriptive issue title
- I have searched existing issues to ensure the bug has not already been reported
Mongoose version
6.X.X - 7.X.X
Node.js version
at least 16
MongoDB server version
at least 4
Typescript version (if applicable)
4.7 - latest
Description
The return type of
const a = await Model.findById('my-id', undefined, { lean: true })
is the same as
const a = await Model.findById('my-id')
it's:
// ^? const a: (mongoose.Document<unknown, {}, { name: string; }> & { name: string; } & { _id: mongoose.Types.ObjectId; }) | null
Steps to Reproduce
See ts playground
Expected Behavior
The return type should be the same as
const a = await Model.findById('a').lean()
it's:
// ^? const a: (mongoose.FlattenMaps<{ name: string; }> & { _id: mongoose.Types.ObjectId; }) | null