Stops execution at await
suggest changeIf 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)
}
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents