A CRUD API is not complete with the update route! If you are a Hacker News frequenter, you'll know that titles of the submissions can change (but not the URL). This route should be straightforward, but there is one caveat! Yes, you could use
findByIdAndUpdate, which is used by
upvote, but what if you wanted to use Mongoose's instance method
Well, it does not return a Promise, so therefore we cannot
yield to it. In fact, at the time of writing, there is still an open issue about this. Using
save(), we can only use the traditional callback pattern. However, remember the rule—do not mix generator functions with callbacks!
So now what? Well, it will be quite common for certain node modules to be only available in the callback format. ...