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({
 name:String
 });
 
 var Person = mongoose.model('Person', PersonSchema);
 module.exports = Person;

App.js

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

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