You need to open the command line as an administrator in the folder where Mongo is installed (in my case: C: \ Program Files \ MongoDB \ Server \ 3.4 \ bin). If you want to dump the entire database, you can simply use:
mongodump --db database_name
You also have the option of dropping only certain collections or dropping all but certain collections (s).
If you want to dump only one collection (e.g. users):
mongodump --db database_name --collection users
If you want to reset everything except the user collection:
mongodump --db database_name --excludeCollection=users
You can also dump the archive file:
mongodump --archive=test.archive --db database_name
Jery Jun 18 '17 at 23:57 2017-06-18 23:57
source share