JSDoc + Mongoose:如何loggingMongoose模型?
我有Mongoose
模式和一个模型 :
var MyClientSchema = new mongoose.Schema({ fist_name: { type: String }, phone_number: { type: String } }); var MyClient = mongoose.model('MyClient', MyClientSchema);
我应该怎样使用JSDoc MyClient
和/或MyClientSchema
来从WebStorm
获取从WebStorm
inheritance的两个方法(如remove, findOne, find
和从模式inheritance的phone_number and first_name
?
虽然它可能不符合您的具体要求,但在官方文档中的喷气机大脑教程解释了您所需要的大部分内容
https://www.jetbrains.com/help/webstorm/2017.1/creating-jsdoc-comments.html
例如,
/** * MyClientSchema schema * @constructor MyClient */ var MyClientSchema = new mongoose.Schema({ fist_name: { type: String }, phone_number: { type: String } });
接下来的js可能会成为你几乎所有你需要的指导