title: Query embedded documents with mongo engine
body: <p>so I'm using <strong>mongoengine</strong> to query embedded documents. </p>
  
  <p><strong>schema: project</strong></p>
  
  <pre class="lang-py prettyprint-override"><code>class _StatusFields(mongoengine.EmbeddedDocument):
      start_time = mongoengine.DateTimeField()
  
  class _Status(mongoengine.EmbeddedDocument):
      start = mongoengine.EmbeddedDocumentField(
          _StatusFields, default=_StatusFields()
      )
      complete = mongoengine.EmbeddedDocumentField(
          _StatusFields, default=_StatusFields()
      )
  class Project(mongoengine.Document):
      status = mongoengine.EmbeddedDocumentField(_Status,  default=_Status),
      location = mongoengine.StringField()
  </code></pre>
  
  <p>As you can see, I am using the <strong>_Status</strong> as an embedded document in the <strong>Project</strong>. I need to query the <strong>status</strong> in the project, that is an embedded document. </p>
  
  <p>So this is the code that I have tried: </p>
  
  <pre class="lang-py prettyprint-override"><code>filter = {'status__in': ['complete']}
  project_objects = Project.objects(**filter).all()
  </code></pre>
  
  <p>But I get this error: 
  <code>mongoengine.errors.InvalidQueryError: Querying the embedded document '_Status' failed, due to an invalid query value</code></p>
  
  <p>It works for strings and objectIds, but it does not seem to add for embedded documents.</p>
  
  <p>Can someone please tell me what is the right way for querying an embedded documents?</p>