The collection name automatically generated by mongoose does not match the Schema.

  node.js, question

By default, the name of the collection automatically generated by mongoose should be the lowercase of the corresponding Schema followed by “s”. I encountered such a problem in the code.

var PersonSchema = new mongoose.Schema({
 var Person = mongoose.model('Person', PersonSchema);
 module.exports = Person;


var person = new Person({name: 'showonne'});;

The result added to the result is in the people Collection (automatically created) inside. Does anyone know what the problem is?

Mongoose will automatically change the set name to complex