I have define the class statement:
from mongoengine import *
class TickDataDocument(Document):
"""
"""
instrument_id = StringField(max_length=10, unique=True, required=True)
tick_data = ReferenceField(TickDocument)
class TickDocument(Document):
"""
"""
price = DecimalField(precision=2, required=True)
volume = LongField(required=True)
turnover = DecimalField(precision=2, required=True)
update_time = DateTimeField(unique=True, required=True)
I want to query the update_time in some period of time.
TickDataDocument.objects(instrument_id="fa1100").filter(tick_data__ update_time__lt =datetime.datetime(2013,9,3))
but I got errors:
mongoengine.errors.InvalidQueryError: Cannot perform join in mongoDB: tick_data__update_time
How could I to five a solution to query the inner reference field in mongoengine.