title: Mongo engine query the referencefield
body: <p>I have define the class statement:</p>
  
  <pre class="lang-py prettyprint-override"><code>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)
  </code></pre>
  
  <p>I want to query the update_time in some period of time. </p>
  
  <pre><code> TickDataDocument.objects(instrument_id="fa1100").filter(tick_data__ update_time__lt =datetime.datetime(2013,9,3))
  </code></pre>
  
  <p>but I got <strong>errors:</strong> </p>
  
  <blockquote>
    <p>mongoengine.errors.InvalidQueryError: Cannot perform join in mongoDB:
    tick_data__update_time</p>
  </blockquote>
  
  <p>How could I to five a solution to query the inner reference field in mongoengine.</p>