mongodb-shell-to-url

0.1.0 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i mongodb-shell-to-url

Weekly Downloads

2

Version

0.1.0

License

Apache-2.0

Last publish

Collaborators

  • orechova
  • himanshusinghs
  • c-buckingham
  • mongo-j
  • mabaasit
  • alexander_schroll
  • chuck.kalmanek
  • mongodb-js-user
  • rueckstiess
  • durran
  • lerouxb
  • fredtruman
  • mbroadst
  • hswolff
  • satyasinha
  • matt_d_rat
  • rhysm
  • tomhollander
  • alena.khineika
  • jeff-allen-mongo
  • mmarcon
  • jonathan.balsano
  • mongodb-build
  • jack.weir
  • stennie
  • mcasimir
  • kristina.stefano
  • jarjee
  • shaketbaby
  • devtoolsbot
  • addaleax
  • gribnoysup
  • mutukrish