-
-
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
Typescript IntelliSense not working for model.updateOne second parameter #14090
Comments
What intellisense do you expect to see? The screenshot you pasted shows MongoDB update operators, which is reasonably correct. |
Hey. I expect to see my schema elements, in this case RolesModel.updateOne({name: '123'}, {permissions: ['admin', 'read']}) Were |
We generally don't debug IDE autocomplete issues, but we will take a quick look at this one. |
types: make property names show up in intellisense for UpdateQuery
Prerequisites
Mongoose version
8.0.1
Node.js version
18.18.2
MongoDB server version
7.0.3 Community
Typescript version (if applicable)
5.2.2
Description
Typescripts interface works for
model.findOne({ /* Autocompletion Working */ })
but not for the second parameter ofmodel.updateOne({ /* Autocompletion Working */}, { /* Autocompletion missing */ })
Steps to Reproduce
I'm only get the default IntelliSense

Vscode seems to get the Inferred type, the second parameter type is

UpdateWithAggregationPipeline | UpdateQuery<IRoles>
Expected Behavior
I should get the same autocompletion as the first
updateOne
parameter.The text was updated successfully, but these errors were encountered: