mongodb compass get connection string code example
Example 1: mongodb local connection string
mongodb://localhost:27017/mydbname
Example 2: connection string mongodb with user
MongoClient.connect('mongodb://admin:password@localhost:27017/db', function (err, db) {