title: Query ElemMatch an array within an array
body: <p>I'm trying to query a collection and filter based on values nested within an array and a second array using elemMatch. </p>
  
  <pre><code>{
  "email": "user1@email.com",
  "project" [ {
                  projectId: ObjectId("123"),
                  preference: [
                              {"name": "name1", "value": true},
                              {"name": "name2", "value": false}
                  ]
              }, 
              {
                  projectId: ObjectId("456"),
                  preference: [
                              {"name": "name1", "value": true},
                              {"name": "name2", "value": true}
                  ]
              }
  ]
  }, 
  {
  "email": "user2@email.com",
  "project" [ {
                  projectId: ObjectId("123"),
                  preference: [
                              {"name": "name1", "value": false},
                              {"name": "name2", "value": true}
                  ]
              }, 
              {
                  projectId: ObjectId("456"),
                  preference: [
                              {"name": "name1", "value": true},
                              {"name": "name2", "value": true}
                  ]
              }
  ]
  }
  </code></pre>
  
  <p>I've tried a few different variations of merging the below two queries into one to try and achieve my goal of returning. </p>
  
  <p>{email: "user1@email.com"}</p>
  
  <pre><code>db.user.find({"project":{"$elemMatch":{"projectId":ObjectId("123")}}}, {email: 1})
  db.user.find({"project.preference":{"$elemMatch":{"$and":[{"name":"name1"}, {"value": true}]}}}, {email: 1})
  </code></pre>