title: mongo export array elements
body: <p>I would like to export 3 different csv files, here is my document </p>
  
  <pre><code>{
  
  "capacities" : [ 
      {
          "size" : "A",
          "incoming_parcels" : 27,
          "outgoing_parcels" : 0,
          "empty_compartments" : 0
      }, 
      {
          "size" : "B",
          "incoming_parcels" : 11,
          "outgoing_parcels" : 0,
          "empty_compartments" : 8
      }, 
      {
          "size" : "C",
          "incoming_parcels" : 2,
          "outgoing_parcels" : 1,
          "empty_compartments" : 7
      }
  ]
  </code></pre>
  
  <p>}</p>
  
  <p>I would like to get all documents where capacities[1] = B and then get all fields - same for all sizes.</p>
  
  <p>Here is my syntax for export :</p>
  
  <pre><code>mongoexport.exe --db name --collection name --type csv --out sizeB.csv -q "{'capacities.1.size': 'B'}" -f size,incoming_parcels,outgoing_parcels,empty_compartments
  </code></pre>
  
  <p>I've also tried -f capacities.1.size etc</p>