-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Open
Labels
developer-experienceThis issue improves error messages, debugging, or reportingThis issue improves error messages, debugging, or reportingtypescriptTypes or Types-test related issue / Pull RequestTypes or Types-test related issue / Pull Request
Milestone
Description
Do you want to request a feature or report a bug?
bug
What is the current behavior?
When using new Model(doc) to create a new model and the save() it. the type of doc is always any which break the auto-completion for properties added by the user model.
If the current behavior is a bug, please provide the steps to reproduce.
Quick Start example from the website
tsconfig.json
{
"compilerOptions": {
"target": "ES2020",
"module": "commonjs",
"outDir": "./dist",
"rootDir": "./src",
"strict": true,
"moduleResolution": "node",
"types": ["mongoose"],
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true
},
"exclude": ["node_modules"],
"include": ["src/**/*.ts"]
}What is the expected behavior?
instead of having any it should use the provided type.
What are the versions of Node.js, Mongoose and MongoDB you are using? Note that "latest" is not a version.
nodejs: v16.1.0
mongoose: 5.12.10
Metadata
Metadata
Assignees
Labels
developer-experienceThis issue improves error messages, debugging, or reportingThis issue improves error messages, debugging, or reportingtypescriptTypes or Types-test related issue / Pull RequestTypes or Types-test related issue / Pull Request
