title: Exporting MongoDB Documents to CSV in C#
body: <p>I want to export a CSV table from the items of an IMongoCollection from MongoDB.Driver using C#.</p>
  
  <p>How would I be able to do this efficiently? I was thinking of doing this by retrieving the documents from the collection and either convert them to a JSON-like format or use a StringBuilder to create the CSV file using and array of PropertyInfo to access the fields of the retrieved object. </p>
  
  <p>Can someone come with an example of how I would be able to do this?</p>