wget https://downloads.mongodb.com/compass/mongodb-mongosh_2.2.0_amd64.deb
General syntax to connect to remote mongdb instance is mongosh "mongodb+srv://mongo-server-ip/myFirstDatabase" --apiVersion 1
# Bydefault mongosh connects to mongodb+srv://localhost:27017/test
mongosh
test> show dbs
In MongoDB, you don't directly create a database in the same way you do in relational databases like MySQL. Instead, MongoDB creates databases and collections on the fly when you first store data into them. However, you can switch to a specific database or create one by storing data into it. Here's how you can do it in the mongosh shell:
for e.g. if you run below command, mongodb will create the database test2 for you
test> use test2
switched to db test2
test2>