I am trying to use lean in my mongoDB query but the problem I am facing is that I don't use .exec() method. I use callback implementation like below
model.find({user_id: mobile_no }, {'_id':0, 'type':1}, {sort: {dateTime: -1}, skip: page*page_size, limit: page_size + 1}, function(err, docs) {
if (err) {
} else {
}
});
but in most documentation,everyone uses lean with .exec() like below
.lean().exec()
Can anyone please tell me how can I use lean using my callback implementation or I would have to use .exec() implementation in order to use it.