How can I query a queryset returned by MongoEngine? Based on the documentation I couldn't find any information about querying querysets: http://docs.mongoengine.org/apireference.html#mongoengine.queryset.QuerySet
import datetime
thirty_days_in_the_past = datetime.datetime.now() - datetime.timedelta(days=30)
def last_messages(from_date):
messages = Messages.objects(sent_at__gt=from_date)
return messages
messages = last_messages(thirty_days_in_the_past)
Then I would like to get messages with a particular subquery such as finding an author_id "ABC":
messages.query(author_id="ABC")
The reason I am looking to do this as the initial query itself is used by a component and a subquery of it is used by another component and I would like to reuse the query.