title: How to aggregate on nested embedded object in MongoDB
body: <pre><code>{
    &quot;_id&quot;: 1,
    &quot;title&quot;: {
      header1:{ &quot;name&quot;:&quot;A&quot; , age:10, &quot;active&quot;:true},
      header2:{ &quot;name&quot;:&quot;B&quot; , age:15, &quot;active&quot;:false},
      header3:{ &quot;name&quot;:&quot;C&quot; , age:20, &quot;active&quot;:true},
      header4:{ &quot;name&quot;:&quot;D&quot; , age:30, &quot;active&quot;:true},
      header5:{ &quot;name&quot;:&quot;E&quot; , age:35, &quot;active&quot;:false},
      header6:{ &quot;name&quot;:&quot;F&quot; , age:40, &quot;active&quot;:true},
      header7:{ &quot;name&quot;:&quot;G&quot; , age:45, &quot;active&quot;:false},
    }
  }
  </code></pre>
  <p>How can I show only those headers whose active value is false?</p>