79244156

Date: 2024-12-02 12:54:44
Score: 0.5
Natty:
Report link

The documentation is a bit tricky and also the updates in different versions can be missleading. What I found is:

mongodump --archive="<the-new-db-name>" --db=<the-db-to-copy>--host="localhost" --port=<e.g:27017> --username=<your-username> --authenticationDatabase=admin

, you may be asked for a password. after the correct password it will write and dump

enter image description here

Note: And you will have your file "archived". if you want it as an output file, you will need to change the "archive=" statement by "--out="

Note2: I am ussing MongoDB: 7.0.5 and Mongosh: 2.1.4

Reasons:
  • Probably link only (1):
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Corina Roca