Reputation: 1905
I am new with MongoDB and I have a test account on mongogb account. I am trying to export the database I have remotely and this has given me a lot of headaches. Can someone help me out on this please?
mongoexport \
--host="myDbUser:DataBas3Pwd@mongodb://cluster0.raiy3.mongodb.net" \
-d socialDeveloper \
-c posts \
--out social.json
When I run the code on my command line it returns the response:
2021-03-01T01:13:26.240+0100 could not connect to server: server selection error: server selection timeout, current topology: { Type: Single, Servers: [{ Addr: cluster0.raiy3.mongodb.net:27017, Type: Unknown, State: Connected, Average RTT: 0, Last error: connection() : dial tcp: lookup cluster0.raiy3.mongodb.net: no such host }, ] }
And here is where I got the connection details from on my mongoDb account
WHat do I need to change please?
Upvotes: 1
Views: 363
Reputation: 1690
Try:
mongoexport 'mongodb+srv://myDbUser:[email protected]' --db=socialDeveloper --collection=posts --out=social.json
Upvotes: 1