New issue
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
Error: "The 2nd parameter to mongoose.model()
should be a schema or a POJO" after upgrading mongoose (discriminator related)
#4738
Comments
mongoose.model()
should be a schema or a POJO after upgrading mongoosemongoose.model()
should be a schema or a POJO" after upgrading mongoose (discriminator related)
@antonioaltamura why you are registering your doc model again?
|
I'm sorry, I don't get what exactly means which schema am I defining as 'linked' to the model |
Did you try to run my block of code? |
Why are you passing a model as the second parameter to |
So the right way to register just to be sure :) |
Exactly :) |
I think you're conflating documents and models. |
There is no new Model here :) |
var mongoose = require('mongoose'); var docSchema = new mongoose.Schema({ var doc = mongoose.model('doc',docSchema); exports.docSchema = docSchema; //this should for You :) |
Error occurs because |
I'm not sure what's the problem, after upgrading mongoose I get the error in title at the row
var doc = mongoose.model('doc',docSchema);
The entire code
The text was updated successfully, but these errors were encountered: