Add autoIndex: false option to mongoose connections.

This prevents mongoose from auto-creating missing indexes on boot.
This commit is contained in:
Shane Kilkelly
2017-11-22 13:37:57 +00:00
parent bda65c0984
commit 035e0c1213
7 changed files with 31 additions and 13 deletions
@@ -30,9 +30,10 @@ ProjectInviteSchema = new Schema(
}
)
conn = mongoose.createConnection(Settings.mongo.url, server: poolSize: Settings.mongo.poolSize || 10)
conn = mongoose.createConnection(Settings.mongo.url, {
server: {poolSize: Settings.mongo.poolSize || 10},
config: {autoIndex: false}
})
ProjectInvite = conn.model('ProjectInvite', ProjectInviteSchema)