我正在使用 CompoundJS 和 MongoDB (juggling-mongodb)。这是我的代码:
架构.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
});
也没有连接问题,集合有数据;)
有人知道会是什么吗?
谢谢!