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
Install MongoDB Compass, then it will have a tool to export query result to Json/CSV files.