Skip to content

Instantly share code, notes, and snippets.

@swateek
Last active September 7, 2017 17:37
Show Gist options
  • Save swateek/ee0e14b917b7b91ff108a0f785688111 to your computer and use it in GitHub Desktop.
Save swateek/ee0e14b917b7b91ff108a0f785688111 to your computer and use it in GitHub Desktop.
Export Data from MongoDB to .csv
// export data to csv
print("ap_mac,tags");
db.managedaps.find({}).forEach(function(ap){
print(ap.mac+","+ap.tags);
});
// mongo dbname filename.js > out.csv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment