O'Reilly logo
  • Aem A thinks this is interesting:

Make sure that your Mongoose configuration file is loaded before any other configuration in the server.js file. This is important since any module that is loaded after this module will be able to use the User model without loading it by itself.

From

Cover of MEAN Web Development

Note

load mongoose configuration before any other, in server.js