How do I export the results of a MongoDB command to a flat file
For example, If I am to get db.collectionname.find() into a flat file.
db.collectionname.find()
I tried
mongoexport --db db_name --collection collection_name --csv --out file_name.csv -f field1,field2, field3