Skip to content
This repository has been archived by the owner on Dec 20, 2023. It is now read-only.
/ shell-to-url Public archive

Converts a shell connection string (from Atlas) to a MongoDB URL.

License

Notifications You must be signed in to change notification settings

mongodb-js/shell-to-url

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mongodb-shell-to-url travis npm

Converts a shell connection string (from Atlas) to a MongoDB URL.

Example

var shellToUrl = require('mongodb-shell-to-url');
var connectionString = 'mongo "mongodb://localhost:27017?replicaSet=MyCluster" --ssl --username hans';

console.log(shellToUrl(connectionString));
// logs "mongodb://hans:PASSWORD@localhost:27017?ssl=true&replicaSet=MyCluster&authSource=admin"

Known Limitations

  • requires a MongoDB URI in double-quotes
  • does not support --hostname, --port yet
  • ignores password and hard-codes to PASSWORD for security reasons
  • only works if the original MongoDB URL contains a ?, sorry :-)

License

Apache 2.0

About

Converts a shell connection string (from Atlas) to a MongoDB URL.

Resources

License

Stars

Watchers

Forks

Packages

No packages published