0

Edited the question as per the answer:

I'm using this command line and generated a CSV but I got 0 exports:

mongoexport --host localhost --db schooldbs --collection name --type=csv --out text.csv --fields name,email,mobile,city,birthday,createdAt

I got this response:

2019-12-24T07:28:16.382+0000    connected to: localhost
2019-12-24T07:28:16.386+0000    exported 0 records

What is name in that command line? What am I doing wrong?

1 Answer 1

1

You are using mongoexport inside mongo terminal. It should not be the case. You have to run from external(point o where mongoexport is there) if its installed globally means just execute the above command. Also replace placeholder like dbname us your real dbname and try.

EDIT

change --collection name name to your real collectionname

Sign up to request clarification or add additional context in comments.

2 Comments

What is collectionname and how do I got about finding out? I'm new to mongo and don't know what I'm doing.
@Elaine Byene see what are all the collections in schooldbs, its like tables in RDBMS. Connect to your mongoDB and see what are the collections are there in db.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.