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

How to retrive sub collection properties #187

Open
santhoshe opened this issue Jun 6, 2014 · 2 comments
Open

How to retrive sub collection properties #187

santhoshe opened this issue Jun 6, 2014 · 2 comments

Comments

@santhoshe
Copy link

I am new to mongodb engine please help us
My models are like
class Address(models.Model):
town=models.CharField(db_column='town',max_length=100L)
pincode=models.IntegerField(db_column='pincode')
class Person(models.Model):
name=models.CharField(db_column='name',max_length=100L)
address=ListField(EmbeddedModelField(Address))
objects=MongoDBManager()

I want query like
Person.objects.values_list('address__town').filter(name='xyd')

@Alir3z4
Copy link

Alir3z4 commented Jul 2, 2014

@santhoshe have you tried raw_query ?

@santhoshe
Copy link
Author

raw_query allowing only one condition at a time. Now I am switched to mongoengine , using this I can execute any of mongodb query

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