I'm playing around with MongoEngine and i just can't find the way querying ReferenceFields
Class Foo(Document)
bar = ReferenceField(Bar)
...
Class Bar(Document)
value =IntField()
...
bars = Bar.objects.filter(value__lt=1000)
Django:
foos = Foo.objects.filter(bar__in=bars)
MongoEngine : ?
Is there a way to achieve this ?
Thanks in advance,
That is impossible by one query.
try this:
bars = Bar.objects.filter(value__lt = 1000)
foo = Foo.objects.filter(bar__in = bars)
More see. That test scripts.
https://github.com/Ankhbayar/mongoengine/blob/dev/tests/django_tests.py#L73
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With