Using Webpack With Mongoose - Mongoose.model Is Not A Function
I'm using Webpack to use require modules in the browser; however, I'm getting the following error: Uncaught TypeError: mongoose.model is not a function at Object.
Solution 1:
mongoose.model is server side only. On the client/browser there is no model, because the client/browswer has no database connection. You can use mongoose.Document though, in order to keep schemas DRY/isomorph.
Post a Comment for "Using Webpack With Mongoose - Mongoose.model Is Not A Function"