Reputation: 6531
I'm new with mongodb. I just used the command mongoexport as follows:
mongoexport -d databasename -c collectionname
operation completed within few minutes, (around 300k documents exported) however I see no files anywhere. I've checked the current folder (as I thought it's runnnig as mongodump) but it seems empty as well.
Did I need to specify a folder? Where are the exported files located?
Upvotes: 0
Views: 1720
Reputation: 168
If you're using windows, add the mongoDB path to your environment variables and choose your directori, for example: Open cmd as admin,
cd C:\Users\Test
After that run:
mongoexport -u admin -p password--host hostname:port -d databasename -c collection --authenticationDatabase admin -o test.csv
You will have your file in
C:\Users\Test
Upvotes: 0
Reputation: 61293
As specify in the documentation
If you do not specify a file name, the mongoexport writes data to standard output (e.g. stdout).
You need to specify a file to write the export to using the --out
option.
Upvotes: 3