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

Add function for generating mongodb query from ecto query #46

Open
ericmj opened this issue Oct 21, 2015 · 1 comment
Open

Add function for generating mongodb query from ecto query #46

ericmj opened this issue Oct 21, 2015 · 1 comment

Comments

@ericmj
Copy link
Collaborator

ericmj commented Oct 21, 2015

Use case is for basing an aggregation query on an ecto query. I would be willing to work on this.

@michalmuskala
Copy link
Collaborator

This is a good idea. One of the problems I see with this is the fact that for some ecto queries we already generate aggregate pipelines (with max, min, count, etc).

What parts we normally extract from the Ecto.Query should we generate in this case? Only the MongoDB's query object or also the projection?

It shouldn't be that hard to do, the main part of the query is translated by NormalizedQuery.query/3, you can probably use that.

I have to admit, I'm a little bit ashamed of the code in normalized_query.ex, maybe this will nudge me to refactor it a little 😃

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

No branches or pull requests

2 participants