Skip to content
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

docs(mongoose): add options.overwriteModel details to mongoose.model() docs #14422

Merged
merged 2 commits into from
Mar 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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