title: Pipelining Multiple unwinds in an Mongo aggeregation framework
body: <p>I have an interesting use case that I am working against which would require me to apply Mongo's $unwind operator on two array types (which is an attribute in the mongo document)</p>
  
  <p>Heres an example where I'd wish to filter on 2 enum types 
  $host.config.storageDevice.scsiLun - enum("ssd","disk1","disk2")
  $host.config.storageDevice.scsiLun.capacity.block - range(1000-100000)</p>
  
  <p>Can I $unwind multiple operators and filter upon them in a single aggregation pipeline</p>
  
  <pre><code>               db["XXXXXXX"].aggregate( { $unwind : { "$host.config.storageDevice.scsiLun", "$host.config.storageDevice.scsiLun.capacity.block" } }, 
                                 { $match : { "host.config.storageDevice.scsiLun.lunType" : "cdrom"  , "host.config.storageDevice.scsiLun.capacity.block" : { $gte : 60000 } , "managedObject" : "host" } } , 
                                 { $project : { "host.name" : 1 , "host.config.storageDevice.scsiLun.devicePath" : 1 , "host.config.storageDevice.scsiLun.capacity.blockSize" : 1 , "host.config.storageDevice.scsiLun.capacity.block" : 1 , "host.config.storageDevice.scsiLun.ssd" : 1 , "host.config.storageDevice.scsiLun.uuid" : 1 , "host.config.storageDevice.scsiLun.lunType" : 1 , "_id" : 0  }} )
  </code></pre>
  
  <p>OR</p>
  
  <p>Can I chain a composite aggregation operational unit's result to another aggregation unit</p>
  
  <pre><code>               db["XXXXXXX"].aggregate( { $unwind : "$host.config.storageDevice.scsiLun" }, 
                 { $match : { "host.config.storageDevice.scsiLun.lunType" : "cdrom"  , "managedObject" : "host" } } , 
                 { $project : { "host.name" : 1 , "host.config.storageDevice.scsiLun.devicePath" : 1 , "host.config.storageDevice.scsiLun.capacity.blockSize" : 1 , "host.config.storageDevice.scsiLun.capacity.block" : 1 , "host.config.storageDevice.scsiLun.ssd" : 1 , "host.config.storageDevice.scsiLun.uuid" : 1 , "host.config.storageDevice.scsiLun.lunType" : 1 , "_id" : 0  }},
                 { $unwind : "$host.config.storageDevice.scsiLun.capacity.blockSize" },
                 { $match : { "host.config.storageDevice.scsiLun.capacity.blockSize" : { $gte : 8000000 } } },
                 { $project : { "host.name" : 1 , "host.config.storageDevice.scsiLun.devicePath" : 1 , "host.config.storageDevice.scsiLun.capacity.blockSize" : 1 , "host.config.storageDevice.scsiLun.capacity.block" : 1 , "host.config.storageDevice.scsiLun.ssd" : 1 , "host.config.storageDevice.scsiLun.uuid" : 1 , "host.config.storageDevice.scsiLun.lunType" : 1 , "_id" : 0  }} 
  </code></pre>