I am a newbie to MongoDB and having an issue connecting to MongoDB from the terminal.
When I tried to connect to MongoDB from the terminal in VS Code, I've got an error saying; "MongoServerSelectionError: read ECONNRESET". What I did is that I googled and unchecked the Proxy Strict SSL in settings, then reloaded the window and ran the command below.
mongosh "mongodb+srv://cluster0.8tjjn.mongodb.net/myFirstDatabase" --apiVersion 1 --username mongo
The username is correct as shown, mongo. I was asked for my password and typed it correctly. It's just 5 letters password, so it's hard to imagine I mistyped it a few times in a row.
I double-checked if I installed mongo and mongosh by running:
mongo --version
↓output
mongo --version
MongoDB shell version v5.0.6
Build Info: {
"version": "5.0.6",
"gitVersion": "212a8dbb47f07427dae194a9c75baec1d81d9259",
"modules": [],
"allocator": "system",
"environment": {
"distarch": "x86_64",
"target_arch": "x86_64"
}
}
Also
mongosh --version
↓output
1.2.2
After the two commands, I ran below and typed the password.
mongosh "mongodb+srv://cluster0.8tjjn.mongodb.net/myFirstDatabase" --apiVersion 1 --username mongo
The YouTuber explained how to connect it in a straightforward way, so I am guessing if my mac air has a problem in it such as the too old version. I still use macOS Mojave 10.14.6 causing some installation problems so far. I can't install a newer OS due to the lack of storage. It has 128GB and most of it is accounted for systems. I sometimes need to restart it when it's slow and have been thinking to buy a new one.
Thanks a lot in advance:)