title: Mongoose, Filter list of object before $setIsSubset
body: <p>Right now I have an aggregation like that</p>
  
  <pre><code>   ObjectWithElement.aggregate([{
        $redact: {
          '$cond': [
            {
              '$eq': [
                { $setIsSubset: ['$elements.element', myElements] }, true
              ]
            },
            '$$KEEP',
            '$$PRUNE'
          ]
        }
      }
      ]).exec(listCallback);
  </code></pre>
  
  <p>The Scheme of Element is:</p>
  
  <pre><code>var ElementSchema = new Schema({
      name: {
        type: String,
        default: '',
        required: 'Please fill name',
        trim: true
      },
      importance: {
        type: String,
        default: 'Medium',
        enum: ['Low', 'Medium', 'High']
      },
      user: {
        type: Schema.ObjectId,
        ref: 'User'
      }
    },
    {
      timestamps: true
    });
  </code></pre>
  
  <p>But I want to filter '$elements.element' by only keeping elemenys that have an importance of 'high' or 'medium'</p>
  
  <p>How can I filter those elements because the $setIsSubset operation?</p>
  
  <p>Some data:</p>
  
  <p>MyElements</p>
  
  <pre><code>{
      "_id" : ObjectId("5834b78271dc8b8c24cec6aa"),
      "user" : ObjectId("581108f40e10a7e846456737"),
      "elements" : [ 
          {
              "element" : ObjectId("581b7c645057c4602f48627f"),
              "quantity" : 1,
              "unit" : ObjectId("581ca0da5b1e3058521a6d8b"),
              "_id" : ObjectId("58540ddb431dc71048974e61")
          }
      ],
      "__v" : 9,
      "createdAt" : ISODate("2016-11-22T21:24:18.000Z"),
      "updatedAt" : ISODate("2016-12-16T15:52:59.841Z") 
  }
  </code></pre>
  
  <hr>
  
  <p>Elements</p>
  
  <pre><code>{
      "_id" : ObjectId("581b7c645057c4602f48627f"),
      "user" : ObjectId("581108f40e10a7e846456737"),
      "importance" : "High",
      "name" : "Element1",
      "__v" : 0,
      "createdAt" : ISODate("2016-11-03T18:05:24.000Z"),
      "updatedAt" : ISODate("2016-12-15T21:40:03.502Z")
  },
  {
      "_id" : ObjectId("581ca0e75b1e3058521a6d8c"),
      "user" : ObjectId("581108f40e10a7e846456737"),
      "importance" : "Low",
      "name" : "Element2",
      "__v" : 0
      "createdAt" : ISODate("2016-11-03T18:05:26.000Z"),
      "updatedAt" : ISODate("2016-12-15T21:44:03.502Z")
  }
  </code></pre>
  
  <hr>
  
  <p>ObjectWithElements</p>
  
  <pre><code>{
      "_id" : ObjectId("582e1b627836bcc045c06325"),
      "user" : ObjectId("581108f40e10a7e846456737"),
      "name" : "Object1",
      "elements" : [ 
          {
              "element" : ObjectId("581b7c645057c4602f48627f"),
              "quantity" : 1,
              "unit" : ObjectId("581ca0da5b1e3058521a6d8b"),
              "_id" : ObjectId("582e1b627836bcc045c06328")
          }, 
          {
              "element" : ObjectId("581ca0e75b1e3058521a6d8c"),
              "quantity" : 1,
              "unit" : ObjectId("581ca0da5b1e3058521a6d8b"),
              "_id" : ObjectId("58530046cfc0c384010f0839")
          }
      ],
      "__v" : 2,
      "createdAt" : ISODate("2016-11-17T21:04:34.000Z"),
      "updatedAt" : ISODate("2016-12-15T20:42:46.843Z")
  },
  {
      "_id" : ObjectId("582e2c05b4e900d03d494fef"),
      "user" : ObjectId("581108f40e10a7e846456737"),
      "name" : "Object2",
      "elements" : [ 
          {
              "element" : ObjectId("581b7c645057c4602f48627f"),
              "quantity" : 2,
              "unit" : ObjectId("581ca0da5b1e3058521a6d8b"),
              "_id" : ObjectId("582e2c05b4e900d03d494ff2")
          }
      ],
      "__v" : 2,
      "createdAt" : ISODate("2016-11-17T22:15:33.000Z"),
      "updatedAt" : ISODate("2016-12-15T20:42:59.999Z")
  }
  </code></pre>