title: Querying a list in mongoengine; contains vs in
body: <p>I have a ListField in a model with ids (ReferenceField), and I need to do a query if a certain id is in that list. AFAIK I have 2 options for this:</p>
  <pre><code>Model.objects.filter(refs__contains='59633cad9d4bc6543aab2f39')
  </code></pre>
  <p>or:</p>
  <pre><code>Model.objects.filter(refs__in=['59633cad9d4bc6543aab2f39'])
  </code></pre>
  <p>Which one is the most efficient for this use case?</p>
  <p>The model looks like:</p>
  <pre><code>class Model(mongoengine.Document):
      refs = mongoengine.ListField(mongoengine.ReferenceField(SomeOtherModel))
  </code></pre>
  <p>From what I can read in the mongoengine <a href="http://docs.mongoengine.org/guide/querying.html#string-queries" rel="nofollow noreferrer">documentation</a>, <code>contains</code> is really a string query, but it works surprisingly here as well. But I'm guessing that <code>__in</code> is more efficient since it should be optimized for lists, or am I wrong?</p>