I
I
Ilya2017-03-14 11:06:08
MongoDB
Ilya, 2017-03-14 11:06:08

How to export MongoDB database to csv?

Tell me how to export the database to csv, all fields.

mongoexport --db=kinopoisk --collection=films_collection --type=csv --fields * -o /home/555.csv

I tried it like this, it creates a file and writes something there, something that has nothing to do with the database. one line and that's it.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
longclaps, 2017-03-14
@nuBacuk

Specify the required fields explicitly:

mongoexport --db video --collection movies --type=csv --fields title,year,imdb -o movies.csv

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question