Not understanding what happened:
ready = function() {
groups = mongoose.model('groups', schemas.group);
groups.find({}, function(err, docs){
for(i in docs){
console.log(docs[i].name);
}
return docs;
});
}
console.log(ready());
OUTPUT:
undefined
Grupo A
Grupo B
Grupo C
was not it for him to print as in function? If someone can help me, I appreciate it.