title: MongoDB find among subdocuments
body: <p>I have a bunch of documents where each of them is formatted this way:</p>
  <pre><code>{
    &quot;faculty&quot;: &quot;Some Faculty&quot;,
    &quot;students&quot;: [
        {
          &quot;id&quot;: &quot;51230867123&quot;,
          &quot;age&quot;: &quot;21&quot;,
          &quot;name&quot;: &quot;awdawdawdawawd&quot;
        },
        {
          &quot;id&quot;: &quot;0217356102&quot;,
          &quot;age&quot;: &quot;22&quot;,
          &quot;name&quot;: &quot;awdawd&quot;
        },
        ...
        ]
  }
  </code></pre>
  <p>I've inserted those documents into a single MongoDB collection using <code>insertMany([...])</code>, so now my <code>students</code> table looks like this:</p>
  <pre><code>{
    &quot;faculty&quot;: &quot;Some Faculty&quot;,
    &quot;students&quot;: [
        {
          &quot;id&quot;: &quot;51230867123&quot;,
          &quot;age&quot;: &quot;21&quot;,
          &quot;name&quot;: &quot;John Doe&quot;
        },
        {
          &quot;id&quot;: &quot;0217356102&quot;,
          &quot;age&quot;: &quot;22&quot;,
          &quot;name&quot;: &quot;Jane Doe&quot;
        },
        ...
        ]
  },
  {
    &quot;faculty&quot;: &quot;Other Faculty&quot;,
    &quot;students&quot;: [
        {
          &quot;id&quot;: &quot;1240876124&quot;,
          &quot;age&quot;: &quot;21&quot;,
          &quot;name&quot;: &quot;Jimmy Doe&quot;
        },
        {
          &quot;id&quot;: &quot;2309857120578&quot;,
          &quot;age&quot;: &quot;22&quot;,
          &quot;name&quot;: &quot;Johnny Doe&quot;
        },
        ...
        ]
  },
  ...
  </code></pre>
  <p>I'd very much like to find out how I can perform a <code>find</code> query on certain subdocuments, specifically <code>students</code>. For example, I'd like to <code>find</code> all <code>students.name</code> with <code>students.age &gt; 23</code>. I've tried many queries, including <code>db.students.find({&quot;students.age&quot;: {$gt: /.*B.*/}}, {_id: 0, &quot;students.name&quot;: 1})</code>, but such queries always return whole documents for which at least one student fulfills the condition. I'd like to query individual students. Is this possible using <code>find</code> (no <code>aggregate</code>)?</p>
  <p>With <code>aggregate</code>, one can use <code>unwrap</code>, which is pretty much exactly what I need to do. I'm however hoping for some tricks to use with <code>find</code> to achieve this behavior.</p>