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
How to use count() ? #17
Comments
The error up here is where I test with User.count(), with User.find().count() I have the following error: |
I've solved the issue. |
I encountered with the same problem, the correct code is:
If you omit the err parameter the count result will be always null (if no error occured). |
|
I tried many things but I can't make count() work.
Based on the documentation, it is supposed to work this may:
User.find({username: 'john'}).count()
I've got this error:
DEBUG: TypeError: undefined is not a function
at CALL_NON_FUNCTION (native)
at /lib/mongoose/lib/model.js:177:9
I've also tried with
User.find({username: 'john'}).count(fn(r) { sys.debug(r); })
Or
User.count();
...
Thanks for your support.
The text was updated successfully, but these errors were encountered: