mdn / express-locallibrary-tutorial

Local Library website written in NodeJS/Express; example for the MDN server-side development NodeJS module: https://developer.mozilla.org/en-US/docs/Learn/Server-side/Express_Nodejs.
Creative Commons Zero v1.0 Universal
1.23k stars 695 forks source link

Update to mongoose v6 #152

Closed hamishwillee closed 1 year ago

hamishwillee commented 1 year ago

This updates mongoose from "^5.10.7" to "^6.8.2". The intent is to fix the errors you get when running populatedb raised in #23356. These started to occur because the docs are tested and written against v5, and there are some changes in v6.

In addition to updating the connection code, this more generally changes var to const in the docs I am already touching. But only for stuff added by me - NOT for stuff created by the express generator (otherwise we would have to do a lot more work here!)

We need to more generally update this tutorial use use JS async behaviour rather than the async module, and update to more recent express. However that's a bigger job.

Corresponding docs changes to happen before this merges: https://github.com/mdn/content/pull/23422