title: Match documents with fields not containing values in array
body: <p>After some "match" steps in db.collection.aggregate I got</p>
  
  <pre><code>{_id: 1, field1: "a", field2: ["1.1.1", "1.1.2", "1.1.3", "1.1.4"]}
  {_id: 2, field1: "b", field2: [         "1.1.2",          "1.1.4"]}
  {_id: 3, field1: "c", field2: ["1.1.1", "1.1.2"                  ]}
  {_id: 4, field1: "d", field2: [                           "1.1.4"]}
  {_id: 5, field1: "e", field2: [                  "1.1.3"         ]}
  </code></pre>
  
  <p>// I made preformatting</p>
  
  <p>I want to apply yet another rule (I suppose it would be "group" rule) in aggregate to get all documents where "field2" does not contain "1.1.1" OR "1.1.4". So I need documents without "1.1.1" OR "1.1.4" OR ("1.1.1" AND "1.1.4").</p>
  
  <p>I want to get something like this:</p>
  
  <pre><code>{_id: 5, field1: "e", field2: [                  "1.1.3"         ]}
  </code></pre>
  
  <p>So, I have field2, which is array in each document, and I want to get all the documents which have no single element in a given array (e.g. ["1.1.1", "1.1.4"]).</p>
  
  <p>P.S. I need this for "single statement aggregation command". No additional JS accepted.</p>
  
  <p>UPD</p>
  
  <p>@blakes-seven , tnx</p>
  
  <p>My mistake is that I used</p>
  
  <pre><code>{ "$match": { "field2": { "$elemMatch": { "$nin": ["1.1.1","1.1.4"] } } } }
  </code></pre>
  
  <p>but right thing is just to use</p>
  
  <pre><code>{ "$match": { "field2": {                 "$nin": ["1.1.1","1.1.4"] } } }
  </code></pre>
  
  <p>Don't overestimate $elemMatch :)</p>