We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I am trying to query the distinct values of a field in all the documents as in: https://docs.mongodb.com/manual/reference/method/db.collection.distinct/
I tried to use the distinct function provided by Ecto (https://hexdocs.pm/ecto/Ecto.Query.html#distinct/3), but I have the following error:
** (Ecto.QueryError) MongoDB adapter does not support distinct clause in this query in query
Here is the code I try to run:
def list_tags do query = from( a in Dataset, distinct: :tags ) query |> Repo.all() end
If the distinct function is not supported by the adapter, is there any other way to get the distinct values of a field?
Thanks!
The text was updated successfully, but these errors were encountered:
Can you please tell me what version of this adapter you are currently using?
Sorry, something went wrong.
I am using the branch ecto-2.1 of this repo:
ecto-2.1
{:mongodb_ecto, github: "michalmuskala/mongodb_ecto", branch: "ecto-2.1"},
And I have configured the adapter to be Mongo.Ecto.
Mongo.Ecto
It looks like we are explicitly disallowing distinct here. I would have to see if we could allow for using the mongo distinct function from this.
Thanks you!
I am new to Elixir, but I'll try to look into this as well.
No branches or pull requests
I am trying to query the distinct values of a field in all the documents as in:
https://docs.mongodb.com/manual/reference/method/db.collection.distinct/
I tried to use the distinct function provided by Ecto (https://hexdocs.pm/ecto/Ecto.Query.html#distinct/3), but I have the following error:
Here is the code I try to run:
If the distinct function is not supported by the adapter, is there any other way to get the distinct values of a field?
Thanks!
The text was updated successfully, but these errors were encountered: