Node.js Async/Await Stops execution at await


Example

If the promise doesn't return anything, the async task can be completed using await.

try{
    await User.findByIdAndUpdate(user._id, {
        $push: {
            tokens: token
        }
    }).exec()
}catch(e){
    handleError(e)
}