title: Aggregation Match Array Element within another Array
body: <p>I'm trying to return the field of an array based on the values in this one but using a 2nd $eq in a field present in an array (array of an array specifically) gives me systematically an empty result</p>
  
  <p>Here's the structure part of my collection :</p>
  
  <pre><code>    ...
      _id: ObjectId("S"),
    array: [
       {
          X: "A",
          Y: NumberInt(0),
          Z: [NumberInt(5),NumberInt(6)]
       },
       {
          X: "B",
          Y: NumberInt(1),
          Z: [NumberInt(5),NumberInt(8)]
       },
       {
          X: "C",
          Y: NumberInt(0)
       }
    ],
      ...
  </code></pre>
  
  <p>and part of my code :</p>
  
  <pre><code>db.collection.aggregate(
     [
        { $match: { _id: ObjectId("56a108914b179d6efafca6f3") } },
        { $project: { _id: 1, list: { $setDifference: [ { $map: { input: "$array", as: "el", in: { $cond: [ { $and: [ { $eq: [ "$$el.Y", 0 ] }, { $eq: [ "$$el.Z", 5 ] } ] }, "$$el.X", false ] } } }, [false] ] } } } 
     ]
  );
  </code></pre>
  
  <p>but the 2nd $eq argument dont work...when i delete it i have good result (without $$el.Z equality).</p>
  
  <p>I want return :</p>
  
  <pre><code>{ "_id" : ObjectId("S"), "list" : [ "A" ] }
  </code></pre>
  
  <p>Thank you in advance,</p>
  
  <p>Best regards.</p>