【发布时间】:2013-05-13 02:29:24
【问题描述】:
我正在使用 CompoundJS 和 MongoDB (juggling-mongodb)。这是我的代码:
schema.js:
var User = describe('User', function() {
property('_id', Number, {
index: true
});
property('name', String);
property('email', String);
property('password', String);
set('restPath', pathTo.users);
setTableName('users');
});
数据库.js:
module.exports =
{ "development":
{ "driver": "mongodb",
"url": "mongodb://admin:1234@localhost/didgeridoo"
}
, "test":
{ "driver": "postgres"
}
, "production":
{ "driver": "postgres"
}
};
我正在做:
User.all(function(err, result) {
//but here result is always empty and there is no error
});
也没有连接问题,集合有数据;)
有人知道它是什么吗?
谢谢!
【问题讨论】:
-
在下面的答案部分添加您的答案!
标签: node.js mongodb compoundjs jugglingdb