Moogoose Constructor小坑

注意! exports 出来的 Model名字,必须和 Constructor的名字不一样!!!

不然Constructor会被覆盖,报错

这个是修改之后的。修改前,是var account = new account();

会报告,TypeError : account is not a constructor

之前感觉奇怪,明明在Model里面,已经exports了account这个model;

前面var account= new account()之后;显示 account()是 Local var 而不是Constructor

修改后恢复正常....

原文地址:https://www.cnblogs.com/jokerjason/p/8108537.html