I'm trying to query my database but for some reason I never get results when I know there are 3 things into my database. I've made this function:
function toJson()
{
var test = [];
async.series({
rooms : function() { return Room.find(); }
}
, function(err, results) {
test = results.rooms;
});
return test;
}
How does this come ? I'm guessing it has something to do that mongoose his method (search) is async..
Thanks in advance.