Not able to connect to Atlas cluster - gives connection closed error

Please enter a MongoDB connection string (Default: mongodb://localhost/): mongodb://cluster0-shard-00-00-jxeqq.mongodb.net:27017,cluster0-shard-00-01-jxeqq.mongodb.net:27017,cluster0-shard-00-02-jxeqq.mongodb.net:27017/aggregations?replicaSet=Cluster0-shard-0 --authenticationDatabase admin --ssl -u m121 -p aggregations --norc
Please enter a MongoDB connection string (Default: mongodb://localhost/): mongodb://cluster0-shard-00-00-jxeqq.mongodb.net:27017,cluster0-shard-00-01-jxeqq.mongodb.net:27017,cluster0-shard-00-02-jxeqq.mongodb.net:27017/aggregations?replicaSet=Cluster0-shard-0 --authenticationDatabase admin --ssl -u m121 -p aggregations --norc
Current Mongosh Log ID: 6240f0800e8c107a6d333ac0
Connecting to: mongodb://cluster0-shard-00-00-jxeqq.mongodb.net:27017,cluster0-shard-00-01-jxeqq.mongodb.net:27017,cluster0-shard-00-02-jxeqq.mongodb.net:27017/aggregations?replicaSet=Cluster0-shard-0+--authenticationDatabase+admin+--ssl+-u+m121+-p+aggregations+--norc&appName=mongosh+1.2.2
MongoServerSelectionError: connection to 34.195.121.130:27017 closed
Press any key to exit:

Are yu trying this in IDE or your localhost?
You have to run the connect string with mongo or mongosh

I can connect

C:\Users\xyz>mongo mongodb://cluster0-shard-0…
connecting to: mongodb://cluster0-shard-00-00-jxeqq.mongodb.net:27017,cluster0-shard-00-01-jxeqq.mongodb.net:27017,clust
er0-shard-00-02-jxeqq.mongodb.net:27017/aggregations?authSource=admin&gssapiServiceName=mongodb&replicaSet=Cluster0-shar
d-0
MongoDB Enterprise Cluster0-shard-0:PRIMARY> db
aggregations