Mongoose Multiple Databases TypeError: users.model is not a function

I am trying to use Mongoose’s example for defining models in a separate document from their schemas (whilst having multiple databases). Mongoose’s Docs example for User.js: const userSchema = require(‘./userSchema’); module.exports = conn => { conn.model(‘User’, userSchema); }; However, I am getting errors (TypeError: users.model is not a function) that I suspect come from the…

Details