MongoDB Mongoose NodeJS

Mongoose Not Creating Collection

August 25, 2019

If collection not created or the create() or save() callback is never triggered, most likely the issue is related to how the model created.

From Mongoose doc:

Note that no tanks will be created/removed until the connection your model uses is open. Every model has an associated connection. When you use mongoose.model(), your model will use the default mongoose connection.

Ref: https://mongoosejs.com/docs/models.html