title: MongoDB mongoexport query
body: <p>I have a collection of the following form in MongoDB.
  As you can see some documends have two members "id" and "xid" and some have only 1 "id" (aside from the Object _id)</p>
  
  <pre><code>[
      {
          "id" : 1,
      },
  
      {
          "id" : 2,
      },
  
      {
         "id" : 3
         "xid": 300
      }
  ]
  </code></pre>
  
  <p>I want to create a mongoexport statement that exports to a csv only documents with id's AND xid's with the value of xid > 0</p>
  
  <p>I currently have the following command:</p>
  
  <pre><code>mongoexport -h host -u user -p pass --db database --collection collections --csv --fields id,xid --query '{"xid":{"$ne":0}}' --out rec.csv
  </code></pre>
  
  <p>However this also exports documents that have an id without an xid. So i get something like</p>
  
  <pre><code>xid, id
  12, 3
  ,4
  14, 5
  ,3
  ,2
  12, 5
  </code></pre>
  
  <p>etc.</p>
  
  <p>Is there a way to export documents that only have both id and xid?</p>