我定义了一个user的模型 mongoose.model(‘User’, UserSchema); 为什么mongoose自动在我表里创建一张表是users ,而不是user。 怎么会多了一个s ,哪个参数是对应表名称的啊? 那个s能不要嘛??
var UserSchema = new Schema({ a : String, b : String }, { collection: 'user' });
签名: 交流群244728015 《Node.js 服务器框架开发实战》 http://url.cn/Pn07N3
and if you are using mongoose 2.0.0, pass the collectionName as the third argument:
mongoose.model('User', UserSchema, 'user');
可以了 ,3Q 。。
CNode 社区为国内最专业的 Node.js 开源技术社区,致力于 Node.js 的技术研究。
and if you are using mongoose 2.0.0, pass the collectionName as the third argument:
可以了 ,3Q 。。