How to export MongoDB collection to CSV
mongoexport command is used to export MongoDB collection into CSV or JSON format. Syntax mongoexport –db DB_NAME –collection COLLECTION_NAME –fields FIELDS_HERE –type=csv –out NAME_OF_OUT_FILE Where DB_NAME = name of the database COLLECTION_NAME = name of the collection FIELDS_HERE = comma separated list of fields. NAME_OF_OUT_FILE = name of the CSV file By default MongoDB connect … Read more