title: MongoDB - How to get specified values of an array in a document
body: <p>Here is the document</p>
  <pre><code>{
    '_id': ObjectId('61a4262a53ddaa8b93374613'),
    'userid': 'renyi',
    'data1': [{'a': 1}, 1, 2, 3],
    'data2': [{'c': 1}, {'b': 2}, {'c': 3}, {'c': 2}],
    'data': {'0': {'a': 1}}
  }
  </code></pre>
  <p>With this</p>
  <pre class="lang-py prettyprint-override"><code>coll.find_one({'userid':'renyi','data2.c':1},{'_id':0,&quot;data2.$&quot;:1})
  </code></pre>
  <p>I can get</p>
  <pre><code>{'data2': [{'c': 1}]}
  </code></pre>
  <p>But how to get</p>
  <pre><code>{'data2': [{'c': 1},{'c': 2}]}
  </code></pre>