O'Reilly logo
  • Patrick S thinks this is interesting:

It's important to understand how Mongoose and MongoDB handle the naming of collections based on your schema and models. Typically, you name your models using singular terms, and Mongoose will recognize this and create your collections using a pluralized model name. So, a model defined as Image will have a collection in MongoDB named images. Likewise, a model named Comment will have a corresponding collection named comments. Mongoose tries to be smart about this; however, a model defined as Person will have a corresponding collection named people and so on.


Cover of Web Development with MongoDB and Node.js


Naming of Collections (based on schema names)