Hi @Sahibjot_Singh, welcome to the community.
Please note that the
mongoexport is a command-line tool that produces a JSON or CSV export of data stored in a MongoDB instance. That means it will export all your collection data into a file that will be saved in your local system.
On the other hand, the
mongoimport tool imports content from an Extended JSON, CSV, or TSV export created by
mongoexport , or potentially, another third-party export tool. So it will take the same file as input from your local system and will add all the data into the specified collection & database respectively.
I hope it helps.
In case you have any doubts, please feel free to reach out to us.
Thanks and Regards.
Curriculum Services Engineer