How to use the modelSchemas function from mongoose
Find comprehensive JavaScript mongoose.modelSchemas code examples handpicked from public code repositorys.
85 86 87 88 89 90 91 92 93 94
## mongoose basics > * your models extends from mongoose.Model > * schemas are stored on global mongoose but models may not > * mongoose.models.ModelName equals to mongoose.model('ModelName') > * ModelName.schema equals to mongoose.modelSchemas.ModelName > * static methods should be extended on mongoose.Model with a dynamic context > * instance methods should be extended on mongoose.Model.prototype > * custom model static methods are stored in MyModel.schema.statics > * connection instance store its own models
7
48
6
+ 11 other calls in file
90 91 92 93 94 95 96 97
} }; // Export model delete mongoose.models.SurveyResponse delete mongoose.modelSchemas.SurveyResponse var SurveyResponse = mongoose.model('SurveyResponse', SurveyResponseSchema); module.exports = SurveyResponse;
29
38
24
mongoose.model is the most popular function in mongoose (2160 examples)