I run into a classic trap, but can't find a good mongoengine example of what I should do.
Using a standard blog example, I have something like:
class Comment(EmbeddedDocument):
author = StringField()
approved = BooleanField(default=False)
class Post(Document):
id = StringField(required=True, unique=True)
comments = ListField(EmbeddedDocumentField(Comment))
For this blog post (with id some_id), I just want to download a list of approved comments. I accidentally download all comments if any comments on the post are approved, because I am matching the list item.
source
share