django-nonrel/mongodb-engine

distinct not working

nickappel opened this issue · 4 comments

on the following code:
Product.objects.distinct('categories')
I keep on getting this error
in check_query raise DatabaseError("This query is not supported by the database.")
DatabaseError: This query is not supported by the database.

When I check the files in the package I can find the distinct() query

I run:
mongo-engine 0.5.2
djangotoolbox 1.6.2

@nickappel Have you set MongoDBManager as the model manager for Product ?

class Product(models.Model):
    ####
    objects = MongoDBManager()

@Alir3z4 No I have not. I am trying to find some documentation on how to set the MongoDBManager because MongoDBManager is not defined. Do you have a url for me?

@Alir3z4 Thanks a lot.