title: how to use mongoexport to get a particular format in .csv file?
body: <p>I am new to mongoDb and exciting about using it at my workplace. However, I have come across a situation where one of our client has sent the data in .bson file. I have got everything working on machine. I want to use mongoexport facility to export my data in csv format. When I am using the following query </p>
  
  <pre><code>./mongoexport --db &lt;dbname&gt; -collection &lt;collectionname&gt; --csv -fields _id,field1,field2
  </code></pre>
  
  <p>I am getting the result in following format</p>
  
  <pre><code>ObjectID(4f6b42eb5e724242f60002ce),"[ { ""$oid"" : ""4f6b31295e72422cc5000001"" } ]",369008
  </code></pre>
  
  <p>However, I just want the value of the fields as a comma separated output like below: <code>4f6b42eb5e724242f60002ce,4f6b31295e72422cc5000001,369008</code></p>
  
  <p>My question is, is there anything that I can do something in mongoexport to ignore certain characters?</p>
  
  <p>any pointer will be helpful.</p>