Skip to content
This repository has been archived by the owner on May 30, 2024. It is now read-only.

Error using mongoose #49

Open
ysilvela opened this issue Dec 11, 2015 · 1 comment
Open

Error using mongoose #49

ysilvela opened this issue Dec 11, 2015 · 1 comment

Comments

@ysilvela
Copy link

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) {

@talha-asad
Copy link

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants