You can use something like https://github.com/eligrey/FileSaver.js to create Blob on the browser side and then offer it as a download.
client side js
var yourCSVData = "Col1Row1,Col2Row1\nCol1Row2,Col2Row2"; var blob = new Blob([yourCSVData], {type: "text/csv;charset=utf-8"}); saveAs(blob, "yourfile.csv");
Create your CSV in yourCSVData , then you can easily upload the file.
To create your CSV, you will have to use some kind of custom javascript. The thing with mongodb is that each document can have a different structure, which is very bad for documents like row / column.
You can use something like the violin given by Yvegeniy ( http://jsfiddle.net/sturtevant/vUnF9/ ) in the comments above, and this may help
var data = MyCollection.find().fetch(); var yourCSVData = JSON2CSV(data);
source share