In previous tutorial, we known the way to import CSV data to a MongoDB collection. Today, we’re gonna export MongoDB collection to CSV file using Node.js with two steps:
- Read data from MongoDB collection using
mongodb
module - Export MongoDB data to CSV file using one of three modules:
fast-csv
,csv-writer
orfs