Hi I use the following codes to query mongodb, Schedule is an mongoose object and the schema is like this:
var MatchSchema = new Schema({
home: {
team: {
type: Schema.ObjectId,
ref: 'Team'
},
And the query is the following:
exports.schedules = function(req, res, next, id){
Schedule.find({
'home.team': id
}, function (err, docs) {
console.info('err', err);
console.info('docs', docs);
next();
});
};
But the console.info are not printed. Are there anything wrong of the code? Please help.