Skip to content

Commit

Permalink
docs(mongoose): add options.overwriteModel details to `mongoose.mod…
Browse files Browse the repository at this point in the history
…el()` docs

Fix #14387
  • Loading branch information
vkarpov15 committed Mar 7, 2024
1 parent 956ed4a commit c41ee9a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -507,12 +507,14 @@ Mongoose.prototype.pluralize = function(fn) {
*
* // or
*
* const collectionName = 'actor'
* const M = mongoose.model('Actor', schema, collectionName)
* const collectionName = 'actor';
* const M = mongoose.model('Actor', schema, collectionName);
*
* @param {String|Function} name model name or class extending Model
* @param {Schema} [schema] the schema to use.
* @param {String} [collection] name (optional, inferred from model name)
* @param {Object} [options]
* @param {Boolean} [options.overwriteModels=false] If true, overwrite existing models with the same name to avoid `OverwriteModelError`
* @return {Model} The model associated with `name`. Mongoose will create the model if it doesn't already exist.
* @api public
*/
Expand Down

0 comments on commit c41ee9a

Please sign in to comment.