My code is like that:
SiteModel.find(
{},
function(docs) {
next(null, { data: docs });
}
);
but it never returns anything... but if I specify something in the {} then there is one record. so, how to findall?
Try this code to debug:
SiteModel.find({}, function(err, docs) {
if (!err) {
console.log(docs);
process.exit();
}
else {
throw err;
}
});