title: mongoexport not working if you add query of selection
body: <p>If you want to export any collections of any of your mongodb database, you can use <code>mongoexport</code> command. For example:</p>
  
  <pre><code>mongoexport --db dbname --collection collectionName --query '{"fields":1}' --out output.json
  </code></pre>
  
  <p>However, if you add any of selection criteria to the query, <code>mongoexport</code> command doesn't work. For example, if you run the following command:</p>
  
  <pre><code>mongoexport --db dbname --collection collectionName --query '{},{"fields":0}' --out output.json
  </code></pre>
  
  <p>the resultant JSON file includes data of every field, despite me excluding a filed named <code>fields</code>.</p>
  
  <p>So why does this such strange behavior occur? And how can I fix it?</p>
  
  <p>For your information, <code>db.colName.find({},{"fields":0})</code> in mongoDB shell works as usual.</p>
  
  <p>I'm on MongoDB 2.4.3 and OS X 10.9.</p>
  
  <p>Thanks.</p>