Mongoose static methods autocompletion in WebStorm
See original GitHub issueWhen doing the following in WebStorm, I cannot get autocompletion when importing a mongoose model and trying to use a static method on the schema.
In one file I have my Mongoose schema defined with static methods:
userSchema.statics.saveUser = function(callback){
var user = new this();
user.save(callback);
};
And in another file I try to use these methods and I don’t get autocompletion…
var User = require('../models/user.js');
User.saveUser(function(err, result) {
...
}
Whereas if I would type User.statics.saveUser(… I would get autocompletion.
Do you know about a workaround ? Thanks.
Issue Analytics
- State:
- Created 7 years ago
- Comments:8
Top Results From Across the Web
Mongoose static methods autocompletion in WebStorm
When doing the following in WebStorm, I cannot get autocompletion when importing a mongoose model and trying to use a static method on......
Read more >WebStorm to autocomplete Mongoose schema fields
When we call: mongoose.model('User', UserSchema) that method generates mongoose model object. It happens on runtime. Which means that WS must ...
Read more >Mongoose static methods autocompletion in WebStorm ...
When doing the following in WebStorm, I cannot get autocompletion when importing a mongoose model and trying to use a static method on...
Read more >Unresolved Variable Schema When Using Webstorm - ADocLib
A NodeJS mongoose Schema Example | ObjectRocketHow to define object in array in Mongoose static methods autocompletion in WebStorm \u2013 IDEs.
Read more >mongoose JavaScript and Node.js code examples - Tabnine
Best JavaScript code snippets using mongoose(Showing top 15 results out of 10,710) ... static async getBySlug({ slug }) { const bookDoc = await...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I opened a feature request in JetBrains. https://youtrack.jetbrains.com/issue/WEB-22317 Please upvote it so that they can take us seriously. Would be great to have first class support for Mongoose inside Jetbrains IDEs.
Thanks !
Nope. If anyone has expertise in webstorm they’re quite welcome to write a plugin and I’d be happy to help, but I have never even installed webstorm so I wouldnt really know where to start.