user1015104
user1015104

Reputation:

where mongodb exports files?

I am struggling to find the location of the file I am exporting with Mongo, using mongoexport

mongoexport --db databaseName --collection collName --out file.json

Can someone point me to the location

I run it on ubuntu server with the default installation of mongo

Upvotes: 5

Views: 7904

Answers (4)

Sheikh Abdul Wahid
Sheikh Abdul Wahid

Reputation: 2773

It will be in your current dir. run pwd command on linux machine to see the current path.

Upvotes: 1

Oss
Oss

Reputation: 4322

If you do not specify a file name, the mongoexport writes data to standard output.

Source: https://docs.mongodb.com/manual/reference/program/mongoexport/#cmdoption-out

Upvotes: 1

Salvador Dali
Salvador Dali

Reputation: 222761

Mongoexport generates the output file in the current directory

But in case you could not just find a file, I would do something like this:

mongoexport --db databaseName --collection collName --out /pathToYourFile/file.json

In such a case you will definitely know where it will be. Make sure that you have rights to write in that folder.

Upvotes: 2

Miguel Cartagena
Miguel Cartagena

Reputation: 2606

Actually, the mongoexport command will generate the out file in the current directory.

Upvotes: 0

Related Questions