Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import os
- host = ""
- username = ""
- password = ""
- directory_to_export = ""
- database = ""
- all_collections = []
- command = "mongoexport --host {} --username {} --password {} --db {} --collection {} --pretty --out {}/{}.json"
- for c in all_collections:
- os.system(command.format(host, username, password, database, c, directory_to_export, c))
Add Comment
Please, Sign In to add comment