Export, import, dump, restore command on Windows machine

Hi team,

I have some serious problem when it comes how to import, export, dump and restore in windows. In the lecture video, I see here “M001” before the commands for each of these 4 operation starts. I watched the video again and again, I couldn’t quiet get that. This is my string. I am hiding my DB here with XXXX. I use this string in my windows terminal!
mongoexport --uri=“mongodb+srv://m001-student:m001-mongodb-basics@sandbox.XXXXX.net/sample_supplies” --collection=sales --out=sales.json
Where is the destination where the exported JSON file saved? And how all these works in windows?

Hi @Medhanie_Gebru1, welcome to the community.
Please note that you have run the mongoexport command from the Terminal/Command Prompt and NOT from the mongo shell. I would recommend you to run that command after exiting from the Mongo Shell by pressing Ctrl+C and then pasting the same command directly to the Command Prompt. I hope it helps.

In case you have any doubts, please feel free to reach out to us.

Thanks and Regards.
Sourabh Bagrecha,
Curriculum Services Engineer

1 Like

Hi Sourabh,

Thank you for your help. I tried it in my terminal as you advised me but I see here the following:
‘mongoexport’ is not recognized as an internal or external command,
operable program or batch file.

Thank you!

Hi @Medhanie_Gebru1, that’s awesome. Now you just have to install the database tools for MongoDB. You can follow the steps mentioned here and you’ll be all set to proceed with the mongoexport and other tools.

In case you have any doubts, please feel free to reach out to us.

Thanks and Regards.
Sourabh Bagrecha,
Curriculum Services Engineer

1 Like