These are chat archives for Automattic/mongoose
@pea The documentation isn't really comprehensive or easy to navigate, but as far as I know it doesn't contain any errors. (I find a lot of details through Google, which leads me to interesting Github issues or Stackoverflow questions.)
I have some suggestions for your code:
userdon't have a
findOneAndUpdate()method, only models like
new User()document if you aren't going to save it.
stravaIdsince it's guaranteed to have that value already - it was in the find query.
err =>callback, and instead just
return User.findOneAndUpdate(. Then any error would fall to the
.catch()and you'll only need that one error handler.