Callback-based:
db.notification.email.find({subject: 'promisify callback'}, (error, result) => {
if (error) {
console.log(error);
}
// normal code here
});
This uses bluebird's promisifyAll method to promisify what is conventionally callback-based code like above. blueb...