title: $filter nested level with $or, $gte, $lte operators
body: <p>I want to filter multi nested documents in MONGO db </p>
  
  <p><strong>Sample JSON:</strong>   </p>
  
  <pre><code>{ 
  "_id" : ObjectId("5b5c3afbcc43cb5ed64b7a04"), 
  "id" : NumberLong(15015060), 
  "name" : "1801_Conf", 
  "type" : NumberInt(2), 
  "members" : [
      {
          "id" : NumberLong(15015061), 
          "name" : "1801_Conf-W--", 
          "sku" : "1801_new", 
          "type" : NumberInt(1), 
          "parent_id" : NumberLong(15015060), 
          "available_qty" : NumberInt(10), 
          "on_hand_qty" : NumberInt(10), 
          "outgoing_qty" : NumberInt(0), 
          "incoming_qty" : NumberInt(0), 
          "shortage_qty" : NumberInt(0), 
          "product_warehouses" : [
              {
                  "warehouse_id" : NumberLong(3), 
                  "available_qty" : NumberInt(10), 
                  "outgoing_qty" : NumberInt(0), 
                  "incoming_qty" : NumberInt(0)
              },
              {
                  "warehouse_id" : NumberLong(4), 
                  "available_qty" : NumberInt(600), 
                  "outgoing_qty" : NumberInt(0), 
                  "incoming_qty" : NumberInt(0)
              }
          ], 
          ]
      } 
  ] 
  </code></pre>
  
  <p>}</p>
  
  <p><strong>Expected Output</strong>: Want to filter only members (not all) that have   available_qty &lt; 50 and > 10 and members.product_warehouses.available_qty  &lt; 50 and > 20</p>
  
  <p><strong>Query:</strong>  </p>
  
  <pre><code>db.products.aggregate([{
     "$match": {
         "tenant_id": XXX,
         "type" : 2
     }
  }, {
     "$project": {
         "name": 1,
         "sku": 1,
         "members": {
             "$filter": {
                 "input": "$members",
                 "as": "member",
                 "cond": {
  
                         "$and": 
                          [
                              {
                                 "$gte": ["$$member.product_warehouses.available_qty", 10]
                              }, 
                              {
                                 "$lte": ["$$member.available_qty", 50]
                              },
                              {
                                 "product_warehouses": {
                                 "$elemMatch" : {
  
                                     }
                                 }
                              }
                          ]
  
                 }
             }
         }
     }
  }])
  </code></pre>
  
  <p><strong>Error:</strong> : { "ok" : 0, "errmsg" : "invalid operator '$elemMatch'", "code" : 15999 } : aggregate failed</p>