Skip to content

Commit

Permalink
docs; clarify ensureIndex (Fix #3156)
Browse files Browse the repository at this point in the history
  • Loading branch information
vkarpov15 committed Jul 17, 2015
1 parent 1d28605 commit cb5b615
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions docs/guide.jade
Expand Up @@ -144,6 +144,7 @@ block content
.important
:markdown
When your application starts up, Mongoose automatically calls `ensureIndex` for each defined index in your schema.
Mongoose will call `ensureIndex` for each index sequentially, and emit an 'index' event on the model when all the `ensureIndex` calls succeeded or when there was an error.
While nice for development, it is recommended this behavior be disabled in production since index creation can cause a [significant performance impact](http://docs.mongodb.org/manual/core/indexes/#index-creation-operations). Disable the behavior by setting the `autoIndex` option of your schema to `false`.

:js
Expand Down

0 comments on commit cb5b615

Please sign in to comment.