We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I am trying to setup a service connected to mongodb via the mongoose adapter.
Here is a snippet of how my users.service.js looks:
users.service.js
const DbService = require("moleculer-db"); const MongooseAdapter = require("moleculer-db-adapter-mongoose"); const mongoose = require("mongoose"); const schema = mongoose.Schema({ username: String, }); module.exports = { name: "users", mixins: [DbService], adapter: new MongooseAdapter(process.env.MONGO_URI), model: mongoose.model('users', schema), }
Whenever I make a change to the file after running npm run dev, I get the following error on hot reload:
npm run dev
OverwriteModelError: Cannot overwrite `users` model once compiled. at Mongoose.model (../mongoose/lib/index.js:549:13)
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I am trying to setup a service connected to mongodb via the mongoose adapter.
Here is a snippet of how my
users.service.js
looks:Whenever I make a change to the file after running
npm run dev
, I get the following error on hot reload:The text was updated successfully, but these errors were encountered: