Aside from the migration guide, which says that autoCreate now defaults to true except in some secondary cases, the Schema Options documentation has not been updated.
Unfortunately, createCollection() cannot change an existing collection. For example, if you add capped: 1024 to your schema and the existing collection is not capped, createCollection() will throw an error. Generally, autoCreate should be false for production environments.
Unlike autoIndex, autoCreate is false by default. You can change this default by setting mongoose.set('autoCreate', true);
From:
So documentation should mirror that case then and be not so strict on not using autoCreate in prod :)
Aside from the migration guide, which says that autoCreate now defaults to true except in some secondary cases, the Schema Options documentation has not been updated.
https://mongoosejs.com/docs/guide.html#autoCreate
From:
Originally posted by @deser in https://github.com/Automattic/mongoose/issues/8814#issuecomment-766811295