From the horse's mouth
ObjectIds contain the raw MongoDB binary and don't work with templating so we provide the id convenience method to convert them to hexstrings
https://github.com/LearnBoost/mongoose/issues/548
One possible solution -
User.findOneById('xxx', function(err, result){
result._id = result._id.toHexString();
res.render('viewName', {user: result});
}
I think assigning it to result.id would also work.
result._id = result.id;