0

I have a MongoDB dbs named test with a collection named items. It has one item. I'm currently learning how to export a copy of the collections, but I get an error message: Failed: error connecting to db server: no reachable servers and a blank .json document. Below is my command for mongoexport in my terminal (using a Mac):

mongoexport --db test --collection items --authenticationDatabase admin --out test.json

How would I fix this so that I get the data from the collection?

1 Answer 1

1

Try adding the host parameter:

mongoexport --host=127.0.0.1 --db test --collection items --authenticationDatabase admin --out test.json
Sign up to request clarification or add additional context in comments.

Comments

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.