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

修改后恢复正常....

posted @ 2017-12-25 11:17  JokerJason  阅读(361)  评论(0编辑  收藏  举报

It's not who you are underneath, it's what you do that defines you

Brick walls are there for a reason :they let us prove how badly we want things