Model.distinct("Age").done(function(err, ward) {
if(err)
return next(err);
if(!ward)
return next();
res.json(ward);
});
After executing this code, it gives the following error:
TypeError: Object [object Object] has no method 'distinct'
But distinct works in robomongo. How can I rectify the error?