Skip to content
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

Can't use Mongo Native method Aggregate #58

Closed
Sriram-27727 opened this issue Jul 4, 2016 · 3 comments
Closed

Can't use Mongo Native method Aggregate #58

Sriram-27727 opened this issue Jul 4, 2016 · 3 comments

Comments

@Sriram-27727
Copy link

Sriram-27727 commented Jul 4, 2016

If am using aggregate method on my collection it gives me error

ebug: internal, implementation, error
TypeError: Uncaught error: ClientStatus.aggregate is not a function
at server.route.config.pre.method.reply (

@jedireza
Copy link
Owner

jedireza commented Jul 5, 2016

Thanks for opening an issue. Since we don't expose a aggregate method in the base class, it'll be up to you to create one on your model(s).

Or, we could extend the base class to expose the aggregate method of the underlying collection like we did in #23 for the distinct method.

Another thought would be to create a getter so we can access the underlying collection and use it directly. (Ex: MyClass.getCollection())

@svnlto
Copy link

svnlto commented Oct 10, 2016

Just expose it like distinct.

@jedireza
Copy link
Owner

mongo-models was updated to expose the aggregate method and was published as mongo-models@1.1.0.

jedireza/mongo-models#2

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

No branches or pull requests

3 participants