Open ysilvela opened 8 years ago
I'm using mongoose to query mongodb from nodejs and I obtain next error when query a document:
2015-12-11T08:56:13.381Z - error: uncaughtException: Cannot read property 'discriminatorMapping' of undefined
The line of code thats thwows error:
User.findOne.sync({id_company: id_c}, function(err, usr) {
You forgot to give first parameter, which is context this, in your case maybe try passing it User. The signature of .sync functions is similar to .call
this
User
.sync
.call
I'm using mongoose to query mongodb from nodejs and I obtain next error when query a document:
2015-12-11T08:56:13.381Z - error: uncaughtException: Cannot read property 'discriminatorMapping' of undefined
The line of code thats thwows error:
User.findOne.sync({id_company: id_c}, function(err, usr) {