Remove _id from Mongoexport JSON results

Remove _id from mongoexport results
mongoexport --collection users --uri $MONGODB_URI | sed '/"_id":/s/"_id":[^,]*,//' > users.json
mongoexport --collection users --type=csv --fieldFile=users.txt --out=users.csv --uri $MONGODB_URI

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store