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 example above, the model Tank the model. 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...