mongodb-shell-to-url
Converts a shell connection string (from Atlas) to a MongoDB URL.
Last updated 4 years ago by rueckstiess .
Apache-2.0 · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install mongodb-shell-to-url 
SYNC missed versions from official npm registry.

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

Current Tags

  • 0.1.0                                ...           latest (4 years ago)

1 Versions

  • 0.1.0                                ...           4 years ago

Copyright 2014 - 2016 © taobao.org |