What is the best way to count distinct values of mongodb arrayfield

I have a problem with django when using mongodb as database.
Detailed question is here on stackoverflow.
I would appreciate any help and response.

Are you using djongo as your interface to mongodb, or some other interface?

Also, it would be more helpful if you posted the issue here. That makes it available for people coming later and searching for information about topics like this. It also makes it easier to quote / comment on posted code.

1 Like

Thank you for your response,
I have posted this issue on several forums and I thought maybe it is better if solutions would be all in one.
Yes, I’m just using djongo as ODM for mongodb and I have checked it’s documentation for this, nothing found.
As far as I know there is an other ODM for django+mongodb named nonrel, I have taken a look at it’s documentation, there was no suitable solution there too.