The first argument is the singular name of the collection your model is for. Mongoose automatically looks for the plural version of your model name. Thus, for the example above, the model Tank is for the tanks collection in the database. The .model() function makes a copy of schema. Make sure that you've added everything you want to schema before calling .model()!
1、从文档中找到:
2、可以自己在第三个参数指定collection的名字。
供参考!
Love MongoDB! Have fun!
2017MongoDB中文社区北京用户组大会在即,2017年6月3日 13:00-18:00
报名中!请戳左边!
这有代码的例子,可以看哈是否有帮助https://github.com/treeandgra...