{"_id":"mongodb-connection-model","_rev":"458-d9e5b5d8a2794d515d249214fac49e3e","name":"mongodb-connection-model","dist-tags":{"experimental":"0.0.0-experimental-1c53312ce4905234885618d41ae95fde9c21aa18","latest":"22.4.1","next":"0.0.0-next-5bb899576d8b95cb24b170e4fb80a7a4cc89beac"},"versions":{"0.0.1":{"name":"mongodb-connection-model","version":"0.0.1","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@0.0.1","maintainers":[{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"}],"homepage":"https://github.com/mongodb-js/mongodb-connection-model","bugs":{"url":"https://github.com/mongodb-js/mongodb-connection-model/issues"},"dist":{"shasum":"1788295a18862427f7d763f3ce736d6ec7d38a6c","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-0.0.1.tgz","integrity":"sha512-fjeyBfLDNVhUuzC0MOduXii70k4DN1q+2ZwGZWX3E+/XUc57AjvzIiNF4GgkkgnC4imGet7y2DSuArv9c/i04w==","signatures":[{"sig":"MEQCID0v77dAf1KI/n8AlkysUD4DlmaqVprYGJ3+BtyfQo/ZAiB10sHZHS8FhXi1kkB6XbhuvdAWWydKzJ4OPOcV37a1+Q==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"_from":".","_shasum":"1788295a18862427f7d763f3ce736d6ec7d38a6c","gitHead":"1ddee78c17d54bcc1ddb0a4340457e20f5415ec5","scripts":{"ci":"mocha","test":"mocha","check":"mongodb-js-precommit"},"_npmUser":{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},"precommit":["check","test"],"repository":{"url":"git://github.com/mongodb-js/mongodb-connection-model.git","type":"git"},"_npmVersion":"3.3.2","description":"MongoDB connection model.","directories":{},"_nodeVersion":"0.12.7","dependencies":{"ampersand-model":"^5.0.3","ampersand-rest-collection":"^4.0.0"},"devDependencies":{"mocha":"^2.2.5","pre-commit":"^1.1.1","mongodb-js-precommit":"^0.1.4","eslint-config-mongodb-js":"^0.1.5"}},"0.0.2":{"name":"mongodb-connection-model","version":"0.0.2","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@0.0.2","maintainers":[{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"mongodb-js","email":"lucas.hrabovsky+mongodb-js@10gen.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"}],"homepage":"https://github.com/mongodb-js/mongodb-connection-model","bugs":{"url":"https://github.com/mongodb-js/mongodb-connection-model/issues"},"dist":{"shasum":"ec2e477f3f8a96549c8c7da18d35e61f4b77ce14","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-0.0.2.tgz","integrity":"sha512-MQOBtKLV2S+2Asjtirgokwe2CT4xK/1p9VX2F79pZiBPDYBInpdweBfmI11TZNLVjR9abTgXsOJIY3hn0nsXGQ==","signatures":[{"sig":"MEYCIQCv8Qk1tscn05aEkxU/5nC/GJPg0diLjJOOl6vTS64ZIQIhAIFmO2QI85H1TQ31pZ+I1P4w6H54Bhf59OcAUXNXgshd","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"_from":".","_shasum":"ec2e477f3f8a96549c8c7da18d35e61f4b77ce14","gitHead":"83ca8c44bad6018022b09a4e5f313c6a5381bd2f","scripts":{"ci":"mocha","test":"mocha","check":"mongodb-js-precommit"},"_npmUser":{"name":"rueckstiess","email":"thomas@rueckstiess.net"},"precommit":["check","test"],"repository":{"url":"git://github.com/mongodb-js/mongodb-connection-model.git","type":"git"},"_npmVersion":"3.3.1","description":"MongoDB connection model.","directories":{},"_nodeVersion":"0.12.7","dependencies":{"ampersand-model":"^5.0.3","ampersand-rest-collection":"^4.0.0"},"devDependencies":{"mocha":"^2.2.5","pre-commit":"^1.1.1","mongodb-js-precommit":"^0.1.4","eslint-config-mongodb-js":"^0.1.5"}},"0.0.3":{"name":"mongodb-connection-model","version":"0.0.3","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@0.0.3","maintainers":[{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"mongodb-js","email":"lucas.hrabovsky+mongodb-js@10gen.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"}],"homepage":"https://github.com/mongodb-js/mongodb-connection-model","bugs":{"url":"https://github.com/mongodb-js/mongodb-connection-model/issues"},"dist":{"shasum":"8ef12a26d53e108ca5cb44aba169d5b28955782c","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-0.0.3.tgz","integrity":"sha512-mqd0LTeQDJj7mknkM4o/9PHcb40H7PQT9aoXY2rYpjoboFwaCvZolZDMS9eXnTgIBjb97J88pSADUwNke6I6og==","signatures":[{"sig":"MEQCIBv159AM0yIxFZZBzf/9VKMeEKfKCN5DK4JObhehPvJVAiAzAoJLHgB6DbMgTFmXovS8+xKFYQS5BkKfhMsRZmmCvQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"_from":".","_shasum":"8ef12a26d53e108ca5cb44aba169d5b28955782c","gitHead":"494007cae7ad10b9f1ced647e875dcff1a52f763","scripts":{"ci":"mocha","test":"mocha","check":"mongodb-js-precommit"},"_npmUser":{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},"precommit":["check","test"],"repository":{"url":"git://github.com/mongodb-js/mongodb-connection-model.git","type":"git"},"_npmVersion":"3.3.2","description":"MongoDB connection model.","directories":{},"_nodeVersion":"0.12.7","dependencies":{"ampersand-model":"^5.0.3","ampersand-rest-collection":"^4.0.0"},"devDependencies":{"mocha":"^2.2.5","pre-commit":"^1.1.1","mongodb-js-precommit":"^0.1.4","eslint-config-mongodb-js":"^0.1.5"}},"1.0.0":{"name":"mongodb-connection-model","version":"1.0.0","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@1.0.0","maintainers":[{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"mongodb-js","email":"lucas.hrabovsky+mongodb-js@10gen.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"}],"homepage":"https://github.com/mongodb-js/mongodb-connection-model","bugs":{"url":"https://github.com/mongodb-js/mongodb-connection-model/issues"},"dist":{"shasum":"afe74586fb3561d7791f7b9fcf058bb4c3075813","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-1.0.0.tgz","integrity":"sha512-nWKQsUHsVtdoFFy7sLqsLJPZb2kEFVrEcN4b2m9341T80Sj0EQbeU9aNJuzvtaJYnOmofJNYNdAFezwXrXumow==","signatures":[{"sig":"MEQCIA5OZ9Jkm353FXHefzYT9uIhC5kCQUpcQ0vjUZ88FbpQAiBDIQW4lcd3BD3aMFoMtivzNkZh1JhAw2VkTD2BpGHdPA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"_from":".","_shasum":"afe74586fb3561d7791f7b9fcf058bb4c3075813","gitHead":"0eb378936831be2649bcb8ff6fd5592ec548dd50","scripts":{"ci":"npm run check && npm test","test":"mocha","check":"mongodb-js-precommit"},"_npmUser":{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},"precommit":["check"],"repository":{"url":"git://github.com/mongodb-js/mongodb-connection-model.git","type":"git"},"_npmVersion":"3.3.1","description":"MongoDB connection model.","directories":{},"_nodeVersion":"0.12.7","dependencies":{"debug":"^2.2.0","lodash.omit":"^3.1.0","lodash.pick":"^3.1.0","mongodb-url":"^1.0.0","lodash.assign":"^3.2.0","ampersand-model":"^6.0.2","lodash.contains":"^2.4.3","ampersand-rest-collection":"^5.0.0"},"devDependencies":{"mocha":"^2.3.3","pre-commit":"^1.1.1","mongodb-js-precommit":"^0.2.2","eslint-config-mongodb-js":"^0.1.6"}},"1.0.1":{"name":"mongodb-connection-model","version":"1.0.1","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@1.0.1","maintainers":[{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"mongodb-js","email":"lucas.hrabovsky+mongodb-js@10gen.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"}],"homepage":"https://github.com/mongodb-js/mongodb-connection-model","bugs":{"url":"https://github.com/mongodb-js/mongodb-connection-model/issues"},"dist":{"shasum":"75e65264eab0c788f07736faa888cda388081244","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-1.0.1.tgz","integrity":"sha512-dv5+RrnRICv0mjxfzDCN3qS4CtslbRfmuUyIHghJIivtQq3Y9tQWka7ArhlBhnlPQuDgRp980s9dJ9i+t34XOQ==","signatures":[{"sig":"MEUCID2JqhvuQ25pLdUHFGJ7raJNTteofgH8yoaOsF7IuIWHAiEAlrxAFpaUD4GmmWmPQLIDLymkK2bIjmUTLEZ9LYA32uY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"_from":".","_shasum":"75e65264eab0c788f07736faa888cda388081244","gitHead":"eda26920261b7036dab065c61f0781e5d95c1962","scripts":{"ci":"npm run check && npm test","test":"mocha","check":"mongodb-js-precommit"},"_npmUser":{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},"precommit":["check"],"repository":{"url":"git://github.com/mongodb-js/mongodb-connection-model.git","type":"git"},"_npmVersion":"3.3.1","description":"MongoDB connection model.","directories":{},"_nodeVersion":"0.12.7","dependencies":{"debug":"^2.2.0","lodash.omit":"^3.1.0","lodash.pick":"^3.1.0","mongodb-url":"^1.0.0","lodash.assign":"^3.2.0","ampersand-model":"^6.0.2","lodash.contains":"^2.4.3","ampersand-rest-collection":"^5.0.0"},"devDependencies":{"mocha":"^2.3.3","pre-commit":"^1.1.1","mongodb-js-precommit":"^0.2.2","eslint-config-mongodb-js":"^0.1.6"}},"1.0.2":{"name":"mongodb-connection-model","version":"1.0.2","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@1.0.2","maintainers":[{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"mongodb-js","email":"lucas.hrabovsky+mongodb-js@10gen.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"}],"homepage":"https://github.com/mongodb-js/mongodb-connection-model","bugs":{"url":"https://github.com/mongodb-js/mongodb-connection-model/issues"},"dist":{"shasum":"717e4a87f15dcbf70839adfbf52180f76d047a25","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-1.0.2.tgz","integrity":"sha512-YRCGg1EDSvIQsSOxJYJ+dPAOGRxx94Rwslzzvo5G3xCq79BWgEFOKZvj2Owpmvn3dwC2iuzJenqKBoG29bKgtQ==","signatures":[{"sig":"MEYCIQDV/fWwuSzV5DkZQJ+LfI9jL4zeUbxJQcU5B6f2gsS2BQIhAIVSxDV1CqhSgG5DoDx2jM/eg1UhrJmPwnKARz4YQ2FN","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"_from":".","_shasum":"717e4a87f15dcbf70839adfbf52180f76d047a25","gitHead":"ceb7f1b6b60d45c8fa25d04c98425452beb14113","scripts":{"ci":"npm run check && npm test","test":"mocha","check":"mongodb-js-precommit"},"_npmUser":{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},"precommit":["check"],"repository":{"url":"git://github.com/mongodb-js/mongodb-connection-model.git","type":"git"},"_npmVersion":"3.3.1","description":"MongoDB connection model.","directories":{},"_nodeVersion":"2.3.4","dependencies":{"debug":"^2.2.0","lodash.omit":"^3.1.0","lodash.pick":"^3.1.0","mongodb-url":"^1.0.0","lodash.assign":"^3.2.0","ampersand-model":"^6.0.2","lodash.contains":"^2.4.3","ampersand-rest-collection":"^5.0.0"},"devDependencies":{"mocha":"^2.3.3","pre-commit":"^1.1.1","mongodb-js-precommit":"^0.2.2","eslint-config-mongodb-js":"^0.1.6"}},"2.0.0":{"name":"mongodb-connection-model","version":"2.0.0","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@2.0.0","maintainers":[{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"mongodb-js","email":"lucas.hrabovsky+mongodb-js@10gen.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"}],"homepage":"https://github.com/mongodb-js/mongodb-connection-model","bugs":{"url":"https://github.com/mongodb-js/mongodb-connection-model/issues"},"dist":{"shasum":"7ab7deaadfb935c049e5f4d8303dd0e5d0225d7a","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-2.0.0.tgz","integrity":"sha512-Dm4ptGwEKVh3iKmlk5W4zzgcfQUiHi/TCdLUX3cZqnNYUS/LCsmgPNDcP3OmzQGlmATfpC2WjILq/pK96XEjvg==","signatures":[{"sig":"MEUCIQCB8gqYjA8tT4T9iySaB6sezoh7mhgTZ1K0sl+uuSn+4QIgf3dA+Yuhe8aBIkWpwaKnf008Zv4nXe03VeH0a82l4YM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"_from":".","_shasum":"7ab7deaadfb935c049e5f4d8303dd0e5d0225d7a","gitHead":"b533d9b39cbda7a65ea8085e650470d4ab45eeb5","scripts":{"ci":"npm run check && npm test","fmt":"mongodb-js-fmt ./*.js ./test/*.js","test":"mocha","check":"mongodb-js-precommit"},"_npmUser":{"name":"imlucas","email":"lucas.hrabovsky+mongodb-js@10gen.com"},"precommit":["check"],"repository":{"url":"git+https://github.com/mongodb-js/mongodb-connection-model.git","type":"git"},"_npmVersion":"3.3.8","description":"MongoDB connection model.","directories":{},"_nodeVersion":"4.2.1","dependencies":{"debug":"^2.2.0","lodash.omit":"^3.1.0","lodash.pick":"^3.1.0","mongodb-url":"^1.0.0","lodash.assign":"^3.2.0","ampersand-model":"^6.0.2","lodash.contains":"^2.4.3","lodash.defaults":"^3.1.2","ampersand-rest-collection":"^5.0.0"},"devDependencies":{"mocha":"^2.3.3","pre-commit":"^1.1.2","mongodb-js-fmt":"0.0.3","mongodb-js-precommit":"^0.2.2","eslint-config-mongodb-js":"^1.0.3"}},"2.0.1":{"name":"mongodb-connection-model","version":"2.0.1","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@2.0.1","maintainers":[{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"mongodb-js","email":"lucas.hrabovsky+mongodb-js@10gen.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"}],"homepage":"https://github.com/mongodb-js/mongodb-connection-model","bugs":{"url":"https://github.com/mongodb-js/mongodb-connection-model/issues"},"dist":{"shasum":"08f844393815860d49dfad5e834a0f134f0e84f9","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-2.0.1.tgz","integrity":"sha512-KgSGjMmTwjkWOdsqgmLQWzSHHo0f5bpFXD7bdEUor9lyvI7cMQThcAWycB9B3q1HpdjrnWRkg2FQXWwJuZPkfw==","signatures":[{"sig":"MEQCIDFxQqBMeQpkzPtYB7vZ2NHcOu4oxdKxp4aJGvLIp2PoAiApnRyTyBix20GBXM9OwR2EEYmy+gHWHQZk7WMWYsbzUg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"_from":".","_shasum":"08f844393815860d49dfad5e834a0f134f0e84f9","gitHead":"64070c01327dd75ec9fc3545cdc04df730c20ccf","scripts":{"ci":"npm run check && npm test","fmt":"mongodb-js-fmt ./*.js ./test/*.js","test":"mocha","check":"mongodb-js-precommit"},"_npmUser":{"name":"imlucas","email":"lucas.hrabovsky+mongodb-js@10gen.com"},"precommit":["check"],"repository":{"url":"git+https://github.com/mongodb-js/mongodb-connection-model.git","type":"git"},"_npmVersion":"3.3.8","description":"MongoDB connection model.","directories":{},"_nodeVersion":"4.2.1","dependencies":{"debug":"^2.2.0","lodash.omit":"^3.1.0","lodash.pick":"^3.1.0","mongodb-url":"^1.0.0","lodash.assign":"^3.2.0","ampersand-model":"^6.0.2","lodash.contains":"^2.4.3","lodash.defaults":"^3.1.2","ampersand-rest-collection":"^5.0.0"},"devDependencies":{"mocha":"^2.3.3","pre-commit":"^1.1.2","mongodb-js-fmt":"0.0.3","mongodb-js-precommit":"^0.2.2","eslint-config-mongodb-js":"^1.0.3"}},"3.0.0":{"name":"mongodb-connection-model","version":"3.0.0","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@3.0.0","maintainers":[{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"mongodb-js","email":"lucas.hrabovsky+mongodb-js@10gen.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"}],"homepage":"https://github.com/mongodb-js/mongodb-connection-model","bugs":{"url":"https://github.com/mongodb-js/mongodb-connection-model/issues"},"dist":{"shasum":"d035143e3e60569551b43c691a6764e8c6d94eb1","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-3.0.0.tgz","integrity":"sha512-BLcEOsMTAir3H85r8C8ZXMCPsIGzUlwidF2Yi72oD+DJQVhJ3c9cs714zCj4sybrSl1HB0S27TKfaSnJ2rKQZQ==","signatures":[{"sig":"MEYCIQDRaI0jgVeaOXTmgpIMjJ8DazrZXslMupemBZ02dMV4BwIhAMxArCr9J8KQpkse0ZTZbQDoUJh6ldYb3Y2cmeOoZ5d3","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"_from":".","_shasum":"d035143e3e60569551b43c691a6764e8c6d94eb1","browser":"browser.js","gitHead":"184e30473f79e3296f4af5420ddc53bc7c7fe07e","scripts":{"ci":"npm run check && npm test","fmt":"mongodb-js-fmt ./*.js ./test/*.js","test":"mocha","check":"mongodb-js-precommit"},"_npmUser":{"name":"imlucas","email":"lucas.hrabovsky+mongodb-js@10gen.com"},"precommit":["check"],"repository":{"url":"git+https://github.com/mongodb-js/mongodb-connection-model.git","type":"git"},"_npmVersion":"3.3.8","description":"MongoDB connection model.","directories":{},"_nodeVersion":"4.2.1","dependencies":{"debug":"^2.2.0","backoff":"^2.4.1","mongodb":"^2.0.46","lodash.omit":"^3.1.0","lodash.pick":"^3.1.0","mongodb-url":"^1.0.0","run-parallel":"^1.1.4","lodash.assign":"^3.2.0","ampersand-model":"^6.0.2","lodash.contains":"^2.4.3","lodash.defaults":"^3.1.2","ampersand-rest-collection":"^5.0.0"},"devDependencies":{"mocha":"^2.3.3","pre-commit":"^1.1.2","mongodb-js-fmt":"^0.0.3","mongodb-js-precommit":"^0.2.2","eslint-config-mongodb-js":"^1.0.3","mongodb-connection-fixture":"^0.0.3"},"optionalDependencies":{"backoff":"^2.4.1","mongodb":"^2.0.46"}},"3.0.1":{"name":"mongodb-connection-model","version":"3.0.1","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@3.0.1","maintainers":[{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"mongodb-js","email":"lucas.hrabovsky+mongodb-js@10gen.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"}],"homepage":"https://github.com/mongodb-js/mongodb-connection-model","bugs":{"url":"https://github.com/mongodb-js/mongodb-connection-model/issues"},"dist":{"shasum":"f2a264ee087deecaa11ddb39a36967a5701247c5","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-3.0.1.tgz","integrity":"sha512-J0iMMKy7jfZK0QOD1211Tnon7J+x1MsZr1mA66Y1a+AGFS1WSixRpNgiGlrudk4yTRKz4VXYEXPRoB+ONfaWKA==","signatures":[{"sig":"MEUCIAwTBkZUyoUC2qc91ZkC+zZH9t5DmwzyMxmr0B3gbT1+AiEAtyfK/WUcCg036UfUilaFPSnM8fC/DT03j/lWiJ3TYfA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"_from":".","_shasum":"f2a264ee087deecaa11ddb39a36967a5701247c5","browser":"browser.js","gitHead":"f279b1f76bbfeddc0667b6275f3dd8ba521ae68a","scripts":{"ci":"npm run check && npm test","fmt":"mongodb-js-fmt ./*.js ./test/*.js","test":"mocha","check":"mongodb-js-precommit"},"_npmUser":{"name":"imlucas","email":"lucas.hrabovsky+mongodb-js@10gen.com"},"precommit":["check"],"repository":{"url":"git+https://github.com/mongodb-js/mongodb-connection-model.git","type":"git"},"_npmVersion":"3.3.8","description":"MongoDB connection model.","directories":{},"_nodeVersion":"4.2.1","dependencies":{"debug":"^2.2.0","backoff":"^2.4.1","mongodb":"^2.0.46","lodash.omit":"^3.1.0","lodash.pick":"^3.1.0","mongodb-url":"^1.0.1","run-parallel":"^1.1.4","lodash.assign":"^3.2.0","ampersand-model":"^6.0.2","lodash.contains":"^2.4.3","lodash.defaults":"^3.1.2","ampersand-rest-collection":"^5.0.0"},"devDependencies":{"mocha":"^2.3.3","pre-commit":"^1.1.2","mongodb-js-fmt":"^0.0.3","mongodb-js-precommit":"^0.2.2","eslint-config-mongodb-js":"^1.0.4","mongodb-connection-fixture":"^0.0.3"},"optionalDependencies":{"backoff":"^2.4.1","mongodb":"^2.0.46"}},"3.0.2":{"name":"mongodb-connection-model","version":"3.0.2","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@3.0.2","maintainers":[{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"mongodb-js","email":"lucas.hrabovsky+mongodb-js@10gen.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"}],"homepage":"https://github.com/mongodb-js/mongodb-connection-model","bugs":{"url":"https://github.com/mongodb-js/mongodb-connection-model/issues"},"dist":{"shasum":"f7c48bd505244167c51a34fbb96b5ccf97c7218a","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-3.0.2.tgz","integrity":"sha512-83TLfx9fgMrN4L06QYW7b9dDR2pgCoMaJrd4O4cFAA0hnIHVcflxFQJBScI8g3g3xJ1tGcyneo0M78naKexU1g==","signatures":[{"sig":"MEQCIAEzXzzFO1suh155fCjQeqsmT8u3ivYAk720HQeAV7CCAiB8oMBTfByVgeyhlt8Pgm1N4qj20UJeoigcFA580JWpmQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"_from":".","_shasum":"f7c48bd505244167c51a34fbb96b5ccf97c7218a","browser":"browser.js","gitHead":"1f958702822d30bd75d2d25f14f9b091e48e2d2c","scripts":{"ci":"npm run check && npm test","fmt":"mongodb-js-fmt ./*.js ./test/*.js","test":"mocha","check":"mongodb-js-precommit"},"_npmUser":{"name":"imlucas","email":"lucas.hrabovsky+mongodb-js@10gen.com"},"precommit":["check"],"repository":{"url":"git+https://github.com/mongodb-js/mongodb-connection-model.git","type":"git"},"_npmVersion":"3.3.8","description":"MongoDB connection model.","directories":{},"_nodeVersion":"4.2.1","dependencies":{"debug":"^2.2.0","backoff":"^2.4.1","mongodb":"^2.0.46","mongodb-url":"^1.0.1","run-parallel":"^1.1.4","lodash.assign":"^3.2.0","ampersand-model":"^6.0.2","lodash.contains":"^2.4.3","lodash.defaults":"^3.1.2","ampersand-rest-collection":"^5.0.0"},"devDependencies":{"mocha":"^2.3.3","pre-commit":"^1.1.2","mongodb-js-fmt":"^0.0.3","mongodb-js-precommit":"^0.2.2","eslint-config-mongodb-js":"^1.0.4","mongodb-connection-fixture":"^0.0.4"},"optionalDependencies":{"backoff":"^2.4.1","mongodb":"^2.0.46"}},"3.0.3":{"name":"mongodb-connection-model","version":"3.0.3","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@3.0.3","maintainers":[{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"mongodb-js","email":"lucas.hrabovsky+mongodb-js@10gen.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"}],"homepage":"https://github.com/mongodb-js/mongodb-connection-model","bugs":{"url":"https://github.com/mongodb-js/mongodb-connection-model/issues"},"dist":{"shasum":"7100a1de81c3213c0a84ce79cb5329f614460ec8","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-3.0.3.tgz","integrity":"sha512-jebDuN0RcYR3XBKNUK4/Qp4JRjbUMqywLHa9ay5NZIO2nQBVQE8xxto8uazRKLygU+ROjeeHWRtZjr5tRx02UQ==","signatures":[{"sig":"MEUCIQD9FBoLAZudJoFa2/2g+LZ6uWfzOeFyZ48yLveO3UCeGQIgOH/8Kd4RxSnejaVoQd18+vUooJIUKcJpVey7lLzCWNY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"_from":".","_shasum":"7100a1de81c3213c0a84ce79cb5329f614460ec8","browser":"browser.js","gitHead":"7241705a91542767706d1b4fdd43950851cbc9b2","scripts":{"ci":"npm run check && npm test","fmt":"mongodb-js-fmt ./*.js ./test/*.js","test":"mocha","check":"mongodb-js-precommit"},"_npmUser":{"name":"imlucas","email":"lucas.hrabovsky+mongodb-js@10gen.com"},"precommit":["check"],"repository":{"url":"git+https://github.com/mongodb-js/mongodb-connection-model.git","type":"git"},"_npmVersion":"3.3.8","description":"MongoDB connection model.","directories":{},"_nodeVersion":"4.2.1","dependencies":{"debug":"^2.2.0","backoff":"^2.4.1","mongodb":"^2.0.47","mongodb-url":"^1.0.1","run-parallel":"^1.1.4","lodash.assign":"^3.2.0","ampersand-model":"^6.0.2","lodash.contains":"^2.4.3","lodash.defaults":"^3.1.2","ampersand-rest-collection":"^5.0.0"},"devDependencies":{"mocha":"^2.3.3","pre-commit":"^1.1.2","mongodb-js-fmt":"^0.0.3","mongodb-js-precommit":"^0.2.2","eslint-config-mongodb-js":"^1.0.4","mongodb-connection-fixture":"^0.0.4"},"optionalDependencies":{"backoff":"^2.4.1","mongodb":"^2.0.47"}},"3.0.4":{"name":"mongodb-connection-model","version":"3.0.4","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@3.0.4","maintainers":[{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"mongodb-js","email":"lucas.hrabovsky+mongodb-js@10gen.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"}],"homepage":"https://github.com/mongodb-js/mongodb-connection-model","bugs":{"url":"https://github.com/mongodb-js/mongodb-connection-model/issues"},"dist":{"shasum":"cbe4d9207ee287dcaf5a29a20f9431c675729ff1","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-3.0.4.tgz","integrity":"sha512-Ct+/4dwvi8oVPegRCN3wlr6dE9IXpwce1jKmPfJnDnvhYvgmtSxQ4+nLZRLlKJ50CKjH7urz4PobPEHgJWbOmQ==","signatures":[{"sig":"MEUCIDmdrGn+vvBPSDDhhlcanvHCcSt0sXmKI2yKa5aY4PqdAiEAs9TRnhScCvl79/45b4tan0vnekZ6VU3LNYTt0lwfYI0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"_from":".","_shasum":"cbe4d9207ee287dcaf5a29a20f9431c675729ff1","browser":"browser.js","gitHead":"e3ac1c8f35e77621889b04f23b5c6bcd172a9a4e","scripts":{"ci":"npm run check && npm test","fmt":"mongodb-js-fmt ./*.js ./test/*.js","test":"mocha","check":"mongodb-js-precommit"},"_npmUser":{"name":"imlucas","email":"lucas.hrabovsky+mongodb-js@10gen.com"},"precommit":["check"],"repository":{"url":"git+https://github.com/mongodb-js/mongodb-connection-model.git","type":"git"},"_npmVersion":"3.3.8","description":"MongoDB connection model.","directories":{},"_nodeVersion":"4.2.1","dependencies":{"debug":"^2.2.0","backoff":"^2.4.1","mongodb":"^2.0.47","mongodb-url":"^1.0.1","run-parallel":"^1.1.4","lodash.assign":"^3.2.0","ampersand-model":"^6.0.2","lodash.contains":"^2.4.3","lodash.defaults":"^3.1.2","ampersand-rest-collection":"^5.0.0"},"devDependencies":{"mocha":"^2.3.3","pre-commit":"^1.1.2","mongodb-js-fmt":"^0.0.3","mongodb-js-precommit":"^0.2.2","eslint-config-mongodb-js":"^1.0.4","mongodb-connection-fixture":"^0.0.4"},"optionalDependencies":{"backoff":"^2.4.1","mongodb":"^2.0.47"}},"3.0.5":{"name":"mongodb-connection-model","version":"3.0.5","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@3.0.5","maintainers":[{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"mongodb-js","email":"lucas.hrabovsky+mongodb-js@10gen.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"}],"homepage":"https://github.com/mongodb-js/mongodb-connection-model","bugs":{"url":"https://github.com/mongodb-js/mongodb-connection-model/issues"},"//":"deps only used for server marked optional so we can use same model w/ browserify.","dist":{"shasum":"7bb93814931f3c7022b1afb4434cf9cf507dd4f2","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-3.0.5.tgz","integrity":"sha512-HJh/ujmuZQtXZYaVBULMsn2jYj9CnzswRkEUNLxAaW80CJ/XyPZpTE9z+IQ+r6LQAegpN/sYpJxl9Poo40zJyw==","signatures":[{"sig":"MEUCIEADlAMF+ElaEetiox+6WtrCDofKD3q31636qrZhhHVAAiEAu6g1pDu7YQ4y4N4xFW9unydqFl47lYiqjfXcIxGwCyM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"_from":".","_shasum":"7bb93814931f3c7022b1afb4434cf9cf507dd4f2","browser":"browser.js","gitHead":"ff227c27a7bb28e9672aa3957ccd8d6d4e4ee946","scripts":{"ci":"npm run check && npm test","fmt":"mongodb-js-fmt ./*.js ./test/*.js","test":"mocha","check":"mongodb-js-precommit"},"_npmUser":{"name":"imlucas","email":"lucas.hrabovsky+mongodb-js@10gen.com"},"precommit":["check"],"repository":{"url":"git+https://github.com/mongodb-js/mongodb-connection-model.git","type":"git"},"_npmVersion":"3.3.8","description":"MongoDB connection model.","directories":{},"_nodeVersion":"4.2.1","dependencies":{"debug":"^2.2.0","backoff":"^2.4.1","mongodb":"^2.0.47","run-series":"^1.1.4","mongodb-url":"^1.0.1","run-parallel":"^1.1.4","lodash.assign":"^3.2.0","ampersand-model":"^6.0.2","lodash.contains":"^2.4.3","lodash.defaults":"^3.1.2","ampersand-rest-collection":"^5.0.0"},"devDependencies":{"mocha":"^2.3.3","mongodb-ns":"^1.0.0","pre-commit":"^1.1.2","mongodb-js-fmt":"^0.0.3","mongodb-runner":"^3.1.12","is-mongodb-running":"0.0.1","mongodb-js-precommit":"^0.2.2","mongodb-read-preference":"^1.0.4","eslint-config-mongodb-js":"^1.0.4","mongodb-connection-fixture":"^0.0.6"},"optionalDependencies":{"backoff":"^2.4.1","mongodb":"^2.0.47","run-series":"^1.1.4","run-parallel":"^1.1.4"}},"3.0.6":{"name":"mongodb-connection-model","version":"3.0.6","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@3.0.6","maintainers":[{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"mongodb-js","email":"lucas.hrabovsky+mongodb-js@10gen.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"}],"homepage":"https://github.com/mongodb-js/mongodb-connection-model","bugs":{"url":"https://github.com/mongodb-js/mongodb-connection-model/issues"},"//":"deps only used for server marked optional so we can use same model w/ browserify.","dist":{"shasum":"bb938b81d3c48fa43311381a6c993f9d762a25f1","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-3.0.6.tgz","integrity":"sha512-AeRYdPlw1e8VLSUbHML8f3GIg+eJnwtbdXUSXIEL3Xm4rLLXLWg9cKWHFoe0y+4weD9ZH4mjQJduNVxwpSefQw==","signatures":[{"sig":"MEQCIGyG79GdbcGPVvdumGyAG22uWDNAnhg7t4IYfbfrv4sYAiATe1qiyCzM1cvKHirUnj4k1X2HIPQXP6buXPI179/pCA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"_from":".","_shasum":"bb938b81d3c48fa43311381a6c993f9d762a25f1","browser":"browser.js","gitHead":"117e2d4ff6db705c68765609d4c75b8f8982992d","scripts":{"ci":"npm run check && npm test","fmt":"mongodb-js-fmt ./*.js ./test/*.js","test":"mocha","check":"mongodb-js-precommit"},"_npmUser":{"name":"imlucas","email":"lucas.hrabovsky+mongodb-js@10gen.com"},"precommit":["check"],"repository":{"url":"git+https://github.com/mongodb-js/mongodb-connection-model.git","type":"git"},"_npmVersion":"3.3.8","description":"MongoDB connection model.","directories":{},"_nodeVersion":"4.2.1","dependencies":{"debug":"^2.2.0","backoff":"^2.4.1","mongodb":"^2.0.47","run-series":"^1.1.4","mongodb-url":"^1.0.1","lodash.clone":"^3.0.3","run-parallel":"^1.1.4","lodash.assign":"^3.2.0","ampersand-model":"^6.0.2","lodash.contains":"^2.4.3","lodash.defaults":"^3.1.2","ampersand-rest-collection":"^5.0.0"},"devDependencies":{"mocha":"^2.3.3","mongodb-ns":"^1.0.0","pre-commit":"^1.1.2","mongodb-js-fmt":"^0.0.3","mongodb-runner":"^3.1.13","mongodb-js-precommit":"^0.2.2","mongodb-instance-model":"^1.0.1","eslint-config-mongodb-js":"^1.0.4","mongodb-connection-fixture":"^0.0.9"},"optionalDependencies":{"backoff":"^2.4.1","mongodb":"^2.0.47","run-series":"^1.1.4","run-parallel":"^1.1.4"}},"3.0.7":{"name":"mongodb-connection-model","version":"3.0.7","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@3.0.7","maintainers":[{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"mongodb-js","email":"lucas.hrabovsky+mongodb-js@10gen.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"wz3chen","email":"waleycz@gmail.com"}],"homepage":"https://github.com/mongodb-js/mongodb-connection-model","bugs":{"url":"https://github.com/mongodb-js/mongodb-connection-model/issues"},"//":"deps only used for server marked optional so we can use same model w/ browserify.","dist":{"shasum":"31451d5a295087619a7d9c88a1b2911aaabd972f","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-3.0.7.tgz","integrity":"sha512-L+VChIkUkFMH9pX09D6n8W/y5WwT6+Hz6iCe8AdoyVC/JnejXGjRoHaEoV2ak6HSE1dJdWlWS3fnPUUrGJOPDw==","signatures":[{"sig":"MEYCIQDO9XJauIc0486SOvGu60JaAYSQ+T0HIrzgtp+e68FAKQIhAI01XmkilRgtL8SQLmUy0fo5XwhTIaZK9seKMKOJvqGz","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"_from":".","_shasum":"31451d5a295087619a7d9c88a1b2911aaabd972f","browser":"browser.js","gitHead":"e1acb83213444729c5dcca8e1e260206427f3d62","scripts":{"ci":"npm run check && npm test","fmt":"mongodb-js-fmt ./*.js ./test/*.js","test":"mocha","check":"mongodb-js-precommit"},"_npmUser":{"name":"wz3chen","email":"waleycz@gmail.com"},"precommit":["check"],"repository":{"url":"git+https://github.com/mongodb-js/mongodb-connection-model.git","type":"git"},"_npmVersion":"3.3.8","description":"MongoDB connection model.","directories":{},"_nodeVersion":"4.2.1","dependencies":{"debug":"^2.2.0","backoff":"^2.4.1","mongodb":"^2.0.48","run-series":"^1.1.4","mongodb-url":"^1.0.1","lodash.clone":"^3.0.3","run-parallel":"^1.1.4","lodash.assign":"^3.2.0","ampersand-model":"^6.0.2","lodash.contains":"^2.4.3","lodash.defaults":"^3.1.2","ampersand-rest-collection":"^5.0.0"},"devDependencies":{"mocha":"^2.3.3","mongodb-ns":"^1.0.0","pre-commit":"^1.1.2","mongodb-js-fmt":"^0.0.3","mongodb-runner":"^3.1.14","mongodb-js-precommit":"^0.2.5","mongodb-instance-model":"^1.0.4","eslint-config-mongodb-js":"^1.0.5","mongodb-connection-fixture":"^0.0.10"},"optionalDependencies":{"backoff":"^2.4.1","mongodb":"^2.0.48","run-series":"^1.1.4","run-parallel":"^1.1.4"}},"3.0.8":{"name":"mongodb-connection-model","version":"3.0.8","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@3.0.8","maintainers":[{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"mongodb-js","email":"lucas.hrabovsky+mongodb-js@10gen.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"wz3chen","email":"waleycz@gmail.com"}],"homepage":"https://github.com/mongodb-js/mongodb-connection-model","bugs":{"url":"https://github.com/mongodb-js/mongodb-connection-model/issues"},"//":"deps only used for server marked optional so we can use same model w/ browserify.","dist":{"shasum":"e6700555eac57a87378d0e6ff3930511cc0c1c1c","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-3.0.8.tgz","integrity":"sha512-IP31M20EohhksgX6XDLYUW1Wgeduxf4o6Q28+Rgg4Sjq/C/bX+KunpBe+5BSMWxiqbmss1ZRN9o4+ZkuEYH3yQ==","signatures":[{"sig":"MEUCIQCL+Q20oqiOKiu43yyNQMyjjVbTVALN9lN7ospP5yR7DgIgF0WVkgBtibsOaNmCiJfPWDlgj35bhRxpp8c84bUQ1s8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"_from":".","_shasum":"e6700555eac57a87378d0e6ff3930511cc0c1c1c","browser":"browser.js","gitHead":"6b3e1139872ca34da8a89dbd25a91aa213c22229","scripts":{"ci":"npm run check && npm test","fmt":"mongodb-js-fmt ./*.js ./test/*.js","test":"electron-mocha","check":"mongodb-js-precommit"},"_npmUser":{"name":"imlucas","email":"lucas.hrabovsky+mongodb-js@10gen.com"},"precommit":["check"],"repository":{"url":"git+https://github.com/mongodb-js/mongodb-connection-model.git","type":"git"},"_npmVersion":"3.4.0","description":"MongoDB connection model.","directories":{},"_nodeVersion":"4.2.1","dependencies":{"debug":"^2.2.0","backoff":"^2.4.1","mongodb":"^2.0.48","run-series":"^1.1.4","mongodb-url":"^1.0.2","lodash.clone":"^3.0.3","run-parallel":"^1.1.4","lodash.assign":"^3.2.0","ampersand-model":"^6.0.2","lodash.contains":"^2.4.3","lodash.defaults":"^3.1.2","ampersand-rest-collection":"^5.0.0"},"devDependencies":{"mocha":"^2.3.3","mongodb-ns":"^1.0.0","pre-commit":"^1.1.2","electron-mocha":"^0.6.1","mongodb-js-fmt":"^0.0.3","mongodb-runner":"^3.1.14","electron-prebuilt":"^0.34.3","mongodb-js-precommit":"^0.2.5","mongodb-instance-model":"^2.0.1","eslint-config-mongodb-js":"^1.0.5","mongodb-connection-fixture":"^0.0.10"},"optionalDependencies":{"backoff":"^2.4.1","mongodb":"^2.0.48","run-series":"^1.1.4","run-parallel":"^1.1.4"}},"3.0.9":{"name":"mongodb-connection-model","version":"3.0.9","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@3.0.9","maintainers":[{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"mongodb-js","email":"lucas.hrabovsky+mongodb-js@10gen.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"wz3chen","email":"waleycz@gmail.com"}],"homepage":"https://github.com/mongodb-js/mongodb-connection-model","bugs":{"url":"https://github.com/mongodb-js/mongodb-connection-model/issues"},"//":"deps only used for server marked optional so we can use same model w/ browserify.","dist":{"shasum":"d8d8f012463a4171128bc6f8dfb893613d26272d","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-3.0.9.tgz","integrity":"sha512-95bqYLPVcgpmkWpsFcA7YZFwBWirbLQiT1ec741M3wmXobQQmKHrQxgDWySaTXWgx/Rt+6OxGwu2uevq19/EAg==","signatures":[{"sig":"MEUCIEoxCk3zDsU/sLMsD1obpCB7400JTKE5w3xS3d1aGvnxAiEAgBDP1WRFYwnxfjPC8N9HucJeoE6JZXJvKKb8RIZrgPg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"_from":".","_shasum":"d8d8f012463a4171128bc6f8dfb893613d26272d","browser":"browser.js","gitHead":"1779e9be06e5276d3865585160ec950bc12c2887","scripts":{"ci":"npm run check && npm test","fmt":"mongodb-js-fmt ./*.js ./test/*.js","test":"mocha","check":"mongodb-js-precommit"},"_npmUser":{"name":"imlucas","email":"lucas.hrabovsky+mongodb-js@10gen.com"},"precommit":["check"],"repository":{"url":"git+https://github.com/mongodb-js/mongodb-connection-model.git","type":"git"},"_npmVersion":"2.14.12","description":"MongoDB connection model.","directories":{},"_nodeVersion":"4.2.1","dependencies":{"debug":"^2.2.0","backoff":"^2.4.1","mongodb":"^2.0.49","kerberos":"0.0.17","run-series":"^1.1.4","mongodb-url":"^1.0.2","lodash.clone":"^3.0.3","run-parallel":"^1.1.4","lodash.assign":"^3.2.0","ampersand-model":"^6.0.2","lodash.contains":"^2.4.3","lodash.defaults":"^3.1.2","ampersand-rest-collection":"^5.0.0"},"devDependencies":{"mocha":"^2.3.4","mongodb-ns":"^1.0.1","pre-commit":"^1.1.2","mongodb-js-fmt":"^0.0.3","mongodb-runner":"^3.1.14","mongodb-js-precommit":"^0.2.8","mongodb-instance-model":"^2.1.0","eslint-config-mongodb-js":"^1.0.6","mongodb-connection-fixture":"^0.0.10"},"optionalDependencies":{"backoff":"^2.4.1","mongodb":"^2.0.49","kerberos":"0.0.17","run-series":"^1.1.4","run-parallel":"^1.1.4"}},"3.0.10":{"name":"mongodb-connection-model","version":"3.0.10","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@3.0.10","maintainers":[{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"wz3chen","email":"waleycz@gmail.com"}],"homepage":"https://github.com/mongodb-js/mongodb-connection-model","bugs":{"url":"https://github.com/mongodb-js/mongodb-connection-model/issues"},"//":"deps only used for server marked optional so we can use same model w/ browserify.","dist":{"shasum":"50e732473bfb123b30d58aa97ebe8c73c944ad5a","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-3.0.10.tgz","integrity":"sha512-6rrgl0260vCMY4vdo3c+wG5Q5p0agXXT3I0IDOEUyNc5l4oMSPpMwJQmyGbrUJIvaAD5dH65g08EnYcyBWRnwQ==","signatures":[{"sig":"MEUCID7qwqcy3ySuNaN2NgjH+vJ1TXmyR3limyS4erJWTfUKAiEAlA51hoc4iKbGYdqd40W43Lz+ivcQpRQIpTV0xX1DjAo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"_from":".","_shasum":"50e732473bfb123b30d58aa97ebe8c73c944ad5a","browser":"browser.js","gitHead":"e249e5cafc1adb3f256b3522452dac4b3f696bcf","scripts":{"ci":"npm run check && npm test","fmt":"mongodb-js-fmt ./*.js ./test/*.js","test":"mocha","check":"mongodb-js-precommit"},"_npmUser":{"name":"imlucas","email":"lucas.hrabovsky+mongodb-js@10gen.com"},"precommit":["check"],"repository":{"url":"git+https://github.com/mongodb-js/mongodb-connection-model.git","type":"git"},"_npmVersion":"3.5.1","description":"MongoDB connection model.","directories":{},"_nodeVersion":"4.2.2","dependencies":{"debug":"^2.2.0","backoff":"^2.4.1","mongodb":"^2.1.1","kerberos":"0.0.17","run-series":"^1.1.4","mongodb-url":"^1.0.2","lodash.clone":"^3.0.3","run-parallel":"^1.1.4","lodash.assign":"^3.2.0","ampersand-model":"^6.0.2","lodash.contains":"^2.4.3","lodash.defaults":"^3.1.2","ampersand-rest-collection":"^5.0.0"},"devDependencies":{"mocha":"^2.3.4","mongodb-ns":"^1.0.1","pre-commit":"^1.1.2","mongodb-js-fmt":"^0.0.3","mongodb-runner":"^3.1.14","mongodb-js-precommit":"^0.2.8","mongodb-instance-model":"^2.1.6","eslint-config-mongodb-js":"^1.0.6","mongodb-connection-fixture":"^0.0.10"},"optionalDependencies":{"backoff":"^2.4.1","mongodb":"^2.1.1","kerberos":"0.0.17","run-series":"^1.1.4","run-parallel":"^1.1.4"}},"4.0.0":{"name":"mongodb-connection-model","version":"4.0.0","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@4.0.0","maintainers":[{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"machyne","email":"mcotter222@gmail.com"},{"name":"mongodb-js-user","email":"lucas.hrabovsky+mongodb-js@10gen.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"wz3chen","email":"waleycz@gmail.com"}],"homepage":"https://github.com/mongodb-js/mongodb-connection-model","bugs":{"url":"https://github.com/mongodb-js/mongodb-connection-model/issues"},"//":"deps only used for server marked optional so we can use same model w/ browserify.","dist":{"shasum":"5d5f1430be0e2a091c62bdca98b25c4d478edf55","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-4.0.0.tgz","integrity":"sha512-Aaa+QB9gc2+qwEpRQr1dLBxYOHaw5tbagMlFxMDFK3YIjec8nF7gRrAPX1RRoRGV+0p2jXVx9jrO1gjSaGd76Q==","signatures":[{"sig":"MEUCIQCrrOzSVg+Zs2IW/nmmM88h49P4sGGws0ybUmrgO2gDyQIgLTlQi0zX7ruzOUZPE9oM6K9fBs4ZDQ+aF50zfK4UqIw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"_from":".","_shasum":"5d5f1430be0e2a091c62bdca98b25c4d478edf55","browser":"browser.js","gitHead":"828c10c01383f1514afa14184daaaaf95e2b408c","scripts":{"ci":"npm run check && npm test","fmt":"mongodb-js-fmt ./*.js ./test/*.js","test":"mocha","check":"mongodb-js-precommit"},"_npmUser":{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},"precommit":["check"],"repository":{"url":"git+https://github.com/mongodb-js/mongodb-connection-model.git","type":"git"},"_npmVersion":"3.5.1","description":"MongoDB connection model.","directories":{},"_nodeVersion":"4.2.2","dependencies":{"debug":"^2.2.0","backoff":"^2.4.1","mongodb":"^2.1.1","kerberos":"0.0.18","run-series":"^1.1.4","mongodb-url":"^1.0.2","lodash.clone":"^3.0.3","run-parallel":"^1.1.4","lodash.assign":"^3.2.0","ampersand-model":"^6.0.2","lodash.contains":"^2.4.3","lodash.defaults":"^3.1.2","ampersand-rest-collection":"^5.0.0"},"devDependencies":{"mocha":"^2.3.4","mongodb-ns":"^1.0.1","pre-commit":"^1.1.2","mongodb-js-fmt":"^0.0.3","mongodb-runner":"^3.1.14","mongodb-js-precommit":"^0.2.8","mongodb-instance-model":"^2.1.6","eslint-config-mongodb-js":"^1.0.6","mongodb-connection-fixture":"^0.0.10"},"optionalDependencies":{"backoff":"^2.4.1","mongodb":"^2.1.1","kerberos":"0.0.18","run-series":"^1.1.4","run-parallel":"^1.1.4"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model-4.0.0.tgz_1454643691467_0.9756931634619832","host":"packages-5-east.internal.npmjs.com"}},"4.0.1":{"name":"mongodb-connection-model","version":"4.0.1","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@4.0.1","maintainers":[{"name":"durran","email":"durran@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"machyne","email":"mcotter222@gmail.com"},{"name":"mongodb-js-user","email":"lucas.hrabovsky+mongodb-js@10gen.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"wz3chen","email":"waleycz@gmail.com"}],"homepage":"https://github.com/mongodb-js/mongodb-connection-model","bugs":{"url":"https://github.com/mongodb-js/mongodb-connection-model/issues"},"//":"deps only used for server marked optional so we can use same model w/ browserify.","dist":{"shasum":"5fec5ec44ba08663d6fdd828aeb1dddf30fa751c","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-4.0.1.tgz","integrity":"sha512-16k4TU9t+4f4r1ZsxeVNMGIH240ECnou4MaqzMx3aDAKGTFk1HVY1KCEN7lOKj2bdc+gJ0bsy6CULRbDXvM8sw==","signatures":[{"sig":"MEYCIQDmY6+NPREvpBFlAIjh5bEPtq2qapUTOZKTMnsMtWzkBQIhAORUqy6PDXNu4D1TMRADgyTdgEPBcP09W+8hrqiFsQ5K","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"_from":".","_shasum":"5fec5ec44ba08663d6fdd828aeb1dddf30fa751c","browser":"browser.js","gitHead":"ff919211f97b7d6ab1eeb00f9d2fe7945c1806e8","scripts":{"ci":"npm run check && npm test","fmt":"mongodb-js-fmt ./*.js ./test/*.js","test":"mocha","check":"mongodb-js-precommit"},"_npmUser":{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},"precommit":["check"],"repository":{"url":"git+https://github.com/mongodb-js/mongodb-connection-model.git","type":"git"},"_npmVersion":"3.3.12","description":"MongoDB connection model.","directories":{},"_nodeVersion":"5.4.1","dependencies":{"debug":"^2.2.0","backoff":"^2.4.1","mongodb":"^2.1.1","kerberos":"0.0.19","run-series":"^1.1.4","mongodb-url":"^1.0.2","lodash.clone":"^3.0.3","run-parallel":"^1.1.4","lodash.assign":"^4.0.2","ampersand-model":"^6.0.2","lodash.contains":"^2.4.3","lodash.defaults":"^3.1.2","ampersand-rest-collection":"^5.0.0"},"devDependencies":{"mocha":"^2.3.4","mongodb-ns":"^1.0.1","pre-commit":"^1.1.2","mongodb-js-fmt":"^0.0.3","mongodb-runner":"^3.1.14","mongodb-js-precommit":"^0.2.8","mongodb-instance-model":"^3.0.0","eslint-config-mongodb-js":"^2.0.0","mongodb-connection-fixture":"^0.0.11"},"optionalDependencies":{"backoff":"^2.4.1","mongodb":"^2.1.1","kerberos":"0.0.19","run-series":"^1.1.4","run-parallel":"^1.1.4"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model-4.0.1.tgz_1457831038531_0.8737152710091323","host":"packages-13-west.internal.npmjs.com"}},"4.0.2":{"name":"mongodb-connection-model","version":"4.0.2","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@4.0.2","maintainers":[{"name":"durran","email":"durran@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"machyne","email":"mcotter222@gmail.com"},{"name":"mongodb-js-user","email":"lucas.hrabovsky+mongodb-js@10gen.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"wz3chen","email":"waleycz@gmail.com"}],"homepage":"https://github.com/mongodb-js/mongodb-connection-model","bugs":{"url":"https://github.com/mongodb-js/mongodb-connection-model/issues"},"//":"deps only used for server marked optional so we can use same model w/ browserify.","dist":{"shasum":"3319ee1ce94f696881f6a7ea51ca0a8a4cf0632e","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-4.0.2.tgz","integrity":"sha512-PoPfzXcGWriZWOf1lXIQFrAjTwgJBp79jdw7RcwscKid86/YbGpDJrmeBsLp7FLdyKW5Dfe6rAoyQl5q3sY8ig==","signatures":[{"sig":"MEQCIEb0ppvpm672CrAwUGQhSUmwXEo+iVnqm785qdTfsQ6EAiAW+FKof/bUdfbE3oT5x6z9qcmO7LxIhXfk7pKvjkxLSQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"_from":".","_shasum":"3319ee1ce94f696881f6a7ea51ca0a8a4cf0632e","browser":"browser.js","gitHead":"2b33bf705908df2ba11ee94b133d61859373aecb","scripts":{"ci":"npm run check && npm test","fmt":"mongodb-js-fmt ./*.js ./test/*.js","test":"mocha","check":"mongodb-js-precommit"},"_npmUser":{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},"precommit":["check"],"repository":{"url":"git+https://github.com/mongodb-js/mongodb-connection-model.git","type":"git"},"_npmVersion":"3.3.12","description":"MongoDB connection model.","directories":{},"_nodeVersion":"5.4.1","dependencies":{"debug":"^2.2.0","backoff":"^2.4.1","mongodb":"^2.1.1","kerberos":"^0.0.19","run-series":"^1.1.4","mongodb-url":"^1.0.2","lodash.clone":"^3.0.3","run-parallel":"^1.1.4","lodash.assign":"^4.0.2","ampersand-model":"^6.0.2","lodash.contains":"^2.4.3","lodash.defaults":"^3.1.2","ampersand-rest-collection":"^5.0.0"},"devDependencies":{"mocha":"^2.3.4","mongodb-ns":"^1.0.1","pre-commit":"^1.1.2","mongodb-js-fmt":"^0.0.3","mongodb-runner":"^3.1.14","mongodb-js-precommit":"^0.2.8","mongodb-instance-model":"^3.0.0","eslint-config-mongodb-js":"^2.0.0","mongodb-connection-fixture":"^0.0.11"},"optionalDependencies":{"backoff":"^2.4.1","mongodb":"^2.1.1","kerberos":"^0.0.19","run-series":"^1.1.4","run-parallel":"^1.1.4"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model-4.0.2.tgz_1457989022865_0.5136515242047608","host":"packages-12-west.internal.npmjs.com"}},"4.0.3":{"name":"mongodb-connection-model","version":"4.0.3","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@4.0.3","maintainers":[{"name":"durran","email":"durran@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"machyne","email":"mcotter222@gmail.com"},{"name":"mongodb-js-user","email":"lucas.hrabovsky+mongodb-js@10gen.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"wz3chen","email":"waleycz@gmail.com"}],"homepage":"https://github.com/mongodb-js/mongodb-connection-model","bugs":{"url":"https://github.com/mongodb-js/mongodb-connection-model/issues"},"//":"deps only used for server marked optional so we can use same model w/ browserify.","dist":{"shasum":"be5e0e6df62262f8c05e77a8314d586e90fd94c0","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-4.0.3.tgz","integrity":"sha512-/BSNP3PmmsRRVNJz00lvGMb3OAK/s5LSUPfPyE6PJZXAXEB7nURR9MROzLKFw5w6Eae3wuZ7P3y+9sxPa+z2wA==","signatures":[{"sig":"MEQCIGvfj+cAQOsLq2DyrtFUHH9NlGQN+UE5a5nQ3sU6g+3PAiBE1XoCcdPLpjzDhqJ/4jnfMoTvIo4Yb06l1HqYv0Jy8Q==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"_from":".","_shasum":"be5e0e6df62262f8c05e77a8314d586e90fd94c0","browser":"browser.js","gitHead":"6792f27962f4e6ff13e597abbe8719321ae7f90d","scripts":{"ci":"npm run check && npm test","fmt":"mongodb-js-fmt ./*.js ./test/*.js","test":"mocha","check":"mongodb-js-precommit"},"_npmUser":{"name":"durran","email":"durran@gmail.com"},"precommit":["check"],"repository":{"url":"git+https://github.com/mongodb-js/mongodb-connection-model.git","type":"git"},"_npmVersion":"3.5.0","description":"MongoDB connection model.","directories":{},"_nodeVersion":"4.2.2","dependencies":{"debug":"^2.2.0","backoff":"^2.4.1","mongodb":"^2.1.1","kerberos":"^0.0.19","run-series":"^1.1.4","mongodb-url":"^1.0.2","lodash.clone":"^3.0.3","run-parallel":"^1.1.4","lodash.assign":"^4.0.2","ampersand-model":"^6.0.2","lodash.contains":"^2.4.3","lodash.defaults":"^3.1.2","ampersand-rest-collection":"^5.0.0"},"devDependencies":{"mocha":"^2.3.4","mongodb-ns":"^1.0.1","pre-commit":"^1.1.2","mongodb-js-fmt":"^0.0.3","mongodb-runner":"^3.1.14","mongodb-js-precommit":"^0.2.8","mongodb-instance-model":"^3.0.0","eslint-config-mongodb-js":"^2.0.0","mongodb-connection-fixture":"^0.0.11"},"optionalDependencies":{"backoff":"^2.4.1","mongodb":"^2.1.1","kerberos":"^0.0.19","run-series":"^1.1.4","run-parallel":"^1.1.4"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model-4.0.3.tgz_1461074983721_0.2534915346186608","host":"packages-16-east.internal.npmjs.com"}},"4.0.4":{"name":"mongodb-connection-model","version":"4.0.4","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@4.0.4","maintainers":[{"name":"cilix","email":"matthewlevenstein@gmail.com"},{"name":"dpercy","email":"davetp425@gmail.com"},{"name":"durran","email":"durran@gmail.com"},{"name":"glowe","email":"graham.lowe@gmail.com"},{"name":"i80and","email":"i80and@foxquill.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"machyne","email":"mcotter222@gmail.com"},{"name":"micheal.parks","email":"michealparks1989@gmail.com"},{"name":"mongodb-js-user","email":"lucas.hrabovsky+mongodb-js@10gen.com"},{"name":"redondos","email":"aolivera@gmail.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"schwartzrw","email":"schwartzrw@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"}],"homepage":"https://github.com/mongodb-js/mongodb-connection-model","bugs":{"url":"https://github.com/mongodb-js/mongodb-connection-model/issues"},"//":"deps only used for server marked optional so we can use same model w/ browserify.","dist":{"shasum":"910531a0daa6ea119c597f5a50bab2c3d324e0d8","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-4.0.4.tgz","integrity":"sha512-c4eMnsxFUWH+RcIK8b3oWwXZrM99ODsW/2uvlv0EdxVwcpaykC4I9+oyOJ21cPj0Z+iy4yBCP+/T+Vs1YOWKFA==","signatures":[{"sig":"MEYCIQCaMLElaNBvWxeYR3UHffpDR1PEIjZt05bahu64qbFjyQIhAM7Fsb9VYFuCTnzr88NG0lFfvqStfU9iaxLbbrlzHuIS","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"_from":".","_shasum":"910531a0daa6ea119c597f5a50bab2c3d324e0d8","browser":"browser.js","gitHead":"440b541e6afa466d66db70ad3b0e3c390c697967","scripts":{"ci":"npm run check && npm test","fmt":"mongodb-js-fmt ./*.js ./test/*.js","test":"mocha","check":"mongodb-js-precommit"},"_npmUser":{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},"precommit":["check"],"repository":{"url":"git+https://github.com/mongodb-js/mongodb-connection-model.git","type":"git"},"_npmVersion":"3.8.8","description":"MongoDB connection model.","directories":{},"_nodeVersion":"5.10.1","dependencies":{"debug":"^2.2.0","backoff":"^2.4.1","mongodb":"^2.1.1","kerberos":"^0.0.19","run-series":"^1.1.4","mongodb-url":"^1.0.2","lodash.clone":"^3.0.3","run-parallel":"^1.1.4","lodash.assign":"^4.0.2","ampersand-model":"^6.0.2","lodash.contains":"^2.4.3","lodash.defaults":"^3.1.2","ampersand-rest-collection":"^5.0.0"},"devDependencies":{"mocha":"^2.3.4","mongodb-ns":"^1.0.1","pre-commit":"^1.1.2","mongodb-js-fmt":"^0.0.3","mongodb-runner":"^3.1.14","mongodb-js-precommit":"^0.2.8","mongodb-instance-model":"^3.0.0","eslint-config-mongodb-js":"^2.0.0","mongodb-connection-fixture":"^0.0.11"},"optionalDependencies":{"backoff":"^2.4.1","mongodb":"^2.1.1","kerberos":"^0.0.19","run-series":"^1.1.4","run-parallel":"^1.1.4"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model-4.0.4.tgz_1464034627890_0.14195860107429326","host":"packages-16-east.internal.npmjs.com"}},"4.1.0":{"name":"mongodb-connection-model","version":"4.1.0","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@4.1.0","maintainers":[{"name":"cilix","email":"matthewlevenstein@gmail.com"},{"name":"dpercy","email":"davetp425@gmail.com"},{"name":"durran","email":"durran@gmail.com"},{"name":"glowe","email":"graham.lowe@gmail.com"},{"name":"i80and","email":"i80and@foxquill.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"machyne","email":"mcotter222@gmail.com"},{"name":"micheal.parks","email":"michealparks1989@gmail.com"},{"name":"mongodb-js-user","email":"lucas.hrabovsky+mongodb-js@10gen.com"},{"name":"redondos","email":"aolivera@gmail.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"schwartzrw","email":"schwartzrw@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"}],"homepage":"https://github.com/mongodb-js/mongodb-connection-model","bugs":{"url":"https://github.com/mongodb-js/mongodb-connection-model/issues"},"//":"deps only used for server marked optional so we can use same model w/ browserify.","dist":{"shasum":"fa83188ed8fb5999a5126328f7005423b0674342","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-4.1.0.tgz","integrity":"sha512-YZKahxFgWKnRdbVeAvdZvZVAy2wPaMIHzxGMnh23n+vEe1T8+ULEedYwxuCzuvGy8o1ER9XnHF30VsxpV5hckg==","signatures":[{"sig":"MEYCIQCAwbMc1HQ5Qn2JVPVHJ7QM/HuTXPVTRoeIiv1NRBPmtAIhAMqYFKj521ra/NHutvVZfKRvr9DFYZMOMzt/u6k1G+dd","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"_from":".","_shasum":"fa83188ed8fb5999a5126328f7005423b0674342","browser":"browser.js","gitHead":"c25ba40bf1faf217bfb218e19322a5389bac0df5","scripts":{"ci":"npm run check && npm test","fmt":"mongodb-js-fmt ./*.js ./test/*.js","test":"mocha","check":"mongodb-js-precommit"},"_npmUser":{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},"precommit":["check"],"repository":{"url":"git+https://github.com/mongodb-js/mongodb-connection-model.git","type":"git"},"_npmVersion":"3.8.8","description":"MongoDB connection model.","directories":{},"_nodeVersion":"5.10.1","dependencies":{"debug":"^2.2.0","backoff":"^2.4.1","mongodb":"^2.1.1","kerberos":"^0.0.19","run-series":"^1.1.4","mongodb-url":"^1.0.2","lodash.clone":"^3.0.3","run-parallel":"^1.1.4","lodash.assign":"^4.0.2","ampersand-model":"^6.0.2","lodash.contains":"^2.4.3","lodash.defaults":"^3.1.2","ampersand-rest-collection":"^5.0.0"},"devDependencies":{"mocha":"^2.3.4","mongodb-ns":"^1.0.1","pre-commit":"^1.1.2","mongodb-js-fmt":"^0.0.3","mongodb-runner":"^3.1.14","mongodb-js-precommit":"^0.2.8","mongodb-instance-model":"^3.0.0","eslint-config-mongodb-js":"^2.0.0","mongodb-connection-fixture":"^0.0.11"},"optionalDependencies":{"backoff":"^2.4.1","mongodb":"^2.1.1","kerberos":"^0.0.19","run-series":"^1.1.4","run-parallel":"^1.1.4"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model-4.1.0.tgz_1464034650989_0.9446691358461976","host":"packages-12-west.internal.npmjs.com"}},"4.2.0":{"name":"mongodb-connection-model","version":"4.2.0","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@4.2.0","maintainers":[{"name":"cilix","email":"matthewlevenstein@gmail.com"},{"name":"dpercy","email":"davetp425@gmail.com"},{"name":"durran","email":"durran@gmail.com"},{"name":"glowe","email":"graham.lowe@gmail.com"},{"name":"i80and","email":"i80and@foxquill.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"machyne","email":"mcotter222@gmail.com"},{"name":"micheal.parks","email":"michealparks1989@gmail.com"},{"name":"mongodb-js-user","email":"lucas.hrabovsky+mongodb-js@10gen.com"},{"name":"redondos","email":"aolivera@gmail.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"schwartzrw","email":"schwartzrw@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"}],"homepage":"https://github.com/mongodb-js/mongodb-connection-model","bugs":{"url":"https://github.com/mongodb-js/mongodb-connection-model/issues"},"//":"deps only used for server marked optional so we can use same model w/ browserify.","dist":{"shasum":"e4929c2a26ab6f4b58c4e4f08589f07b8f3483fd","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-4.2.0.tgz","integrity":"sha512-NRZE9WpXMvA1/jdnna/NhzH6dEqglZSXnBFoXAry+Xt2OGIL/VpGz/enJ9wP4miVaBQF3LAgy4xMtTUb8SXluA==","signatures":[{"sig":"MEUCIQDNXjY6S3WcZf6sJSFYZpUo8petqjPM0R/Br2hu+3h1ewIgBAVX5nZ8J/ojJn8pGF4UtKbkakPYSXpWFP9VH4c9Gto=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"_from":".","_shasum":"e4929c2a26ab6f4b58c4e4f08589f07b8f3483fd","browser":"browser.js","gitHead":"22254066505ff47e5030378a4216f999e20e3c24","scripts":{"ci":"npm run check && npm test","fmt":"mongodb-js-fmt ./*.js ./test/*.js","test":"mocha","check":"mongodb-js-precommit"},"_npmUser":{"name":"durran","email":"durran@gmail.com"},"precommit":["check"],"repository":{"url":"git+https://github.com/mongodb-js/mongodb-connection-model.git","type":"git"},"_npmVersion":"3.7.3","description":"MongoDB connection model.","directories":{},"_nodeVersion":"5.9.0","dependencies":{"debug":"^2.2.0","backoff":"^2.4.1","mongodb":"^2.1.1","kerberos":"^0.0.19","run-series":"^1.1.4","mongodb-url":"^1.0.2","lodash.clone":"^3.0.3","run-parallel":"^1.1.4","lodash.assign":"^4.0.2","ampersand-model":"^6.0.2","lodash.contains":"^2.4.3","lodash.defaults":"^3.1.2","ampersand-rest-collection":"^5.0.0"},"devDependencies":{"mocha":"^2.3.4","mongodb-ns":"^1.0.1","pre-commit":"^1.1.2","mongodb-js-fmt":"^0.0.3","mongodb-runner":"^3.1.14","mongodb-js-precommit":"^0.2.8","mongodb-instance-model":"^3.0.0","eslint-config-mongodb-js":"^2.0.0","mongodb-connection-fixture":"^0.0.11"},"optionalDependencies":{"backoff":"^2.4.1","mongodb":"^2.1.1","kerberos":"^0.0.19","run-series":"^1.1.4","run-parallel":"^1.1.4"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model-4.2.0.tgz_1464787537857_0.3907311758957803","host":"packages-12-west.internal.npmjs.com"}},"4.3.0":{"name":"mongodb-connection-model","version":"4.3.0","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@4.3.0","maintainers":[{"name":"cilix","email":"matthewlevenstein@gmail.com"},{"name":"dpercy","email":"davetp425@gmail.com"},{"name":"durran","email":"durran@gmail.com"},{"name":"glowe","email":"graham.lowe@gmail.com"},{"name":"i80and","email":"i80and@foxquill.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"machyne","email":"mcotter222@gmail.com"},{"name":"micheal.parks","email":"michealparks1989@gmail.com"},{"name":"mongodb-js-user","email":"lucas.hrabovsky+mongodb-js@10gen.com"},{"name":"redondos","email":"aolivera@gmail.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"schwartzrw","email":"schwartzrw@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"}],"homepage":"https://github.com/mongodb-js/mongodb-connection-model","bugs":{"url":"https://github.com/mongodb-js/mongodb-connection-model/issues"},"//":"deps only used for server marked optional so we can use same model w/ browserify.","dist":{"shasum":"4a8243471044c8da39582305d19edcd07257acfb","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-4.3.0.tgz","integrity":"sha512-kh6AojbARU3Iw5sZyuJWkUge518ArAXvUYGLFnq/p3m8wuAHEyzffXhfnfazpnoMtR40LruDzQgD2UMoOm5V5A==","signatures":[{"sig":"MEYCIQDBB/vVzLJVDRAkKr19PsPtpRcy8lxPj9D5r+LsJl5fsAIhAM6zaDz0So1VlRTCtQd/71W4wIKG//22z+u2sZPDBJp4","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"_from":".","_shasum":"4a8243471044c8da39582305d19edcd07257acfb","browser":"browser.js","gitHead":"253f8a312c0af58bc8012dd4b6326f28d20ddff7","scripts":{"ci":"npm run check && npm test","fmt":"mongodb-js-fmt ./*.js ./test/*.js","test":"mocha","check":"mongodb-js-precommit"},"_npmUser":{"name":"durran","email":"durran@gmail.com"},"precommit":["check"],"repository":{"url":"git+https://github.com/mongodb-js/mongodb-connection-model.git","type":"git"},"_npmVersion":"3.7.3","description":"MongoDB connection model.","directories":{},"_nodeVersion":"5.9.0","dependencies":{"debug":"^2.2.0","backoff":"^2.4.1","mongodb":"^2.1.1","kerberos":"^0.0.19","run-series":"^1.1.4","mongodb-url":"^1.0.2","lodash.clone":"^3.0.3","run-parallel":"^1.1.4","lodash.assign":"^4.0.2","ampersand-model":"^6.0.2","lodash.contains":"^2.4.3","lodash.defaults":"^3.1.2","ampersand-rest-collection":"^5.0.0"},"devDependencies":{"mocha":"^2.3.4","mongodb-ns":"^1.0.1","pre-commit":"^1.1.2","mongodb-js-fmt":"^0.0.3","mongodb-runner":"^3.1.14","mongodb-js-precommit":"^0.2.8","mongodb-instance-model":"^3.0.0","eslint-config-mongodb-js":"^2.0.0","mongodb-connection-fixture":"^0.0.11"},"optionalDependencies":{"backoff":"^2.4.1","mongodb":"^2.1.1","kerberos":"^0.0.19","run-series":"^1.1.4","run-parallel":"^1.1.4"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model-4.3.0.tgz_1465308189482_0.34568951884284616","host":"packages-16-east.internal.npmjs.com"}},"5.0.0":{"name":"mongodb-connection-model","version":"5.0.0","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@5.0.0","maintainers":[{"name":"cilix","email":"matthewlevenstein@gmail.com"},{"name":"dpercy","email":"davetp425@gmail.com"},{"name":"durran","email":"durran@gmail.com"},{"name":"glowe","email":"graham.lowe@gmail.com"},{"name":"i80and","email":"i80and@foxquill.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"machyne","email":"mcotter222@gmail.com"},{"name":"micheal.parks","email":"michealparks1989@gmail.com"},{"name":"mongodb-js-user","email":"lucas.hrabovsky+mongodb-js@10gen.com"},{"name":"redondos","email":"aolivera@gmail.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"schwartzrw","email":"schwartzrw@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"}],"homepage":"https://github.com/mongodb-js/mongodb-connection-model","bugs":{"url":"https://github.com/mongodb-js/mongodb-connection-model/issues"},"//":"deps only used for server marked optional so we can use same model w/ browserify.","dist":{"shasum":"81d532c77ff3b47591b35c092d79485f82231b83","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-5.0.0.tgz","integrity":"sha512-9xVcOn/Uci3DjkH3BKWeWAlA8mF15j7slIUQNdBjBA+Ksv+GLkN1yyAy6fXVMSdT7t5nVwUUvFlnr9jRs2IdTw==","signatures":[{"sig":"MEYCIQDYvytim9jyyLrhHAA2U3RZTR6MxJI9ZiluERMvZ9NqkAIhAI6cQeCVFijYJ3RwIfBO1hBWRms4O4yvzYrDOlMURGLw","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"_from":".","_shasum":"81d532c77ff3b47591b35c092d79485f82231b83","browser":"browser.js","gitHead":"212483847f5451fdcdb9a632e439161600b7333e","scripts":{"ci":"npm run check && npm test","fmt":"mongodb-js-fmt ./*.js lib/*.js ./test/*.js","test":"mocha","check":"mongodb-js-precommit"},"_npmUser":{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},"precommit":["check"],"repository":{"url":"git+https://github.com/mongodb-js/mongodb-connection-model.git","type":"git"},"_npmVersion":"3.9.6","description":"MongoDB connection model.","directories":{},"_nodeVersion":"5.10.1","dependencies":{"async":"^2.0.1","debug":"^2.2.0","lodash":"^4.14.0","backoff":"^2.4.1","mongodb":"^2.2.4","kerberos":"^0.0.20","tunnel-ssh":"^2.1.1","mongodb-url":"^1.0.2","ampersand-model":"^8.0.0","ampersand-rest-collection":"^5.0.0"},"devDependencies":{"mocha":"^2.5.2","mongodb-ns":"^1.0.1","pre-commit":"^1.1.2","mongodb-js-fmt":"^0.0.3","mongodb-runner":"^3.3.2","mongodb-js-precommit":"^0.2.8","mongodb-instance-model":"^3.0.0","eslint-config-mongodb-js":"^2.0.0","mongodb-connection-fixture":"^0.0.13"},"optionalDependencies":{"backoff":"^2.4.1","mongodb":"^2.2.4","kerberos":"^0.0.20","tunnel-ssh":"^2.1.1"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model-5.0.0.tgz_1469553216397_0.28427664190530777","host":"packages-12-west.internal.npmjs.com"}},"5.0.1":{"name":"mongodb-connection-model","version":"5.0.1","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@5.0.1","maintainers":[{"name":"cilix","email":"matthewlevenstein@gmail.com"},{"name":"dpercy","email":"davetp425@gmail.com"},{"name":"durran","email":"durran@gmail.com"},{"name":"glowe","email":"graham.lowe@gmail.com"},{"name":"i80and","email":"i80and@foxquill.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"machyne","email":"mcotter222@gmail.com"},{"name":"micheal.parks","email":"michealparks1989@gmail.com"},{"name":"mongodb-js-user","email":"lucas.hrabovsky+mongodb-js@10gen.com"},{"name":"redondos","email":"aolivera@gmail.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"schwartzrw","email":"schwartzrw@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"}],"homepage":"https://github.com/mongodb-js/mongodb-connection-model","bugs":{"url":"https://github.com/mongodb-js/mongodb-connection-model/issues"},"//":"deps only used for server marked optional so we can use same model w/ browserify.","dist":{"shasum":"299cedd5e2b29dcf887039cc17acb952f3fc2911","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-5.0.1.tgz","integrity":"sha512-Tqob70BdC5mUWFVJTkoNcOhWOcD7gy7Y7R39YLlUSlqh6Lwt+XOTk8iHdBcLrhH93VqZYTvJ6iR4Gdm4Pqlu9A==","signatures":[{"sig":"MEUCIQCfzz/aG+Fc9R4cEDhCmLfu4GP4zWJTctGux04YU+xRHQIgRMil9vmaxAaSBE26tkhCkU2EtFFISaVt7QTGeXeWwBc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"_from":".","_shasum":"299cedd5e2b29dcf887039cc17acb952f3fc2911","browser":"browser.js","gitHead":"33d19f1d65f97381416ad7db272d549787fa0057","scripts":{"ci":"npm run check && npm test","fmt":"mongodb-js-fmt ./*.js lib/*.js ./test/*.js","test":"mocha","check":"mongodb-js-precommit"},"_npmUser":{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},"precommit":["check"],"repository":{"url":"git+https://github.com/mongodb-js/mongodb-connection-model.git","type":"git"},"_npmVersion":"3.9.6","description":"MongoDB connection model.","directories":{},"_nodeVersion":"5.10.1","dependencies":{"async":"^2.0.1","debug":"^2.2.0","lodash":"^4.14.0","backoff":"^2.4.1","mongodb":"^2.2.4","kerberos":"^0.0.20","tunnel-ssh":"^2.1.1","mongodb-url":"^1.0.2","ampersand-model":"^8.0.0","ampersand-rest-collection":"^5.0.0"},"devDependencies":{"mocha":"^2.5.2","mongodb-ns":"^1.0.1","pre-commit":"^1.1.2","mongodb-js-fmt":"^0.0.3","mongodb-runner":"^3.3.2","mongodb-js-precommit":"^0.2.8","mongodb-instance-model":"^3.0.0","eslint-config-mongodb-js":"^2.0.0","mongodb-connection-fixture":"^0.0.13"},"optionalDependencies":{"backoff":"^2.4.1","mongodb":"^2.2.4","kerberos":"^0.0.20","tunnel-ssh":"^2.1.1"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model-5.0.1.tgz_1469630186651_0.011211012490093708","host":"packages-12-west.internal.npmjs.com"}},"5.0.2":{"name":"mongodb-connection-model","version":"5.0.2","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@5.0.2","maintainers":[{"name":"cilix","email":"matthewlevenstein@gmail.com"},{"name":"dpercy","email":"davetp425@gmail.com"},{"name":"durran","email":"durran@gmail.com"},{"name":"glowe","email":"graham.lowe@gmail.com"},{"name":"i80and","email":"i80and@foxquill.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"machyne","email":"mcotter222@gmail.com"},{"name":"micheal.parks","email":"michealparks1989@gmail.com"},{"name":"mongodb-js-user","email":"lucas.hrabovsky+mongodb-js@10gen.com"},{"name":"redondos","email":"aolivera@gmail.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"schwartzrw","email":"schwartzrw@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"}],"homepage":"https://github.com/mongodb-js/mongodb-connection-model","bugs":{"url":"https://github.com/mongodb-js/mongodb-connection-model/issues"},"dist":{"shasum":"f4f6323a5e932d9d77d71576ea10ee59f5c4fc25","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-5.0.2.tgz","integrity":"sha512-BRUohChaBZMO5AqZev2kF+7yKjsaEXBHvHlFoz/q1/wMubBsdQ6twOEG7ug9D3EhZ5PAJYpvXBHyadGOQSfUPw==","signatures":[{"sig":"MEQCIGpN8h2uWNgxBqzp8zGOvJ6ugsqg+AMQsSmkHZUv1XGTAiBA9RCCb9LGhmlBS9jO/jwiYpmKJhz0Zt7cB2Ks5tI7MA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"_from":".","_shasum":"f4f6323a5e932d9d77d71576ea10ee59f5c4fc25","browser":"browser.js","gitHead":"c42cf0453367c8f23adc848f716afafa2f146d93","scripts":{"ci":"npm run check && npm test","fmt":"mongodb-js-fmt ./*.js lib/*.js ./test/*.js","test":"mocha","check":"mongodb-js-precommit"},"_npmUser":{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},"precommit":["check"],"repository":{"url":"git+https://github.com/mongodb-js/mongodb-connection-model.git","type":"git"},"_npmVersion":"3.9.6","description":"MongoDB connection model.","directories":{},"_nodeVersion":"5.10.1","dependencies":{"async":"^2.0.1","debug":"^2.2.0","lodash":"^4.14.0","backoff":"^2.4.1","mongodb":"^2.2.4","kerberos":"^0.0.21","tunnel-ssh":"^2.1.1","mongodb-url":"^1.0.2","ampersand-model":"^8.0.0","ampersand-rest-collection":"^5.0.0"},"devDependencies":{"mocha":"^2.5.2","mongodb-ns":"^1.0.1","pre-commit":"^1.1.2","mongodb-js-fmt":"^0.0.3","mongodb-runner":"^3.3.2","mongodb-js-precommit":"^0.2.8","mongodb-instance-model":"^3.0.0","eslint-config-mongodb-js":"^2.0.0","mongodb-connection-fixture":"^0.0.13"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model-5.0.2.tgz_1469718807503_0.41820827848277986","host":"packages-12-west.internal.npmjs.com"}},"5.0.3":{"name":"mongodb-connection-model","version":"5.0.3","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@5.0.3","maintainers":[{"name":"brahmgardner","email":"brahm.gardner@gmail.com"},{"name":"cilix","email":"matthewlevenstein@gmail.com"},{"name":"dpercy","email":"davetp425@gmail.com"},{"name":"durran","email":"durran@gmail.com"},{"name":"glowe","email":"graham.lowe@gmail.com"},{"name":"i80and","email":"i80and@foxquill.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"machyne","email":"mcotter222@gmail.com"},{"name":"micheal.parks","email":"michealparks1989@gmail.com"},{"name":"mongodb-js-user","email":"lucas.hrabovsky+mongodb-js@10gen.com"},{"name":"redondos","email":"aolivera@gmail.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"schwartzrw","email":"schwartzrw@gmail.com"},{"name":"shum","email":"chris.shum@mongodb.com"},{"name":"wz3chen","email":"waleycz@gmail.com"}],"homepage":"https://github.com/mongodb-js/mongodb-connection-model","bugs":{"url":"https://github.com/mongodb-js/mongodb-connection-model/issues"},"dist":{"shasum":"37b256024cf8613c7411ab01ac9fe972a1a8faee","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-5.0.3.tgz","integrity":"sha512-jL56b3OprGfMysKrFgbsIih5gOXoxP6M2Py/VYZUuwfvDXh8Edtvv07XPAZOtanr9Z/OpKlGLrNZpZpEY2aeYw==","signatures":[{"sig":"MEQCIGKEuku/SQpgI/+WYnfNIf8qt5ysftACfvhr09tpWHqbAiATNZGHks8l2YmrQWbcbr11zeK3helHNPBm+osD/cGTyQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"_from":".","_shasum":"37b256024cf8613c7411ab01ac9fe972a1a8faee","browser":"browser.js","gitHead":"889137f8e2851ad3d0a4297cff1e822300084f70","scripts":{"ci":"npm run check && npm test","fmt":"mongodb-js-fmt ./*.js lib/*.js ./test/*.js","test":"mocha","check":"mongodb-js-precommit"},"_npmUser":{"name":"rueckstiess","email":"thomas@rueckstiess.net"},"precommit":["check"],"repository":{"url":"git+https://github.com/mongodb-js/mongodb-connection-model.git","type":"git"},"_npmVersion":"3.8.6","description":"MongoDB connection model.","directories":{},"_nodeVersion":"5.11.1","dependencies":{"async":"^2.0.1","debug":"^2.2.0","lodash":"^4.14.0","backoff":"^2.4.1","mongodb":"^2.2.4","kerberos":"^0.0.21","tunnel-ssh":"^2.1.1","mongodb-url":"^1.0.2","ampersand-model":"^8.0.0","ampersand-rest-collection":"^5.0.0"},"devDependencies":{"mocha":"^2.5.2","mongodb-ns":"^1.0.1","pre-commit":"^1.1.2","mongodb-js-fmt":"^0.0.3","mongodb-runner":"^3.3.2","mongodb-js-precommit":"^0.2.9","mongodb-instance-model":"^3.0.0","eslint-config-mongodb-js":"^2.2.0","mongodb-connection-fixture":"^0.0.13"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model-5.0.3.tgz_1471808751832_0.37524506566114724","host":"packages-16-east.internal.npmjs.com"}},"5.1.0":{"name":"mongodb-connection-model","version":"5.1.0","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@5.1.0","maintainers":[{"name":"brahmgardner","email":"brahm.gardner@gmail.com"},{"name":"cilix","email":"matthewlevenstein@gmail.com"},{"name":"dpercy","email":"davetp425@gmail.com"},{"name":"durran","email":"durran@gmail.com"},{"name":"glowe","email":"graham.lowe@gmail.com"},{"name":"i80and","email":"i80and@foxquill.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"machyne","email":"mcotter222@gmail.com"},{"name":"micheal.parks","email":"michealparks1989@gmail.com"},{"name":"mongodb-js-user","email":"lucas.hrabovsky+mongodb-js@10gen.com"},{"name":"redondos","email":"aolivera@gmail.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"schwartzrw","email":"schwartzrw@gmail.com"},{"name":"shum","email":"chris.shum@mongodb.com"},{"name":"wz3chen","email":"waleycz@gmail.com"}],"homepage":"https://github.com/mongodb-js/mongodb-connection-model","bugs":{"url":"https://github.com/mongodb-js/mongodb-connection-model/issues"},"dist":{"shasum":"04b13723ec1e4f190559b08ad2a2b03a3bf44621","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-5.1.0.tgz","integrity":"sha512-GxeLr36pXYZZwhyqDQ25KsEcU0YXIoP+M80WdxhJOIA3bWDqnxghMW66LNpmT1yU2U2mkilGMNPT43gv7MSSKg==","signatures":[{"sig":"MEYCIQD633s0mX5IoSFel1fIrwVNRCdfpVitUE4qu7J0KF0Z0wIhAI9nPUVeIT4ZHfoiBZibcqzfCrKmFR0HifK5HfFpMFLS","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"_from":".","_shasum":"04b13723ec1e4f190559b08ad2a2b03a3bf44621","browser":"browser.js","gitHead":"81df16ccdab87f922237084d82f17efd2092f32d","scripts":{"ci":"npm run check && npm test","fmt":"mongodb-js-fmt ./*.js lib/*.js ./test/*.js","test":"mocha","check":"mongodb-js-precommit"},"_npmUser":{"name":"durran","email":"durran@gmail.com"},"precommit":["check"],"repository":{"url":"git+https://github.com/mongodb-js/mongodb-connection-model.git","type":"git"},"_npmVersion":"3.10.3","description":"MongoDB connection model.","directories":{},"_nodeVersion":"6.3.1","dependencies":{"async":"^2.0.1","debug":"^2.2.0","lodash":"^4.14.0","backoff":"^2.4.1","mongodb":"^2.2.8","kerberos":"^0.0.21","tunnel-ssh":"^2.1.1","mongodb-url":"^1.0.2","ampersand-model":"^8.0.0","ampersand-rest-collection":"^5.0.0"},"devDependencies":{"mocha":"^2.5.2","mongodb-ns":"^1.0.1","pre-commit":"^1.1.2","mongodb-js-fmt":"^0.0.3","mongodb-runner":"^3.3.2","mongodb-js-precommit":"^0.2.9","mongodb-instance-model":"^3.0.0","eslint-config-mongodb-js":"^2.2.0","mongodb-connection-fixture":"^0.0.13"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model-5.1.0.tgz_1471974206151_0.08912462135776877","host":"packages-16-east.internal.npmjs.com"}},"6.0.0":{"name":"mongodb-connection-model","version":"6.0.0","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@6.0.0","maintainers":[{"name":"brahmgardner","email":"brahm.gardner@gmail.com"},{"name":"cilix","email":"matthewlevenstein@gmail.com"},{"name":"dpercy","email":"davetp425@gmail.com"},{"name":"durran","email":"durran@gmail.com"},{"name":"glowe","email":"graham.lowe@gmail.com"},{"name":"i80and","email":"i80and@foxquill.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"machyne","email":"mcotter222@gmail.com"},{"name":"micheal.parks","email":"michealparks1989@gmail.com"},{"name":"mongodb-js-user","email":"lucas.hrabovsky+mongodb-js@10gen.com"},{"name":"redondos","email":"aolivera@gmail.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"schwartzrw","email":"schwartzrw@gmail.com"},{"name":"shum","email":"chris.shum@mongodb.com"},{"name":"wz3chen","email":"waleycz@gmail.com"}],"homepage":"https://github.com/mongodb-js/mongodb-connection-model","bugs":{"url":"https://github.com/mongodb-js/mongodb-connection-model/issues"},"dist":{"shasum":"c31492684694ade42140d2fff933f37da438c24a","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-6.0.0.tgz","integrity":"sha512-rgkQK/mXYdoeuECW+le5LEmF19SRsgQ2nAAHvW9C7wLjZS+xodNJZ13Kp9/aWZJRpniyYPmyOvYLxHEBcxeTdA==","signatures":[{"sig":"MEYCIQCEl2CN41JDkliwO7hXqgLY7U4pNx9gcXk7JhRrxFxhJwIhAMVzjKQMi2u4WgRFSLs9l8olZrocoFLdXq9xhhOBjXcP","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"_from":".","_shasum":"c31492684694ade42140d2fff933f37da438c24a","browser":"browser.js","gitHead":"399948983b35cbb9be33b4fccc4c9efe299099ce","scripts":{"ci":"npm run check && npm test","fmt":"mongodb-js-fmt ./*.js lib/*.js ./test/*.js","test":"mocha","check":"mongodb-js-precommit"},"_npmUser":{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},"precommit":["check"],"repository":{"url":"git+https://github.com/mongodb-js/mongodb-connection-model.git","type":"git"},"_npmVersion":"3.9.6","description":"MongoDB connection model.","directories":{},"_nodeVersion":"5.10.1","dependencies":{"async":"^2.0.1","debug":"^2.2.0","lodash":"^4.14.0","backoff":"^2.4.1","mongodb":"^2.2.9","kerberos":"^0.0.21","tunnel-ssh":"^4.1.0","mongodb-url":"^1.0.2","ampersand-model":"^8.0.0","ampersand-rest-collection":"^5.0.0"},"devDependencies":{"mocha":"^3.0.2","mongodb-ns":"^1.0.1","pre-commit":"^1.1.2","mongodb-js-fmt":"^0.0.3","mongodb-runner":"^3.3.3","mongodb-js-precommit":"^0.2.9","mongodb-instance-model":"^3.1.5","eslint-config-mongodb-js":"^2.2.0","mongodb-connection-fixture":"^0.0.13"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model-6.0.0.tgz_1474579842663_0.5769874767865986","host":"packages-16-east.internal.npmjs.com"}},"6.1.0":{"name":"mongodb-connection-model","version":"6.1.0","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@6.1.0","maintainers":[{"name":"brahmgardner","email":"brahm.gardner@gmail.com"},{"name":"cilix","email":"matthewlevenstein@gmail.com"},{"name":"dpercy","email":"davetp425@gmail.com"},{"name":"durran","email":"durran@gmail.com"},{"name":"glowe","email":"graham.lowe@gmail.com"},{"name":"i80and","email":"i80and@foxquill.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"machyne","email":"mcotter222@gmail.com"},{"name":"micheal.parks","email":"michealparks1989@gmail.com"},{"name":"mongodb-js-user","email":"lucas.hrabovsky+mongodb-js@10gen.com"},{"name":"redondos","email":"aolivera@gmail.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"schwartzrw","email":"schwartzrw@gmail.com"},{"name":"shum","email":"chris.shum@mongodb.com"},{"name":"wz3chen","email":"waleycz@gmail.com"}],"homepage":"https://github.com/mongodb-js/mongodb-connection-model","bugs":{"url":"https://github.com/mongodb-js/mongodb-connection-model/issues"},"dist":{"shasum":"fec9076991d18dc88bdd88afc2788b93dce7ca7b","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-6.1.0.tgz","integrity":"sha512-5EbHJKj9VXnRls/TgeOzTwwC6vtq9de9yd49VIO9VI6RClWnhVdD6cGNmoj1siCrkyqEYiiW2hPgQS9kMV6tBw==","signatures":[{"sig":"MEUCIDaT9li1qOYGk9KYrwAsRvO2AcfSF7V7HAzfcdVmXuLTAiEAyX9sMWuiazq0rYLPfah6421SFkp7ij+udoAg85xoJMU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"_from":".","_shasum":"fec9076991d18dc88bdd88afc2788b93dce7ca7b","browser":"browser.js","gitHead":"625f6d89c22add38c3d2a995c419da7562eda621","scripts":{"ci":"npm run check && npm test","fmt":"mongodb-js-fmt ./*.js lib/*.js ./test/*.js","test":"mocha","check":"mongodb-js-precommit"},"_npmUser":{"name":"durran","email":"durran@gmail.com"},"precommit":["check"],"repository":{"url":"git+https://github.com/mongodb-js/mongodb-connection-model.git","type":"git"},"_npmVersion":"3.10.7","description":"MongoDB connection model.","directories":{},"_nodeVersion":"6.3.1","dependencies":{"async":"^2.0.1","debug":"^2.2.0","lodash":"^4.16.4","backoff":"^2.4.1","mongodb":"^2.2.9","kerberos":"^0.0.21","tunnel-ssh":"^4.1.0","mongodb-url":"^1.0.2","ampersand-model":"^8.0.0","ampersand-rest-collection":"^5.0.0"},"devDependencies":{"mocha":"^3.1.2","mongodb-ns":"^1.0.1","pre-commit":"^1.1.2","mongodb-js-fmt":"^0.0.3","mongodb-runner":"^3.3.3","mongodb-js-precommit":"^0.2.9","mongodb-instance-model":"^3.1.5","eslint-config-mongodb-js":"^2.2.0","mongodb-connection-fixture":"^0.0.13"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model-6.1.0.tgz_1477308141261_0.8307706376072019","host":"packages-12-west.internal.npmjs.com"}},"6.2.0":{"name":"mongodb-connection-model","version":"6.2.0","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@6.2.0","maintainers":[{"name":"brahmgardner","email":"brahm.gardner@gmail.com"},{"name":"cilix","email":"matthewlevenstein@gmail.com"},{"name":"dpercy","email":"davetp425@gmail.com"},{"name":"durran","email":"durran@gmail.com"},{"name":"glowe","email":"graham.lowe@gmail.com"},{"name":"i80and","email":"i80and@foxquill.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"machyne","email":"mcotter222@gmail.com"},{"name":"micheal.parks","email":"michealparks1989@gmail.com"},{"name":"mongodb-js-user","email":"lucas.hrabovsky+mongodb-js@10gen.com"},{"name":"redondos","email":"aolivera@gmail.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"schwartzrw","email":"schwartzrw@gmail.com"},{"name":"shum","email":"chris.shum@mongodb.com"},{"name":"wz3chen","email":"waleycz@gmail.com"}],"homepage":"https://github.com/mongodb-js/mongodb-connection-model","bugs":{"url":"https://github.com/mongodb-js/mongodb-connection-model/issues"},"dist":{"shasum":"bcda70d9ed21978b0a621de0598992539fb7b7aa","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-6.2.0.tgz","integrity":"sha512-ECi3sznw2tDjS9dHah7YCjaxhQ92ZFcWwWffuZsstG13T1bGerhy7Auw/TGTwMUwZ960NBKQuJzPEkHnLljerg==","signatures":[{"sig":"MEQCICzs1lyNo2aO8Bv6V46CUfFayp4LYcPC/GIOWHgVaTxxAiAygbrr+qQ9SOgs0HhlNU4NCD8Do1YnYIVpn8cW6pyPGA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"_from":".","_shasum":"bcda70d9ed21978b0a621de0598992539fb7b7aa","browser":"browser.js","gitHead":"2cefbaa1dd829639431751b34fca13cb735d09d5","scripts":{"ci":"npm run check && npm test","fmt":"mongodb-js-fmt ./*.js lib/*.js ./test/*.js","test":"mocha","check":"mongodb-js-precommit"},"_npmUser":{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},"precommit":["check"],"repository":{"url":"git+https://github.com/mongodb-js/mongodb-connection-model.git","type":"git"},"_npmVersion":"3.10.3","description":"MongoDB connection model.","directories":{},"_nodeVersion":"6.5.0","dependencies":{"async":"^2.0.1","debug":"^2.2.0","lodash":"^4.16.4","backoff":"^2.4.1","mongodb":"^2.2.9","kerberos":"^0.0.21","tunnel-ssh":"^4.1.0","mongodb-url":"^1.0.2","ampersand-model":"^8.0.0","ampersand-rest-collection":"^5.0.0"},"devDependencies":{"mocha":"^3.1.2","mongodb-ns":"^1.0.1","pre-commit":"^1.1.2","mongodb-js-fmt":"^0.0.3","mongodb-runner":"^3.3.3","mongodb-js-precommit":"^0.2.9","mongodb-instance-model":"^3.1.5","eslint-config-mongodb-js":"^2.2.0","mongodb-connection-fixture":"^0.0.13"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model-6.2.0.tgz_1477929748346_0.9211542066186666","host":"packages-18-east.internal.npmjs.com"}},"6.3.0":{"name":"mongodb-connection-model","version":"6.3.0","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@6.3.0","maintainers":[{"name":"brahmgardner","email":"brahm.gardner@gmail.com"},{"name":"cilix","email":"matthewlevenstein@gmail.com"},{"name":"dpercy","email":"davetp425@gmail.com"},{"name":"durran","email":"durran@gmail.com"},{"name":"glowe","email":"graham.lowe@gmail.com"},{"name":"i80and","email":"i80and@foxquill.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"machyne","email":"mcotter222@gmail.com"},{"name":"micheal.parks","email":"michealparks1989@gmail.com"},{"name":"mongodb-js-user","email":"lucas.hrabovsky+mongodb-js@10gen.com"},{"name":"redondos","email":"aolivera@gmail.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"schwartzrw","email":"schwartzrw@gmail.com"},{"name":"shum","email":"chris.shum@mongodb.com"},{"name":"wz3chen","email":"waleycz@gmail.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"9fd407b985282fa8f146a05a78c6672e1cfaa53d","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-6.3.0.tgz","integrity":"sha512-KK6kXZzdA2A8wZejESjV9Tj6m2hNLlwmOCEHHBdb5pKEcz/Ody4LuwFNeSRW0i9sAlvcYPcZYjpoScXCpcagFQ==","signatures":[{"sig":"MEUCIQDIG99X22XuVUtjJdnJ060/6J9mSolYo4pXq3jKEMe/sAIgP+uwNKm4KVrEriiOCPAdKBOfepg5cpoL7tKl2P3tBAo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"_from":".","_shasum":"9fd407b985282fa8f146a05a78c6672e1cfaa53d","browser":"browser.js","gitHead":"18274d5ca43fb14cb0e2c722e75e806c2c007b8f","scripts":{"ci":"npm run check && npm test","fmt":"mongodb-js-fmt ./*.js lib/*.js ./test/*.js","test":"mocha","check":"mongodb-js-precommit"},"_npmUser":{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},"precommit":["check"],"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"3.10.3","description":"MongoDB connection model.","directories":{},"_nodeVersion":"6.5.0","dependencies":{"ssh2":"^0.5.2","async":"^2.0.1","debug":"^2.2.0","lodash":"^4.16.4","backoff":"^2.4.1","mongodb":"^2.2.11","kerberos":"^0.0.21","mongodb-url":"^1.0.2","ampersand-model":"^8.0.0","ampersand-rest-collection":"^5.0.0"},"devDependencies":{"mocha":"^3.1.2","mongodb-ns":"^1.0.1","pre-commit":"^1.1.2","mongodb-js-fmt":"^0.0.3","mongodb-runner":"^3.3.3","mongodb-js-precommit":"^0.2.9","mongodb-instance-model":"^3.1.7","eslint-config-mongodb-js":"^2.2.0","mongodb-connection-fixture":"^0.0.13"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model-6.3.0.tgz_1478030708774_0.31116389902308583","host":"packages-12-west.internal.npmjs.com"}},"6.3.1":{"name":"mongodb-connection-model","version":"6.3.1","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@6.3.1","maintainers":[{"name":"brahmgardner","email":"brahm.gardner@gmail.com"},{"name":"cilix","email":"matthewlevenstein@gmail.com"},{"name":"dpercy","email":"davetp425@gmail.com"},{"name":"durran","email":"durran@gmail.com"},{"name":"glowe","email":"graham.lowe@gmail.com"},{"name":"i80and","email":"i80and@foxquill.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"machyne","email":"mcotter222@gmail.com"},{"name":"micheal.parks","email":"michealparks1989@gmail.com"},{"name":"mongodb-js-user","email":"lucas.hrabovsky+mongodb-js@10gen.com"},{"name":"redondos","email":"aolivera@gmail.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"schwartzrw","email":"schwartzrw@gmail.com"},{"name":"shum","email":"chris.shum@mongodb.com"},{"name":"wz3chen","email":"waleycz@gmail.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"c6eeeab45792649fbc60f42073572c0e7e16b142","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-6.3.1.tgz","integrity":"sha512-KBWT3EYuIOkTx/9JZ3Q+jEyLrZ0XnrWBvrjlGXshQeLQM9ubdTXsKZ3Cf+1gNLsoYhN1w9mfOGa1Ctzr/so2CQ==","signatures":[{"sig":"MEYCIQDlm86PuK4yPr7DQjDIKZhIzgbPG9Jtf+/YxH1SUUstzAIhAPi/ikO8BT0tqR3pCBv8Q2aveMQXMYttghud5o4DYmW5","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"_from":".","_shasum":"c6eeeab45792649fbc60f42073572c0e7e16b142","browser":"browser.js","gitHead":"82d4fe10b5ebf109a8f96dc5c069f52d998915a3","scripts":{"ci":"npm run check && npm test","fmt":"mongodb-js-fmt ./*.js lib/*.js ./test/*.js","test":"mocha","check":"mongodb-js-precommit"},"_npmUser":{"name":"pzrq","email":"peter@peterjs.com"},"precommit":["check"],"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"3.10.3","description":"MongoDB connection model.","directories":{},"_nodeVersion":"6.5.0","dependencies":{"ssh2":"^0.5.2","async":"^2.0.1","debug":"^2.2.0","lodash":"^4.16.4","backoff":"^2.4.1","mongodb":"^2.2.11","kerberos":"^0.0.21","mongodb-url":"^1.0.2","ampersand-model":"^8.0.0","ampersand-rest-collection":"^5.0.0"},"devDependencies":{"mocha":"^3.1.2","mongodb-ns":"^1.0.1","pre-commit":"^1.1.2","mongodb-js-fmt":"^0.0.3","mongodb-runner":"^3.3.3","mongodb-js-precommit":"^0.2.9","mongodb-instance-model":"^3.1.7","eslint-config-mongodb-js":"^2.2.0","mongodb-connection-fixture":"^0.0.13"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model-6.3.1.tgz_1478573460581_0.7860774064902216","host":"packages-18-east.internal.npmjs.com"}},"6.3.2":{"name":"mongodb-connection-model","version":"6.3.2","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@6.3.2","maintainers":[{"name":"aherlihy","email":"anna@mongodb.com"},{"name":"brahmgardner","email":"brahm.gardner@gmail.com"},{"name":"cilix","email":"matthewlevenstein@gmail.com"},{"name":"dpercy","email":"davetp425@gmail.com"},{"name":"durran","email":"durran@gmail.com"},{"name":"glowe","email":"graham.lowe@gmail.com"},{"name":"i80and","email":"i80and@foxquill.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"jsmulrow","email":"jack.mulrow@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"justinjmoses","email":"justinjmoses@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"keyboardtsundoku","email":"satyendra.n.sinha@gmail.com"},{"name":"machyne","email":"mcotter222@gmail.com"},{"name":"micheal.parks","email":"michealparks1989@gmail.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"pzrq","email":"peter@peterjs.com"},{"name":"redondos","email":"aolivera@gmail.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"schwartzrw","email":"schwartzrw@gmail.com"},{"name":"shum","email":"chris.shum@mongodb.com"},{"name":"wz3chen","email":"waleycz@gmail.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"9eec6691b81d9e5f96600775f165ecee1d48c535","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-6.3.2.tgz","integrity":"sha512-c3bSNb9s+tTkNdyJUfP1pKcmexwD3uRfZZVFuNL69P216CwM4SUNRNJOUvrRtzFzVEKCzLMzCzVOCBtTy+btNg==","signatures":[{"sig":"MEQCIDNxfB/4uCCuBkyWQrzh+g6P9iqIGWVltPo3QB5tERSYAiBbfAFtxwUEjn/NhPFFRvuanuZEl/G9LK21oCKbPFE0eQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"_from":".","_shasum":"9eec6691b81d9e5f96600775f165ecee1d48c535","browser":"browser.js","gitHead":"1a422ceb663035881e84a67860967f5917412357","scripts":{"ci":"npm run check && npm test","fmt":"mongodb-js-fmt ./*.js lib/*.js ./test/*.js","test":"mocha","check":"mongodb-js-precommit"},"_npmUser":{"name":"pzrq","email":"peter@peterjs.com"},"precommit":["check"],"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"3.10.9","description":"MongoDB connection model.","directories":{},"_nodeVersion":"6.9.1","dependencies":{"ssh2":"^0.5.4","async":"^2.0.1","debug":"^2.2.0","lodash":"^4.16.4","backoff":"^2.4.1","mongodb":"^2.2.11","kerberos":"^0.0.22","mongodb-url":"^1.0.2","ampersand-model":"^8.0.0","ampersand-rest-collection":"^6.0.0"},"devDependencies":{"mocha":"^3.1.2","pre-commit":"^1.1.2","mongodb-js-fmt":"^0.0.3","mongodb-runner":"^3.3.3","mongodb-js-precommit":"^0.2.9","mongodb-instance-model":"^3.1.7","eslint-config-mongodb-js":"^2.2.0","mongodb-connection-fixture":"^0.0.13"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model-6.3.2.tgz_1479198811579_0.215089077828452","host":"packages-18-east.internal.npmjs.com"}},"6.3.3":{"name":"mongodb-connection-model","version":"6.3.3","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@6.3.3","maintainers":[{"name":"aherlihy","email":"anna@mongodb.com"},{"name":"brahmgardner","email":"brahm.gardner@gmail.com"},{"name":"cilix","email":"matthewlevenstein@gmail.com"},{"name":"dpercy","email":"davetp425@gmail.com"},{"name":"durran","email":"durran@gmail.com"},{"name":"glowe","email":"graham.lowe@gmail.com"},{"name":"i80and","email":"i80and@foxquill.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"jsmulrow","email":"jack.mulrow@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"justinjmoses","email":"justinjmoses@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"keyboardtsundoku","email":"satyendra.n.sinha@gmail.com"},{"name":"machyne","email":"mcotter222@gmail.com"},{"name":"micheal.parks","email":"michealparks1989@gmail.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"pzrq","email":"peter@peterjs.com"},{"name":"redondos","email":"aolivera@gmail.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"schwartzrw","email":"schwartzrw@gmail.com"},{"name":"shum","email":"chris.shum@mongodb.com"},{"name":"wz3chen","email":"waleycz@gmail.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"bcb7ae968c341f5c44913e54c105c424d1a849ad","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-6.3.3.tgz","integrity":"sha512-sZakH4fdFakU9xuYuKDJR/EA5Rg+DjFVPxJUPn3LDE5JbmwNSA6x3Y+/h0HIfzTREXjJn1ivt8A6qnPVT63uqA==","signatures":[{"sig":"MEUCIQDyhmA/IyJwrLtHvcQI5WqagG4aDIjgqJKUgmh8nTluGQIgNbsmWUhV35F/OHox1igEsrVU/u0+uDyIGzVPOjMRS04=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"_from":".","_shasum":"bcb7ae968c341f5c44913e54c105c424d1a849ad","browser":"browser.js","gitHead":"ea1bf8e8844826aa4d95b60a66aa7634c48c5a1f","scripts":{"ci":"npm run check && npm test","fmt":"mongodb-js-fmt ./*.js lib/*.js ./test/*.js","test":"mocha","check":"mongodb-js-precommit"},"_npmUser":{"name":"rueckstiess","email":"thomas@rueckstiess.net"},"precommit":["check"],"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"3.10.3","description":"MongoDB connection model.","directories":{},"_nodeVersion":"6.3.1","dependencies":{"ssh2":"^0.5.4","async":"^2.0.1","debug":"^2.2.0","lodash":"^4.16.4","backoff":"^2.4.1","mongodb":"^2.2.11","kerberos":"^0.0.22","mongodb-url":"^1.0.2","ampersand-model":"^8.0.0","ampersand-rest-collection":"^6.0.0"},"devDependencies":{"mocha":"^3.1.2","pre-commit":"^1.1.2","mongodb-js-fmt":"^0.0.3","mongodb-runner":"^3.3.3","mongodb-js-precommit":"^0.2.9","mongodb-instance-model":"^3.1.7","eslint-config-mongodb-js":"^2.2.0","mongodb-connection-fixture":"^0.0.13"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model-6.3.3.tgz_1479446006165_0.9006049516610801","host":"packages-12-west.internal.npmjs.com"}},"6.3.4":{"name":"mongodb-connection-model","version":"6.3.4","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@6.3.4","maintainers":[{"name":"aherlihy","email":"anna@mongodb.com"},{"name":"brahmgardner","email":"brahm.gardner@gmail.com"},{"name":"cilix","email":"matthewlevenstein@gmail.com"},{"name":"dpercy","email":"davetp425@gmail.com"},{"name":"durran","email":"durran@gmail.com"},{"name":"glowe","email":"graham.lowe@gmail.com"},{"name":"i80and","email":"i80and@foxquill.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"jsmulrow","email":"jack.mulrow@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"justinjmoses","email":"justinjmoses@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"keyboardtsundoku","email":"satyendra.n.sinha@gmail.com"},{"name":"machyne","email":"mcotter222@gmail.com"},{"name":"micheal.parks","email":"michealparks1989@gmail.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"pzrq","email":"peter@peterjs.com"},{"name":"redondos","email":"aolivera@gmail.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"schwartzrw","email":"schwartzrw@gmail.com"},{"name":"shum","email":"chris.shum@mongodb.com"},{"name":"wz3chen","email":"waleycz@gmail.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"e9fc75f11a5309b52f38a36286cc1471790659f8","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-6.3.4.tgz","integrity":"sha512-bt2TxWdvQp+wJGOvpdc1SIN0MocWk08MB1eqTGXv1j+AcVLRcIPM236/HP3LsvJYltqFDqU7yeLiq558cgnMnw==","signatures":[{"sig":"MEYCIQDTyBHeYOsJpOpJKw40W/dYTFKd2VGsL5atZAcDleRLOgIhAPDvjcA6mRYADB0oI9+lYuuhVhRi7d8TLTiiM5rlKsWb","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"_from":".","_shasum":"e9fc75f11a5309b52f38a36286cc1471790659f8","browser":"browser.js","gitHead":"86768ece5077e973e4cfe4422afd4a419f91ffb9","scripts":{"ci":"npm run check && npm test","fmt":"mongodb-js-fmt ./*.js lib/*.js ./test/*.js","test":"mocha","check":"mongodb-js-precommit","pretest":"mongodb-runner install"},"_npmUser":{"name":"pzrq","email":"peter@peterjs.com"},"precommit":["check"],"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"3.10.9","description":"MongoDB connection model.","directories":{},"_nodeVersion":"6.9.1","dependencies":{"ssh2":"^0.5.4","async":"^2.0.1","debug":"^2.3.3","lodash":"^4.16.4","backoff":"^2.4.1","mongodb":"^2.2.11","kerberos":"^0.0.22","mongodb-url":"^1.0.2","ampersand-model":"^8.0.0","ampersand-rest-collection":"^6.0.0"},"devDependencies":{"mocha":"^3.1.2","pre-commit":"^1.1.2","mongodb-js-fmt":"^0.0.3","mongodb-runner":"^3.3.3","mongodb-js-precommit":"^0.2.9","mongodb-instance-model":"^3.1.7","eslint-config-mongodb-js":"^2.2.0","mongodb-connection-fixture":"^0.0.13"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model-6.3.4.tgz_1481247648500_0.9239045917056501","host":"packages-18-east.internal.npmjs.com"}},"6.3.5":{"name":"mongodb-connection-model","version":"6.3.5","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@6.3.5","maintainers":[{"name":"aherlihy","email":"anna@mongodb.com"},{"name":"brahmgardner","email":"brahm.gardner@gmail.com"},{"name":"cilix","email":"matthewlevenstein@gmail.com"},{"name":"dpercy","email":"davetp425@gmail.com"},{"name":"durran","email":"durran@gmail.com"},{"name":"glowe","email":"graham.lowe@gmail.com"},{"name":"i80and","email":"i80and@foxquill.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"jsmulrow","email":"jack.mulrow@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"justinjmoses","email":"justinjmoses@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"keyboardtsundoku","email":"satyendra.n.sinha@gmail.com"},{"name":"machyne","email":"mcotter222@gmail.com"},{"name":"micheal.parks","email":"michealparks1989@gmail.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"pzrq","email":"peter@peterjs.com"},{"name":"redondos","email":"aolivera@gmail.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"schwartzrw","email":"schwartzrw@gmail.com"},{"name":"shum","email":"chris.shum@mongodb.com"},{"name":"wz3chen","email":"waleycz@gmail.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"3a693f0741ee022b351a4ed58214d4dff9698535","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-6.3.5.tgz","integrity":"sha512-OcuBDO+m+kkiBk7YUF8b4DU+mmRYN0GBCKvBi/WuC94JyNIB1EX2RuwrxBOKqyatWPigG5ecnChsXFf8/CarkQ==","signatures":[{"sig":"MEYCIQDwx6r7MzTVpSPlAmLYL47R601J12l1RLcL8nhRqRaiqwIhALqcaV0TKbtJzNySV7UxO5k7jMS/3THP36l3d2Pas4ic","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"_from":".","_shasum":"3a693f0741ee022b351a4ed58214d4dff9698535","browser":"browser.js","gitHead":"c652b9d95f978cb7ff44c4ca501b262a5b91a8bf","scripts":{"ci":"npm run check && npm test","fmt":"mongodb-js-fmt ./*.js lib/*.js ./test/*.js","test":"mocha","check":"mongodb-js-precommit","pretest":"mongodb-runner install"},"_npmUser":{"name":"rueckstiess","email":"thomas@rueckstiess.net"},"precommit":["check"],"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"3.10.3","description":"MongoDB connection model.","directories":{},"_nodeVersion":"6.3.1","dependencies":{"ssh2":"^0.5.4","async":"^2.0.1","debug":"^2.3.3","lodash":"^4.16.4","backoff":"^2.4.1","mongodb":"^2.2.11","kerberos":"^0.0.22","mongodb-url":"^1.0.2","ampersand-model":"^8.0.0","ampersand-rest-collection":"^6.0.0"},"devDependencies":{"mocha":"^3.1.2","sinon":"^1.17.7","pre-commit":"^1.1.2","mock-require":"^2.0.1","mongodb-js-fmt":"^0.0.3","mongodb-runner":"^3.3.3","mongodb-js-precommit":"^0.2.9","mongodb-instance-model":"^3.1.7","eslint-config-mongodb-js":"^2.2.0","mongodb-connection-fixture":"^0.0.14"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model-6.3.5.tgz_1484027091071_0.9242784345988184","host":"packages-18-east.internal.npmjs.com"}},"6.4.0":{"name":"mongodb-connection-model","version":"6.4.0","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@6.4.0","maintainers":[{"name":"aherlihy","email":"anna@mongodb.com"},{"name":"brahmgardner","email":"brahm.gardner@gmail.com"},{"name":"cilix","email":"matthewlevenstein@gmail.com"},{"name":"dpercy","email":"davetp425@gmail.com"},{"name":"durran","email":"durran@gmail.com"},{"name":"glowe","email":"graham.lowe@gmail.com"},{"name":"i80and","email":"i80and@foxquill.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"jsmulrow","email":"jack.mulrow@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"justinjmoses","email":"justinjmoses@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"keyboardtsundoku","email":"satyendra.n.sinha@gmail.com"},{"name":"machyne","email":"mcotter222@gmail.com"},{"name":"micheal.parks","email":"michealparks1989@gmail.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"pzrq","email":"peter@peterjs.com"},{"name":"redondos","email":"aolivera@gmail.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"schwartzrw","email":"schwartzrw@gmail.com"},{"name":"shum","email":"chris.shum@mongodb.com"},{"name":"wz3chen","email":"waleycz@gmail.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"8dc1c4fa05efd84d87b99877d1f56e3c2b318da7","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-6.4.0.tgz","integrity":"sha512-65TF33feelHS4fivogGpOfq2T/fr3CL3TWnPSpwaIo/Gr1GxvY30WUP0wCo5wmgV7mSMpFvmCifVy4MGSfZO/w==","signatures":[{"sig":"MEYCIQDtMmlIyEYmLq+Tj3smip1i0Xpce4e3gH8IM3C3+OWKXAIhAOMKRiofUvxlhKP1cFVYmob6twPBVCXhGV4JBSuc7wCG","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"_from":".","_shasum":"8dc1c4fa05efd84d87b99877d1f56e3c2b318da7","browser":"browser.js","gitHead":"839858f9ffb8fc9e2f4df723c991ab9da4c67204","scripts":{"ci":"npm run check && npm test","fmt":"mongodb-js-fmt ./*.js lib/*.js ./test/*.js","test":"mocha","check":"mongodb-js-precommit","pretest":"mongodb-runner install"},"_npmUser":{"name":"durran","email":"durran@gmail.com"},"precommit":["check"],"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"3.10.7","description":"MongoDB connection model.","directories":{},"_nodeVersion":"6.3.1","dependencies":{"ssh2":"^0.5.4","async":"^2.0.1","debug":"^2.6.0","lodash":"^4.16.4","backoff":"^2.4.1","mongodb":"^2.2.23","kerberos":"^0.0.22","mongodb-url":"^1.0.2","ampersand-model":"^8.0.0","ampersand-rest-collection":"^6.0.0"},"devDependencies":{"mocha":"^3.2.0","sinon":"^1.17.7","pre-commit":"^1.1.2","mock-require":"^2.0.1","mongodb-js-fmt":"^0.0.3","mongodb-runner":"^3.3.3","mongodb-js-precommit":"^0.2.9","mongodb-instance-model":"^3.1.7","eslint-config-mongodb-js":"^2.2.0","mongodb-connection-fixture":"^0.0.14"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model-6.4.0.tgz_1487054368790_0.7234118662308902","host":"packages-18-east.internal.npmjs.com"}},"6.4.1":{"name":"mongodb-connection-model","version":"6.4.1","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@6.4.1","maintainers":[{"name":"aherlihy","email":"anna@mongodb.com"},{"name":"brahmgardner","email":"brahm.gardner@gmail.com"},{"name":"cilix","email":"matthewlevenstein@gmail.com"},{"name":"dpercy","email":"davetp425@gmail.com"},{"name":"durran","email":"durran@gmail.com"},{"name":"glowe","email":"graham.lowe@gmail.com"},{"name":"i80and","email":"i80and@foxquill.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"jsmulrow","email":"jack.mulrow@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"justinjmoses","email":"justinjmoses@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"keyboardtsundoku","email":"satyendra.n.sinha@gmail.com"},{"name":"machyne","email":"mcotter222@gmail.com"},{"name":"micheal.parks","email":"michealparks1989@gmail.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"pzrq","email":"peter@peterjs.com"},{"name":"redondos","email":"aolivera@gmail.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"schwartzrw","email":"schwartzrw@gmail.com"},{"name":"shum","email":"chris.shum@mongodb.com"},{"name":"wz3chen","email":"waleycz@gmail.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"f6049a7c5f24df83cbbb47c23b0139ef3f25812e","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-6.4.1.tgz","integrity":"sha512-c7esldQ/8e/fh1Ow0J1+TdQSqZ1Ht2JrkZczSWDwYA1D38InxPs0bhhVXFhfkFUovNwL0JKeBFxb8kqJpsyE1w==","signatures":[{"sig":"MEYCIQC964emS0W0IxppQ4hpr2/mHPqH3+PK1fMkrcfW5kBV0gIhAJuavoJVdq6Us0y3Il8W6vyuBT+bQNF8gJXsuwAq643p","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"_from":".","_shasum":"f6049a7c5f24df83cbbb47c23b0139ef3f25812e","browser":"browser.js","gitHead":"011d0936dc04199d8b489d76247f212d31b1d3bf","scripts":{"ci":"npm run check && npm test","fmt":"mongodb-js-fmt ./*.js lib/*.js ./test/*.js","test":"mocha","check":"mongodb-js-precommit","pretest":"mongodb-runner install"},"_npmUser":{"name":"pzrq","email":"peter@peterjs.com"},"precommit":["check"],"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"3.10.10","description":"MongoDB connection model.","directories":{},"_nodeVersion":"6.10.0","dependencies":{"ssh2":"^0.5.4","async":"^2.0.1","debug":"^2.6.0","lodash":"^4.16.4","backoff":"^2.4.1","mongodb":"^2.2.24","kerberos":"^0.0.22","mongodb-url":"^1.0.2","ampersand-model":"^8.0.0","ampersand-rest-collection":"^6.0.0"},"devDependencies":{"mocha":"^3.2.0","sinon":"^1.17.7","pre-commit":"^1.1.2","mock-require":"^2.0.1","mongodb-js-fmt":"^0.0.3","mongodb-runner":"^3.3.3","mongodb-js-precommit":"^0.2.9","mongodb-instance-model":"^3.1.7","eslint-config-mongodb-js":"^2.2.0","mongodb-connection-fixture":"^0.0.14"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model-6.4.1.tgz_1488338342806_0.7890043791849166","host":"packages-18-east.internal.npmjs.com"}},"6.4.2":{"name":"mongodb-connection-model","version":"6.4.2","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@6.4.2","maintainers":[{"name":"aherlihy","email":"anna@mongodb.com"},{"name":"brahmgardner","email":"brahm.gardner@gmail.com"},{"name":"cilix","email":"matthewlevenstein@gmail.com"},{"name":"dpercy","email":"davetp425@gmail.com"},{"name":"durran","email":"durran@gmail.com"},{"name":"glowe","email":"graham.lowe@gmail.com"},{"name":"i80and","email":"i80and@foxquill.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"jsmulrow","email":"jack.mulrow@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"justinjmoses","email":"justinjmoses@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"keyboardtsundoku","email":"satyendra.n.sinha@gmail.com"},{"name":"machyne","email":"mcotter222@gmail.com"},{"name":"micheal.parks","email":"michealparks1989@gmail.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"pzrq","email":"peter@peterjs.com"},{"name":"redondos","email":"aolivera@gmail.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"schwartzrw","email":"schwartzrw@gmail.com"},{"name":"shum","email":"chris.shum@mongodb.com"},{"name":"wz3chen","email":"waleycz@gmail.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"f1314732be8ec455ad1a0c73c4eacbe35ea56e19","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-6.4.2.tgz","integrity":"sha512-IqWhCLbhBwxfI/tICiMCBrf1fje3qnxPr2O0TlVeM3lauP6Yeoyf1LFpPbQNNrlqnc5MY5cCkIrVoyA0zmkEOw==","signatures":[{"sig":"MEUCIQC1O6mroiBTkfXWlnlfrZnrX+BO2HdMYTV9oKBCd8XOIgIgfSBjf64doadxrWQ5/DIoLfxrLA9d6jDN26koFQBQzUg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"_from":".","_shasum":"f1314732be8ec455ad1a0c73c4eacbe35ea56e19","browser":"browser.js","gitHead":"2f7b22ddcf3d742b1b3417000ad911c86d04d40c","scripts":{"ci":"npm run check && npm test","fmt":"mongodb-js-fmt ./*.js lib/*.js ./test/*.js","test":"mocha","check":"mongodb-js-precommit","pretest":"mongodb-runner install"},"_npmUser":{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},"precommit":["check"],"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"3.10.10","description":"MongoDB connection model.","directories":{},"_nodeVersion":"6.5.0","dependencies":{"ssh2":"^0.5.4","async":"^2.1.5","debug":"^2.6.0","lodash":"^4.16.4","backoff":"^2.4.1","mongodb":"^2.2.24","kerberos":"^0.0.22","mongodb-url":"^1.0.2","ampersand-model":"^8.0.0","ampersand-rest-collection":"^6.0.0"},"devDependencies":{"mocha":"^3.2.0","sinon":"^1.17.7","pre-commit":"^1.1.2","mock-require":"^2.0.1","mongodb-js-fmt":"^0.0.3","mongodb-runner":"^3.3.3","mongodb-js-precommit":"^0.2.9","mongodb-instance-model":"^3.1.7","eslint-config-mongodb-js":"^2.2.0","mongodb-connection-fixture":"^0.0.14"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model-6.4.2.tgz_1488385441202_0.877820496680215","host":"packages-18-east.internal.npmjs.com"}},"6.4.3":{"name":"mongodb-connection-model","version":"6.4.3","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@6.4.3","maintainers":[{"name":"aherlihy","email":"anna@mongodb.com"},{"name":"brahmgardner","email":"brahm.gardner@gmail.com"},{"name":"cilix","email":"matthewlevenstein@gmail.com"},{"name":"dpercy","email":"davetp425@gmail.com"},{"name":"durran","email":"durran@gmail.com"},{"name":"glowe","email":"graham.lowe@gmail.com"},{"name":"i80and","email":"i80and@foxquill.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"jsmulrow","email":"jack.mulrow@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"justinjmoses","email":"justinjmoses@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"keyboardtsundoku","email":"satyendra.n.sinha@gmail.com"},{"name":"machyne","email":"mcotter222@gmail.com"},{"name":"micheal.parks","email":"michealparks1989@gmail.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"pzrq","email":"peter@peterjs.com"},{"name":"redondos","email":"aolivera@gmail.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"schwartzrw","email":"schwartzrw@gmail.com"},{"name":"shum","email":"chris.shum@mongodb.com"},{"name":"wz3chen","email":"waleycz@gmail.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"7e51cf158ae499554c6d0f43dfa127efe978d9ce","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-6.4.3.tgz","integrity":"sha512-5sW+1s3i2bG1fqPloSltprU7lVPC0TSBx8oA02/2Lf1ROMrOQLpL1eZweUQsE7iMXBdN/4KFpKP2BPsSg0mfsA==","signatures":[{"sig":"MEUCIQDQ93CwyP10VP6kzYMWi6gwblvubnf4xfHPITz4QTCA9wIgUP4aG4xno2qOy8IUord0v6i+7BJqLEhpuE57QxEeCvY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"_from":".","_shasum":"7e51cf158ae499554c6d0f43dfa127efe978d9ce","browser":"browser.js","gitHead":"6bdb5e5269d2b60a7b0b57c21e39d246b82c9c96","scripts":{"ci":"npm run check && npm test","fmt":"mongodb-js-fmt ./*.js lib/*.js ./test/*.js","test":"mocha","check":"mongodb-js-precommit","pretest":"mongodb-runner install"},"_npmUser":{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},"precommit":["check"],"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"3.10.10","description":"MongoDB connection model.","directories":{},"_nodeVersion":"6.5.0","dependencies":{"ssh2":"^0.5.4","async":"^2.1.5","debug":"^2.6.0","lodash":"^4.16.4","backoff":"^2.4.1","mongodb":"^2.2.24","kerberos":"^0.0.22","mongodb-url":"^1.0.2","ampersand-model":"^8.0.0","ampersand-rest-collection":"^6.0.0"},"devDependencies":{"mocha":"^3.2.0","sinon":"^1.17.7","pre-commit":"^1.1.2","mock-require":"^2.0.1","mongodb-js-fmt":"^0.0.3","mongodb-runner":"^3.3.3","mongodb-js-precommit":"^0.2.9","mongodb-instance-model":"^3.1.7","eslint-config-mongodb-js":"^2.2.0","mongodb-connection-fixture":"^0.0.14"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model-6.4.3.tgz_1488815775449_0.6960940395947546","host":"packages-18-east.internal.npmjs.com"}},"6.5.0":{"name":"mongodb-connection-model","version":"6.5.0","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@6.5.0","maintainers":[{"name":"aherlihy","email":"anna@mongodb.com"},{"name":"christkv","email":"christkv@gmail.com"},{"name":"cilix","email":"matthewlevenstein@gmail.com"},{"name":"dpercy","email":"davetp425@gmail.com"},{"name":"durran","email":"durran@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"glowe","email":"graham.lowe@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"justinjmoses","email":"justinjmoses@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"keyboardtsundoku","email":"satyendra.n.sinha@gmail.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"micheal.parks","email":"michealparks1989@gmail.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"mpobrien","email":"mpobrien005@gmail.com"},{"name":"pzrq","email":"peter@peterjs.com"},{"name":"redondos","email":"aolivera@gmail.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"schwartzrw","email":"schwartzrw@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"cfca694afebe2657aa6e60831289ccafd60ca010","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-6.5.0.tgz","integrity":"sha512-1A+64tA9N2jFKjNbyV3nzag0Dj6LO8s8SXJ4V8a45aJasiZekRTUANwXT+rz5aQnPXwl4RprPYw5oSVVO/kvIQ==","signatures":[{"sig":"MEUCIQCO75jWl/dYboptNTaEMWgAH6dpNg3Qs9aaP9rdijruUgIgQ6k68NPL6/LF3V6SZ5dAHOrQUp+qegs1DXw4NGVPoYY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"_from":".","_shasum":"cfca694afebe2657aa6e60831289ccafd60ca010","browser":"browser.js","gitHead":"c30c4f10d6263825e23f14fa1f4d745e7dd4be89","scripts":{"ci":"npm run check && npm test","fmt":"mongodb-js-fmt ./*.js lib/*.js ./test/*.js","test":"mocha","check":"mongodb-js-precommit","pretest":"mongodb-runner install"},"_npmUser":{"name":"rueckstiess","email":"thomas@rueckstiess.net"},"precommit":["check"],"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"4.0.5","description":"MongoDB connection model.","directories":{},"_nodeVersion":"7.4.0","dependencies":{"ssh2":"^0.5.4","async":"^2.1.5","debug":"^2.6.0","lodash":"^4.16.4","backoff":"^2.4.1","mongodb":"^2.2.24","kerberos":"^0.0.22","mongodb-url":"^1.0.2","ampersand-model":"^8.0.0","ampersand-rest-collection":"^6.0.0"},"devDependencies":{"mocha":"^3.2.0","sinon":"^1.17.7","pre-commit":"^1.1.2","mock-require":"^2.0.1","mongodb-js-fmt":"^0.0.3","mongodb-runner":"^3.3.3","mongodb-js-precommit":"^0.2.9","mongodb-instance-model":"^3.1.7","eslint-config-mongodb-js":"^2.2.0","mongodb-connection-fixture":"^0.0.14"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model-6.5.0.tgz_1492746300229_0.9966232446022332","host":"packages-12-west.internal.npmjs.com"}},"6.5.1":{"name":"mongodb-connection-model","version":"6.5.1","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@6.5.1","maintainers":[{"name":"aherlihy","email":"anna@mongodb.com"},{"name":"christkv","email":"christkv@gmail.com"},{"name":"cilix","email":"matthewlevenstein@gmail.com"},{"name":"dpercy","email":"davetp425@gmail.com"},{"name":"durran","email":"durran@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"glowe","email":"graham.lowe@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"justinjmoses","email":"justinjmoses@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"keyboardtsundoku","email":"satyendra.n.sinha@gmail.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"micheal.parks","email":"michealparks1989@gmail.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"mpobrien","email":"mpobrien005@gmail.com"},{"name":"pzrq","email":"peter@peterjs.com"},{"name":"redondos","email":"aolivera@gmail.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"schwartzrw","email":"schwartzrw@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"96cbd58f1c7f1e7ad5e5d8aabaa1f04684a18a4d","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-6.5.1.tgz","integrity":"sha512-UyxCPQ7nZzTgAOiYdtPRgBHFA2lEay8bxJynCE07nWhKN3nCDi2BBkO8eVj1l4aMi3BBNcjv8DI3zgtvT7vtbQ==","signatures":[{"sig":"MEQCIDxtPkjDtnsf1NhJ2OBp30DNd6HF8vYRj++TEM7Dwmq1AiBmcSNr31xkXDcMh7V0V2EhNQ5pbpFQXJEpQo6dUgiTag==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"_from":".","_shasum":"96cbd58f1c7f1e7ad5e5d8aabaa1f04684a18a4d","browser":"browser.js","gitHead":"37e096e2cbb488163033ce2011a5c14fac738193","scripts":{"ci":"npm run check && npm test","fmt":"mongodb-js-fmt ./*.js lib/*.js ./test/*.js","test":"mocha","check":"mongodb-js-precommit","pretest":"mongodb-runner install"},"_npmUser":{"name":"keyboardtsundoku","email":"satyendra.n.sinha@gmail.com"},"precommit":["check"],"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"4.0.5","description":"MongoDB connection model.","directories":{},"_nodeVersion":"7.4.0","dependencies":{"ssh2":"^0.5.4","async":"^2.1.5","debug":"^2.6.0","lodash":"^4.16.4","backoff":"^2.4.1","mongodb":"^2.2.24","kerberos":"^0.0.22","mongodb-url":"^1.0.2","ampersand-model":"^8.0.0","ampersand-rest-collection":"^6.0.0"},"devDependencies":{"mocha":"^3.2.0","sinon":"^1.17.7","pre-commit":"^1.1.2","mock-require":"^2.0.1","mongodb-js-fmt":"^0.0.3","mongodb-runner":"^3.3.3","mongodb-js-precommit":"^0.2.9","mongodb-instance-model":"^3.1.7","eslint-config-mongodb-js":"^2.2.0","mongodb-connection-fixture":"^0.0.14"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model-6.5.1.tgz_1493000171270_0.5102910879068077","host":"packages-12-west.internal.npmjs.com"}},"6.5.2":{"name":"mongodb-connection-model","version":"6.5.2","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@6.5.2","maintainers":[{"name":"aherlihy","email":"anna@mongodb.com"},{"name":"christkv","email":"christkv@gmail.com"},{"name":"cilix","email":"matthewlevenstein@gmail.com"},{"name":"dpercy","email":"davetp425@gmail.com"},{"name":"durran","email":"durran@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"glowe","email":"graham.lowe@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"justinjmoses","email":"justinjmoses@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"keyboardtsundoku","email":"satyendra.n.sinha@gmail.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"micheal.parks","email":"michealparks1989@gmail.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"mpobrien","email":"mpobrien005@gmail.com"},{"name":"pzrq","email":"peter@peterjs.com"},{"name":"redondos","email":"aolivera@gmail.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"schwartzrw","email":"schwartzrw@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"e6330284db0581a958d94a91f538b098d4d7bd5b","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-6.5.2.tgz","integrity":"sha512-6xTbwSYLB+8euOlAXsSOYCDAxKfCz6CeF0lwvvEDO0WHOQ4ozka8lIS1YTUHIPwG9vNpqhgvDnhziUWTF5almg==","signatures":[{"sig":"MEUCIQDFp/0ciL/g2d0503dCbKo8xfyTyoptB5/gTiIMI1tAfQIgQ4FVq3cg+tM4t5NjY+YZU4vRwl4T7e53fJxCyrhv5Yc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"_from":".","_shasum":"e6330284db0581a958d94a91f538b098d4d7bd5b","browser":"browser.js","gitHead":"ff47e79f6c6c416885efa39240bdee1d4dcaa8bc","scripts":{"ci":"npm run check && npm test","fmt":"mongodb-js-fmt ./*.js lib/*.js ./test/*.js","test":"mocha","check":"mongodb-js-precommit","pretest":"mongodb-runner install"},"_npmUser":{"name":"pzrq","email":"peter@peterjs.com"},"precommit":["check"],"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"4.0.5","description":"MongoDB connection model.","directories":{},"_nodeVersion":"7.4.0","dependencies":{"ssh2":"^0.5.4","async":"^2.1.5","debug":"^2.6.0","lodash":"^4.16.4","backoff":"^2.4.1","mongodb":"^2.2.24","kerberos":"^0.0.22","mongodb-url":"^1.0.2","ampersand-model":"^8.0.0","ampersand-rest-collection":"^6.0.0"},"devDependencies":{"mocha":"^3.2.0","sinon":"^1.17.7","pre-commit":"^1.1.2","mock-require":"^2.0.1","mongodb-js-fmt":"^0.0.3","mongodb-runner":"^3.3.3","mongodb-js-precommit":"^0.2.9","mongodb-instance-model":"^3.1.7","eslint-config-mongodb-js":"^2.2.0","mongodb-connection-fixture":"^0.0.14"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model-6.5.2.tgz_1493230738247_0.24144951277412474","host":"packages-18-east.internal.npmjs.com"}},"7.0.0":{"name":"mongodb-connection-model","version":"7.0.0","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@7.0.0","maintainers":[{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"terakilobyte","email":"terakilobyte@gmail.com"},{"name":"jimol","email":"jim.oleary@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"mpobrien","email":"mpobrien005@gmail.com"},{"name":"christkv","email":"christkv@gmail.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"keyboardtsundoku","email":"satyendra.n.sinha@gmail.com"},{"name":"pzrq","email":"peter@peterjs.com"},{"name":"justinjmoses","email":"justinjmoses@gmail.com"},{"name":"aherlihy","email":"anna@mongodb.com"},{"name":"redondos","email":"aolivera@gmail.com"},{"name":"dpercy","email":"davetp425@gmail.com"},{"name":"cilix","email":"matthewlevenstein@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"glowe","email":"graham.lowe@gmail.com"},{"name":"micheal.parks","email":"michealparks1989@gmail.com"},{"name":"schwartzrw","email":"schwartzrw@gmail.com"},{"name":"durran","email":"durran@gmail.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"1cc2e16abfef173ae15f0ecbeca50319ab919359","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-7.0.0.tgz","integrity":"sha512-3fbV26Hm2CTH2NkzmHWCP/dlsts6L/rNKO0fZc9fKBKEH0nY9It6Z8gbrOcaLKC+zsWpnqP6y2Rj/PHW7OmNcw==","signatures":[{"sig":"MEQCIFgggszeVpi85F3beTJkmjkMdT3XIMpkjW4p1q+R0u3OAiB77E0IYY/b5yPJEb5x0fZBTWaPGFjstI2tG0kTnxi0OA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"_from":".","_shasum":"1cc2e16abfef173ae15f0ecbeca50319ab919359","browser":"browser.js","gitHead":"9a3671017768b9c4beac003f7133ac840c168c0d","scripts":{"ci":"npm run check && npm test","fmt":"mongodb-js-fmt ./*.js lib/*.js ./test/*.js","test":"mocha","check":"mongodb-js-precommit","pretest":"mongodb-runner install"},"_npmUser":{"name":"durran","email":"durran@gmail.com"},"precommit":["check"],"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"4.0.5","description":"MongoDB connection model.","directories":{},"_nodeVersion":"7.4.0","dependencies":{"ssh2":"^0.5.4","async":"^2.1.5","debug":"^2.6.0","lodash":"^4.16.4","backoff":"^2.4.1","mongodb":"^2.2.27","kerberos":"^0.0.22","mongodb-url":"^1.0.2","ampersand-model":"^8.0.0","ampersand-rest-collection":"^6.0.0"},"devDependencies":{"mocha":"^3.2.0","sinon":"^1.17.7","pre-commit":"^1.1.2","mock-require":"^2.0.1","mongodb-js-fmt":"^0.0.3","mongodb-runner":"^3.3.3","mongodb-js-precommit":"^0.2.9","mongodb-instance-model":"^3.1.7","eslint-config-mongodb-js":"^2.2.0","mongodb-connection-fixture":"^0.0.14"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model-7.0.0.tgz_1495499409196_0.0808414847124368","host":"s3://npm-registry-packages"}},"8.0.0-beta.0":{"name":"mongodb-connection-model","version":"8.0.0-beta.0","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@8.0.0-beta.0","maintainers":[{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"terakilobyte","email":"terakilobyte@gmail.com"},{"name":"jimol","email":"jim.oleary@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"mpobrien","email":"mpobrien005@gmail.com"},{"name":"christkv","email":"christkv@gmail.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"keyboardtsundoku","email":"satyendra.n.sinha@gmail.com"},{"name":"pzrq","email":"peter@peterjs.com"},{"name":"justinjmoses","email":"justinjmoses@gmail.com"},{"name":"aherlihy","email":"anna@mongodb.com"},{"name":"redondos","email":"aolivera@gmail.com"},{"name":"dpercy","email":"davetp425@gmail.com"},{"name":"cilix","email":"matthewlevenstein@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"glowe","email":"graham.lowe@gmail.com"},{"name":"micheal.parks","email":"michealparks1989@gmail.com"},{"name":"schwartzrw","email":"schwartzrw@gmail.com"},{"name":"durran","email":"durran@gmail.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"45f480018198a90aa94dd984db381320fa605009","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-8.0.0-beta.0.tgz","integrity":"sha512-cahKeioR55KsdC0rrm4zMEksV9VvMqNw7vlty+ei+5fw5rBSgRUMesyPOb/8/ZoBPicyKn0FU5qkQlXGr+zuAw==","signatures":[{"sig":"MEYCIQDtLWweKJ3RIpxhlnF+yYSzhCrxOV3AhXFFkKICU+ytNwIhAO33c64n/Oz4noBCsNX5jbuoG1WYci/RkbVGH7PW242U","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"_from":".","_shasum":"45f480018198a90aa94dd984db381320fa605009","browser":"browser.js","gitHead":"eca095abfccb35c0f96597239c75b04d54312395","scripts":{"ci":"npm run check && npm test","fmt":"mongodb-js-fmt ./*.js lib/*.js ./test/*.js","test":"mocha","check":"mongodb-js-precommit","pretest":"mongodb-runner install"},"_npmUser":{"name":"durran","email":"durran@gmail.com"},"precommit":["check"],"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"4.0.5","description":"MongoDB connection model.","directories":{},"_nodeVersion":"7.4.0","dependencies":{"ssh2":"^0.5.4","async":"^2.1.5","debug":"^2.6.0","lodash":"^4.16.4","backoff":"^2.4.1","mongodb":"github:mongodb/node-mongodb-native#2.2","kerberos":"^0.0.22","mongodb-url":"^1.0.2","ampersand-model":"^8.0.0","ampersand-rest-collection":"^6.0.0"},"devDependencies":{"mocha":"^3.2.0","sinon":"^1.17.7","pre-commit":"^1.1.2","mock-require":"^2.0.1","mongodb-js-fmt":"^0.0.3","mongodb-runner":"^3.3.3","mongodb-js-precommit":"^0.2.9","mongodb-instance-model":"^3.1.7","eslint-config-mongodb-js":"^2.2.0","mongodb-connection-fixture":"^0.0.14"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model-8.0.0-beta.0.tgz_1495835277266_0.7561270582955331","host":"s3://npm-registry-packages"}},"8.0.0-beta.1":{"name":"mongodb-connection-model","version":"8.0.0-beta.1","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@8.0.0-beta.1","maintainers":[{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"terakilobyte","email":"terakilobyte@gmail.com"},{"name":"jimol","email":"jim.oleary@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"mpobrien","email":"mpobrien005@gmail.com"},{"name":"christkv","email":"christkv@gmail.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"keyboardtsundoku","email":"satyendra.n.sinha@gmail.com"},{"name":"pzrq","email":"peter@peterjs.com"},{"name":"justinjmoses","email":"justinjmoses@gmail.com"},{"name":"aherlihy","email":"anna@mongodb.com"},{"name":"redondos","email":"aolivera@gmail.com"},{"name":"dpercy","email":"davetp425@gmail.com"},{"name":"cilix","email":"matthewlevenstein@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"glowe","email":"graham.lowe@gmail.com"},{"name":"micheal.parks","email":"michealparks1989@gmail.com"},{"name":"schwartzrw","email":"schwartzrw@gmail.com"},{"name":"durran","email":"durran@gmail.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"0752713843b8328cfd1648f4290f71ffab01f356","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-8.0.0-beta.1.tgz","integrity":"sha512-fRWTde3GsMehanfVmGYR6irDzg861x50jgqhhpowcW6s/iRbNnuaBEikmbcGocDDcZqPrhzmtSZGJfGHj/sSvg==","signatures":[{"sig":"MEQCIHyzgELLksrX/1/e4K2L97hLoawLxBU+Lq3d/OmYbr91AiBolY7pW1SvgCaiglVwLcWV+CbQVakjSx3jWvc+eVP12g==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"_from":".","_shasum":"0752713843b8328cfd1648f4290f71ffab01f356","browser":"browser.js","gitHead":"ab770bbfa6dd1955ab42791466ad0a62054342ed","scripts":{"ci":"npm run check && npm test","fmt":"mongodb-js-fmt ./*.js lib/*.js ./test/*.js","test":"mocha","check":"mongodb-js-precommit","pretest":"mongodb-runner install"},"_npmUser":{"name":"durran","email":"durran@gmail.com"},"precommit":["check"],"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"4.0.5","description":"MongoDB connection model.","directories":{},"_nodeVersion":"7.4.0","dependencies":{"ssh2":"^0.5.4","async":"^2.1.5","debug":"^2.6.0","lodash":"^4.16.4","backoff":"^2.4.1","mongodb":"github:mongodb/node-mongodb-native#2.2","kerberos":"^0.0.22","mongodb-url":"^2.0.0","ampersand-model":"^8.0.0","ampersand-rest-collection":"^6.0.0"},"devDependencies":{"mocha":"^3.2.0","sinon":"^1.17.7","pre-commit":"^1.1.2","mock-require":"^2.0.1","mongodb-js-fmt":"^0.0.3","mongodb-runner":"^3.3.3","mongodb-js-precommit":"^0.2.9","mongodb-instance-model":"^4.0.0","eslint-config-mongodb-js":"^2.2.0","mongodb-connection-fixture":"^0.0.14"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model-8.0.0-beta.1.tgz_1496063624022_0.6154817142523825","host":"s3://npm-registry-packages"}},"8.0.0":{"name":"mongodb-connection-model","version":"8.0.0","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@8.0.0","maintainers":[{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"terakilobyte","email":"terakilobyte@gmail.com"},{"name":"jimol","email":"jim.oleary@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"mpobrien","email":"mpobrien005@gmail.com"},{"name":"christkv","email":"christkv@gmail.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"keyboardtsundoku","email":"satyendra.n.sinha@gmail.com"},{"name":"pzrq","email":"peter@peterjs.com"},{"name":"justinjmoses","email":"justinjmoses@gmail.com"},{"name":"aherlihy","email":"anna@mongodb.com"},{"name":"redondos","email":"aolivera@gmail.com"},{"name":"dpercy","email":"davetp425@gmail.com"},{"name":"cilix","email":"matthewlevenstein@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"glowe","email":"graham.lowe@gmail.com"},{"name":"micheal.parks","email":"michealparks1989@gmail.com"},{"name":"schwartzrw","email":"schwartzrw@gmail.com"},{"name":"durran","email":"durran@gmail.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"7f8964d4cb3870926e1b753ad96803867312eec6","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-8.0.0.tgz","integrity":"sha512-3JPBimzjtq6SQIG5SjvkEWsK8Z52uW0AiiHmd9XazLw5rG68mY2dL3yre4rG9gG7a5kvfk5urOkrtpmOuo1Y9A==","signatures":[{"sig":"MEYCIQDSH7FYzHTYHdTghFmUNZzy1xg9q43XoYrtDO0pQRDkDAIhAMpoYVS3Dc83zsIciLoq3KRsoMte5pi1bPXTaJKKiNZL","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"_from":".","_shasum":"7f8964d4cb3870926e1b753ad96803867312eec6","browser":"browser.js","gitHead":"ad39f796c78ddc131a5d86bd17fb1d8811173dfb","scripts":{"ci":"npm run check && npm test","fmt":"mongodb-js-fmt ./*.js lib/*.js ./test/*.js","test":"mocha","check":"mongodb-js-precommit","pretest":"mongodb-runner install"},"_npmUser":{"name":"durran","email":"durran@gmail.com"},"precommit":["check"],"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"4.0.5","description":"MongoDB connection model.","directories":{},"_nodeVersion":"7.4.0","dependencies":{"ssh2":"^0.5.4","async":"^2.1.5","debug":"^2.6.0","lodash":"^4.16.4","backoff":"^2.4.1","mongodb":"^2.2.28","kerberos":"^0.0.22","mongodb-url":"^2.0.0","ampersand-model":"^8.0.0","ampersand-rest-collection":"^6.0.0"},"devDependencies":{"mocha":"^3.2.0","sinon":"^1.17.7","pre-commit":"^1.1.2","mock-require":"^2.0.1","mongodb-js-fmt":"^0.0.3","mongodb-runner":"^3.3.3","mongodb-js-precommit":"^0.2.9","mongodb-instance-model":"^4.0.0","eslint-config-mongodb-js":"^2.2.0","mongodb-connection-fixture":"^0.0.14"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model-8.0.0.tgz_1496514888584_0.4638402438722551","host":"s3://npm-registry-packages"}},"8.0.1":{"name":"mongodb-connection-model","version":"8.0.1","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@8.0.1","maintainers":[{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"jlord","email":"to.jlord@gmail.com"},{"name":"terakilobyte","email":"terakilobyte@gmail.com"},{"name":"jimol","email":"jim.oleary@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"mpobrien","email":"mpobrien005@gmail.com"},{"name":"christkv","email":"christkv@gmail.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"keyboardtsundoku","email":"satyendra.n.sinha@gmail.com"},{"name":"pzrq","email":"peter@peterjs.com"},{"name":"justinjmoses","email":"justinjmoses@gmail.com"},{"name":"aherlihy","email":"anna@mongodb.com"},{"name":"redondos","email":"aolivera@gmail.com"},{"name":"dpercy","email":"davetp425@gmail.com"},{"name":"cilix","email":"matthewlevenstein@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"glowe","email":"graham.lowe@gmail.com"},{"name":"micheal.parks","email":"michealparks1989@gmail.com"},{"name":"schwartzrw","email":"schwartzrw@gmail.com"},{"name":"durran","email":"durran@gmail.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"4cf02695a214e834276beb2b59c6b0723f77d3a8","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-8.0.1.tgz","integrity":"sha512-ncVLeiixH5UWbtwmdg4seYxE2kOdzev3+yOfiQ1cMiG9LAyNFP2pl8ZURV7iI6d9EzabeIspXRqnXiKZyoDKPA==","signatures":[{"sig":"MEUCIH7Hc5MVEbzeqxGSWIhwjNqceH23t7xMUBkKilbTnNdrAiEA3hU2Q50aVf3wNkIuqvMzW4TCHyNFWyglq0uoOdsAvuc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"_from":".","_shasum":"4cf02695a214e834276beb2b59c6b0723f77d3a8","browser":"browser.js","gitHead":"74fbe203ac2a7f2321605a6b10f7e353b26ec838","scripts":{"ci":"npm run check && npm test","fmt":"mongodb-js-fmt ./*.js lib/*.js ./test/*.js","test":"mocha","check":"mongodb-js-precommit","pretest":"mongodb-runner install"},"_npmUser":{"name":"durran","email":"durran@gmail.com"},"precommit":["check"],"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"4.0.5","description":"MongoDB connection model.","directories":{},"_nodeVersion":"7.4.0","dependencies":{"ssh2":"^0.5.4","async":"^2.1.5","debug":"^2.6.0","lodash":"^4.16.4","backoff":"^2.4.1","mongodb":"^2.2.28","kerberos":"^0.0.22","mongodb-url":"^2.0.0","ampersand-model":"^8.0.0","ampersand-rest-collection":"^6.0.0"},"devDependencies":{"mocha":"^3.2.0","sinon":"^1.17.7","pre-commit":"^1.1.2","mock-require":"^2.0.1","mongodb-js-fmt":"^0.0.3","mongodb-runner":"^3.3.3","mongodb-js-precommit":"^0.2.9","mongodb-instance-model":"^4.0.0","eslint-config-mongodb-js":"^2.2.0","mongodb-connection-fixture":"^0.0.14"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model-8.0.1.tgz_1496927493764_0.07622540718875825","host":"s3://npm-registry-packages"}},"9.0.0-beta.0":{"name":"mongodb-connection-model","version":"9.0.0-beta.0","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@9.0.0-beta.0","maintainers":[{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"jlord","email":"to.jlord@gmail.com"},{"name":"terakilobyte","email":"terakilobyte@gmail.com"},{"name":"jimol","email":"jim.oleary@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"mpobrien","email":"mpobrien005@gmail.com"},{"name":"christkv","email":"christkv@gmail.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"keyboardtsundoku","email":"satyendra.n.sinha@gmail.com"},{"name":"pzrq","email":"peter@peterjs.com"},{"name":"justinjmoses","email":"justinjmoses@gmail.com"},{"name":"aherlihy","email":"anna@mongodb.com"},{"name":"redondos","email":"aolivera@gmail.com"},{"name":"dpercy","email":"davetp425@gmail.com"},{"name":"cilix","email":"matthewlevenstein@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"glowe","email":"graham.lowe@gmail.com"},{"name":"micheal.parks","email":"michealparks1989@gmail.com"},{"name":"schwartzrw","email":"schwartzrw@gmail.com"},{"name":"durran","email":"durran@gmail.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"43f34057b5c9dd6fc8224fa67fcfe574a86e47de","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-9.0.0-beta.0.tgz","integrity":"sha512-N0w85P8fqxDDcEK8+gh6eI/NUiaDsxbr/ZMxYZjL/kyzEzds1PvkXqDwz6hvx60zo/DActYOuct4UZvgREMW0w==","signatures":[{"sig":"MEUCIQDNlty8QqbxeOjdKMRuHYHwhOisw/5lrUFjpLM/psEbdQIgUJdllq7aUAcoaOOfNiReoeskpttdILBzebCDGCFxakI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"_from":".","_shasum":"43f34057b5c9dd6fc8224fa67fcfe574a86e47de","browser":"browser.js","gitHead":"b0fca311255808734b80001c7bd7a28f4af9f9b8","scripts":{"ci":"npm run check && npm test","fmt":"mongodb-js-fmt ./*.js lib/*.js ./test/*.js","test":"mocha","check":"mongodb-js-precommit","pretest":"mongodb-runner install"},"_npmUser":{"name":"durran","email":"durran@gmail.com"},"precommit":["check"],"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"4.0.5","description":"MongoDB connection model.","directories":{},"_nodeVersion":"7.4.0","dependencies":{"ssh2":"^0.5.4","async":"^2.1.5","debug":"^2.6.0","lodash":"^4.16.4","backoff":"^2.4.1","mongodb":"^2.2.28","kerberos":"^0.0.22","mongodb-url":"^2.0.0","ampersand-model":"^8.0.0","ampersand-rest-collection":"^6.0.0"},"devDependencies":{"mocha":"^3.2.0","sinon":"^1.17.7","pre-commit":"^1.1.2","mock-require":"^2.0.1","mongodb-js-fmt":"^0.0.3","mongodb-runner":"^3.3.3","mongodb-js-precommit":"^0.2.9","mongodb-instance-model":"^4.0.0","eslint-config-mongodb-js":"^2.2.0","mongodb-connection-fixture":"^0.0.14"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model-9.0.0-beta.0.tgz_1497183035637_0.6601049930322915","host":"s3://npm-registry-packages"}},"9.0.0":{"name":"mongodb-connection-model","version":"9.0.0","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@9.0.0","maintainers":[{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"jlord","email":"to.jlord@gmail.com"},{"name":"terakilobyte","email":"terakilobyte@gmail.com"},{"name":"jimol","email":"jim.oleary@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"mpobrien","email":"mpobrien005@gmail.com"},{"name":"christkv","email":"christkv@gmail.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"keyboardtsundoku","email":"satyendra.n.sinha@gmail.com"},{"name":"pzrq","email":"peter@peterjs.com"},{"name":"justinjmoses","email":"justinjmoses@gmail.com"},{"name":"aherlihy","email":"anna@mongodb.com"},{"name":"redondos","email":"aolivera@gmail.com"},{"name":"dpercy","email":"davetp425@gmail.com"},{"name":"cilix","email":"matthewlevenstein@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"glowe","email":"graham.lowe@gmail.com"},{"name":"micheal.parks","email":"michealparks1989@gmail.com"},{"name":"schwartzrw","email":"schwartzrw@gmail.com"},{"name":"durran","email":"durran@gmail.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"14b5b540a9c3b5e81251498caaacc98688c9bdbd","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-9.0.0.tgz","integrity":"sha512-cxNBsozJmm+l0KLxJXVSIbVGDuTb5zC41ahFyHXHnvZ+P54e/VulCSfR2OJQvh/j8JB6xxvwgf8pdAqFlM19/w==","signatures":[{"sig":"MEQCID0T7uqwLAVPu/WHt+YAHIMAikU3iqF4Aj0GftdBbB/IAiBDsUQPMF/Eu+Ml5hO9DO0yKi5cB4BF9r/BriOsebU2bg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"_from":".","_shasum":"14b5b540a9c3b5e81251498caaacc98688c9bdbd","browser":"browser.js","gitHead":"4a03647b8b45317cce93ea26067a1b7c7f0f29f5","scripts":{"ci":"npm run check && npm test","fmt":"mongodb-js-fmt ./*.js lib/*.js ./test/*.js","test":"mocha","check":"mongodb-js-precommit","pretest":"mongodb-runner install"},"_npmUser":{"name":"durran","email":"durran@gmail.com"},"precommit":["check"],"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"4.0.5","description":"MongoDB connection model.","directories":{},"_nodeVersion":"7.4.0","dependencies":{"ssh2":"^0.5.4","async":"^2.1.5","debug":"^2.6.0","lodash":"^4.16.4","backoff":"^2.4.1","mongodb":"^2.2.28","kerberos":"^0.0.22","mongodb-url":"^2.0.0","ampersand-model":"^8.0.0","ampersand-rest-collection":"^6.0.0"},"devDependencies":{"mocha":"^3.2.0","sinon":"^1.17.7","pre-commit":"^1.1.2","mock-require":"^2.0.1","mongodb-js-fmt":"^0.0.3","mongodb-runner":"^3.3.3","mongodb-js-precommit":"^0.2.9","mongodb-instance-model":"^4.0.0","eslint-config-mongodb-js":"^2.2.0","mongodb-connection-fixture":"^0.0.14"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model-9.0.0.tgz_1497196352976_0.9344904078170657","host":"s3://npm-registry-packages"}},"9.1.0":{"name":"mongodb-connection-model","version":"9.1.0","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@9.1.0","maintainers":[{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"danulf","email":"danagroff@hotmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"jlord","email":"to.jlord@gmail.com"},{"name":"terakilobyte","email":"terakilobyte@gmail.com"},{"name":"jimol","email":"jim.oleary@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"mpobrien","email":"mpobrien005@gmail.com"},{"name":"christkv","email":"christkv@gmail.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"pzrq","email":"peter@peterjs.com"},{"name":"justinjmoses","email":"justinjmoses@gmail.com"},{"name":"aherlihy","email":"anna@mongodb.com"},{"name":"redondos","email":"aolivera@gmail.com"},{"name":"dpercy","email":"davetp425@gmail.com"},{"name":"cilix","email":"matthewlevenstein@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"glowe","email":"graham.lowe@gmail.com"},{"name":"micheal.parks","email":"michealparks1989@gmail.com"},{"name":"schwartzrw","email":"schwartzrw@gmail.com"},{"name":"durran","email":"durran@gmail.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"475d921f23b5f654aa7e80087b7200ed54b61270","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-9.1.0.tgz","integrity":"sha512-021OmAKSvQ5vjQByfVaj/ueKKVGwpFyIow+s/iMQb4rai7nKDjIKPv5aB6JLiNbxFIBebloEodzsEbLbv6n60A==","signatures":[{"sig":"MEUCIE8PKoZu/xD4ekoi7PxFaqvxpQ3J8s4RQde+ixIqWSLgAiEA/lJG27YOHrHqzVBGTcqg41UAWuiC+x1ZVaEnXh2tg9c=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"_from":".","_shasum":"475d921f23b5f654aa7e80087b7200ed54b61270","browser":"browser.js","gitHead":"a96ab3243e4c228badc83712730be637f1c992f0","scripts":{"ci":"npm run check && npm test","fmt":"mongodb-js-fmt ./*.js lib/*.js ./test/*.js","test":"mocha","check":"mongodb-js-precommit","pretest":"mongodb-runner install"},"_npmUser":{"name":"jlord","email":"to.jlord@gmail.com"},"precommit":["check"],"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"4.0.0","description":"MongoDB connection model.","directories":{},"_nodeVersion":"7.4.0","dependencies":{"ssh2":"^0.5.4","async":"^2.1.5","debug":"^2.6.0","lodash":"^4.16.4","backoff":"^2.4.1","mongodb":"^2.2.28","kerberos":"^0.0.22","mongodb-url":"^2.0.0","ampersand-model":"^8.0.0","ampersand-rest-collection":"^6.0.0"},"devDependencies":{"mocha":"^3.2.0","sinon":"^1.17.7","pre-commit":"^1.1.2","mock-require":"^2.0.1","mongodb-js-fmt":"^0.0.3","mongodb-runner":"^3.3.3","mongodb-js-precommit":"^0.2.9","mongodb-instance-model":"^4.0.0","eslint-config-mongodb-js":"^2.2.0","mongodb-connection-fixture":"^0.0.14"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model-9.1.0.tgz_1501268094883_0.017011523945257068","host":"s3://npm-registry-packages"}},"9.2.0":{"name":"mongodb-connection-model","version":"9.2.0","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@9.2.0","maintainers":[{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"danulf","email":"danagroff@hotmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"jlord","email":"to.jlord@gmail.com"},{"name":"terakilobyte","email":"terakilobyte@gmail.com"},{"name":"jimol","email":"jim.oleary@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"mpobrien","email":"mpobrien005@gmail.com"},{"name":"christkv","email":"christkv@gmail.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"pzrq","email":"peter@peterjs.com"},{"name":"justinjmoses","email":"justinjmoses@gmail.com"},{"name":"aherlihy","email":"anna@mongodb.com"},{"name":"redondos","email":"aolivera@gmail.com"},{"name":"dpercy","email":"davetp425@gmail.com"},{"name":"cilix","email":"matthewlevenstein@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"glowe","email":"graham.lowe@gmail.com"},{"name":"micheal.parks","email":"michealparks1989@gmail.com"},{"name":"schwartzrw","email":"schwartzrw@gmail.com"},{"name":"durran","email":"durran@gmail.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"1d10c92ac783c8f45bdb8674d61ff46053d9d115","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-9.2.0.tgz","integrity":"sha512-/qI3qkMh19IH5oc23Km5n3n+fEZiBrfi0c4Tul91O5oR4uORfZbV9KyPU4i21riBmwAN+H/E5DqZ6/kZI+PybQ==","signatures":[{"sig":"MEUCIE79EtwkC50zSlh2IpRzkbqtAsOmy+amPB/zBLElkn2SAiEA3vn/xusPf1OTVmyl6DCOPTL/2SoQcT43kyqZS5YMxfo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"_from":".","_shasum":"1d10c92ac783c8f45bdb8674d61ff46053d9d115","browser":"browser.js","gitHead":"a0e1f0573c819e34d8ce296f34269a569cf5e451","scripts":{"ci":"npm run check && npm test","fmt":"mongodb-js-fmt ./*.js lib/*.js ./test/*.js","test":"mocha","check":"mongodb-js-precommit","pretest":"mongodb-runner install"},"_npmUser":{"name":"jlord","email":"to.jlord@gmail.com"},"precommit":["check"],"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"4.0.0","description":"MongoDB connection model.","directories":{},"_nodeVersion":"7.4.0","dependencies":{"ssh2":"^0.5.4","async":"^2.1.5","debug":"^2.6.0","lodash":"^4.16.4","backoff":"^2.4.1","mongodb":"^2.2.28","kerberos":"^0.0.22","mongodb-url":"^2.0.0","ampersand-model":"^8.0.0","ampersand-rest-collection":"^6.0.0"},"devDependencies":{"mocha":"^3.2.0","sinon":"^1.17.7","pre-commit":"^1.1.2","mock-require":"^2.0.1","mongodb-js-fmt":"^0.0.3","mongodb-runner":"^3.3.3","mongodb-js-precommit":"^0.2.9","mongodb-instance-model":"^4.0.0","eslint-config-mongodb-js":"^2.2.0","mongodb-connection-fixture":"^0.0.14"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model-9.2.0.tgz_1501271804936_0.7619155524298549","host":"s3://npm-registry-packages"}},"10.0.0":{"name":"mongodb-connection-model","version":"10.0.0","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@10.0.0","maintainers":[{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"danulf","email":"danagroff@hotmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"jlord","email":"to.jlord@gmail.com"},{"name":"terakilobyte","email":"terakilobyte@gmail.com"},{"name":"jimol","email":"jim.oleary@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"mpobrien","email":"mpobrien005@gmail.com"},{"name":"christkv","email":"christkv@gmail.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"pzrq","email":"peter@peterjs.com"},{"name":"justinjmoses","email":"justinjmoses@gmail.com"},{"name":"aherlihy","email":"anna@mongodb.com"},{"name":"redondos","email":"aolivera@gmail.com"},{"name":"dpercy","email":"davetp425@gmail.com"},{"name":"cilix","email":"matthewlevenstein@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"glowe","email":"graham.lowe@gmail.com"},{"name":"micheal.parks","email":"michealparks1989@gmail.com"},{"name":"schwartzrw","email":"schwartzrw@gmail.com"},{"name":"durran","email":"durran@gmail.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"6d5692cc7b7c50658473b269bd4c0e4110b057dd","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-10.0.0.tgz","integrity":"sha512-MNG6U3hIsWkP5YIDTF14ysKL1ZzPCyxQy6WOIq1AE4EqrdfMP4ULKNTAZpVOtHFJW5lLxeBFnKTwRvIw9qjHkw==","signatures":[{"sig":"MEUCIQDjFjRvhIiTjg7hpRVy457JRzY8m/PWyyWGQCL6W1fqhAIgRm6EMdTrLestr92RorVx2l+A9g5VleLYqoO4/OfVmTM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"_from":".","_shasum":"6d5692cc7b7c50658473b269bd4c0e4110b057dd","browser":"browser.js","gitHead":"8d0d745c94b785c0424bfdf1c8696ca68a0fcbc7","scripts":{"ci":"npm run check && npm test","fmt":"mongodb-js-fmt ./*.js lib/*.js ./test/*.js","test":"mocha","check":"mongodb-js-precommit","pretest":"mongodb-runner install"},"_npmUser":{"name":"jlord","email":"to.jlord@gmail.com"},"precommit":["check"],"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"4.0.0","description":"MongoDB connection model.","directories":{},"_nodeVersion":"7.4.0","dependencies":{"ssh2":"^0.5.4","async":"^2.1.5","debug":"^2.6.0","lodash":"^4.16.4","backoff":"^2.4.1","mongodb":"^2.2.28","kerberos":"^0.0.22","mongodb-url":"^2.0.0","ampersand-model":"^8.0.0","ampersand-rest-collection":"^6.0.0"},"devDependencies":{"mocha":"^3.2.0","sinon":"^1.17.7","pre-commit":"^1.1.2","mock-require":"^2.0.1","mongodb-js-fmt":"^0.0.3","mongodb-runner":"^3.3.3","mongodb-js-precommit":"^0.2.9","mongodb-instance-model":"^4.0.0","eslint-config-mongodb-js":"^2.2.0","mongodb-connection-fixture":"^0.0.14"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model-10.0.0.tgz_1503425128691_0.7305771741084754","host":"s3://npm-registry-packages"}},"10.0.1":{"name":"mongodb-connection-model","version":"10.0.1","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@10.0.1","maintainers":[{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"danulf","email":"danagroff@hotmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"jlord","email":"to.jlord@gmail.com"},{"name":"terakilobyte","email":"terakilobyte@gmail.com"},{"name":"jimol","email":"jim.oleary@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"mpobrien","email":"mpobrien005@gmail.com"},{"name":"christkv","email":"christkv@gmail.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"pzrq","email":"peter@peterjs.com"},{"name":"justinjmoses","email":"justinjmoses@gmail.com"},{"name":"aherlihy","email":"anna@mongodb.com"},{"name":"redondos","email":"aolivera@gmail.com"},{"name":"dpercy","email":"davetp425@gmail.com"},{"name":"cilix","email":"matthewlevenstein@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"glowe","email":"graham.lowe@gmail.com"},{"name":"micheal.parks","email":"michealparks1989@gmail.com"},{"name":"schwartzrw","email":"schwartzrw@gmail.com"},{"name":"durran","email":"durran@gmail.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"758e733316b2cf51194e5b5d66d85a72b82b2139","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-10.0.1.tgz","integrity":"sha512-a0xAGJKA6G7L252DgEVjjmv3aL0VsqPVWn2ORIFY6AjhzaCgqdy0IUYBq4gpVeWTMuOhz3aU0lcevEr2Yrn3Dg==","signatures":[{"sig":"MEYCIQDpkM+hmrn06Aop9JoaJLs6P5o86PIkDS7FQKG4D37XaQIhAKvxWAUthHRZgmqg3UjUILdjBVMF6QxpeSa35s0a0vP2","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"_from":".","_shasum":"758e733316b2cf51194e5b5d66d85a72b82b2139","browser":"browser.js","gitHead":"d5220f1f9bc93943ce48950fd53e080dbbd48977","scripts":{"ci":"npm run check && npm test","fmt":"mongodb-js-fmt ./*.js lib/*.js ./test/*.js","test":"mocha","check":"mongodb-js-precommit","pretest":"mongodb-runner install"},"_npmUser":{"name":"durran","email":"durran@gmail.com"},"precommit":["check"],"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"4.0.5","description":"MongoDB connection model.","directories":{},"_nodeVersion":"7.4.0","dependencies":{"ssh2":"^0.5.4","async":"^2.1.5","debug":"^2.6.0","lodash":"^4.16.4","backoff":"^2.4.1","mongodb":"^2.2.28","kerberos":"^0.0.22","mongodb-url":"^2.0.0","ampersand-model":"^8.0.0","ampersand-rest-collection":"^6.0.0"},"devDependencies":{"mocha":"^3.2.0","sinon":"^1.17.7","pre-commit":"^1.1.2","mock-require":"^2.0.1","mongodb-js-fmt":"^0.0.3","mongodb-runner":"^3.3.3","mongodb-js-precommit":"^0.2.9","mongodb-instance-model":"^4.0.0","eslint-config-mongodb-js":"^2.2.0","mongodb-connection-fixture":"^0.0.14"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model-10.0.1.tgz_1504711407859_0.3080400382168591","host":"s3://npm-registry-packages"}},"10.0.2":{"name":"mongodb-connection-model","version":"10.0.2","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@10.0.2","maintainers":[{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"danulf","email":"danagroff@hotmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"jlord","email":"to.jlord@gmail.com"},{"name":"terakilobyte","email":"terakilobyte@gmail.com"},{"name":"jimol","email":"jim.oleary@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"mpobrien","email":"mpobrien005@gmail.com"},{"name":"christkv","email":"christkv@gmail.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"pzrq","email":"peter@peterjs.com"},{"name":"justinjmoses","email":"justinjmoses@gmail.com"},{"name":"aherlihy","email":"anna@mongodb.com"},{"name":"redondos","email":"aolivera@gmail.com"},{"name":"dpercy","email":"davetp425@gmail.com"},{"name":"cilix","email":"matthewlevenstein@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"glowe","email":"graham.lowe@gmail.com"},{"name":"micheal.parks","email":"michealparks1989@gmail.com"},{"name":"schwartzrw","email":"schwartzrw@gmail.com"},{"name":"durran","email":"durran@gmail.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"384035187e60d12ad9e8e81222779a57a15e50af","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-10.0.2.tgz","integrity":"sha512-UFsnkfOFsjXbDOkmTvnmIKbwIFbIq5QRksbm3eNIvcFeMVk5K1dgBS7Q9Ag/xmMS1XBe2qlhg8Q5+1DXe1UvEw==","signatures":[{"sig":"MEUCIBTdy0epZ7pPebTL76LMQ0SYldeA1Xi/hA6br6F4Z94HAiEAjGDQS/3MbH4kLWjxWRu2ju0g1uT3BtWk3kpjGzvOkFk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"_from":".","_shasum":"384035187e60d12ad9e8e81222779a57a15e50af","browser":"browser.js","gitHead":"e33f45be677a46ba1caec1329df4353669d75448","scripts":{"ci":"npm run check && npm test","fmt":"mongodb-js-fmt ./*.js lib/*.js ./test/*.js","test":"mocha","check":"mongodb-js-precommit","pretest":"mongodb-runner install"},"_npmUser":{"name":"durran","email":"durran@gmail.com"},"precommit":["check"],"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"4.0.5","description":"MongoDB connection model.","directories":{},"_nodeVersion":"7.4.0","dependencies":{"ssh2":"^0.5.4","async":"^2.1.5","debug":"^2.6.0","lodash":"^4.16.4","backoff":"^2.4.1","mongodb":"^2.2.28","kerberos":"^0.0.22","mongodb-url":"^2.0.0","ampersand-model":"^8.0.0","ampersand-rest-collection":"^6.0.0"},"devDependencies":{"mocha":"^3.2.0","sinon":"^1.17.7","pre-commit":"^1.1.2","mock-require":"^2.0.1","mongodb-js-fmt":"^0.0.3","mongodb-runner":"^3.3.3","mongodb-js-precommit":"^0.2.9","mongodb-instance-model":"^4.0.0","eslint-config-mongodb-js":"^2.2.0","mongodb-connection-fixture":"^0.0.14"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model-10.0.2.tgz_1504713019906_0.5882570436224341","host":"s3://npm-registry-packages"}},"10.1.0":{"name":"mongodb-connection-model","version":"10.1.0","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@10.1.0","maintainers":[{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"danulf","email":"danagroff@hotmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"jlord","email":"to.jlord@gmail.com"},{"name":"terakilobyte","email":"terakilobyte@gmail.com"},{"name":"jimol","email":"jim.oleary@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"mpobrien","email":"mpobrien005@gmail.com"},{"name":"christkv","email":"christkv@gmail.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"pzrq","email":"peter@peterjs.com"},{"name":"justinjmoses","email":"justinjmoses@gmail.com"},{"name":"aherlihy","email":"anna@mongodb.com"},{"name":"redondos","email":"aolivera@gmail.com"},{"name":"dpercy","email":"davetp425@gmail.com"},{"name":"cilix","email":"matthewlevenstein@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"glowe","email":"graham.lowe@gmail.com"},{"name":"micheal.parks","email":"michealparks1989@gmail.com"},{"name":"schwartzrw","email":"schwartzrw@gmail.com"},{"name":"durran","email":"durran@gmail.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"634b2c167186187c5a6fcf5fc2744a885fb56432","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-10.1.0.tgz","integrity":"sha512-A61/sy+H7pUkBWEzg5r4AJHB0iNO8lSERVusam8QfpPcxLXjdNAHQ9kicj5Qecvxw6lrK9ZlVhzKuziPlEOftw==","signatures":[{"sig":"MEYCIQDPiQXN2QAmvTy0z8Y5gWHY8mNkm74tFUF2pP876cIqWAIhANGzu5F/4j5zbEH1y1Gat+8Lu/hHNJ7v4Gx6TVKk4nB3","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"_from":".","_shasum":"634b2c167186187c5a6fcf5fc2744a885fb56432","browser":"browser.js","gitHead":"3b9ba011451f7fb9a8c6a941b043be0328c0ac06","scripts":{"ci":"npm run check && npm test","fmt":"mongodb-js-fmt ./*.js lib/*.js ./test/*.js","test":"mocha","check":"mongodb-js-precommit","pretest":"mongodb-runner install"},"_npmUser":{"name":"durran","email":"durran@gmail.com"},"precommit":["check"],"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"4.0.5","description":"MongoDB connection model.","directories":{},"_nodeVersion":"7.4.0","dependencies":{"ssh2":"^0.5.4","async":"^2.1.5","debug":"^2.6.0","lodash":"^4.16.4","backoff":"^2.4.1","mongodb":"^2.2.28","kerberos":"^0.0.22","mongodb-url":"^2.0.0","ampersand-model":"^8.0.0","ampersand-rest-collection":"^6.0.0"},"devDependencies":{"mocha":"^3.2.0","sinon":"^1.17.7","pre-commit":"^1.1.2","mock-require":"^2.0.1","mongodb-js-fmt":"^0.0.3","mongodb-runner":"^3.3.3","mongodb-js-precommit":"^0.2.9","mongodb-instance-model":"^4.0.0","eslint-config-mongodb-js":"^2.2.0","mongodb-connection-fixture":"^0.0.14"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model-10.1.0.tgz_1504715741517_0.47794318990781903","host":"s3://npm-registry-packages"}},"10.1.1":{"name":"mongodb-connection-model","version":"10.1.1","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@10.1.1","maintainers":[{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"danulf","email":"danagroff@hotmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"jlord","email":"to.jlord@gmail.com"},{"name":"terakilobyte","email":"terakilobyte@gmail.com"},{"name":"jimol","email":"jim.oleary@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"mpobrien","email":"mpobrien005@gmail.com"},{"name":"christkv","email":"christkv@gmail.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"pzrq","email":"peter@peterjs.com"},{"name":"justinjmoses","email":"justinjmoses@gmail.com"},{"name":"aherlihy","email":"anna@mongodb.com"},{"name":"redondos","email":"aolivera@gmail.com"},{"name":"dpercy","email":"davetp425@gmail.com"},{"name":"cilix","email":"matthewlevenstein@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"glowe","email":"graham.lowe@gmail.com"},{"name":"micheal.parks","email":"michealparks1989@gmail.com"},{"name":"schwartzrw","email":"schwartzrw@gmail.com"},{"name":"durran","email":"durran@gmail.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"d4abf0c0aa9b2c2e6a29f399fbe6311f027cfdd4","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-10.1.1.tgz","integrity":"sha512-w1xe9PwHZJRGYoRzsGiZ4ULSzHFqUHLvztobeZrh3mILv4AAK1DpCa8QKyczjjEVCOjbG94eAKN3syfTcT63Gg==","signatures":[{"sig":"MEYCIQDvBuoZOp1lMvbRW1wPfMgc8S/hRvxqtOoqRJQvpvEjIAIhANuObsWgLX9YmDyISrdEfVZfRToW/YvFDVL1sWR8kQcB","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"_from":".","_shasum":"d4abf0c0aa9b2c2e6a29f399fbe6311f027cfdd4","browser":"browser.js","gitHead":"5e753bd33d09f9d88b0d760fee69c89f92ae45c8","scripts":{"ci":"npm run check && npm test","fmt":"mongodb-js-fmt ./*.js lib/*.js ./test/*.js","test":"mocha","check":"mongodb-js-precommit","pretest":"mongodb-runner install"},"_npmUser":{"name":"durran","email":"durran@gmail.com"},"precommit":["check"],"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"4.0.5","description":"MongoDB connection model.","directories":{},"_nodeVersion":"7.4.0","dependencies":{"ssh2":"^0.5.4","async":"^2.1.5","debug":"^2.6.0","lodash":"^4.16.4","backoff":"^2.4.1","mongodb":"^2.2.28","kerberos":"^0.0.22","mongodb-url":"^2.0.0","ampersand-model":"^8.0.0","ampersand-rest-collection":"^6.0.0"},"devDependencies":{"mocha":"^3.2.0","sinon":"^1.17.7","pre-commit":"^1.1.2","mock-require":"^2.0.1","mongodb-js-fmt":"^0.0.3","mongodb-runner":"^3.3.3","mongodb-js-precommit":"^0.2.9","mongodb-instance-model":"^4.0.0","eslint-config-mongodb-js":"^2.2.0","mongodb-connection-fixture":"^0.0.14"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model-10.1.1.tgz_1504880378155_0.6657821710687131","host":"s3://npm-registry-packages"}},"10.1.2":{"name":"mongodb-connection-model","version":"10.1.2","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@10.1.2","maintainers":[{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"danulf","email":"danagroff@hotmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"jlord","email":"to.jlord@gmail.com"},{"name":"terakilobyte","email":"terakilobyte@gmail.com"},{"name":"jimol","email":"jim.oleary@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"mpobrien","email":"mpobrien005@gmail.com"},{"name":"christkv","email":"christkv@gmail.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"pzrq","email":"peter@peterjs.com"},{"name":"justinjmoses","email":"justinjmoses@gmail.com"},{"name":"aherlihy","email":"anna@mongodb.com"},{"name":"redondos","email":"aolivera@gmail.com"},{"name":"dpercy","email":"davetp425@gmail.com"},{"name":"cilix","email":"matthewlevenstein@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"glowe","email":"graham.lowe@gmail.com"},{"name":"micheal.parks","email":"michealparks1989@gmail.com"},{"name":"schwartzrw","email":"schwartzrw@gmail.com"},{"name":"durran","email":"durran@gmail.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"189ed920830928c325bd00c5e6c5816a5972cfc1","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-10.1.2.tgz","integrity":"sha512-d5hJICL5eKNNHZTfrc+fljwkOnAjlNSNEK37keShdnZULe8llf1aqdlJcEbmkEvZOhAPngcCf/2GdUb/PaXnZg==","signatures":[{"sig":"MEQCIAGHKALcQv6JHwNSulpJCrOIqU2QQcMomtAc7GjgMMQ2AiB6bABGnZ724XF8ILLBX2uoPhOv7CdmERtmK6307O54bQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"_from":".","_shasum":"189ed920830928c325bd00c5e6c5816a5972cfc1","browser":"browser.js","gitHead":"cacd62fa2d20807fe3ee3620f8e2df12a476cd55","scripts":{"ci":"npm run check && npm test","fmt":"mongodb-js-fmt ./*.js lib/*.js ./test/*.js","test":"mocha","check":"mongodb-js-precommit","pretest":"mongodb-runner install"},"_npmUser":{"name":"durran","email":"durran@gmail.com"},"precommit":["check"],"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"4.0.5","description":"MongoDB connection model.","directories":{},"_nodeVersion":"7.4.0","dependencies":{"ssh2":"^0.5.4","async":"^2.1.5","debug":"^2.6.0","lodash":"^4.16.4","backoff":"^2.4.1","mongodb":"^2.2.28","kerberos":"^0.0.22","mongodb-url":"^2.0.0","ampersand-model":"^8.0.0","ampersand-rest-collection":"^6.0.0"},"devDependencies":{"mocha":"^3.2.0","sinon":"^1.17.7","pre-commit":"^1.1.2","mock-require":"^2.0.1","mongodb-js-fmt":"^0.0.3","mongodb-runner":"^3.3.3","mongodb-js-precommit":"^0.2.9","mongodb-instance-model":"^4.0.0","eslint-config-mongodb-js":"^2.2.0","mongodb-connection-fixture":"^0.0.14"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model-10.1.2.tgz_1504887934931_0.21096643968485296","host":"s3://npm-registry-packages"}},"10.1.3":{"name":"mongodb-connection-model","version":"10.1.3","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@10.1.3","maintainers":[{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"danulf","email":"danagroff@hotmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"jlord","email":"to.jlord@gmail.com"},{"name":"terakilobyte","email":"terakilobyte@gmail.com"},{"name":"jimol","email":"jim.oleary@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"mpobrien","email":"mpobrien005@gmail.com"},{"name":"christkv","email":"christkv@gmail.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"pzrq","email":"peter@peterjs.com"},{"name":"justinjmoses","email":"justinjmoses@gmail.com"},{"name":"aherlihy","email":"anna@mongodb.com"},{"name":"redondos","email":"aolivera@gmail.com"},{"name":"dpercy","email":"davetp425@gmail.com"},{"name":"cilix","email":"matthewlevenstein@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"glowe","email":"graham.lowe@gmail.com"},{"name":"micheal.parks","email":"michealparks1989@gmail.com"},{"name":"schwartzrw","email":"schwartzrw@gmail.com"},{"name":"durran","email":"durran@gmail.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"da5ed1d8b94dc4f19c491b3a47094ba8047fd3d8","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-10.1.3.tgz","integrity":"sha512-CPAbuaRA3A5bbUeWzyAwtrX1vdNnVxj8rOm1NwMFUHE2wwt2k/uVylGvO5/If9QFgamR7UYvDQGO2rSo5bXeGw==","signatures":[{"sig":"MEQCIETGvPBJWbMkOnlO3umNYDTDlWtDOVs+GSqeWzru8ywKAiAykOG82flJJ0WdqUpt0A6QaXu2REfoKGUxz0ZY3YUGkg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"browser":"browser.js","gitHead":"ce81b307268e3e74024477fdd5296ffce9255da4","scripts":{"ci":"npm run check && npm test","fmt":"mongodb-js-fmt ./*.js lib/*.js ./test/*.js","test":"mocha","check":"mongodb-js-precommit","pretest":"mongodb-runner install"},"_npmUser":{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},"precommit":["check"],"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"5.4.2","description":"MongoDB connection model.","directories":{},"_nodeVersion":"8.1.2","dependencies":{"ssh2":"^0.5.4","async":"^2.1.5","debug":"^2.6.0","lodash":"^4.16.4","backoff":"^2.4.1","mongodb":"^2.2.28","kerberos":"^0.0.22","mongodb-url":"^2.0.1","ampersand-model":"^8.0.0","ampersand-rest-collection":"^6.0.0"},"devDependencies":{"mocha":"^3.2.0","sinon":"^1.17.7","pre-commit":"^1.1.2","mock-require":"^2.0.1","mongodb-js-fmt":"^0.0.3","mongodb-runner":"^3.3.3","mongodb-js-precommit":"^0.2.9","mongodb-instance-model":"^4.0.0","eslint-config-mongodb-js":"^2.2.0","mongodb-connection-fixture":"^0.0.14"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model-10.1.3.tgz_1505783534547_0.28209394379518926","host":"s3://npm-registry-packages"}},"10.2.0":{"name":"mongodb-connection-model","version":"10.2.0","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@10.2.0","maintainers":[{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"danulf","email":"danagroff@hotmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"jlord","email":"to.jlord@gmail.com"},{"name":"terakilobyte","email":"terakilobyte@gmail.com"},{"name":"jimol","email":"jim.oleary@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"mpobrien","email":"mpobrien005@gmail.com"},{"name":"christkv","email":"christkv@gmail.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"pzrq","email":"peter@peterjs.com"},{"name":"justinjmoses","email":"justinjmoses@gmail.com"},{"name":"aherlihy","email":"anna@mongodb.com"},{"name":"redondos","email":"aolivera@gmail.com"},{"name":"dpercy","email":"davetp425@gmail.com"},{"name":"cilix","email":"matthewlevenstein@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"glowe","email":"graham.lowe@gmail.com"},{"name":"micheal.parks","email":"michealparks1989@gmail.com"},{"name":"schwartzrw","email":"schwartzrw@gmail.com"},{"name":"durran","email":"durran@gmail.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"2b45de346cfdf5e0a7f6a7a73b009cea65aeed32","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-10.2.0.tgz","integrity":"sha512-yAJ8aYSgwzjCkIIc3kB7ZW6liLUdBn62UUQfDOjh/eqr3Qrj2XubHmkrMdL6LCDoC5bCfmGbuAd9D3rItiXtDA==","signatures":[{"sig":"MEUCIGXKs4Pph/z46nq6cujVoA6r+SS7rjCoqYQFR5rmaBgwAiEAyRyL9SNJzlSjVmwdZ78iCjzYeLSolbr8nj7Q/J2sufc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"browser":"browser.js","gitHead":"77c4387d89c208a4a1a87033ffc59946e4b08f43","scripts":{"ci":"npm run check && npm test","fmt":"mongodb-js-fmt ./*.js lib/*.js ./test/*.js","test":"mocha","check":"mongodb-js-precommit","pretest":"mongodb-runner install"},"_npmUser":{"name":"rueckstiess","email":"thomas@rueckstiess.net"},"precommit":["check"],"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"5.3.0","description":"MongoDB connection model.","directories":{},"_nodeVersion":"7.4.0","dependencies":{"ssh2":"^0.5.4","async":"^2.1.5","debug":"^2.6.0","lodash":"^4.16.4","backoff":"^2.4.1","mongodb":"^2.2.28","kerberos":"^0.0.22","mongodb-url":"^2.0.1","ampersand-model":"^8.0.0","ampersand-rest-collection":"^6.0.0"},"devDependencies":{"mocha":"^3.2.0","sinon":"^1.17.7","pre-commit":"^1.1.2","mock-require":"^2.0.1","mongodb-js-fmt":"^0.0.3","mongodb-runner":"^3.3.3","mongodb-js-precommit":"^0.2.9","mongodb-instance-model":"^4.0.0","eslint-config-mongodb-js":"^2.2.0","mongodb-connection-fixture":"^0.0.14"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model-10.2.0.tgz_1507931791461_0.7176933835726231","host":"s3://npm-registry-packages"}},"10.3.0":{"name":"mongodb-connection-model","version":"10.3.0","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@10.3.0","maintainers":[{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"danulf","email":"danagroff@hotmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"jlord","email":"to.jlord@gmail.com"},{"name":"terakilobyte","email":"terakilobyte@gmail.com"},{"name":"jimol","email":"jim.oleary@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"mpobrien","email":"mpobrien005@gmail.com"},{"name":"christkv","email":"christkv@gmail.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"pzrq","email":"peter@peterjs.com"},{"name":"justinjmoses","email":"justinjmoses@gmail.com"},{"name":"aherlihy","email":"anna@mongodb.com"},{"name":"redondos","email":"aolivera@gmail.com"},{"name":"dpercy","email":"davetp425@gmail.com"},{"name":"cilix","email":"matthewlevenstein@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"glowe","email":"graham.lowe@gmail.com"},{"name":"micheal.parks","email":"michealparks1989@gmail.com"},{"name":"schwartzrw","email":"schwartzrw@gmail.com"},{"name":"durran","email":"durran@gmail.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"e7ee08ca4125eb852b8e48f173890df99ab05329","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-10.3.0.tgz","integrity":"sha512-lCabSFqF/pReByWg6itBpAPVc48/JvkBxxmKcgiPrmLq9N0/5AVVfSsO9SxT4xTRyIzeau0dsjPtr2riJrvcSQ==","signatures":[{"sig":"MEUCIFEZHab0Ex+TJCRXrKiuweYKJN2Zl4BEOfyX+VfV51cpAiEAzCjO88pL6WUpx8ZlVzZP9STCzBo/QkX0LJEnvQFrNhQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"_from":".","_shasum":"e7ee08ca4125eb852b8e48f173890df99ab05329","browser":"browser.js","gitHead":"14e2ccf40c4cd02ce426799bc2d14123b2438f8f","scripts":{"ci":"npm run check && npm test","fmt":"mongodb-js-fmt ./*.js lib/*.js ./test/*.js","test":"mocha","check":"mongodb-js-precommit","pretest":"mongodb-runner install"},"_npmUser":{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},"precommit":["check"],"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"4.0.5","description":"MongoDB connection model.","directories":{},"_nodeVersion":"7.4.0","dependencies":{"ssh2":"^0.5.4","async":"^2.1.5","debug":"^2.6.0","lodash":"^4.16.4","backoff":"^2.4.1","mongodb":"^2.2.28","kerberos":"^0.0.22","mongodb-url":"^2.0.1","ampersand-model":"^8.0.0","ampersand-rest-collection":"^6.0.0"},"devDependencies":{"mocha":"^3.2.0","sinon":"^1.17.7","pre-commit":"^1.1.2","mock-require":"^2.0.1","mongodb-js-fmt":"^0.0.3","mongodb-runner":"^3.3.3","mongodb-js-precommit":"^0.2.9","mongodb-instance-model":"^4.0.0","eslint-config-mongodb-js":"^2.2.0","mongodb-connection-fixture":"^0.0.14"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model-10.3.0.tgz_1508338982400_0.8696414134465158","host":"s3://npm-registry-packages"}},"10.4.0":{"name":"mongodb-connection-model","version":"10.4.0","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@10.4.0","maintainers":[{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"daprahamian","email":"dan.aprahamian@gmail.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"jlord","email":"to.jlord@gmail.com"},{"name":"terakilobyte","email":"terakilobyte@gmail.com"},{"name":"jimol","email":"jim.oleary@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"mpobrien","email":"mpobrien005@gmail.com"},{"name":"christkv","email":"christkv@gmail.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"pzrq","email":"peter@peterjs.com"},{"name":"justinjmoses","email":"justinjmoses@gmail.com"},{"name":"aherlihy","email":"anna@mongodb.com"},{"name":"redondos","email":"aolivera@gmail.com"},{"name":"dpercy","email":"davetp425@gmail.com"},{"name":"cilix","email":"matthewlevenstein@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"glowe","email":"graham.lowe@gmail.com"},{"name":"micheal.parks","email":"michealparks1989@gmail.com"},{"name":"schwartzrw","email":"schwartzrw@gmail.com"},{"name":"durran","email":"durran@gmail.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"f9da3facd38883be7bc285e11ae7d3efc56b2418","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-10.4.0.tgz","integrity":"sha512-hL+pTk1AurHskpCS2gLLkb8M0fJEkJkygRg6aKIuXKsxNJt3FFfHHjI7nXKHNuUG2pdaZPzTBfbpvxcHPIAQDw==","signatures":[{"sig":"MEQCICnbJVzVCuNjMQNNoDtuTtI/C/HZ0YwK3u5xvCiAHzPlAiAIStkUJNtXlkBd6AA2lsJ835xt8kJ+68ZYAm5+9NfhFw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"_from":".","_shasum":"f9da3facd38883be7bc285e11ae7d3efc56b2418","browser":"browser.js","gitHead":"686b05df63e8e07a1c21b14e2dedd75ffb05ae15","scripts":{"ci":"npm run check && npm test","fmt":"mongodb-js-fmt ./*.js lib/*.js ./test/*.js","test":"mocha","check":"mongodb-js-precommit","pretest":"mongodb-runner install"},"_npmUser":{"name":"durran","email":"durran@gmail.com"},"precommit":["check"],"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"4.0.5","description":"MongoDB connection model.","directories":{},"_nodeVersion":"7.4.0","dependencies":{"ssh2":"^0.5.4","async":"^2.1.5","debug":"^2.6.0","lodash":"^4.16.4","backoff":"^2.4.1","mongodb":"^2.2.28","kerberos":"^0.0.22","mongodb-url":"^2.0.1","ampersand-model":"^8.0.0","ampersand-rest-collection":"^6.0.0"},"devDependencies":{"mocha":"^3.2.0","sinon":"^1.17.7","pre-commit":"^1.1.2","mock-require":"^2.0.1","mongodb-js-fmt":"^0.0.3","mongodb-runner":"^3.3.3","mongodb-js-precommit":"^0.2.9","mongodb-instance-model":"^4.0.0","eslint-config-mongodb-js":"^2.2.0","mongodb-connection-fixture":"^0.0.14"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model-10.4.0.tgz_1509790008304_0.21174255618825555","host":"s3://npm-registry-packages"}},"10.4.1":{"name":"mongodb-connection-model","version":"10.4.1","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@10.4.1","maintainers":[{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"daprahamian","email":"dan.aprahamian@gmail.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"jlord","email":"to.jlord@gmail.com"},{"name":"terakilobyte","email":"terakilobyte@gmail.com"},{"name":"jimol","email":"jim.oleary@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"mpobrien","email":"mpobrien005@gmail.com"},{"name":"christkv","email":"christkv@gmail.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"pzrq","email":"peter@peterjs.com"},{"name":"justinjmoses","email":"justinjmoses@gmail.com"},{"name":"aherlihy","email":"anna@mongodb.com"},{"name":"redondos","email":"aolivera@gmail.com"},{"name":"dpercy","email":"davetp425@gmail.com"},{"name":"cilix","email":"matthewlevenstein@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"glowe","email":"graham.lowe@gmail.com"},{"name":"micheal.parks","email":"michealparks1989@gmail.com"},{"name":"schwartzrw","email":"schwartzrw@gmail.com"},{"name":"durran","email":"durran@gmail.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"66621acd7ecdbeb506d11bf67c75b1c593074407","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-10.4.1.tgz","integrity":"sha512-yAisY3QQShjLsObQo85Q9yFRz17Db8VJ4J5aAuSefQE6I/dLU2PwvhItr3deQl/yEDtimYmm+FW8bG86s6nvrQ==","signatures":[{"sig":"MEUCIFSnI5cIosMTZVIR0qenzdk/b5BLtArqM3dRYzNahEoQAiEApSYGKHu7rziRX1Lg4dQX97iUvaQfJk9YFSVLFOE1HXs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"_from":".","_shasum":"66621acd7ecdbeb506d11bf67c75b1c593074407","browser":"browser.js","gitHead":"8f65064f15ea807a46f089092ecff4fd803c697a","scripts":{"ci":"npm run check && npm test","fmt":"mongodb-js-fmt ./*.js lib/*.js ./test/*.js","test":"mocha","check":"mongodb-js-precommit","pretest":"mongodb-runner install"},"_npmUser":{"name":"durran","email":"durran@gmail.com"},"precommit":["check"],"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"4.0.5","description":"MongoDB connection model.","directories":{},"_nodeVersion":"7.4.0","dependencies":{"ssh2":"^0.5.4","async":"^2.1.5","debug":"^2.6.0","lodash":"^4.16.4","backoff":"^2.4.1","mongodb":"^2.2.28","kerberos":"^0.0.22","mongodb-url":"^2.0.1","ampersand-model":"^8.0.0","ampersand-rest-collection":"^6.0.0"},"devDependencies":{"mocha":"^3.2.0","sinon":"^1.17.7","pre-commit":"^1.1.2","mock-require":"^2.0.1","mongodb-js-fmt":"^0.0.3","mongodb-runner":"^3.3.3","mongodb-js-precommit":"^0.2.9","mongodb-instance-model":"^4.0.0","eslint-config-mongodb-js":"^2.2.0","mongodb-connection-fixture":"^0.0.14"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model-10.4.1.tgz_1510060500839_0.584173334762454","host":"s3://npm-registry-packages"}},"10.4.2":{"name":"mongodb-connection-model","version":"10.4.2","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@10.4.2","maintainers":[{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"daprahamian","email":"dan.aprahamian@gmail.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"jlord","email":"to.jlord@gmail.com"},{"name":"terakilobyte","email":"terakilobyte@gmail.com"},{"name":"jimol","email":"jim.oleary@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"mpobrien","email":"mpobrien005@gmail.com"},{"name":"christkv","email":"christkv@gmail.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"pzrq","email":"peter@peterjs.com"},{"name":"justinjmoses","email":"justinjmoses@gmail.com"},{"name":"aherlihy","email":"anna@mongodb.com"},{"name":"redondos","email":"aolivera@gmail.com"},{"name":"dpercy","email":"davetp425@gmail.com"},{"name":"cilix","email":"matthewlevenstein@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"glowe","email":"graham.lowe@gmail.com"},{"name":"micheal.parks","email":"michealparks1989@gmail.com"},{"name":"schwartzrw","email":"schwartzrw@gmail.com"},{"name":"durran","email":"durran@gmail.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"00e11439a5852a10a8f83710f1496c11d909ef59","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-10.4.2.tgz","integrity":"sha512-HRpJx1rCZEt1NW2yn2Ypqt80aV1eVfG+qFBlMvlg0G5iFNHk8V5AtRzf19I0wpG/9Zz3TSxThD7Kv1NVtATnCw==","signatures":[{"sig":"MEQCIEpSkc+XF6iZvElWyj3e6To9znMBSM7sMxu220qipEbpAiAOnSGyMtZt1y1pQHSWiObcc61PuQviI6RL5Cxt3KMjFA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"_from":".","_shasum":"00e11439a5852a10a8f83710f1496c11d909ef59","browser":"browser.js","gitHead":"869386d1655b0d2b5ddb4a1c82518adf8dcafac1","scripts":{"ci":"npm run check && npm test","fmt":"mongodb-js-fmt ./*.js lib/*.js ./test/*.js","test":"mocha","check":"mongodb-js-precommit","pretest":"mongodb-runner install"},"_npmUser":{"name":"durran","email":"durran@gmail.com"},"precommit":["check"],"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"4.0.5","description":"MongoDB connection model.","directories":{},"_nodeVersion":"7.4.0","dependencies":{"ssh2":"^0.5.4","async":"^2.1.5","debug":"^2.6.0","lodash":"^4.16.4","backoff":"^2.4.1","mongodb":"^2.2.28","kerberos":"^0.0.22","mongodb-url":"^2.0.1","ampersand-model":"^8.0.0","ampersand-rest-collection":"^6.0.0"},"devDependencies":{"mocha":"^3.2.0","sinon":"^1.17.7","pre-commit":"^1.1.2","mock-require":"^2.0.1","mongodb-js-fmt":"^0.0.3","mongodb-runner":"^3.3.3","mongodb-js-precommit":"^0.2.9","mongodb-instance-model":"^4.0.0","eslint-config-mongodb-js":"^2.2.0","mongodb-connection-fixture":"^0.0.14"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model-10.4.2.tgz_1510130454026_0.38531609368510544","host":"s3://npm-registry-packages"}},"10.4.3":{"name":"mongodb-connection-model","version":"10.4.3","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@10.4.3","maintainers":[{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"daprahamian","email":"dan.aprahamian@gmail.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"jlord","email":"to.jlord@gmail.com"},{"name":"terakilobyte","email":"terakilobyte@gmail.com"},{"name":"jimol","email":"jim.oleary@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"mpobrien","email":"mpobrien005@gmail.com"},{"name":"christkv","email":"christkv@gmail.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"pzrq","email":"peter@peterjs.com"},{"name":"justinjmoses","email":"justinjmoses@gmail.com"},{"name":"aherlihy","email":"anna@mongodb.com"},{"name":"redondos","email":"aolivera@gmail.com"},{"name":"dpercy","email":"davetp425@gmail.com"},{"name":"cilix","email":"matthewlevenstein@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"glowe","email":"graham.lowe@gmail.com"},{"name":"micheal.parks","email":"michealparks1989@gmail.com"},{"name":"schwartzrw","email":"schwartzrw@gmail.com"},{"name":"durran","email":"durran@gmail.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"37d4effacdd476e208fa7b9df922d3a2a748957e","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-10.4.3.tgz","integrity":"sha512-4pseIvjxr1WTeEgztn11SNdHrDRLxUSv4M6CHC9lNYv101wrp8BZftXDUq2pIQ7Cl/DA8lfP8FzchJMZJFocAA==","signatures":[{"sig":"MEUCIQC7ALzPiLMwiZMfIAM64BPruY6ewPVWcx1xfnl23L0OpgIgafPmwVuc0J03r1RUSTXVLefQ/5J6llHr44J08wmG18I=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"_from":".","_shasum":"37d4effacdd476e208fa7b9df922d3a2a748957e","browser":"browser.js","gitHead":"f4709880780a285d8e774836a12f8110c1ff56b3","scripts":{"ci":"npm run check && npm test","fmt":"mongodb-js-fmt ./*.js lib/*.js ./test/*.js","test":"mocha","check":"mongodb-js-precommit","pretest":"mongodb-runner install"},"_npmUser":{"name":"durran","email":"durran@gmail.com"},"precommit":["check"],"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"4.0.5","description":"MongoDB connection model.","directories":{},"_nodeVersion":"7.4.0","dependencies":{"ssh2":"^0.5.4","async":"^2.1.5","debug":"^2.6.0","lodash":"^4.16.4","backoff":"^2.4.1","mongodb":"^2.2.28","kerberos":"^0.0.22","mongodb-url":"^2.0.1","ampersand-model":"^8.0.0","ampersand-rest-collection":"^6.0.0"},"devDependencies":{"mocha":"^3.2.0","sinon":"^1.17.7","pre-commit":"^1.1.2","mock-require":"^2.0.1","mongodb-js-fmt":"^0.0.3","mongodb-runner":"^3.3.3","mongodb-js-precommit":"^0.2.9","mongodb-instance-model":"^4.0.0","eslint-config-mongodb-js":"^2.2.0","mongodb-connection-fixture":"^0.0.14"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model-10.4.3.tgz_1510325559231_0.6343397095333785","host":"s3://npm-registry-packages"}},"10.5.0":{"name":"mongodb-connection-model","version":"10.5.0","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@10.5.0","maintainers":[{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"daprahamian","email":"dan.aprahamian@gmail.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"jlord","email":"to.jlord@gmail.com"},{"name":"terakilobyte","email":"terakilobyte@gmail.com"},{"name":"jimol","email":"jim.oleary@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"mpobrien","email":"mpobrien005@gmail.com"},{"name":"christkv","email":"christkv@gmail.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"pzrq","email":"peter@peterjs.com"},{"name":"justinjmoses","email":"justinjmoses@gmail.com"},{"name":"aherlihy","email":"anna@mongodb.com"},{"name":"redondos","email":"aolivera@gmail.com"},{"name":"dpercy","email":"davetp425@gmail.com"},{"name":"cilix","email":"matthewlevenstein@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"glowe","email":"graham.lowe@gmail.com"},{"name":"micheal.parks","email":"michealparks1989@gmail.com"},{"name":"schwartzrw","email":"schwartzrw@gmail.com"},{"name":"durran","email":"durran@gmail.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"ec0703fdd9fb41040515f0f0ca26dbe311a04809","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-10.5.0.tgz","integrity":"sha512-cYRlqArhQpNx+l5EcLMu7LTeWy/lKluiz+go9NkD3HjUE05uMjII4hgbDKdDeY2Tx0mKSIwFwjRq6Rz2Yi1bTw==","signatures":[{"sig":"MEUCIQDfuOmEX/rVKVwZfY2Evlu36AaliPr4Q0Fc2Bxx43QdlgIgKQh11SnCwSxoXVGVQ+irPiZu1AoYdcbjMZcalkQx0SU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"_from":".","_shasum":"ec0703fdd9fb41040515f0f0ca26dbe311a04809","browser":"browser.js","gitHead":"32dd7ca4f9c327df874326d29cd3ec610c4583d1","scripts":{"ci":"npm run check && npm test","fmt":"mongodb-js-fmt ./*.js lib/*.js ./test/*.js","test":"mocha","check":"mongodb-js-precommit","pretest":"mongodb-runner install"},"_npmUser":{"name":"durran","email":"durran@gmail.com"},"precommit":["check"],"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"4.0.5","description":"MongoDB connection model.","directories":{},"_nodeVersion":"7.4.0","dependencies":{"ssh2":"^0.5.4","async":"^2.1.5","debug":"^2.6.0","lodash":"^4.16.4","backoff":"^2.4.1","mongodb":"^2.2.28","kerberos":"^0.0.22","mongodb-url":"^2.0.1","ampersand-model":"^8.0.0","ampersand-rest-collection":"^6.0.0"},"devDependencies":{"mocha":"^3.2.0","sinon":"^1.17.7","pre-commit":"^1.1.2","mock-require":"^2.0.1","mongodb-js-fmt":"^0.0.3","mongodb-runner":"^3.3.3","mongodb-js-precommit":"^0.2.9","mongodb-instance-model":"^4.0.0","eslint-config-mongodb-js":"^2.2.0","mongodb-connection-fixture":"^0.0.14"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model-10.5.0.tgz_1510488621434_0.9158486307132989","host":"s3://npm-registry-packages"}},"10.6.0":{"name":"mongodb-connection-model","version":"10.6.0","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@10.6.0","maintainers":[{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"daprahamian","email":"dan.aprahamian@gmail.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"jlord","email":"to.jlord@gmail.com"},{"name":"terakilobyte","email":"terakilobyte@gmail.com"},{"name":"jimol","email":"jim.oleary@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"mpobrien","email":"mpobrien005@gmail.com"},{"name":"christkv","email":"christkv@gmail.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"pzrq","email":"peter@peterjs.com"},{"name":"justinjmoses","email":"justinjmoses@gmail.com"},{"name":"aherlihy","email":"anna@mongodb.com"},{"name":"redondos","email":"aolivera@gmail.com"},{"name":"dpercy","email":"davetp425@gmail.com"},{"name":"cilix","email":"matthewlevenstein@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"glowe","email":"graham.lowe@gmail.com"},{"name":"micheal.parks","email":"michealparks1989@gmail.com"},{"name":"schwartzrw","email":"schwartzrw@gmail.com"},{"name":"durran","email":"durran@gmail.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"a39df6f4fe0b9c08cb2c2ca435dcc7ac2c9e95f3","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-10.6.0.tgz","integrity":"sha512-IHbTPSYOrWmB906RjTp/ki2PE0oYp8o1coGijWF7JMqDKeUL6TuwEPY0gFmu5+8X2BvQHp0WxAouOMhotMsDpw==","signatures":[{"sig":"MEQCICiBBZWA2NLQMS0wR60Lo18PGgC0y5V5yoqRPNnC01njAiBIslr4ismc7oNW6OI5o/IbkOcylKYuWtlTGpGWuLnaTg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"_from":".","_shasum":"a39df6f4fe0b9c08cb2c2ca435dcc7ac2c9e95f3","browser":"browser.js","gitHead":"522118020033527af21f22c5eb574de9932ff6c5","scripts":{"ci":"npm run check && npm test","fmt":"mongodb-js-fmt ./*.js lib/*.js ./test/*.js","test":"mocha","check":"mongodb-js-precommit","pretest":"mongodb-runner install"},"_npmUser":{"name":"durran","email":"durran@gmail.com"},"precommit":["check"],"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"4.0.5","description":"MongoDB connection model.","directories":{},"_nodeVersion":"7.4.0","dependencies":{"ssh2":"^0.5.4","async":"^2.1.5","debug":"^2.6.0","lodash":"^4.16.4","backoff":"^2.4.1","mongodb":"^2.2.28","kerberos":"^0.0.22","mongodb-url":"^2.1.0","ampersand-model":"^8.0.0","ampersand-rest-collection":"^6.0.0"},"devDependencies":{"mocha":"^3.2.0","sinon":"^1.17.7","pre-commit":"^1.1.2","mock-require":"^2.0.1","mongodb-js-fmt":"^0.0.3","mongodb-runner":"^3.3.3","mongodb-js-precommit":"^0.2.9","mongodb-instance-model":"^4.0.0","eslint-config-mongodb-js":"^2.2.0","mongodb-connection-fixture":"^0.0.14"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model-10.6.0.tgz_1510683411567_0.15141435945406556","host":"s3://npm-registry-packages"}},"10.7.0":{"name":"mongodb-connection-model","version":"10.7.0","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@10.7.0","maintainers":[{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"daprahamian","email":"dan.aprahamian@gmail.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"jlord","email":"to.jlord@gmail.com"},{"name":"terakilobyte","email":"terakilobyte@gmail.com"},{"name":"jimol","email":"jim.oleary@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"mpobrien","email":"mpobrien005@gmail.com"},{"name":"christkv","email":"christkv@gmail.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"pzrq","email":"peter@peterjs.com"},{"name":"justinjmoses","email":"justinjmoses@gmail.com"},{"name":"aherlihy","email":"anna@mongodb.com"},{"name":"redondos","email":"aolivera@gmail.com"},{"name":"dpercy","email":"davetp425@gmail.com"},{"name":"cilix","email":"matthewlevenstein@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"glowe","email":"graham.lowe@gmail.com"},{"name":"micheal.parks","email":"michealparks1989@gmail.com"},{"name":"schwartzrw","email":"schwartzrw@gmail.com"},{"name":"durran","email":"durran@gmail.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"6afc7a32f9ff737243d06854ee9a93d4be6efd80","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-10.7.0.tgz","integrity":"sha512-GGLrYXclqhD9C3JyCvqC0OVI37gn6SY7DGhBHqsN2jKAumFGUnGfs+mlcP2tBczrRz7tf+UNGFE2BlOfU0CKXg==","signatures":[{"sig":"MEQCIBYxhNnGSIWDoGbbqy/sFKVVwNWlPkMIWLYiDD4DSjK5AiAK86CYqBYxA9QEMWXcFM7YkY69UL7PRDE5N7xdvlT9kA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"_from":".","_shasum":"6afc7a32f9ff737243d06854ee9a93d4be6efd80","browser":"browser.js","gitHead":"6b841845208b60c9b8568d43fe63173815371f80","scripts":{"ci":"npm run check && npm test","fmt":"mongodb-js-fmt ./*.js lib/*.js ./test/*.js","test":"mocha","check":"mongodb-js-precommit","pretest":"mongodb-runner install"},"_npmUser":{"name":"durran","email":"durran@gmail.com"},"precommit":["check"],"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"4.0.5","description":"MongoDB connection model.","directories":{},"_nodeVersion":"7.4.0","dependencies":{"ssh2":"^0.5.4","async":"^2.1.5","debug":"^2.6.0","lodash":"^4.16.4","backoff":"^2.4.1","mongodb":"^2.2.28","kerberos":"^0.0.22","mongodb-url":"^2.1.0","ampersand-model":"^8.0.0","ampersand-rest-collection":"^6.0.0"},"devDependencies":{"mocha":"^3.2.0","sinon":"^1.17.7","pre-commit":"^1.1.2","mock-require":"^2.0.1","mongodb-js-fmt":"^0.0.3","mongodb-runner":"^3.3.3","mongodb-js-precommit":"^0.2.9","mongodb-instance-model":"^4.0.0","eslint-config-mongodb-js":"^2.2.0","mongodb-connection-fixture":"^0.0.14"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model-10.7.0.tgz_1510688079457_0.13269409048371017","host":"s3://npm-registry-packages"}},"10.7.1":{"name":"mongodb-connection-model","version":"10.7.1","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@10.7.1","maintainers":[{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"lrlna","email":"shestak.irina@gmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"diodredd","email":"diodredd@gmail.com"},{"name":"jrbalsano","email":"jrbalsano@gmail.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"daprahamian","email":"dan.aprahamian@gmail.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"jlord","email":"to.jlord@gmail.com"},{"name":"terakilobyte","email":"terakilobyte@gmail.com"},{"name":"jimol","email":"jim.oleary@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"mpobrien","email":"mpobrien005@gmail.com"},{"name":"christkv","email":"christkv@gmail.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"pzrq","email":"peter@peterjs.com"},{"name":"justinjmoses","email":"justinjmoses@gmail.com"},{"name":"aherlihy","email":"anna@mongodb.com"},{"name":"redondos","email":"aolivera@gmail.com"},{"name":"dpercy","email":"davetp425@gmail.com"},{"name":"cilix","email":"matthewlevenstein@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"glowe","email":"graham.lowe@gmail.com"},{"name":"micheal.parks","email":"michealparks1989@gmail.com"},{"name":"schwartzrw","email":"schwartzrw@gmail.com"},{"name":"durran","email":"durran@gmail.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"b531b255f91b2e0723ce489a85c24e3d8619957b","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-10.7.1.tgz","integrity":"sha512-fAvyNIfL4dAWru2IsZIvXiW9Spud6ZkI1/tiX0S0vTqNqesaCC7Te+8YlLZGjn8tcqUXMZ8+6+O9Ly/W1MUCiA==","signatures":[{"sig":"MEYCIQCyBar45CTD0obny7cRxEEw1OmIh0f4gB+O47R10UwoCAIhAIp9oI9CvxVkRldG1Xil26VE01VSloVG564/PmKiR9IK","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"_from":".","_shasum":"b531b255f91b2e0723ce489a85c24e3d8619957b","browser":"browser.js","gitHead":"58c4c5f3b4f95f8b0917111539cbf3826b7558ad","scripts":{"ci":"npm run check && npm test","fmt":"mongodb-js-fmt ./*.js lib/*.js ./test/*.js","test":"mocha","check":"mongodb-js-precommit","pretest":"mongodb-runner install"},"_npmUser":{"name":"durran","email":"durran@gmail.com"},"precommit":["check"],"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"4.0.5","description":"MongoDB connection model.","directories":{},"_nodeVersion":"7.4.0","dependencies":{"ssh2":"^0.5.4","async":"^2.1.5","debug":"^2.6.0","lodash":"^4.16.4","backoff":"^2.4.1","mongodb":"2.2.33","kerberos":"^0.0.22","mongodb-url":"^2.1.0","ampersand-model":"^8.0.0","ampersand-rest-collection":"^6.0.0"},"devDependencies":{"mocha":"^3.2.0","sinon":"^1.17.7","pre-commit":"^1.1.2","mock-require":"^2.0.1","mongodb-js-fmt":"^0.0.3","mongodb-runner":"^3.3.3","mongodb-js-precommit":"^0.2.9","mongodb-instance-model":"^4.0.0","eslint-config-mongodb-js":"^2.2.0","mongodb-connection-fixture":"^0.0.14"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model-10.7.1.tgz_1515023179249_0.16548708267509937","host":"s3://npm-registry-packages"}},"11.0.0":{"name":"mongodb-connection-model","version":"11.0.0","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@11.0.0","maintainers":[{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"lrlna","email":"shestak.irina@gmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"diodredd","email":"diodredd@gmail.com"},{"name":"jrbalsano","email":"jrbalsano@gmail.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"daprahamian","email":"dan.aprahamian@gmail.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"jlord","email":"to.jlord@gmail.com"},{"name":"terakilobyte","email":"terakilobyte@gmail.com"},{"name":"jimol","email":"jim.oleary@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"mpobrien","email":"mpobrien005@gmail.com"},{"name":"christkv","email":"christkv@gmail.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"pzrq","email":"peter@peterjs.com"},{"name":"justinjmoses","email":"justinjmoses@gmail.com"},{"name":"aherlihy","email":"anna@mongodb.com"},{"name":"redondos","email":"aolivera@gmail.com"},{"name":"dpercy","email":"davetp425@gmail.com"},{"name":"cilix","email":"matthewlevenstein@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"glowe","email":"graham.lowe@gmail.com"},{"name":"micheal.parks","email":"michealparks1989@gmail.com"},{"name":"schwartzrw","email":"schwartzrw@gmail.com"},{"name":"durran","email":"durran@gmail.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"22553b8ad348460e857987a73a5d091b06004fee","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-11.0.0.tgz","integrity":"sha512-UpVYnSFRzLyQiY5VGfYOI1rf3aDrKuPw6mA12uYJORuTvklMaY7Dlyz/xm0BptL24hnSr4P8NVDygJblvK0WjA==","signatures":[{"sig":"MEYCIQDcpK7E91Tqq69ETdnEArB0HKGFcaCjEpMIb2OkPBti5AIhAOxzVIPyrUBjZeOQQc/NQ3UxHGZjycB9g5uquHIIYIrN","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"_from":".","_shasum":"22553b8ad348460e857987a73a5d091b06004fee","browser":"browser.js","gitHead":"6cca0fdbdd62a75b1e5153461589aebeadd774e4","scripts":{"ci":"npm run check && npm test","fmt":"mongodb-js-fmt ./*.js lib/*.js ./test/*.js","test":"mocha","check":"mongodb-js-precommit","pretest":"mongodb-runner install"},"_npmUser":{"name":"durran","email":"durran@gmail.com"},"precommit":["check"],"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"4.2.0","description":"MongoDB connection model.","directories":{},"_nodeVersion":"7.9.0","dependencies":{"ssh2":"^0.5.4","async":"^2.1.5","debug":"^2.6.0","lodash":"^4.16.4","backoff":"^2.4.1","mongodb":"^2.2.34","kerberos":"^0.0.22","mongodb-url":"^2.1.0","ampersand-model":"^8.0.0","ampersand-rest-collection":"^6.0.0"},"devDependencies":{"mocha":"^3.2.0","sinon":"^1.17.7","pre-commit":"^1.1.2","mock-require":"^2.0.1","mongodb-js-fmt":"^0.0.3","mongodb-runner":"^3.6.1","mongodb-js-precommit":"^0.2.9","mongodb-instance-model":"^4.0.0","eslint-config-mongodb-js":"^2.2.0","mongodb-connection-fixture":"^0.0.14"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model-11.0.0.tgz_1515668071782_0.4586507477797568","host":"s3://npm-registry-packages"}},"12.0.0":{"name":"mongodb-connection-model","version":"12.0.0","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@12.0.0","maintainers":[{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"lrlna","email":"shestak.irina@gmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"diodredd","email":"diodredd@gmail.com"},{"name":"jrbalsano","email":"jrbalsano@gmail.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"daprahamian","email":"dan.aprahamian@gmail.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"jlord","email":"to.jlord@gmail.com"},{"name":"terakilobyte","email":"terakilobyte@gmail.com"},{"name":"jimol","email":"jim.oleary@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"mpobrien","email":"mpobrien005@gmail.com"},{"name":"christkv","email":"christkv@gmail.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"pzrq","email":"peter@peterjs.com"},{"name":"justinjmoses","email":"justinjmoses@gmail.com"},{"name":"aherlihy","email":"anna@mongodb.com"},{"name":"redondos","email":"aolivera@gmail.com"},{"name":"dpercy","email":"davetp425@gmail.com"},{"name":"cilix","email":"matthewlevenstein@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"glowe","email":"graham.lowe@gmail.com"},{"name":"micheal.parks","email":"michealparks1989@gmail.com"},{"name":"schwartzrw","email":"schwartzrw@gmail.com"},{"name":"durran","email":"durran@gmail.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"9557f9ae12e7dcf21a7768a789f09ec40dbdb400","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-12.0.0.tgz","integrity":"sha512-Ti3d2qafYa8XfbdckQ36yjAWEZJlIt935mPVx5JOHEzL/7GcYKL4D0UZEu29qJTQtz8g4iDAoXgp5g7KEUTY4A==","signatures":[{"sig":"MEYCIQCGaSCXpK35/h65ecpgzjRiou95V6axEOExGpQ+R6GhyAIhAPjpprk5gUE9qLfChPvX/JolYC5gCkCZVq4JPbFXvEIr","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"_from":".","_shasum":"9557f9ae12e7dcf21a7768a789f09ec40dbdb400","browser":"browser.js","gitHead":"a6b37214b8169b07309e25f9cd5a4345b3c12fe7","scripts":{"ci":"npm run check && npm test","fmt":"mongodb-js-fmt ./*.js lib/*.js ./test/*.js","test":"mocha","check":"mongodb-js-precommit","pretest":"mongodb-runner install"},"_npmUser":{"name":"durran","email":"durran@gmail.com"},"precommit":["check"],"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"4.2.0","description":"MongoDB connection model.","directories":{},"_nodeVersion":"7.9.0","dependencies":{"ssh2":"^0.5.4","async":"^2.1.5","debug":"^2.6.0","lodash":"^4.16.4","backoff":"^2.4.1","mongodb":"^3.0.1","kerberos":"^0.0.22","lodash.omit":"^4.5.0","mongodb-url":"^3.0.0","lodash.clone":"^4.5.0","mongodb-core":"^3.0.1","lodash.assign":"^4.2.0","ampersand-model":"^8.0.0","lodash.defaults":"^4.2.0","lodash.includes":"^4.3.0","lodash.isstring":"^4.0.1","lodash.isfunction":"^3.0.8","ampersand-rest-collection":"^6.0.0"},"devDependencies":{"mocha":"^3.2.0","sinon":"^1.17.7","pre-commit":"^1.1.2","mock-require":"^2.0.1","mongodb-js-fmt":"^0.0.3","mongodb-runner":"^3.6.1","mongodb-js-precommit":"^0.2.9","mongodb-instance-model":"^7.0.0","eslint-config-mongodb-js":"^2.2.0","mongodb-connection-fixture":"^0.0.14"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model-12.0.0.tgz_1517051251294_0.6597075995523483","host":"s3://npm-registry-packages"}},"12.0.1":{"name":"mongodb-connection-model","version":"12.0.1","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@12.0.1","maintainers":[{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"lrlna","email":"shestak.irina@gmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"diodredd","email":"diodredd@gmail.com"},{"name":"jrbalsano","email":"jrbalsano@gmail.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"daprahamian","email":"dan.aprahamian@gmail.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"jlord","email":"to.jlord@gmail.com"},{"name":"terakilobyte","email":"terakilobyte@gmail.com"},{"name":"jimol","email":"jim.oleary@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"mpobrien","email":"mpobrien005@gmail.com"},{"name":"christkv","email":"christkv@gmail.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"pzrq","email":"peter@peterjs.com"},{"name":"justinjmoses","email":"justinjmoses@gmail.com"},{"name":"aherlihy","email":"anna@mongodb.com"},{"name":"redondos","email":"aolivera@gmail.com"},{"name":"dpercy","email":"davetp425@gmail.com"},{"name":"cilix","email":"matthewlevenstein@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"glowe","email":"graham.lowe@gmail.com"},{"name":"micheal.parks","email":"michealparks1989@gmail.com"},{"name":"schwartzrw","email":"schwartzrw@gmail.com"},{"name":"durran","email":"durran@gmail.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"dff72f7677c414045ca3eec425af299b5b8c0e5c","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-12.0.1.tgz","integrity":"sha512-cPdDq44+OP47AVSGH//9S5PFkdS7pvQu0Com6XHZSNrxjPEzCjK3MIsXFGEa3RufF0ZXWy/PMpcmHd5Pd2yZXA==","signatures":[{"sig":"MEUCIQCbd94nM7RfLhSxpm9x+qykUqoMpDi0qe0A3/4lpglBNwIgUVg/vXBmXqgqj8omQq5mnjsTf3pcyEsF4UyZ72Cdfpk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"_from":".","_shasum":"dff72f7677c414045ca3eec425af299b5b8c0e5c","browser":"browser.js","gitHead":"24782385fe3e8af7bd42f6f2ee24f9eb7f69f80e","scripts":{"ci":"npm run check && npm test","fmt":"mongodb-js-fmt ./*.js lib/*.js ./test/*.js","test":"mocha","check":"mongodb-js-precommit","pretest":"mongodb-runner install"},"_npmUser":{"name":"durran","email":"durran@gmail.com"},"precommit":["check"],"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"4.2.0","description":"MongoDB connection model.","directories":{},"_nodeVersion":"7.9.0","dependencies":{"ssh2":"^0.5.4","async":"^2.1.5","debug":"^2.6.0","backoff":"^2.4.1","mongodb":"^3.0.1","kerberos":"^0.0.22","lodash.omit":"^4.5.0","mongodb-url":"^3.0.0","lodash.clone":"^4.5.0","mongodb-core":"^3.0.1","lodash.assign":"^4.2.0","ampersand-model":"^8.0.0","lodash.defaults":"^4.2.0","lodash.includes":"^4.3.0","lodash.isstring":"^4.0.1","lodash.isfunction":"^3.0.8","ampersand-rest-collection":"^6.0.0"},"devDependencies":{"mocha":"^3.2.0","sinon":"^1.17.7","pre-commit":"^1.1.2","mock-require":"^2.0.1","mongodb-js-fmt":"^0.0.3","mongodb-runner":"^3.6.1","mongodb-js-precommit":"^0.2.9","mongodb-instance-model":"^7.0.0","eslint-config-mongodb-js":"^2.2.0","mongodb-connection-fixture":"^0.0.14"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model-12.0.1.tgz_1517051599364_0.14454151410609484","host":"s3://npm-registry-packages"}},"12.0.2":{"name":"mongodb-connection-model","version":"12.0.2","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@12.0.2","maintainers":[{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"lrlna","email":"shestak.irina@gmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"diodredd","email":"diodredd@gmail.com"},{"name":"jrbalsano","email":"jrbalsano@gmail.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"daprahamian","email":"dan.aprahamian@gmail.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"jlord","email":"to.jlord@gmail.com"},{"name":"terakilobyte","email":"terakilobyte@gmail.com"},{"name":"jimol","email":"jim.oleary@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"mpobrien","email":"mpobrien005@gmail.com"},{"name":"christkv","email":"christkv@gmail.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"pzrq","email":"peter@peterjs.com"},{"name":"justinjmoses","email":"justinjmoses@gmail.com"},{"name":"aherlihy","email":"anna@mongodb.com"},{"name":"redondos","email":"aolivera@gmail.com"},{"name":"dpercy","email":"davetp425@gmail.com"},{"name":"cilix","email":"matthewlevenstein@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"glowe","email":"graham.lowe@gmail.com"},{"name":"micheal.parks","email":"michealparks1989@gmail.com"},{"name":"schwartzrw","email":"schwartzrw@gmail.com"},{"name":"durran","email":"durran@gmail.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"f8393b767a8fadfc36474a7a1cf52a71f1a16943","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-12.0.2.tgz","integrity":"sha512-A+5/i7ocjg8zwSDVXyHBkGLvxpUtgXltifCkgEeJwdM/un98RAyJp15XUNLkckgA7mWbHT/ioHNBsPrrGhqQrg==","signatures":[{"sig":"MEYCIQDqTlaGJm5sPb/BEYmEpm1CbBP18EfJaEwUVMm5EhsFLAIhAP2weWMdKfOq+V/dgZikEEohJJtw11BTB3VNESslLeFT","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"_from":".","_shasum":"f8393b767a8fadfc36474a7a1cf52a71f1a16943","browser":"browser.js","gitHead":"f7bf2d2acf004c312397250d38245c6a8796a318","scripts":{"ci":"npm run check && npm test","fmt":"mongodb-js-fmt ./*.js lib/*.js ./test/*.js","test":"mocha","check":"mongodb-js-precommit","pretest":"mongodb-runner install"},"_npmUser":{"name":"durran","email":"durran@gmail.com"},"precommit":["check"],"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"4.2.0","description":"MongoDB connection model.","directories":{},"_nodeVersion":"7.9.0","dependencies":{"ssh2":"^0.5.4","async":"^2.1.5","debug":"^2.6.0","backoff":"^2.4.1","mongodb":"^3.0.1","kerberos":"^0.0.22","lodash.omit":"^4.5.0","mongodb-url":"^3.0.0","lodash.clone":"^4.5.0","mongodb-core":"^3.0.1","lodash.assign":"^4.2.0","ampersand-model":"^8.0.0","lodash.defaults":"^4.2.0","lodash.includes":"^4.3.0","lodash.isstring":"^4.0.1","lodash.isfunction":"^3.0.8","ampersand-rest-collection":"^6.0.0"},"devDependencies":{"mocha":"^3.2.0","sinon":"^1.17.7","pre-commit":"^1.1.2","mock-require":"^2.0.1","mongodb-js-fmt":"^0.0.3","mongodb-runner":"^3.6.1","mongodb-js-precommit":"^0.2.9","mongodb-instance-model":"^7.0.0","eslint-config-mongodb-js":"^2.2.0","mongodb-connection-fixture":"^0.0.14"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model-12.0.2.tgz_1517061911808_0.04957291786558926","host":"s3://npm-registry-packages"}},"12.0.3":{"name":"mongodb-connection-model","version":"12.0.3","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@12.0.3","maintainers":[{"name":"aherlihy","email":"anna@mongodb.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"christkv","email":"christkv@gmail.com"},{"name":"cilix","email":"matthewlevenstein@gmail.com"},{"name":"daprahamian","email":"dan.aprahamian@gmail.com"},{"name":"deepshah","email":"deepcshah@gmail.com"},{"name":"dpercy","email":"davetp425@gmail.com"},{"name":"durran","email":"durran@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"glowe","email":"graham.lowe@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"jimol","email":"jim.oleary@gmail.com"},{"name":"jlord","email":"to.jlord@gmail.com"},{"name":"jon.franco","email":"jon.franco@mongodb.com"},{"name":"jrbalsano","email":"jrbalsano@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"justinjmoses","email":"justinjmoses@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"lrlna","email":"shestak.irina@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"micheal.parks","email":"michealparks1989@gmail.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"mpobrien","email":"mpobrien005@gmail.com"},{"name":"pzrq","email":"peter@peterjs.com"},{"name":"redondos","email":"aolivera@gmail.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"sampoonachot","email":"joy.sampoonachot@10gen.com"},{"name":"samweaver","email":"samuel.james.weaver@gmail.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"schwartzrw","email":"schwartzrw@gmail.com"},{"name":"terakilobyte","email":"terakilobyte@gmail.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"69f4607e114c2098285fb0883f7853b1f522a15e","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-12.0.3.tgz","fileCount":12,"integrity":"sha512-aTWLi/ThiTx4BjPZaA2UmEN75EPuJ04VtBaRPUCZl6h2/1Y2/DRBXXojF14v+4AzoNj05v9cif8k92Pya32IOw==","signatures":[{"sig":"MEUCIEkn6JYpr4EAGrt+picTD91G0mmuNcRd6NN8sfDMLvbOAiEAwnok7nOfDA92gggEbFbOQPac9pL07gdLHlevb/UFvbA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":73355},"browser":"browser.js","gitHead":"b24719f5243e6c6f3d0e026a203556467c801b4e","scripts":{"ci":"npm run check && npm test","fmt":"mongodb-js-fmt ./*.js lib/*.js ./test/*.js","test":"mocha","check":"mongodb-js-precommit","pretest":"mongodb-runner install"},"_npmUser":{"name":"durran","email":"durran@gmail.com"},"precommit":["check"],"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"5.3.0","description":"MongoDB connection model.","directories":{},"_nodeVersion":"8.2.1","dependencies":{"ssh2":"^0.5.4","async":"^2.1.5","debug":"^2.6.0","backoff":"^2.4.1","mongodb":"^3.0.1","kerberos":"^0.0.22","lodash.omit":"^4.5.0","mongodb-url":"^3.0.0","lodash.clone":"^4.5.0","mongodb-core":"^3.0.1","lodash.assign":"^4.2.0","ampersand-model":"^8.0.0","lodash.defaults":"^4.2.0","lodash.includes":"^4.3.0","lodash.isstring":"^4.0.1","lodash.isfunction":"^3.0.8","ampersand-rest-collection":"^6.0.0"},"_hasShrinkwrap":false,"devDependencies":{"mocha":"^3.2.0","sinon":"^1.17.7","pre-commit":"^1.1.2","mock-require":"^2.0.1","mongodb-js-fmt":"^0.0.3","mongodb-runner":"^3.6.1","mongodb-js-precommit":"^0.2.9","mongodb-instance-model":"^7.0.0","eslint-config-mongodb-js":"^2.2.0","mongodb-connection-fixture":"^0.0.14"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_12.0.3_1520536034542_0.33437076683592193","host":"s3://npm-registry-packages"}},"12.0.4":{"name":"mongodb-connection-model","version":"12.0.4","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@12.0.4","maintainers":[{"name":"aherlihy","email":"anna@mongodb.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"christkv","email":"christkv@gmail.com"},{"name":"cilix","email":"matthewlevenstein@gmail.com"},{"name":"daprahamian","email":"dan.aprahamian@gmail.com"},{"name":"deepshah","email":"deepcshah@gmail.com"},{"name":"dpercy","email":"davetp425@gmail.com"},{"name":"durran","email":"durran@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"glowe","email":"graham.lowe@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"jimol","email":"jim.oleary@gmail.com"},{"name":"jon.franco","email":"jon.franco@mongodb.com"},{"name":"jrbalsano","email":"jrbalsano@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"justinjmoses","email":"justinjmoses@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"lrlna","email":"shestak.irina@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"micheal.parks","email":"michealparks1989@gmail.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"mpobrien","email":"mpobrien005@gmail.com"},{"name":"pzrq","email":"peter@peterjs.com"},{"name":"redondos","email":"aolivera@gmail.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"sampoonachot","email":"joy.sampoonachot@10gen.com"},{"name":"samweaver","email":"samuel.james.weaver@gmail.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"schwartzrw","email":"schwartzrw@gmail.com"},{"name":"terakilobyte","email":"terakilobyte@gmail.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"122dc6b0215f7b4f909ab98b52cac8cc79ba50b3","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-12.0.4.tgz","fileCount":11,"integrity":"sha512-msxZcLIUT6U9qhj+hR6NglAZhbWR69xE40azunkDLfnZLMz6al0m3D7UcIOnUOeAJG+ekA9HY2vyb7U9PvaDeQ==","signatures":[{"sig":"MEYCIQC9pEWjCKqWxi6fW/xvustu41R7P6FDy1+gS8tpPRpZCAIhAMqFeKFP3i5w76ZIwY1sNqOl4sukPiapxYAJka12glnC","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":73274},"browser":"browser.js","gitHead":"ab879bb58f0f22da9acf42672c29fb9d81a40fe8","scripts":{"ci":"npm run check && npm test","fmt":"mongodb-js-fmt ./*.js lib/*.js ./test/*.js","test":"mocha","check":"mongodb-js-precommit","pretest":"mongodb-runner install"},"_npmUser":{"name":"durran","email":"durran@gmail.com"},"precommit":["check"],"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"5.6.0","description":"MongoDB connection model.","directories":{},"_nodeVersion":"8.2.1","dependencies":{"ssh2":"^0.5.4","async":"^2.1.5","debug":"^2.6.0","backoff":"^2.4.1","mongodb":"^3.0.1","kerberos":"^0.0.22","lodash.omit":"^4.5.0","mongodb-url":"^3.0.1","lodash.clone":"^4.5.0","mongodb-core":"^3.0.1","lodash.assign":"^4.2.0","ampersand-model":"^8.0.0","lodash.defaults":"^4.2.0","lodash.includes":"^4.3.0","lodash.isstring":"^4.0.1","lodash.isfunction":"^3.0.8","ampersand-rest-collection":"^6.0.0"},"_hasShrinkwrap":false,"devDependencies":{"mocha":"^3.2.0","sinon":"^1.17.7","pre-commit":"^1.1.2","mock-require":"^2.0.1","mongodb-js-fmt":"^0.0.3","mongodb-runner":"^3.6.1","mongodb-js-precommit":"^0.2.9","mongodb-instance-model":"^7.0.0","eslint-config-mongodb-js":"^2.2.0","mongodb-connection-fixture":"^0.0.14"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_12.0.4_1522691556752_0.3850678069912765","host":"s3://npm-registry-packages"}},"12.0.5":{"name":"mongodb-connection-model","version":"12.0.5","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@12.0.5","maintainers":[{"name":"aherlihy","email":"anna@mongodb.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"christkv","email":"christkv@gmail.com"},{"name":"cilix","email":"matthewlevenstein@gmail.com"},{"name":"daprahamian","email":"dan.aprahamian@gmail.com"},{"name":"deepshah","email":"deepcshah@gmail.com"},{"name":"dpercy","email":"davetp425@gmail.com"},{"name":"durran","email":"durran@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"glowe","email":"graham.lowe@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"jimol","email":"jim.oleary@gmail.com"},{"name":"jon.franco","email":"jon.franco@mongodb.com"},{"name":"jrbalsano","email":"jrbalsano@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"justinjmoses","email":"justinjmoses@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"lrlna","email":"shestak.irina@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"micheal.parks","email":"michealparks1989@gmail.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"mpobrien","email":"mpobrien005@gmail.com"},{"name":"pzrq","email":"peter@peterjs.com"},{"name":"redondos","email":"aolivera@gmail.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"sampoonachot","email":"joy.sampoonachot@10gen.com"},{"name":"samweaver","email":"samuel.james.weaver@gmail.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"schwartzrw","email":"schwartzrw@gmail.com"},{"name":"terakilobyte","email":"terakilobyte@gmail.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"0b2309bd211c3860106b4b34c536e72e8345cb48","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-12.0.5.tgz","fileCount":11,"integrity":"sha512-UcQaowtrfHLRvLo3hX0bv4COc6aAc4wjlznq/AxBrOQ9d8cTH/6YUK64UAwFUzpk0KA6juPWAP2L/HGIS16XPQ==","signatures":[{"sig":"MEQCIHnB5CZ6XgSjn3qmrIyw0KrqWM6zHSYTMJooYcehaLxXAiA86o/qC6TCzVxuklcXUYNNglD/7xXXQXXBDixvxTfzLA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":73270},"browser":"browser.js","gitHead":"302bd9cc8ccfa8fcd68e5a25329d2612d2fac370","scripts":{"ci":"npm run check && npm test","fmt":"mongodb-js-fmt ./*.js lib/*.js ./test/*.js","test":"mocha","check":"mongodb-js-precommit","pretest":"mongodb-runner install"},"_npmUser":{"name":"durran","email":"durran@gmail.com"},"precommit":["check"],"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"5.6.0","description":"MongoDB connection model.","directories":{},"_nodeVersion":"8.2.1","dependencies":{"ssh2":"^0.5.4","async":"^2.1.5","debug":"^2.6.0","backoff":"^2.4.1","mongodb":"^3.0.1","kerberos":"^0.0.22","lodash.omit":"^4.5.0","mongodb-url":"^3.0.1","lodash.clone":"^4.5.0","mongodb-core":"^3.0.1","lodash.assign":"^4.2.0","ampersand-model":"^8.0.0","lodash.defaults":"^4.2.0","lodash.includes":"^4.3.0","lodash.isstring":"^4.0.1","lodash.isfunction":"^3.0.8","ampersand-rest-collection":"^6.0.0"},"_hasShrinkwrap":false,"devDependencies":{"mocha":"^3.2.0","sinon":"^1.17.7","pre-commit":"^1.1.2","mock-require":"^2.0.1","mongodb-js-fmt":"^0.0.3","mongodb-runner":"^3.6.1","mongodb-js-precommit":"^0.2.9","mongodb-instance-model":"^7.0.0","eslint-config-mongodb-js":"^2.2.0","mongodb-connection-fixture":"^0.0.14"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_12.0.5_1522771677546_0.6763468937361905","host":"s3://npm-registry-packages"}},"12.1.0":{"name":"mongodb-connection-model","version":"12.1.0","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@12.1.0","maintainers":[{"name":"aherlihy","email":"anna@mongodb.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"christkv","email":"christkv@gmail.com"},{"name":"cilix","email":"matthewlevenstein@gmail.com"},{"name":"daprahamian","email":"dan.aprahamian@gmail.com"},{"name":"deepshah","email":"deepcshah@gmail.com"},{"name":"dpercy","email":"davetp425@gmail.com"},{"name":"durran","email":"durran@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"glowe","email":"graham.lowe@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"jimol","email":"jim.oleary@gmail.com"},{"name":"jon.franco","email":"jon.franco@mongodb.com"},{"name":"jrbalsano","email":"jrbalsano@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"justinjmoses","email":"justinjmoses@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"lrlna","email":"shestak.irina@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"micheal.parks","email":"michealparks1989@gmail.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"mpobrien","email":"mpobrien005@gmail.com"},{"name":"pzrq","email":"peter@peterjs.com"},{"name":"redondos","email":"aolivera@gmail.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"sampoonachot","email":"joy.sampoonachot@10gen.com"},{"name":"samweaver","email":"samuel.james.weaver@gmail.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"schwartzrw","email":"schwartzrw@gmail.com"},{"name":"terakilobyte","email":"terakilobyte@gmail.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"21a04057433470c4279761ac8c5e5a83ea85b178","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-12.1.0.tgz","fileCount":12,"integrity":"sha512-MgKIxShr/NxrR5o+L7+2QilVBrtgdOIAqYMQBNjf33lqQ9a0X/b+e7AgFs+RjcEJ/SAm9KJskwIx5vBhkpm+Ag==","signatures":[{"sig":"MEQCIGylYQALSHqzokdK3EjGKmv8a9MMo764P+OyB/XgYVZsAiAspP4ybeOKV/QveWG1bx64EJuAm8C8kXvaf09gU2/jGg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":73062},"browser":"browser.js","gitHead":"6eea2563289c419d9411e0acb9ebc059bc311bbe","scripts":{"ci":"npm run check && npm test","fmt":"mongodb-js-fmt ./*.js lib/*.js ./test/*.js","test":"mocha","check":"mongodb-js-precommit","pretest":"mongodb-runner install"},"_npmUser":{"name":"durran","email":"durran@gmail.com"},"precommit":["check"],"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"5.3.0","description":"MongoDB connection model.","directories":{},"_nodeVersion":"8.2.1","dependencies":{"ssh2":"^0.5.4","async":"^2.1.5","debug":"^2.6.0","backoff":"^2.4.1","mongodb":"^3.0.6","kerberos":"^0.0.22","lodash.omit":"^4.5.0","mongodb-url":"^3.0.1","lodash.clone":"^4.5.0","mongodb-core":"^3.0.1","lodash.assign":"^4.2.0","ampersand-model":"^8.0.0","lodash.defaults":"^4.2.0","lodash.includes":"^4.3.0","lodash.isstring":"^4.0.1","lodash.isfunction":"^3.0.8","ampersand-rest-collection":"^6.0.0"},"_hasShrinkwrap":false,"devDependencies":{"mocha":"^3.2.0","sinon":"^1.17.7","pre-commit":"^1.1.2","mock-require":"^2.0.1","mongodb-js-fmt":"^0.0.3","mongodb-runner":"^3.6.1","mongodb-js-precommit":"^0.2.9","mongodb-instance-model":"^7.0.0","eslint-config-mongodb-js":"^2.2.0","mongodb-connection-fixture":"^0.0.14"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_12.1.0_1523363792701_0.832126795762566","host":"s3://npm-registry-packages"}},"12.2.0":{"name":"mongodb-connection-model","version":"12.2.0","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@12.2.0","maintainers":[{"name":"aherlihy","email":"anna@mongodb.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"christkv","email":"christkv@gmail.com"},{"name":"cilix","email":"matthewlevenstein@gmail.com"},{"name":"daprahamian","email":"dan.aprahamian@gmail.com"},{"name":"deepshah","email":"deepcshah@gmail.com"},{"name":"dpercy","email":"davetp425@gmail.com"},{"name":"durran","email":"durran@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"glowe","email":"graham.lowe@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"jimol","email":"jim.oleary@gmail.com"},{"name":"jon.franco","email":"jon.franco@mongodb.com"},{"name":"jrbalsano","email":"jrbalsano@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"justinjmoses","email":"justinjmoses@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"lrlna","email":"shestak.irina@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"micheal.parks","email":"michealparks1989@gmail.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"mpobrien","email":"mpobrien005@gmail.com"},{"name":"pzrq","email":"peter@peterjs.com"},{"name":"redondos","email":"aolivera@gmail.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"sampoonachot","email":"joy.sampoonachot@10gen.com"},{"name":"samweaver","email":"samuel.james.weaver@gmail.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"schwartzrw","email":"schwartzrw@gmail.com"},{"name":"terakilobyte","email":"terakilobyte@gmail.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"f4523bbe7338ca8a767ee01ecc9606c97130d8ce","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-12.2.0.tgz","fileCount":12,"integrity":"sha512-UlxqIs/K5IvhW2eNSokT1Vk51krLZunFuS5xmeLalOSJIMJxfL+hbjpZc+ICLZTuCgPESQdPvirVqnKk0+FVJQ==","signatures":[{"sig":"MEQCICFOFoeInDqQvX6/N6ZGzK+FGfHawzUqVolKHux/Pf0FAiAFH/9ol+85uI5NjIOb20Ip5ou3X3tsiDeiFgT0737ZMg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":73062,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa1ylbCRA9TVsSAnZWagAAGhkP/0RMi36UTfQmjYBC9227\n7XJqROgiWn94Sc0CGy38i0OWtezGRbJ93OmxbJlY19B3a+cT85hNiKPlCMk3\nC9Cqq4UZG8Ok4rslOoKrxP/MfSt/fPpPsNFCfLUNbeT898aFrN0+q6Opdn1M\nnw4TBx4I/i4cpogkLk61wWOfkIdBo6SlWbahrBVoth5AbH6/yr6S4mRvo7Fe\nnUThGXlRL7jpHR6nRmAp2/Zbg5LmXyXmLVMESuH7PZq1vuwUaAdMbFyfJgq0\n8P+NIdlcjNGeXq2mRhaXcBlcEMTJnrzIzQc7BbuqIgkYFtaFE36mCN7h0Tm3\nXRaM8edviaH1dT76ce6YiPQAjedxrvBtKmpoc5Nhas4Gy1TH70dm6dt3hG0I\n6wYi8cxRxGTq7f0Nex4B9AsQzQnh/TzUz9M3tbEkI7M0k4XxZ4AXStfJLasS\nIL33OzGDfdycRe/CI8GCLMAQaqlRuEl0abxykcWJMKBFe3ogZD0XAFrZBI6u\nKatsiXFTKaGg/hGMXwRtdrElDlybKHM+eRo4w+kUK2z1bFqostcrtQnWFJpn\neVAjCsi5PDCbSoMqNn5zaDbgyfvD7FC4WbaEsvvGOFkJif2apSf/z6BWhULH\nl6VT7tjHQwbX9lxbbXYNGTwaSb31vLo+5+EgSuAPe7BOfgx/cVt+EdohYPwu\n5M/n\r\n=k0gU\r\n-----END PGP SIGNATURE-----\r\n"},"browser":"browser.js","gitHead":"83f113e42c4612891601b01e13cdb8d1338e932c","scripts":{"ci":"npm run check && npm test","fmt":"mongodb-js-fmt ./*.js lib/*.js ./test/*.js","test":"mocha","check":"mongodb-js-precommit","pretest":"mongodb-runner install"},"_npmUser":{"name":"durran","email":"durran@gmail.com"},"precommit":["check"],"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"5.3.0","description":"MongoDB connection model.","directories":{},"_nodeVersion":"8.2.1","dependencies":{"ssh2":"^0.5.4","async":"^2.1.5","debug":"^2.6.0","backoff":"^2.4.1","mongodb":"^3.0.7","kerberos":"^0.0.22","lodash.omit":"^4.5.0","mongodb-url":"^3.0.1","lodash.clone":"^4.5.0","mongodb-core":"^3.0.7","lodash.assign":"^4.2.0","ampersand-model":"^8.0.0","lodash.defaults":"^4.2.0","lodash.includes":"^4.3.0","lodash.isstring":"^4.0.1","lodash.isfunction":"^3.0.8","ampersand-rest-collection":"^6.0.0"},"_hasShrinkwrap":false,"devDependencies":{"mocha":"^3.2.0","sinon":"^1.17.7","pre-commit":"^1.1.2","mock-require":"^2.0.1","mongodb-js-fmt":"^0.0.3","mongodb-runner":"^3.6.1","mongodb-js-precommit":"^0.2.9","mongodb-instance-model":"^7.0.0","eslint-config-mongodb-js":"^2.2.0","mongodb-connection-fixture":"^0.0.14"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_12.2.0_1524050266250_0.4307343594187909","host":"s3://npm-registry-packages"}},"12.3.0":{"name":"mongodb-connection-model","version":"12.3.0","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@12.3.0","maintainers":[{"name":"aherlihy","email":"anna@mongodb.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"christkv","email":"christkv@gmail.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"cilix","email":"matthewlevenstein@gmail.com"},{"name":"daprahamian","email":"dan.aprahamian@gmail.com"},{"name":"deepshah","email":"deepcshah@gmail.com"},{"name":"dpercy","email":"davetp425@gmail.com"},{"name":"durran","email":"durran@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"glowe","email":"graham.lowe@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"jimol","email":"jim.oleary@gmail.com"},{"name":"jon.franco","email":"jon.franco@mongodb.com"},{"name":"jrbalsano","email":"jrbalsano@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"justinjmoses","email":"justinjmoses@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"lrlna","email":"shestak.irina@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"micheal.parks","email":"michealparks1989@gmail.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"mpobrien","email":"mpobrien005@gmail.com"},{"name":"pzrq","email":"peter@peterjs.com"},{"name":"redondos","email":"aolivera@gmail.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"sampoonachot","email":"joy.sampoonachot@10gen.com"},{"name":"samweaver","email":"samuel.james.weaver@gmail.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"schwartzrw","email":"schwartzrw@gmail.com"},{"name":"terakilobyte","email":"terakilobyte@gmail.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"81cae54fc25680559eb2fcbd839d0aecc3286285","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-12.3.0.tgz","fileCount":11,"integrity":"sha512-HLi7BXuVS+xcGCbnZEPR5HiOISp7Z4SdXJjj2pR3dhshkyGHkP1GeQB4z0+JAgCElXp7pddkJZ4Jj2xl0dg/2Q==","signatures":[{"sig":"MEYCIQDqgvHK/trM3np/IXtwE+97praR+4V+Z6RXJF/WW0utGwIhAJNEa985InLG9OGP+v/5AujryIEFy71SPzE9FQCZ1FSi","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":73024,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbO41KCRA9TVsSAnZWagAAuIYQAJWsUM7CWGExBxSGsvBe\nM1BOlsA9GVIZzSZ2m6r4jZrKMXKDwW/gC642SJKwiomqD0JJ+AoYr5JzA+RH\nS5USFoCjQZ4pltXtcMN07hwBZfEaHzKpjERBKQuyr5awgFBerGRmy1WtoG+D\nFsj5MGItJ9zOeEkopjzbFHW+u7s8xW9mXUrnAwE10ZscqGX6+/zpYWrjVfVZ\nBdK+4hdl4ugjm6FMkU6d1eY5pqsYcWweHGX+HdCAxp4fAbPeZPyGz7/RFfSh\nDNpGOhhHy7wr1Vi6f3ZXgM+vksBeEJe2n/gYhAX892TY8/A950knZ1PN4gum\nefF4s6AeLdRRKipW9Dhy172hVMnXfspp02TVZkIXrvWt1pBwvVYcTFpjZZXV\nj1mfRNJzFZ50vh8RIUs2ajZaxwcQ1ieyniG70S0mODviwW0oucHm5CBgO25l\npJv6vgTRsqDpeZWfKbXgf9wRpkDEFrPE+IfaB5I50ktxOkZn3CB7gXziV8KZ\nrKmOKtOR/pn8cFSX7MJQyaJRqux17lyCFsQtRn+bx8Vvu1EI/QY3mbFc74o+\nfz3gINKpRC/y0+W8KmyJiT1d5Le/zgmMF7QEF4nhGdF09bwY2sRP+Q7B4nbW\narA0Ex7mhatybooHw1iC/L+LvvWDnrB/T1NKr4GRbxJV6ICTR6OFE2j5g1Ke\nGLMJ\r\n=JG25\r\n-----END PGP SIGNATURE-----\r\n"},"browser":"browser.js","gitHead":"6198f0bc1e9fda866cdec83a2cbe17e4ead25148","scripts":{"ci":"npm run check && npm test","fmt":"mongodb-js-fmt ./*.js lib/*.js ./test/*.js","test":"mocha","check":"mongodb-js-precommit","pretest":"mongodb-runner install"},"_npmUser":{"name":"durran","email":"durran@gmail.com"},"precommit":["check"],"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"5.5.1","description":"MongoDB connection model.","directories":{},"_nodeVersion":"8.9.3","dependencies":{"ssh2":"^0.5.4","async":"^2.1.5","debug":"^2.6.0","backoff":"^2.4.1","mongodb":"^3.1.0","kerberos":"^0.0.24","lodash.omit":"^4.5.0","mongodb-url":"^3.0.1","lodash.clone":"^4.5.0","mongodb-core":"^3.1.0","lodash.assign":"^4.2.0","ampersand-model":"^8.0.0","lodash.defaults":"^4.2.0","lodash.includes":"^4.3.0","lodash.isstring":"^4.0.1","lodash.isfunction":"^3.0.8","ampersand-rest-collection":"^6.0.0"},"_hasShrinkwrap":false,"devDependencies":{"mocha":"^3.2.0","sinon":"^1.17.7","pre-commit":"^1.1.2","mock-require":"^2.0.1","mongodb-js-fmt":"^0.0.3","mongodb-runner":"^4.0.0","mongodb-js-precommit":"^0.2.9","mongodb-instance-model":"^7.0.0","eslint-config-mongodb-js":"^2.2.0","mongodb-connection-fixture":"^0.0.14"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_12.3.0_1530629450274_0.8007524401907931","host":"s3://npm-registry-packages"}},"12.3.1":{"name":"mongodb-connection-model","version":"12.3.1","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@12.3.1","maintainers":[{"name":"aherlihy","email":"anna@mongodb.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"christkv","email":"christkv@gmail.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"cilix","email":"matthewlevenstein@gmail.com"},{"name":"daprahamian","email":"dan.aprahamian@gmail.com"},{"name":"deepshah","email":"deepcshah@gmail.com"},{"name":"dpercy","email":"davetp425@gmail.com"},{"name":"durran","email":"durran@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"glowe","email":"graham.lowe@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"jimol","email":"jim.oleary@gmail.com"},{"name":"jon.franco","email":"jon.franco@mongodb.com"},{"name":"jrbalsano","email":"jrbalsano@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"justinjmoses","email":"justinjmoses@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"lrlna","email":"shestak.irina@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"micheal.parks","email":"michealparks1989@gmail.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"mpobrien","email":"mpobrien005@gmail.com"},{"name":"pzrq","email":"peter@peterjs.com"},{"name":"redondos","email":"aolivera@gmail.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"sampoonachot","email":"joy.sampoonachot@10gen.com"},{"name":"samweaver","email":"samuel.james.weaver@gmail.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"schwartzrw","email":"schwartzrw@gmail.com"},{"name":"terakilobyte","email":"terakilobyte@gmail.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"153339452f68078606a27fd5dbaeebc3db9d23a7","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-12.3.1.tgz","fileCount":11,"integrity":"sha512-4pO/EgyEiwZdrr63z8nfwZr5f7T1DsK8lqpc4R/CRHiu3IzVnfnmb7aPtDig/5xNEzCSt3ncGHkCg9U04G0EGQ==","signatures":[{"sig":"MEYCIQDTYPRLxfnRkC3++1NQ1l0DJ1fCPtg7O/gX1DnObzYdJgIhAL90TtXLW8NfFkoftu3iY+VFXuPWSAC7PBLmQUtCaHgH","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":73727,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbPi52CRA9TVsSAnZWagAAFMQP/1C2Wsw97qv9NtjQg8xo\n7se8tT6aiDCZXkO+TGiZ05eqwZYV5dBxDAfeS1NB7gH1uoTmzs7/fXFR8lXT\nFc451P1NWLsPiqgSCCtOBFiexe71pXDa2xmuTPZljqCfGNzu559k+yfXQtMM\nLJZPjU1aiEQVtEwKmaqlziZnu1XuUr1b2yPObHWoajydYhXQYR+HX5g4qOES\nRCMYpGd1E3YZYhbD4IfadEpMlQbT1cSvoPAO++YkManoFOo08pBjhKWAUeHM\nUq4qGeCye4OAmXoWqqnxg9XR2gkgrcxDW5Mz7r13pkn2/cXjuqFcB04/aB/0\ntL44rlo8Uwv7qnMcz1LnegLhyDCw1wlobUpHC9q9cG1qZwJjYp+EvXAYOJR9\nYMxJ4+g+hksEyYLFmqa48gIpgKKLLfcK862afIxXg3ha60rtXhPpeJQnFeJM\nmYX83ugLVpM1Pxq92viD2GeFajzz9HeriHIwH5WPRtgXFe6VuzoKpilXyJwz\nDc+LLuihka9STBVW+ucsfvHJdAknK2PJE+bJnd/TSxhHouyoGVh5n8leJLoF\nytum9/69xCH25ptFA+oXF77P05PCf6TI2WMBb9N0SjgKyNVsJLxr3hVfhemU\nthF64vILzqHHE1GLI8N7WEFJZtuyH4RogHqF0je9a89Ov3F5GeURQJ3Eoo8p\n6Wmq\r\n=7Sf4\r\n-----END PGP SIGNATURE-----\r\n"},"browser":"browser.js","gitHead":"2475465483a80174265db43ca5bae6f1f5059b14","scripts":{"ci":"npm run check && npm test","fmt":"mongodb-js-fmt ./*.js lib/*.js ./test/*.js","test":"mocha","check":"mongodb-js-precommit","pretest":"mongodb-runner install"},"_npmUser":{"name":"durran","email":"durran@gmail.com"},"precommit":["check"],"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"5.5.1","description":"MongoDB connection model.","directories":{},"_nodeVersion":"8.9.3","dependencies":{"ssh2":"^0.5.4","async":"^2.1.5","debug":"^2.6.0","backoff":"^2.4.1","mongodb":"^3.1.0","kerberos":"^0.0.24","lodash.omit":"^4.5.0","mongodb-url":"^3.0.2","lodash.clone":"^4.5.0","mongodb-core":"^3.1.0","lodash.assign":"^4.2.0","ampersand-model":"^8.0.0","lodash.defaults":"^4.2.0","lodash.includes":"^4.3.0","lodash.isstring":"^4.0.1","lodash.isfunction":"^3.0.8","ampersand-rest-collection":"^6.0.0"},"_hasShrinkwrap":false,"devDependencies":{"mocha":"^3.2.0","sinon":"^1.17.7","pre-commit":"^1.1.2","mock-require":"^2.0.1","mongodb-js-fmt":"^0.0.3","mongodb-runner":"^4.0.0","mongodb-js-precommit":"^0.2.9","mongodb-instance-model":"^7.0.0","eslint-config-mongodb-js":"^2.2.0","mongodb-connection-fixture":"^0.0.14"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_12.3.1_1530801781934_0.4923633089989876","host":"s3://npm-registry-packages"}},"12.3.2":{"name":"mongodb-connection-model","version":"12.3.2","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@12.3.2","maintainers":[{"name":"aherlihy","email":"anna@mongodb.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"christkv","email":"christkv@gmail.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"cilix","email":"matthewlevenstein@gmail.com"},{"name":"daprahamian","email":"dan.aprahamian@gmail.com"},{"name":"deepshah","email":"deepcshah@gmail.com"},{"name":"dpercy","email":"davetp425@gmail.com"},{"name":"durran","email":"durran@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"glowe","email":"graham.lowe@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"jimol","email":"jim.oleary@gmail.com"},{"name":"jon.franco","email":"jon.franco@mongodb.com"},{"name":"jrbalsano","email":"jrbalsano@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"justinjmoses","email":"justinjmoses@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"lrlna","email":"shestak.irina@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"micheal.parks","email":"michealparks1989@gmail.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"mpobrien","email":"mpobrien005@gmail.com"},{"name":"pzrq","email":"peter@peterjs.com"},{"name":"redondos","email":"aolivera@gmail.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"sampoonachot","email":"joy.sampoonachot@10gen.com"},{"name":"samweaver","email":"samuel.james.weaver@gmail.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"schwartzrw","email":"schwartzrw@gmail.com"},{"name":"terakilobyte","email":"terakilobyte@gmail.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"a7053560485baa26e37ada794f6d2b9ff58ce53f","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-12.3.2.tgz","fileCount":11,"integrity":"sha512-vc1voMVHEvHqC9FxhRO8Vp3gtTCpFdGampgIPCHqHbhnjt21kyAEOgWJQqn2mzT4KL8PW58yymSE4dZMZbeyiA==","signatures":[{"sig":"MEYCIQDBMe5AFXdN6Hk1tTNTGpYSq/wrSsaIYHBA9MVaYyyMmwIhAPgKgcyybNERmsUrZLmE/AOKD3cNloAz2LkEhDjmwWW+","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":73727,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbQ0ZlCRA9TVsSAnZWagAAh0EQAJU2/W5twB6SqXSngkp3\ng01JhmFWoOvEkGM9KxZpXRQ2urUdpBZQIzYsB1sklsiF/YhoQp/L22GSQApr\ntba9NtBR4kqBzaKFtTUuq8PFxm8LNHO3v7JJdfzaGPtUQvoqMIPifMl9WJUD\nCl2YyNIb0LWsApvlz+pe0uDdTkt0KmH/rzxhq/P4Gz0eHtGmiB7j64eR7Xyj\nmMPPMOl//ePzVm1KytyH/InqBNkdpDCF3y02uILT1PfaW173ecy74MrOLCV4\nZz/5lIqshtsu/dydy0eeJW+YXVc8eaDbpId+Fr6dDxDprcwTe/wnb6KUZxlx\nYZEcD45JSuN3rbEYYt6FkoZqVhJz0806eGc/ct92hvoLO8avar/+PS1qc00W\nxFXsil45FxxgIcba2dywiY7uxyKenlD/eBzYiW1uA+PO5JpNC1Uk5HgBV4Ew\nT0vpz8NBS02cqPcd+ZKTrYrV36tztlMIwtvZ4WdVf2TJGH69d9XYQ7jcAF8W\n/knbhaXiqRAfqIYhZmFxTqNjYcKJm02fxhQN0EmJq1Srl169TNNBLG4udXcc\nVqS5eAVGNKB/sLR8gn4Ubv4V4sSfJYBuflA0MZ3rTGnbZvH0TbeKAlUG/gAQ\nzgioXshtET4UqRnr2w3r2PvD4IVVMt2VDbN86h738mvYKb76j1A9GeSTspsk\nHb25\r\n=JWjF\r\n-----END PGP SIGNATURE-----\r\n"},"browser":"browser.js","gitHead":"92e5675d23d9ca5ce53fdd784af8e0e48e90c420","scripts":{"ci":"npm run check && npm test","fmt":"mongodb-js-fmt ./*.js lib/*.js ./test/*.js","test":"mocha","check":"mongodb-js-precommit","pretest":"mongodb-runner install"},"_npmUser":{"name":"durran","email":"durran@gmail.com"},"precommit":["check"],"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"5.5.1","description":"MongoDB connection model.","directories":{},"_nodeVersion":"8.9.3","dependencies":{"ssh2":"^0.5.4","async":"^2.1.5","debug":"^2.6.0","backoff":"^2.4.1","mongodb":"^3.1.1","kerberos":"^0.0.24","lodash.omit":"^4.5.0","mongodb-url":"^3.0.2","lodash.clone":"^4.5.0","mongodb-core":"^3.1.0","lodash.assign":"^4.2.0","ampersand-model":"^8.0.0","lodash.defaults":"^4.2.0","lodash.includes":"^4.3.0","lodash.isstring":"^4.0.1","lodash.isfunction":"^3.0.8","ampersand-rest-collection":"^6.0.0"},"_hasShrinkwrap":false,"devDependencies":{"mocha":"^3.2.0","sinon":"^1.17.7","pre-commit":"^1.1.2","mock-require":"^2.0.1","mongodb-js-fmt":"^0.0.3","mongodb-runner":"^4.0.0","mongodb-js-precommit":"^0.2.9","mongodb-instance-model":"^7.0.0","eslint-config-mongodb-js":"^2.2.0","mongodb-connection-fixture":"^0.0.14"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_12.3.2_1531135589684_0.8638787938165613","host":"s3://npm-registry-packages"}},"12.4.0":{"name":"mongodb-connection-model","version":"12.4.0","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@12.4.0","maintainers":[{"name":"aherlihy","email":"anna@mongodb.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"christkv","email":"christkv@gmail.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"cilix","email":"matthewlevenstein@gmail.com"},{"name":"daprahamian","email":"dan.aprahamian@gmail.com"},{"name":"deepshah","email":"deepcshah@gmail.com"},{"name":"dpercy","email":"davetp425@gmail.com"},{"name":"durran","email":"durran@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"glowe","email":"graham.lowe@gmail.com"},{"name":"gregg.b","email":"gregg.brewster@mongodb.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"jimol","email":"jim.oleary@gmail.com"},{"name":"jon.franco","email":"jon.franco@mongodb.com"},{"name":"jrbalsano","email":"jrbalsano@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"justinjmoses","email":"justinjmoses@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"lrlna","email":"shestak.irina@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"micheal.parks","email":"michealparks1989@gmail.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"mpobrien","email":"mpobrien005@gmail.com"},{"name":"redondos","email":"aolivera@gmail.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"sampoonachot","email":"joy.sampoonachot@10gen.com"},{"name":"samweaver","email":"samuel.james.weaver@gmail.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"schwartzrw","email":"schwartzrw@gmail.com"},{"name":"terakilobyte","email":"terakilobyte@gmail.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"4fee0d42d339239a7ae252399cbb244b84215fae","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-12.4.0.tgz","fileCount":11,"integrity":"sha512-DJuPeaN3aBjSAJ+tuDA7gHjPOBjqNhp/JcTfgrppUc4KJgDDuRB0Y0cpcqHNmazriZjJpJWf315gLpdqSlgJgw==","signatures":[{"sig":"MEQCIHSy29N+xppQ4ntoWuZ0Bb50h8qmTkBGWfMnCTagL6r+AiAZA5VTEbYOMK5GVmBSRmryaxTj27cpX1JkEaXsXljVTw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":73726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbhU2+CRA9TVsSAnZWagAA7zIP/3VDkpT6+tkEp26GPO1R\nx/7OZmZ4kASr7vLUPkThT43HOsaruzmUNGcDQC9mQ8UsuTnCh3lL9DH2cbdN\n5h7qdrsPczYXeJ2jSxkFPLitXkKrjlmkNxoyNM0g2k/D5tejHiNsjtx231/Z\njA84uDRIm6CCAtqKzdJVFpmKasS/pkzQ1hLanDBSenUuVdBKpQ8fRGiSVRSd\nmG4FPvGQHpUkkTLhLVLpivSIvNkLXgU1jhpS0TQ2jzP1RMWku5WVQSoS9bCO\nSDB/vV4wZghzTVuALZRGOAnX1TH6OHvEBRig1a9MKy1F+MNoGvLZDSbGhpvw\nO0+BkOlHMEWHcATk0TOgTRFewAnMV6kwHQTjqxR0YXBc0fW9om9b8NwvyQTD\nw4jeRg9PrIhNDeIKXuuIBnGGXttvWyTWBWUTaYrpvH+YEGGHNhmWCtovF1pi\n22YSfoyKckY3pQ8Lbtxrklk+BFhSOqlM9g8i/1K9+UY79rwZLjgAhuLPZooi\nkrZF0lNXfrvfhdD+7vyKlCdqJKD8XjeLi4O2gPYT4ivky5MBOPVT2w1ZferW\nLe1q5KmMze6AvqKBjvlj1CuPHZLI2zUG8QaZhcPESWoRVe10OwFFSVxIjxIS\nVqn1NPwfCq5FA7SZNM4KHdneSIA20MYJBp/vX1bKKotEvilgTKiUDkBYYH6O\nEkDG\r\n=sFpW\r\n-----END PGP SIGNATURE-----\r\n"},"browser":"browser.js","gitHead":"ce2529c7113b8769b2de34a26c182d74ae71513c","scripts":{"ci":"npm run check && npm test","fmt":"mongodb-js-fmt ./*.js lib/*.js ./test/*.js","test":"mocha","check":"mongodb-js-precommit","pretest":"mongodb-runner install"},"_npmUser":{"name":"durran","email":"durran@gmail.com"},"precommit":["check"],"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"5.5.1","description":"MongoDB connection model.","directories":{},"_nodeVersion":"8.9.3","dependencies":{"ssh2":"^0.5.4","async":"^2.1.5","debug":"^2.6.0","backoff":"^2.4.1","mongodb":"^3.1.4","kerberos":"^1.0.0","lodash.omit":"^4.5.0","mongodb-url":"^3.0.2","lodash.clone":"^4.5.0","mongodb-core":"^3.1.3","lodash.assign":"^4.2.0","ampersand-model":"^8.0.0","lodash.defaults":"^4.2.0","lodash.includes":"^4.3.0","lodash.isstring":"^4.0.1","lodash.isfunction":"^3.0.8","ampersand-rest-collection":"^6.0.0"},"_hasShrinkwrap":false,"devDependencies":{"mocha":"^3.2.0","sinon":"^1.17.7","pre-commit":"^1.1.2","mock-require":"^2.0.1","mongodb-js-fmt":"^0.0.3","mongodb-runner":"^4.1.0","mongodb-js-precommit":"^0.2.9","mongodb-instance-model":"^7.0.0","eslint-config-mongodb-js":"^2.2.0","mongodb-connection-fixture":"^0.0.14"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_12.4.0_1535462845886_0.4274686479366119","host":"s3://npm-registry-packages"}},"12.4.1":{"name":"mongodb-connection-model","version":"12.4.1","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@12.4.1","maintainers":[{"name":"aherlihy","email":"anna@mongodb.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"christkv","email":"christkv@gmail.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"cilix","email":"matthewlevenstein@gmail.com"},{"name":"daprahamian","email":"dan.aprahamian@gmail.com"},{"name":"deepshah","email":"deepcshah@gmail.com"},{"name":"dpercy","email":"davetp425@gmail.com"},{"name":"durran","email":"durran@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"glowe","email":"graham.lowe@gmail.com"},{"name":"gregg.b","email":"gregg.brewster@mongodb.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"jimol","email":"jim.oleary@gmail.com"},{"name":"jon.franco","email":"jon.franco@mongodb.com"},{"name":"jrbalsano","email":"jrbalsano@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"justinjmoses","email":"justinjmoses@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"lrlna","email":"shestak.irina@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"micheal.parks","email":"michealparks1989@gmail.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"mpobrien","email":"mpobrien005@gmail.com"},{"name":"redondos","email":"aolivera@gmail.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"sampoonachot","email":"joy.sampoonachot@10gen.com"},{"name":"samweaver","email":"samuel.james.weaver@gmail.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"schwartzrw","email":"schwartzrw@gmail.com"},{"name":"terakilobyte","email":"terakilobyte@gmail.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"cc1998cdfadc854b881962e2df51fb7ddaa2163b","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-12.4.1.tgz","fileCount":11,"integrity":"sha512-P9PXMvgiFqCtVqhIoi52n29YWpl3A8KI20eqYMKn7rqmdo1A4OTAv8VRKhHPODej/yjoK54MptrgiwahVIyxCQ==","signatures":[{"sig":"MEQCIFdjRJzA5HbjuvYpST3Ne6iK9QDSLyFtTpq6NjXtFdjbAiBgnEzs0zvmQ4RRKrtP9gS0d0JgGPjXDhuNh/yKhdiYoA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":73726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbpKYaCRA9TVsSAnZWagAAM10P/2fuXz9PTFFgBpoKCu9g\n1eBn/VB+/xlc184LaWkSOCtOkDZxJ+IXCWW+zw0WURO+zA5k00Dw/eW4vEhF\n/m+90xGZxN2C6/E9407iaRUrHnzT4iFkHKuWyiAMrQy5+hObTtHCyQexOO6V\nxU7yUMT6f1OIKP+t6U8dh3mia0FoEQxoUsPHTTPM8E1aJE1CarYSE+XqxVKp\n2tqI0KNZf2u2+urEXKtHENQcQGjmuJPT7U+mQ927ttVanj6rwUppkpip+FKA\nC+ZPg1cunSutEtJBrRFygsaZZ7WEgKYX0/6ofFVmx1X6KLxqu/49RBY3DYJJ\nA6CbxEh4yzTm+2AGK2eY9kPvq8/t/kR1lANBbgxwOFzn7qhPBdS6/qkbupWv\n0KR2ZaYGtZYonZT8bQrpO4Rqs5v2g4BQ6bxZ++K085cdah5FgaiXDIiwXAB6\nOyZSCwitsK8COsRS56KVn+0dJnPrhEpjFrH6L6txJf0y7em0vJl+7gH2ECww\nM1qcMR7udVUrSQvQ76hv2K50W7LgF10t05oFCk5nY5mkBXPU0APZ+8pRvyZK\nuweSK1cP70D1zBDMUvm7UEET0Uhp8NAYlB2SRGPtgDln43CGzTR/mu3Vrp2K\n3F4ymKYtOYpsuvTRxpvXarnjbTFxSvNgCa5bwOg25Xww4K+85S5hFjw8e3ko\n383s\r\n=7ioI\r\n-----END PGP SIGNATURE-----\r\n"},"browser":"browser.js","gitHead":"f974ebb4f686e89de4848769ba5aaf4e85a3b289","scripts":{"ci":"npm run check && npm test","fmt":"mongodb-js-fmt ./*.js lib/*.js ./test/*.js","test":"mocha","check":"mongodb-js-precommit","pretest":"mongodb-runner install"},"_npmUser":{"name":"aherlihy","email":"anna@mongodb.com"},"precommit":["check"],"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"5.6.0","description":"MongoDB connection model.","directories":{},"_nodeVersion":"8.9.4","dependencies":{"ssh2":"^0.5.4","async":"^2.1.5","debug":"^2.6.0","backoff":"^2.4.1","mongodb":"^3.1.5","kerberos":"^1.0.0","lodash.omit":"^4.5.0","mongodb-url":"^3.0.2","lodash.clone":"^4.5.0","mongodb-core":"^3.1.4","lodash.assign":"^4.2.0","ampersand-model":"^8.0.0","lodash.defaults":"^4.2.0","lodash.includes":"^4.3.0","lodash.isstring":"^4.0.1","lodash.isfunction":"^3.0.8","ampersand-rest-collection":"^6.0.0"},"_hasShrinkwrap":false,"devDependencies":{"mocha":"^3.2.0","sinon":"^1.17.7","pre-commit":"^1.1.2","mock-require":"^2.0.1","mongodb-js-fmt":"^0.0.3","mongodb-runner":"^4.1.0","mongodb-js-precommit":"^0.2.9","mongodb-instance-model":"^7.0.0","eslint-config-mongodb-js":"^2.2.0","mongodb-connection-fixture":"^0.0.14"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_12.4.1_1537517081698_0.34034302856030574","host":"s3://npm-registry-packages"}},"12.4.2":{"name":"mongodb-connection-model","version":"12.4.2","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@12.4.2","maintainers":[{"name":"aherlihy","email":"anna@mongodb.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"christkv","email":"christkv@gmail.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"cilix","email":"matthewlevenstein@gmail.com"},{"name":"daprahamian","email":"dan.aprahamian@gmail.com"},{"name":"deepshah","email":"deepcshah@gmail.com"},{"name":"dpercy","email":"davetp425@gmail.com"},{"name":"durran","email":"durran@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"glowe","email":"graham.lowe@gmail.com"},{"name":"gregg.b","email":"gregg.brewster@mongodb.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"jimol","email":"jim.oleary@gmail.com"},{"name":"jon.franco","email":"jon.franco@mongodb.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"justinjmoses","email":"justinjmoses@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"lrlna","email":"shestak.irina@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"micheal.parks","email":"michealparks1989@gmail.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"mpobrien","email":"mpobrien005@gmail.com"},{"name":"redondos","email":"aolivera@gmail.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"sampoonachot","email":"joy.sampoonachot@10gen.com"},{"name":"samweaver","email":"samuel.james.weaver@gmail.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"schwartzrw","email":"schwartzrw@gmail.com"},{"name":"terakilobyte","email":"terakilobyte@gmail.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"907aceba69cb2907e98e523b195428cd37f5f5d0","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-12.4.2.tgz","fileCount":11,"integrity":"sha512-VnVN93IxRWjCCArRU/rZ7PK85W4KL7Pc+PLvaInt45X7AJJUtgj6qLBe4I1319WsbvtCiFhATXpDPHZvlg1NXQ==","signatures":[{"sig":"MEUCIQDEahCHkyRe2J/vRDBoBB4n+8/l9DOE6CnQrku1RF7PMAIgNurGamyskD1BdNkDJ+ULt9pULuQY3sxlK+6A3pKp6Vg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":73828,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb2vaSCRA9TVsSAnZWagAAa+0P/0XwiPFFOz4S1YqSQJDP\n2lA4XsEzxYmZwF0bYhcmY4eU1WhlSkf5dobN2cJBmt+Nw8pyrUrBiIM7pDkD\nxujpsxbdXxjB0WKaDuXnUmto+D4aUCPEvHYQqeUF1RsROWQ2TirHLZmODn4y\nGSvrPI9D9qNQJ6qomH+5Xhv0tAShsJVg40BmASRGYvgrLLp/G58INDzWUWqG\nNF2yXTZcMz7KL6f4x+pnjj3zrUsgNy1jiyLFEHD3+aP7syqYq2cKiOHvdPUI\nKmKXg8qTUdaTnRZGX3ZRQTJ0qY+ZRTefJ3fWn8MY44DRJS6I5/1BPuCQE1XR\nwRAQDZmQxMnW/SQ+Z1zxQdodqTvL1mKU19U2o2I4wns1amxlV2rhP3K+souS\nDIADqZc+YMBshwLNW9ISpFIMCXCVsOUaQhVea4L9hFmn/M2JLcAbwJBb1pWX\nJhoRnVsvgMkohzOBPa8M2CFrQQdaqi9QJfdgLCDAQupd6mDiNorg4h17HJZW\nuu8dK0MyWdcX4cz3Sr/ipmF/AKm9O4JTRqV1+9de2zuOjFC0+9lGxRwcWCKe\n8Uem4FiU9/TNAfa/vqsZ9DJ2gxBkrcYa4ieONyS23bWbNj/7HnAmV/iFs12k\nJ0OCtokGuHT57z1nnOvxRRmXSNAXHfrvuuxCyYNTaCwpCwT+BG3ULzpvyjl9\nRB31\r\n=WiX0\r\n-----END PGP SIGNATURE-----\r\n"},"browser":"browser.js","gitHead":"1bc4f581b0db0736474495dabb913098d83cc306","scripts":{"ci":"npm run check && npm test","fmt":"mongodb-js-fmt ./*.js lib/*.js ./test/*.js","test":"mocha","check":"mongodb-js-precommit","pretest":"mongodb-runner install"},"_npmUser":{"name":"durran","email":"durran@gmail.com"},"precommit":["check"],"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"6.0.1","description":"MongoDB connection model.","directories":{},"_nodeVersion":"8.9.3","dependencies":{"ssh2":"^0.5.4","async":"^2.1.5","debug":"^2.6.0","backoff":"^2.4.1","mongodb":"^3.1.5","kerberos":"^1.0.0","lodash.omit":"^4.5.0","mongodb-url":"^3.0.2","lodash.clone":"^4.5.0","mongodb-core":"^3.1.4","lodash.assign":"^4.2.0","ampersand-model":"^8.0.0","lodash.defaults":"^4.2.0","lodash.includes":"^4.3.0","lodash.isstring":"^4.0.1","lodash.isfunction":"^3.0.8","ampersand-rest-collection":"^6.0.0"},"_hasShrinkwrap":false,"devDependencies":{"mocha":"^3.2.0","sinon":"^1.17.7","pre-commit":"^1.1.2","mock-require":"^2.0.1","mongodb-js-fmt":"^0.0.3","mongodb-runner":"^4.1.0","mongodb-js-precommit":"^0.2.9","mongodb-instance-model":"^7.0.0","eslint-config-mongodb-js":"^2.2.0","mongodb-connection-fixture":"^0.0.14"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_12.4.2_1541076625921_0.537892813931558","host":"s3://npm-registry-packages"}},"12.5.0":{"name":"mongodb-connection-model","version":"12.5.0","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@12.5.0","maintainers":[{"name":"aherlihy","email":"anna@mongodb.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"cilix","email":"matthewlevenstein@gmail.com"},{"name":"daprahamian","email":"dan.aprahamian@gmail.com"},{"name":"deepshah","email":"deepcshah@gmail.com"},{"name":"dpercy","email":"davetp425@gmail.com"},{"name":"durran","email":"durran@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"glowe","email":"graham.lowe@gmail.com"},{"name":"gregg.b","email":"gregg.brewster@mongodb.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"jimol","email":"jim.oleary@gmail.com"},{"name":"jon.franco","email":"jon.franco@mongodb.com"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"lrlna","email":"shestak.irina@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"micheal.parks","email":"michealparks1989@gmail.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"mpobrien","email":"mpobrien005@gmail.com"},{"name":"redondos","email":"aolivera@gmail.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"sampoonachot","email":"joy.sampoonachot@10gen.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"schwartzrw","email":"schwartzrw@gmail.com"},{"name":"terakilobyte","email":"terakilobyte@gmail.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"497b55913622d23e9d9b9827438ef73f1716e3a4","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-12.5.0.tgz","fileCount":11,"integrity":"sha512-eHFBpoYdSFSs9WSEVIlsYK8U+FNw3eZWFkAvRbWjZHsc9+jGHBAEJW17WnAzybFLXvWK/VF8Ve7G/EuAq4litQ==","signatures":[{"sig":"MEQCIHT1hjgTvGzpQefUJMCAKY3M47SblzMgZtRSvg0H7pn4AiAFqOMQ3nWar/7RnCL4QxF7X2KEGEAs9ynYJH+aT2hgeQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":73828,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb4ZkQCRA9TVsSAnZWagAAq7oQAJ4LY5bbWr6lKtPzoSF+\nJLWTqjceXOG3Gawcsynd2rB3zmmVyMDhC8jYsJna3dktS7q6AEx6y58tuzWU\ny8kW1eWmHCFWsBi/WIT+yRGbwH2x6XGyF7vZhkbnAyFsF1DDZhRsXNCxS28r\n1qEdKvNvC4P2ro8INZ8UWMg1pgZOdSRb/wuVcZtFfT+0hs0D4yZef5qDkKmM\nowg0mzKuVw1V1iA+DtcM0RwHtFU6Idm9GFjYIh6UEWTw+mdUH5GsMquujVlg\n4+ciyu86kcl8oOd9YHtj0tExTZ1haIAqA3U7gcik1EW63DIcLXugYP2+8t3J\n2ckBuoV1u+jPttFTwd9+oeWAh7ME6lQ+Lqg1qiYGy8UWNwyoosqZz+0a6fRr\nWek4ZM0yY8ktRry/rLcJscHY9RROm0cqNxECovdb8i8/2pxxD26ShC5Leema\nHy1LN9ZyWWglVj+UdnZxjCRX5OYFLtLNMoEODOgbjGI9TDEUfA9hTrBAqoou\n+lHvTDvVHoJjlXswyk8+va0T1DWHWW+pXBjFOjHZRR8ATAO3wSTX/XvSesqE\nF0CUF9qncvDu8Augf8uyx96XzgIsMAX398KwdQzvhEZAJdNlRmrTmoCcyK0G\n4wQBM3Ydaj3oZ7InJavmwGApUWCFoB7zu1Y9VGUEb/FBNVOQ1jE0P5Zo5JN5\nFV4/\r\n=1SCE\r\n-----END PGP SIGNATURE-----\r\n"},"browser":"browser.js","gitHead":"d43d8cd92347ab478456f9b32bb3017bb507a4d1","scripts":{"ci":"npm run check && npm test","fmt":"mongodb-js-fmt ./*.js lib/*.js ./test/*.js","test":"mocha","check":"mongodb-js-precommit","pretest":"mongodb-runner install"},"_npmUser":{"name":"durran","email":"durran@gmail.com"},"precommit":["check"],"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"5.5.1","description":"MongoDB connection model.","directories":{},"_nodeVersion":"8.9.3","dependencies":{"ssh2":"^0.5.4","async":"^2.1.5","debug":"^2.6.0","backoff":"^2.4.1","mongodb":"^3.1.9","kerberos":"^1.1.2","lodash.omit":"^4.5.0","mongodb-url":"^3.0.2","lodash.clone":"^4.5.0","mongodb-core":"^3.1.8","lodash.assign":"^4.2.0","ampersand-model":"^8.0.0","lodash.defaults":"^4.2.0","lodash.includes":"^4.3.0","lodash.isstring":"^4.0.1","lodash.isfunction":"^3.0.8","ampersand-rest-collection":"^6.0.0"},"_hasShrinkwrap":false,"devDependencies":{"mocha":"^3.2.0","sinon":"^1.17.7","pre-commit":"^1.1.2","mock-require":"^2.0.1","mongodb-js-fmt":"^0.0.3","mongodb-runner":"^4.6.0","mongodb-js-precommit":"^0.2.9","mongodb-instance-model":"^7.0.0","eslint-config-mongodb-js":"^2.2.0","mongodb-connection-fixture":"^0.0.14"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_12.5.0_1541511439146_0.20893709353375578","host":"s3://npm-registry-packages"}},"12.5.1":{"name":"mongodb-connection-model","version":"12.5.1","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@12.5.1","maintainers":[{"name":"aherlihy","email":"anna@mongodb.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"cilix","email":"matthewlevenstein@gmail.com"},{"name":"daprahamian","email":"dan.aprahamian@gmail.com"},{"name":"deepshah","email":"deepcshah@gmail.com"},{"name":"dpercy","email":"davetp425@gmail.com"},{"name":"durran","email":"durran@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"glowe","email":"graham.lowe@gmail.com"},{"name":"gregg.b","email":"gregg.brewster@mongodb.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"jimol","email":"jim.oleary@gmail.com"},{"name":"jon.franco","email":"jon.franco@mongodb.com"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"lrlna","email":"shestak.irina@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"micheal.parks","email":"michealparks1989@gmail.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"mpobrien","email":"mpobrien005@gmail.com"},{"name":"redondos","email":"aolivera@gmail.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"sampoonachot","email":"joy.sampoonachot@10gen.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"schwartzrw","email":"schwartzrw@gmail.com"},{"name":"terakilobyte","email":"terakilobyte@gmail.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"81f243bd3a91436d485a6c15cdc11729b6c5843c","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-12.5.1.tgz","fileCount":11,"integrity":"sha512-eeMvqIwCD1s14TNXbTobbpeGKrYLcNvsOY6L8e0lMb0GWKetsVXDY784llWVMd3jG1/qU/fCfWcEZVof1QLgzQ==","signatures":[{"sig":"MEUCIEbY11ChbcsMQ0i1tGL7r5PsOK5d1R7mrYa9W/fk5nIvAiEAsZumvFRkMKUP6W5yuULZsKSKGWuP/flDtPZ3h0VIruw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":73844,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb6A0ECRA9TVsSAnZWagAAnEwQAJYNYW3MW1oPRKBRATsk\nMUkqTVEj2+r98XZ+MNCAK//w6smombZkoHuwZlfFR+Wx/WmuJ8ygWWB31ygb\n9bJNlrk8BeU3VqkKFCb3gux9ltzHPb/v1aqpnYI/8NwFjuQQCc10g6SdNCCb\nythmGul/ls5w1sSDILewhws08OCSJ7tLj9RM2JYjbtPYhPwHWZzB+7Gd5D3e\nA4vts/iKrGzjlR0Lny8aTvfBf6mGWQ4k92Vl3KSMW2Ko7/qGJv9ozM7B3Hy+\nKzT9Ka8p04GtEbyu8qWSjirhsSiwdh9REFmKTySQUvRkbleqTl9aGfKsWs4N\nTaUfLXxYiTzVCehaL7oWSn5gA9YjllzuGnfl+lNmAWNZIxQC9pRJWdN3bb4U\niVetJnghkNlYM5O56TozCVdUs67lrAI26U7FEHDLhto+Px19MEx7RxSD4t/L\nY+SNYF23SkvWir6pStYnpENSX8QWcGKQtfz2xaQwT9FebzJwgr37/iUIFQN8\n8j63uD/kLiHYrQPq/DCyxLumTWEhtw5LgBTpGdqNpWAc4JqajnneeuJ3Mj/x\nkSfVKrlJnuTHqG9bLrOsLKVv0j3rPtCRG1HEJInti08gNt//DBWcqGYL4Lg7\nTyDawARw72HQPfrKFbNEb+J/17IoZkh1jemcsUWKTK8CF7cOGdgkuEgC/svx\nyWxt\r\n=jwHT\r\n-----END PGP SIGNATURE-----\r\n"},"browser":"browser.js","gitHead":"d05e5a43dc0c99e34f6e4b7c7653e46d0396eba2","scripts":{"ci":"npm run check && npm test","fmt":"mongodb-js-fmt ./*.js lib/*.js ./test/*.js","test":"mocha","check":"mongodb-js-precommit","pretest":"mongodb-runner install"},"_npmUser":{"name":"durran","email":"durran@gmail.com"},"precommit":["check"],"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"5.5.1","description":"MongoDB connection model.","directories":{},"_nodeVersion":"8.9.3","dependencies":{"ssh2":"^0.5.4","async":"^2.1.5","debug":"^2.6.0","backoff":"^2.4.1","mongodb":"^3.1.9","kerberos":"^1.1.2","lodash.omit":"^4.5.0","mongodb-url":"^3.0.2","lodash.clone":"^4.5.0","mongodb-core":"^3.1.8","lodash.assign":"^4.2.0","ampersand-model":"^8.0.0","lodash.defaults":"^4.2.0","lodash.includes":"^4.3.0","lodash.isstring":"^4.0.1","lodash.isfunction":"^3.0.8","ampersand-rest-collection":"^6.0.0"},"_hasShrinkwrap":false,"devDependencies":{"mocha":"^3.2.0","sinon":"^1.17.7","pre-commit":"^1.1.2","mock-require":"^2.0.1","mongodb-js-fmt":"^0.0.3","mongodb-runner":"^4.6.0","mongodb-js-precommit":"^0.2.9","mongodb-instance-model":"^7.0.0","eslint-config-mongodb-js":"^2.2.0","mongodb-connection-fixture":"^0.0.14"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_12.5.1_1541934339361_0.32325120907651606","host":"s3://npm-registry-packages"}},"12.5.2":{"name":"mongodb-connection-model","version":"12.5.2","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@12.5.2","maintainers":[{"name":"aherlihy","email":"anna@mongodb.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"cilix","email":"matthewlevenstein@gmail.com"},{"name":"daprahamian","email":"dan.aprahamian@gmail.com"},{"name":"deepshah","email":"deepcshah@gmail.com"},{"name":"dpercy","email":"davetp425@gmail.com"},{"name":"durran","email":"durran@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"glowe","email":"graham.lowe@gmail.com"},{"name":"gregg.b","email":"gregg.brewster@mongodb.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"jimol","email":"jim.oleary@gmail.com"},{"name":"jon.franco","email":"jon.franco@mongodb.com"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"lrlna","email":"shestak.irina@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"micheal.parks","email":"michealparks1989@gmail.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"mpobrien","email":"mpobrien005@gmail.com"},{"name":"redondos","email":"aolivera@gmail.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"sampoonachot","email":"joy.sampoonachot@10gen.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"schwartzrw","email":"schwartzrw@gmail.com"},{"name":"terakilobyte","email":"terakilobyte@gmail.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"c40a049f8d1f3c6530959e126f2aff306062906a","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-12.5.2.tgz","fileCount":11,"integrity":"sha512-zdPq+2nUXzYI9gTdB4VPy7Q22o7ukOciIrmiIJYf6YZODhaoO3rCVtUqLH1sGkZ3FjaLRE5Sr/kgdmS9HzBP4g==","signatures":[{"sig":"MEYCIQDC0a0kdqbS4HcdSL7z2ypCATZyxhDIQLPo95hJ0WG1YQIhAN0yc4CJg82Kmj1KHAz6CxCRYlXbiZ6oOm1NPkVU0/1X","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":73896,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb/YtmCRA9TVsSAnZWagAAq1EP/i42uIYNWRbkUE8qMQcf\nVH34iJhruob5kRSuPd1pEncA6+zUPyFKA8ltz63B+9E1HCYl/ecCVy9KvVgO\n0+OrJPF5ABhPLcOw70tUTYkId3W/E9Amfl1t+G6WaSpyq1MrJMox0Oj1Kik5\n2wTKu/XQrp6G4pSDhQcv1fG7ZD8eaKB/ewhcAEanlDZwCfswjwT5GKcS4nn8\nbiXfE3e+gJjNJRta3yNPXJ4TXoRDJmAuKCYFkBrXxt/YSWVdjaQEskzNAQ+K\n7sHclphx77UrUQbj4NS7+hd+HNtABo4TshynTmz0aox0Zd1jl7vgOAQQcCzB\nKz5/fxmtj3nhdmdALB2gwhGLtKaVK+qltI1Ty6xbZSX5bwjm5F5YF9vaPXZf\n2kpls/engCseIUMGCsnma54PNCj3epdvNAQxgDSymkDtVTAgQgwWjYiw4We7\njRBCj3/6iBmZI70hPJWr1SsEbe6NqAPZBHY0I1RpBgP7jv1Sfnw1mPVsJFzv\npp0V5uHa9kQiJQriGqWBG07vYovRhfUFAKglmuHabBgQ4qAO08yWwPglqOCN\nOdRSvP1ckW6LHelV1MvAwxiQyHUgnd2/UqR8qMl9JWBWCpbX78xwSJWl1gs+\n/L9NqDkrjeInK4MuXsQqwDNHYviIlA5O+LCrsJyQ2DfzK+gxa9PwUq2BaqqF\nCqKw\r\n=q95v\r\n-----END PGP SIGNATURE-----\r\n"},"browser":"browser.js","gitHead":"74e78fc920f365d63d66b1aa224dd1d00594b65e","scripts":{"ci":"npm run check && npm test","fmt":"mongodb-js-fmt ./*.js lib/*.js ./test/*.js","test":"mocha","check":"mongodb-js-precommit","pretest":"mongodb-runner install"},"_npmUser":{"name":"durran","email":"durran@gmail.com"},"precommit":["check"],"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"6.4.1","description":"MongoDB connection model.","directories":{},"_nodeVersion":"10.2.1","dependencies":{"ssh2":"^0.5.4","async":"^2.1.5","debug":"^2.6.0","backoff":"^2.4.1","mongodb":"^3.1.9","kerberos":"^1.1.2","lodash.omit":"^4.5.0","mongodb-url":"^3.0.2","lodash.clone":"^4.5.0","mongodb-core":"^3.1.8","lodash.assign":"^4.2.0","ampersand-model":"^8.0.0","lodash.defaults":"^4.2.0","lodash.includes":"^4.3.0","lodash.isstring":"^4.0.1","lodash.isfunction":"^3.0.8","ampersand-rest-collection":"^6.0.0"},"_hasShrinkwrap":false,"devDependencies":{"mocha":"^3.2.0","sinon":"^1.17.7","pre-commit":"^1.1.2","mock-require":"^2.0.1","mongodb-js-fmt":"^0.0.3","mongodb-runner":"^4.6.0","mongodb-js-precommit":"^0.2.9","mongodb-instance-model":"^7.0.0","eslint-config-mongodb-js":"^2.2.0","mongodb-connection-fixture":"^0.0.14"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_12.5.2_1543342949350_0.2872337058917631","host":"s3://npm-registry-packages"}},"12.5.3":{"name":"mongodb-connection-model","version":"12.5.3","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@12.5.3","maintainers":[{"name":"aherlihy","email":"anna@mongodb.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"cilix","email":"matthewlevenstein@gmail.com"},{"name":"daprahamian","email":"dan.aprahamian@gmail.com"},{"name":"deepshah","email":"deepcshah@gmail.com"},{"name":"dpercy","email":"davetp425@gmail.com"},{"name":"durran","email":"durran@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"glowe","email":"graham.lowe@gmail.com"},{"name":"gregg.b","email":"gregg.brewster@mongodb.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"jimol","email":"jim.oleary@gmail.com"},{"name":"jon.franco","email":"jon.franco@mongodb.com"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"lrlna","email":"shestak.irina@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"micheal.parks","email":"michealparks1989@gmail.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"mpobrien","email":"mpobrien005@gmail.com"},{"name":"redondos","email":"aolivera@gmail.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"sampoonachot","email":"joy.sampoonachot@10gen.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"schwartzrw","email":"schwartzrw@gmail.com"},{"name":"terakilobyte","email":"terakilobyte@gmail.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"78dcbf8ffc288882a685f738643ad353373ce9fb","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-12.5.3.tgz","fileCount":11,"integrity":"sha512-pMnXHXfEnAm30k5UJyUg86lbeKVJLbm1n/VBiYZBfjZ0//6stO/uvSMwbW7Ew9u0KDAdkOpfv66NkAwSOrmeeQ==","signatures":[{"sig":"MEYCIQDPjubKd22zrfkiCnfmCxCjLxh2dqblZTs1N9hX4yLfwQIhAIYyC8kVIpr0aco1ZPbSbhABDBvQYodh55d2D7f4R8DZ","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":73810,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb/ZzwCRA9TVsSAnZWagAA/p0P/3yTElshWFGr3jzd4gJb\nNDgrA9KUPaLwEc/o0qO5vUV1W4GsneD1UcZMrsF3/ed4XfLVvg9Ox3kI8EWf\nMv3FeRmM7WYOPM24w4oCjncSSGeFgwZj0yixzjQjekTL4AkIf5OpzFkFCpmN\nN2KJoVJlgzv7pA3LHFv+Gcu6KZpS3Z2GlMQX+UgO3gU1BMjinE5i7VtE9123\n9YLp+zKLkd1T3ZcN4Z/rCG1v409lUngjBvdcRLG5pNP3NC8Mz36NzqZBSQg3\nZEI69Z1K3aiHn+G4ySeTaFJkl2ZfrsoyxlGnLGsmAYkPkUyUHL3YTMTqeLsT\ncoT0vmUwdFI0xJLwRGxnCO3Pn/3eNJon/fzSvB8bNYS9Mb7yilm6GybKc8F1\nIUMqGM2dH82ZXBZVpj5jAhHtFTxw/KFPDyvgx/VJmMMiL9lidDF0Gv44FLyV\nrQ4bazJ9T0GfFd4MeUOEwRsSajxROMOz3Wqjz2BnBI2JYxxMBXGywgw5RZFG\n2HSwhl7SB/e7Vz4NqjKIk8MeEwOw/i5RW4JBtGyqzahRLswOZmtikrII5Zet\nkajIzvhn/RpT+l/hTYZOJrM7keMH7UAMDTunwPyDrN1YhXIveaFazjOSar/M\nhUtgY50vi0Jep4cXDnK/e4wUdt4Hg1IN9esn/Pvcv/KHX6sNVErR5hxB74fg\nCFmI\r\n=Yilh\r\n-----END PGP SIGNATURE-----\r\n"},"browser":"browser.js","gitHead":"db765b17215d87d4e9f719b20bdf88f8c7c3c551","scripts":{"ci":"npm run check && npm test","fmt":"mongodb-js-fmt ./*.js lib/*.js ./test/*.js","test":"mocha","check":"mongodb-js-precommit","pretest":"mongodb-runner install"},"_npmUser":{"name":"durran","email":"durran@gmail.com"},"precommit":["check"],"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"6.4.1","description":"MongoDB connection model.","directories":{},"_nodeVersion":"10.2.1","dependencies":{"ssh2":"^0.5.4","async":"^2.1.5","debug":"^2.6.0","backoff":"^2.4.1","mongodb":"^3.1.9","kerberos":"^1.1.2","lodash.omit":"^4.5.0","mongodb-url":"^3.0.2","lodash.clone":"^4.5.0","mongodb-core":"^3.1.8","lodash.assign":"^4.2.0","ampersand-model":"^8.0.0","lodash.defaults":"^4.2.0","lodash.includes":"^4.3.0","lodash.isstring":"^4.0.1","lodash.isfunction":"^3.0.8","ampersand-rest-collection":"^6.0.0"},"_hasShrinkwrap":false,"devDependencies":{"mocha":"^3.2.0","sinon":"^1.17.7","pre-commit":"^1.1.2","mock-require":"^2.0.1","mongodb-js-fmt":"^0.0.3","mongodb-runner":"^4.6.0","mongodb-js-precommit":"^0.2.9","mongodb-instance-model":"^7.0.0","eslint-config-mongodb-js":"^2.2.0","mongodb-connection-fixture":"^0.0.14"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_12.5.3_1543347439797_0.023734862014501257","host":"s3://npm-registry-packages"}},"12.5.4":{"name":"mongodb-connection-model","version":"12.5.4","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@12.5.4","maintainers":[{"name":"aherlihy","email":"anna@mongodb.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"cilix","email":"matthewlevenstein@gmail.com"},{"name":"daprahamian","email":"dan.aprahamian@gmail.com"},{"name":"deepshah","email":"deepcshah@gmail.com"},{"name":"dpercy","email":"davetp425@gmail.com"},{"name":"durran","email":"durran@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"glowe","email":"graham.lowe@gmail.com"},{"name":"gregg.b","email":"gregg.brewster@mongodb.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"jimol","email":"jim.oleary@gmail.com"},{"name":"jon.franco","email":"jon.franco@mongodb.com"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"lrlna","email":"shestak.irina@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"micheal.parks","email":"michealparks1989@gmail.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"mpobrien","email":"mpobrien005@gmail.com"},{"name":"redondos","email":"aolivera@gmail.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"sampoonachot","email":"joy.sampoonachot@10gen.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"schwartzrw","email":"schwartzrw@gmail.com"},{"name":"terakilobyte","email":"terakilobyte@gmail.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"202e974089acc20dbd3e88ebc0b59bbd1c97d9fe","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-12.5.4.tgz","fileCount":11,"integrity":"sha512-O3lrG2w95IzSPruxig3Ktrw27XUUzDUPqwOHiph9/7RxMIVEHDqXtsIMY1Bi1m6sZH963lZ/Y8FuEPeeVWWyIQ==","signatures":[{"sig":"MEUCIQCWikAGPRm6p8jRBVuOYY1agViruw18S3Huv9JxzAqqkwIgdzlDrp5hjvyNuQXAfxxUlb6cw1XFQq2lLbCAA/g09Zc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":74023,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb/pZICRA9TVsSAnZWagAAEtkQAI9r28EIKOIEs9ITm/Hd\nY3YFGczzw9O1WyDmZxaydfgTtKTgGbb2x9alfCesRwF7L0kTQpfq1Pc+SnAV\nftFte23Dlv+N/h8YjCjhlfXkg+1cFvB7ea+JpMdwWX6WYS1Bo2yhWxD4wRAb\nLbBPZ8nrkAaUnu6IeGp1Ixb7OhEiE75xeZ+7oW6+YSK51s1yhQGHRFg5vLnj\nzy16kwuIzeOQ0pzJ47p+89rJ1BiUYk7Wwj1AdZqDGekEMmaZKXYRuhTnr6Xq\ncQ8uF4DD53S7dU9jo0edaYTYo2WLfVjSSUyF3LefWcSW8UCCCZ63CBS90rTF\nFuEqPwt85+sZpZ0DI6+xwpkxWiIyAWj6vIiDhf3J2QUX5MpCmdmSvzYwDUyf\nK28/ygj1SpqrPofPVFE39fxQpejHGR1OnvdvgJ0MX7DJTh0/L5yIdCCgL//I\ntNyZdnvJTL8+WL2FtuPhgjmqceA06haokdEQX7Yym6JhhnjOB/eN1zeuTnVq\n9F8nD8AUJBFYIeAVJgM97wjUgOn2Ox3JMyQViAEKVBVGhj+0a5rFLEJCoQy7\nnyRgpCnop7fDH8mLZhLS76xr38onoiePm/KjcjlPDp0axTkorNElI63v1ZuW\nD4337X8H3+uJkH+hmtn06DSBx1J+UfbMloZURWAxN+DpFinOp/nVbTHaEpTj\nxaqb\r\n=N5Gz\r\n-----END PGP SIGNATURE-----\r\n"},"browser":"browser.js","gitHead":"457bbad55b770aa736a83161df335e6ef6bb20ca","scripts":{"ci":"npm run check && npm test","fmt":"mongodb-js-fmt ./*.js lib/*.js ./test/*.js","test":"mocha","check":"mongodb-js-precommit","pretest":"mongodb-runner install"},"_npmUser":{"name":"durran","email":"durran@gmail.com"},"precommit":["check"],"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"6.4.1","description":"MongoDB connection model.","directories":{},"_nodeVersion":"10.2.1","dependencies":{"ssh2":"^0.5.4","async":"^2.1.5","debug":"^2.6.0","backoff":"^2.4.1","mongodb":"^3.1.9","kerberos":"^1.1.2","lodash.omit":"^4.5.0","mongodb-url":"^3.0.2","lodash.clone":"^4.5.0","mongodb-core":"^3.1.8","lodash.assign":"^4.2.0","ampersand-model":"^8.0.0","lodash.defaults":"^4.2.0","lodash.includes":"^4.3.0","lodash.isstring":"^4.0.1","lodash.isfunction":"^3.0.8","ampersand-rest-collection":"^6.0.0"},"_hasShrinkwrap":false,"devDependencies":{"mocha":"^3.2.0","sinon":"^1.17.7","pre-commit":"^1.1.2","mock-require":"^2.0.1","mongodb-js-fmt":"^0.0.3","mongodb-runner":"^4.6.0","mongodb-js-precommit":"^0.2.9","mongodb-instance-model":"^7.0.0","eslint-config-mongodb-js":"^2.2.0","mongodb-connection-fixture":"^0.0.14"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_12.5.4_1543411271349_0.9569884989476345","host":"s3://npm-registry-packages"}},"12.5.5":{"name":"mongodb-connection-model","version":"12.5.5","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@12.5.5","maintainers":[{"name":"aherlihy","email":"anna@mongodb.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"cilix","email":"matthewlevenstein@gmail.com"},{"name":"daprahamian","email":"dan.aprahamian@gmail.com"},{"name":"deepshah","email":"deepcshah@gmail.com"},{"name":"dpercy","email":"davetp425@gmail.com"},{"name":"durran","email":"durran@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"glowe","email":"graham.lowe@gmail.com"},{"name":"gregg.b","email":"gregg.brewster@mongodb.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"jimol","email":"jim.oleary@gmail.com"},{"name":"jon.franco","email":"jon.franco@mongodb.com"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"lrlna","email":"shestak.irina@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"micheal.parks","email":"michealparks1989@gmail.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"mpobrien","email":"mpobrien005@gmail.com"},{"name":"redondos","email":"aolivera@gmail.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"sampoonachot","email":"joy.sampoonachot@10gen.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"schwartzrw","email":"schwartzrw@gmail.com"},{"name":"terakilobyte","email":"terakilobyte@gmail.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"9496e0569d0e81284c4d9d6cf7168dfc803c7e79","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-12.5.5.tgz","fileCount":11,"integrity":"sha512-0wa5/DKPT0SBzJ37KFLsv1391jxJ8Z6Ubp3lHzWT/j0VztXHEH4Juv/5CNtnhPeLI0P4sk1+OLFn2+od4/QABg==","signatures":[{"sig":"MEYCIQCrhhInvgWcflvlE1weJvLu1FgJZrZSNyJsumtUi208mAIhALXOFWN3V+sZXNJ5iw/savZtXAEAZdxiy7slpU6Tvn+0","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":74199,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcASH0CRA9TVsSAnZWagAAmIsP/ia7/SvAtaw3rs/pgg6J\nXKyFMYUvFWBEXBmGhocByjtQwSB+2RaRXXLPjHL252m5WSu9rKMqHWo2u8yD\ncU7fFfyNKiDErjVA68PHIZtUhx9JJJtErivXUcCEmoGkZXPhh05Ano+/j0xT\ni7QMjVJqqw5ae3Z6lJDMZHKSB4molGKUdyAfWfYfUYm/rwe+zt9PKLORLOeo\nrDIzMndd4mxSp1O9xZg9dV/xp48nap7GrKJLk41hsAN+tTeJy6CP5vJ6dTKM\nsl8o6SiPMSnxa5Zi8saAJlNmCIolYTBpIkZIaciIL5KBB5AYRGfaNZ2YPwL6\nkGvh9n6UHpvZWmlq8ELhSb3S/9qgIgtNuw7klqoaxAhw/6rcOHZlPK12kU3B\nPJIcWOiczrUmypt9vqXJBpmV2vZS0YXx7COUigIQB2gZXXh1Yq3QmaueSzze\nCWba3SRiT/qtlNfeWnvUOwb5nuEq2JQHl/VNXneYKMNESr7s+0h9wZtnDz4K\niKnVQgzrvKCQ9tkxOIXd63K/4JohZLF1068tHcZmHf/7+mqMmrS++wsj34bB\nn40jx2lShJnMGKkOOGQlSaLjG/E+XK32gPijJtajZFc6JE6EBa5Mn6/X5u1X\nrfy/w/iSVs6R25Rk1xG1thDdYA91oGFhtfDdGaGNXO6HTfq8Rayw4osPzu6q\nfKQw\r\n=H3M+\r\n-----END PGP SIGNATURE-----\r\n"},"browser":"browser.js","gitHead":"c4b57a82bc84910f625869241621c8226a727978","scripts":{"ci":"npm run check && npm test","fmt":"mongodb-js-fmt ./*.js lib/*.js ./test/*.js","test":"mocha","check":"mongodb-js-precommit","pretest":"mongodb-runner install"},"_npmUser":{"name":"durran","email":"durran@gmail.com"},"precommit":["check"],"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"6.4.1","description":"MongoDB connection model.","directories":{},"_nodeVersion":"10.2.1","dependencies":{"ssh2":"^0.5.4","async":"^2.1.5","debug":"^2.6.0","backoff":"^2.4.1","mongodb":"^3.1.9","kerberos":"^1.1.2","lodash.omit":"^4.5.0","mongodb-url":"^3.0.2","lodash.clone":"^4.5.0","mongodb-core":"^3.1.8","lodash.assign":"^4.2.0","ampersand-model":"^8.0.0","lodash.defaults":"^4.2.0","lodash.includes":"^4.3.0","lodash.isstring":"^4.0.1","lodash.isfunction":"^3.0.8","ampersand-rest-collection":"^6.0.0"},"_hasShrinkwrap":false,"devDependencies":{"mocha":"^3.2.0","sinon":"^1.17.7","pre-commit":"^1.1.2","mock-require":"^2.0.1","mongodb-js-fmt":"^0.0.3","mongodb-runner":"^4.6.0","mongodb-js-precommit":"^0.2.9","mongodb-instance-model":"^7.0.0","eslint-config-mongodb-js":"^2.2.0","mongodb-connection-fixture":"^0.0.14"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_12.5.5_1543578099398_0.0042462833840581915","host":"s3://npm-registry-packages"}},"12.5.6":{"name":"mongodb-connection-model","version":"12.5.6","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@12.5.6","maintainers":[{"name":"aherlihy","email":"anna@mongodb.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"cilix","email":"matthewlevenstein@gmail.com"},{"name":"daprahamian","email":"dan.aprahamian@gmail.com"},{"name":"deafgoat","email":"deafgoat@gmail.com"},{"name":"deepshah","email":"deepcshah@gmail.com"},{"name":"dpercy","email":"davetp425@gmail.com"},{"name":"durran","email":"durran@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"glowe","email":"graham.lowe@gmail.com"},{"name":"gregg.b","email":"gregg.brewster@mongodb.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"jimol","email":"jim.oleary@gmail.com"},{"name":"jon.franco","email":"jon.franco@mongodb.com"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"lrlna","email":"shestak.irina@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"micheal.parks","email":"michealparks1989@gmail.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"mpobrien","email":"mpobrien005@gmail.com"},{"name":"redondos","email":"aolivera@gmail.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"sampoonachot","email":"joy.sampoonachot@10gen.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"schwartzrw","email":"schwartzrw@gmail.com"},{"name":"terakilobyte","email":"terakilobyte@gmail.com"},{"name":"thomaslangston-mongodb","email":"thomas.langston@mongodb.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"c68cfd00dd3ddd355fff956b3e7853d47b32099f","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-12.5.6.tgz","fileCount":11,"integrity":"sha512-bAV2LmaT0SD8fK4Zu59MHdhhlP8ALoQi09p+1wjso3MLVgauMVUJFiGP9ntr4tD+N7/fpuhvx18xRgLiNRTU3g==","signatures":[{"sig":"MEUCIB42UBuv4ErR67YgrQPkJ6Co9ZQmuaV66CZXxhmQuDejAiEAzm5gF7QsNDZjLoniFSMtM9fYmbLhgRYZqmoeuILKFws=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":74172,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcZCjgCRA9TVsSAnZWagAAaiIP/jXt0l0quwx/Iv4yB/fW\nN9i7G93xgZ3jE07s1VxDAdGSNE5CAuyjGYr3YW4GBTmljjgRvwqipG6RIe5w\n9QDKs/NtTpT5l/TgXtRaDY1sL6noOks1ggIeBNLhJksRFbHJaGshfbd3mxfs\n0VdyvewXlsCbt0wwScsd+CMU8PCj3V8iKQGowpBqOKYOHwKBxbRStKRm4aS8\n62mMjGIyT81oH6YUcaI8ZnrVxYwPrbCwzKJf2SL76PeO0dKqiaNp/OhyU/RK\nPzyIjPYLama89zdcUA3ftbsWdH6FsDhElBje0dmJOyJt/lJ6Ehsmrw8C/lzr\nFOgpMhtH+T0lY9zWLcB9tsR/znMuI1KKtk7Ljib+gE/FAibKojwaoPw2ZorJ\nSIIK9oDfTh5gqDyZhc9k0pZU1r4vcTXFNK6NHkZq0Q2W1VyK04Ix45jfdBnv\n7oyBlt/4p1ZUUroO1N6xsjRUOuczQEIsVXuvx7nJ2nXCcMT9cXSazU0qDfaF\nUXX1HRY2gnZESclYH70XlqVkwO2Mx+DYQgBZneF2qz4EqvCG8Du11ISMSFE5\nzcSpm1jgtKNzmhwsJTPl+HbdDZQbpHkweBMF0BxsmSHvYPAnlbl4UA3jK+dO\nA17v/0MUA+buNr0/aQps5CvyQLvoLQt6yUv0AYr8srkkwCsdSeP3JX4WEA33\n8qo3\r\n=KTax\r\n-----END PGP SIGNATURE-----\r\n"},"gitHead":"150cfd4f8bcabfd2359469f92d7e6e3f9c663cc4","scripts":{"ci":"npm run check && npm test","fmt":"mongodb-js-fmt ./*.js lib/*.js ./test/*.js","test":"mocha","check":"mongodb-js-precommit","pretest":"mongodb-runner install"},"_npmUser":{"name":"durran","email":"durran@gmail.com"},"precommit":["check"],"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"6.4.1","description":"MongoDB connection model.","directories":{},"_nodeVersion":"10.2.1","dependencies":{"ssh2":"^0.5.4","async":"^2.1.5","debug":"^2.6.0","backoff":"^2.4.1","mongodb":"^3.1.9","kerberos":"^1.1.2","lodash.omit":"^4.5.0","mongodb-url":"^3.0.2","lodash.clone":"^4.5.0","mongodb-core":"^3.1.8","lodash.assign":"^4.2.0","ampersand-model":"^8.0.0","lodash.defaults":"^4.2.0","lodash.includes":"^4.3.0","lodash.isstring":"^4.0.1","lodash.isfunction":"^3.0.8","ampersand-rest-collection":"^6.0.0"},"_hasShrinkwrap":false,"devDependencies":{"mocha":"^3.2.0","sinon":"^1.17.7","pre-commit":"^1.1.2","mock-require":"^2.0.1","mongodb-js-fmt":"^0.0.3","mongodb-runner":"^4.6.0","mongodb-js-precommit":"^0.2.9","mongodb-instance-model":"^7.0.0","eslint-config-mongodb-js":"^2.2.0","mongodb-connection-fixture":"^0.0.14"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_12.5.6_1550067935185_0.19594893413022985","host":"s3://npm-registry-packages"}},"13.0.0":{"name":"mongodb-connection-model","version":"13.0.0","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@13.0.0","maintainers":[{"name":"aherlihy","email":"anna@mongodb.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"cilix","email":"matthewlevenstein@gmail.com"},{"name":"daprahamian","email":"dan.aprahamian@gmail.com"},{"name":"deafgoat","email":"deafgoat@gmail.com"},{"name":"deepshah","email":"deepcshah@gmail.com"},{"name":"dpercy","email":"davetp425@gmail.com"},{"name":"durran","email":"durran@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"glowe","email":"graham.lowe@gmail.com"},{"name":"gregg.b","email":"gregg.brewster@mongodb.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"jimol","email":"jim.oleary@gmail.com"},{"name":"jon.franco","email":"jon.franco@mongodb.com"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"lrlna","email":"shestak.irina@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"micheal.parks","email":"michealparks1989@gmail.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"mpobrien","email":"mpobrien005@gmail.com"},{"name":"redondos","email":"aolivera@gmail.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"sampoonachot","email":"joy.sampoonachot@10gen.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"schwartzrw","email":"schwartzrw@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"terakilobyte","email":"terakilobyte@gmail.com"},{"name":"thomaslangston-mongodb","email":"thomas.langston@mongodb.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"e6d59f8bc5ba87c310bc3b48d7903b615fb756bf","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-13.0.0.tgz","fileCount":20,"integrity":"sha512-J6TXG5hhQtfupUst7L2gWROSL+mYWuTDAJASDnIeKBoMSZihF6O2k6scmKm8mvynuEcbII/3uIqAeHfJgf9FxA==","signatures":[{"sig":"MEUCIDAkx9Zsbvipy0rEeisjz+Ps83FgtP5/PTBQ096VoWS7AiEAsUFz1nkfT7g3EezrlYqMPggKp/+TZP6HHO3EKh+Qmoc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":94340,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcd8zlCRA9TVsSAnZWagAAp84P/j61zH67ufGJ2BpoGcVG\naLUA3NqoSUHKpLm+p0C3F7q2GV3fcnDFlR40oGxcvW7FPUgYWLiKvGDyejm1\nkcuRi4oJ+AWyKcOruvny1oGxjv1eW5cYq+l9/h05pASkFfbDYxoL4ibKbYtW\ndY7MRX+s2JYGOY+uGghsMhl+OZ+gh4BXo3St5NYzN2pS90l3ZL3/5vkUT+AN\nmZBjmMJ92Z+UBgX5S6Z/R+a8tcFjcEd6REzgh5IuF1CWKQAz493xxbIA51d0\nrGMOB8irIyEYVPEJDfO8k1bW8b0FMoYbD5tWqEUYhmfFZTNNuV5qngNQ2n9K\n5i5i3MeqCR/kDS9aTNRzKDoNrp+0sdnp2TWdW1TysPF6Kzx3SrCyav2DGagd\nTgDrRwOXU7kjY42Jkis0d0ilwl21ecBEL+vVRKJUjIpl8CK90oIkxBAmPsVF\nuAeHOHLUYhgiPLOTZoy0ylBDfmIMir5elLCikX4mpJeRMYosNJkn8xSCWwrl\nMyo//kVL+nku/JksytEHV++reQ9DynkyTd9/h62sSL3QxqM3Bx75kxlOlJDB\nnLf2bh888YCLe9srQUJcHZyewkrm/3wnaepmNt6P9UptwJ33GmRx6Yj3kQO3\nvHKZpZYMKkRs/qrPJNtgViDlEHfiJDQoPR00PFNhm5QiBZ9RNCyQ2R51rld9\nzJIv\r\n=cdUL\r\n-----END PGP SIGNATURE-----\r\n"},"gitHead":"2786a25cc5fe132fdae9f140fbd816e35fb92b90","scripts":{"ci":"npm run check && npm test","fmt":"mongodb-js-fmt ./*.js lib/*.js ./test/*.js","test":"mocha","check":"mongodb-js-precommit","pretest":"mongodb-runner install"},"_npmUser":{"name":"aherlihy","email":"anna@mongodb.com"},"precommit":["check"],"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"6.7.0","description":"MongoDB connection model.","directories":{},"_nodeVersion":"11.10.0","dependencies":{"ssh2":"^0.5.4","async":"^2.1.5","debug":"^2.6.0","backoff":"^2.4.1","mongodb":"^3.1.9","kerberos":"^1.1.2","lodash.omit":"^4.5.0","mongodb-url":"^3.0.2","lodash.clone":"^4.5.0","mongodb-core":"^3.1.8","lodash.assign":"^4.2.0","ampersand-model":"^8.0.0","lodash.defaults":"^4.2.0","lodash.includes":"^4.3.0","lodash.isstring":"^4.0.1","lodash.isfunction":"^3.0.8","ampersand-rest-collection":"^6.0.0"},"_hasShrinkwrap":false,"devDependencies":{"raf":"^3.4.1","bson":"^4.0.1","uuid":"^3.3.2","mocha":"^3.2.0","sinon":"^1.17.7","electron":"^4.0.6","pre-commit":"^1.1.2","mock-require":"^2.0.1","storage-mixin":"^2.0.0","lodash.foreach":"^4.5.0","mongodb-js-fmt":"^0.0.3","mongodb-runner":"^4.6.0","mongodb-js-metrics":"^4.2.0","mongodb-data-service":"^12.4.17","mongodb-js-precommit":"^0.2.9","eslint-config-mongodb-js":"^2.2.0","mongodb-connection-fixture":"^0.0.14"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_13.0.0_1551355109139_0.47542188814894115","host":"s3://npm-registry-packages"}},"13.0.1":{"name":"mongodb-connection-model","version":"13.0.1","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@13.0.1","maintainers":[{"name":"aherlihy","email":"anna@mongodb.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"cilix","email":"matthewlevenstein@gmail.com"},{"name":"daprahamian","email":"dan.aprahamian@gmail.com"},{"name":"deafgoat","email":"deafgoat@gmail.com"},{"name":"deepshah","email":"deepcshah@gmail.com"},{"name":"dpercy","email":"davetp425@gmail.com"},{"name":"durran","email":"durran@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"glowe","email":"graham.lowe@gmail.com"},{"name":"gregg.b","email":"gregg.brewster@mongodb.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"jimol","email":"jim.oleary@gmail.com"},{"name":"jon.franco","email":"jon.franco@mongodb.com"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"lrlna","email":"shestak.irina@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"micheal.parks","email":"michealparks1989@gmail.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"mpobrien","email":"mpobrien005@gmail.com"},{"name":"redondos","email":"aolivera@gmail.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"sampoonachot","email":"joy.sampoonachot@10gen.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"schwartzrw","email":"schwartzrw@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"terakilobyte","email":"terakilobyte@gmail.com"},{"name":"thomaslangston-mongodb","email":"thomas.langston@mongodb.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"75540951175aca531123bdbc2fcada83591b7d95","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-13.0.1.tgz","fileCount":20,"integrity":"sha512-SOYnj6Z8aKlIIGUpcN2L2lSzY3nLo7UtNLDdIJJ3wYPrVUQzFBweOkaxGATeS5w/DDpJlEkjnIcY8rfdq2kOVQ==","signatures":[{"sig":"MEQCIFNUgi5L/lP0odUIdfkIpCizL0tWT7SyPlGOhLj1UbJlAiBFvpJbUlvbm0r4NwaGZcSxo8aylQj9USyZoZes/kSghQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":98424,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJceApDCRA9TVsSAnZWagAAWv4P/iTgItXnC/c4c3lFangH\nfV8t05M6IGZMTlHd+RKX85wMhSUoFT5TtKcPu1IsHeVBjFxldAitUx6M/4YO\nT9FM7abG6qIM7sR8wKMln3UdvDo5YN81SDPcezVtAm86zx5ukhBj4SF3nvlG\n3fd03DdPEi6cO9zajHZrRJCc7+L5E1wNuSwlU2aKT5BtOtwuJZ+vCpO8UI4R\nu0uJYQ82tdHhn5yy+8Y/RhAm8czmGbIABks1lyx2MPDYwCdIyQFaqkhMdajX\nupIWe2wruYQKoJ26W3bDfG1zV8sKi1xO3UTdV9dGpvsfUHLrOEzM8jG676Jh\n/A2Xlx7iH6Uar7q9TxYOBEmQeZwfUd5utTK50/oAPc7ykLLBUj5tduk2EIJe\nDDn4whPZJgIY1cLjOP3C84D6b9FKBmIJuEg4dbmflrLApu/mJ0GGBSc0sUXA\namdmiRlocTLpngtmG61Yc/rj37s6xzeKWiX3d7pj4ozjuupK5HUX1GjxOXkA\nzleUYGCIpFoURVYkApaKHD3SOCzDRcdazJCvb7z6qBnkavtfF0hj9g+A13sc\nF9TzOlyZBQYr5udiXk9m1NETdC3mILN7n65i/wfoXkV1UKl0xkh9PWgnh9RH\nRotV66WNLR1CD6gb99eoGpjfB9nIN56CCuAP1UgmuxQEQSnyly+9lpa9oab0\n/AwN\r\n=jDf+\r\n-----END PGP SIGNATURE-----\r\n"},"gitHead":"f13753d2d0bba677321e765285279234e0b0099f","scripts":{"ci":"npm run check && npm test","fmt":"mongodb-js-fmt ./*.js lib/*.js ./test/*.js","test":"mocha","check":"mongodb-js-precommit","pretest":"mongodb-runner install"},"_npmUser":{"name":"aherlihy","email":"anna@mongodb.com"},"precommit":["check"],"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"6.5.0","description":"MongoDB connection model.","directories":{},"_nodeVersion":"10.2.1","dependencies":{"ssh2":"^0.5.4","async":"^2.1.5","debug":"^2.6.0","backoff":"^2.4.1","mongodb":"^3.1.9","kerberos":"^1.1.2","lodash.omit":"^4.5.0","mongodb-url":"^3.0.2","lodash.clone":"^4.5.0","mongodb-core":"^3.1.8","lodash.assign":"^4.2.0","ampersand-model":"^8.0.0","lodash.defaults":"^4.2.0","lodash.includes":"^4.3.0","lodash.isstring":"^4.0.1","lodash.isfunction":"^3.0.8","ampersand-rest-collection":"^6.0.0"},"_hasShrinkwrap":false,"devDependencies":{"raf":"^3.4.1","bson":"^4.0.1","uuid":"^3.3.2","mocha":"^3.2.0","sinon":"^1.17.7","electron":"^4.0.6","pre-commit":"^1.1.2","mock-require":"^2.0.1","storage-mixin":"^2.0.0","lodash.foreach":"^4.5.0","mongodb-js-fmt":"^0.0.3","mongodb-runner":"^4.6.0","mongodb-js-metrics":"^4.2.0","mongodb-data-service":"^12.4.17","mongodb-js-precommit":"^0.2.9","eslint-config-mongodb-js":"^2.2.0","mongodb-connection-fixture":"^0.0.14"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_13.0.1_1551370818510_0.012019960340720282","host":"s3://npm-registry-packages"}},"13.1.0":{"name":"mongodb-connection-model","version":"13.1.0","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@13.1.0","maintainers":[{"name":"aherlihy","email":"anna@mongodb.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"cilix","email":"matthewlevenstein@gmail.com"},{"name":"daprahamian","email":"dan.aprahamian@gmail.com"},{"name":"deafgoat","email":"deafgoat@gmail.com"},{"name":"deepshah","email":"deepcshah@gmail.com"},{"name":"dpercy","email":"davetp425@gmail.com"},{"name":"durran","email":"durran@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"glowe","email":"graham.lowe@gmail.com"},{"name":"gregg.b","email":"gregg.brewster@mongodb.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"jimol","email":"jim.oleary@gmail.com"},{"name":"jon.franco","email":"jon.franco@mongodb.com"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"lrlna","email":"shestak.irina@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"micheal.parks","email":"michealparks1989@gmail.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"mpobrien","email":"mpobrien005@gmail.com"},{"name":"redondos","email":"aolivera@gmail.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"sampoonachot","email":"joy.sampoonachot@10gen.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"schwartzrw","email":"schwartzrw@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"terakilobyte","email":"terakilobyte@gmail.com"},{"name":"thomaslangston-mongodb","email":"thomas.langston@mongodb.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"5ef39f5e7ca6672e0b2f90f8de2476a9e8d88ee5","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-13.1.0.tgz","fileCount":13,"integrity":"sha512-K99qG0ir4bTFEW7E6ndE+PDxgdd5T8Q4On+aa+vQyT9t9JOdBaXv2m5peCr1hQNolNR5g7wmiD5qcttRcshd3g==","signatures":[{"sig":"MEUCIQDBdM/0cscgqDnC6wuQmhT/AKdzADv5KyDGUk/wIUPzKQIgVYitSSsL+l49kIPPfQGzNY5OrTqnD9ZCBPDU+x9W1I0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":78787,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcnkHbCRA9TVsSAnZWagAAacMQAKBOzC2RZWbOPkoT4AV3\nuJIzN4++txQR9tD+lgiQrrOdMRsmZlhpiflSrBIrGA16IJrmzTuxbAcQabPD\nRIi9xY/1lGeZLm+Vc7w747PbC0kCBOyvWd6euUrnaFnOiBfK4jFqy697uKvy\nuq2yyG+3UwbxYQlm007wuQ1SB15CxJjN2UvRzQuda239nSucC1Ek9WfqeF2W\nZ+cH2rKqi0w+oqGapwTV1epvpdxwyRvDafWFQ7jbBAeP6Nxw6GN2BB2oEVqo\nTAo5NYF8je8gVBURUfd+tyFSIfHXCjh3zcxjgVucFHW9stjeu6e/QGLrXVTE\nAl9zGUFQXnQXoPKGTV/7/pqurF4Ly/oJ3zGvcO8dQLYVyHdJYoNcvtDW3PJh\n7cfqdLv9C8tL5Y7RTh/9VNCNpDCikKIcfW4K1fpvdvCF+EOZsNjxCbtzpqd3\ntEmOk4/eK65rMJRyCOEuGBf36NmpPyAs4jav0/xGFSElOFsCCzy/Pm3kbr5V\n3jb37u/rakyii5iBKff8SpXhiZqCDo+eaU6pyvQeHt2DEG0FBS4Y7ujB7E28\n9rgD1i1mIQ+UXG34iA4jCpLywbswmWHjYvEMM4+h47Gr0ChM03mu6mAyt+Hs\njcxdVMHduTAhCqecHobmmntOSPEulXNV4iiKnf5xJ8P7QlL+X40j2fGfgKwj\nxFNh\r\n=LW8x\r\n-----END PGP SIGNATURE-----\r\n"},"gitHead":"42145133198d6e6d7fe3906733ef2e7c48632e10","scripts":{"ci":"npm run check && npm test","fmt":"mongodb-js-fmt ./*.js lib/*.js ./test/*.js","test":"mocha","check":"mongodb-js-precommit","pretest":"mongodb-runner install"},"_npmUser":{"name":"durran","email":"durran@gmail.com"},"precommit":["check"],"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"6.4.1","description":"MongoDB connection model.","directories":{},"_nodeVersion":"10.2.1","dependencies":{"ssh2":"^0.5.4","async":"^2.1.5","debug":"^2.6.0","backoff":"^2.4.1","mongodb":"^3.2.2","kerberos":"^1.1.2","lodash.omit":"^4.5.0","mongodb-url":"^3.0.2","lodash.clone":"^4.5.0","mongodb-core":"^3.2.2","lodash.assign":"^4.2.0","ampersand-model":"^8.0.0","lodash.defaults":"^4.2.0","lodash.includes":"^4.3.0","lodash.isstring":"^4.0.1","lodash.isfunction":"^3.0.8","ampersand-rest-collection":"^6.0.0"},"_hasShrinkwrap":false,"devDependencies":{"raf":"^3.4.1","bson":"^4.0.1","uuid":"^3.3.2","mocha":"^3.2.0","sinon":"^1.17.7","electron":"^4.0.6","pre-commit":"^1.1.2","mock-require":"^2.0.1","storage-mixin":"^2.0.0","lodash.foreach":"^4.5.0","mongodb-js-fmt":"^0.0.3","mongodb-runner":"^4.6.0","mongodb-js-metrics":"^4.2.0","mongodb-data-service":"^12.4.17","mongodb-js-precommit":"^0.2.9","eslint-config-mongodb-js":"^2.2.0","mongodb-connection-fixture":"^0.0.14"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_13.1.0_1553875418132_0.6437873090233988","host":"s3://npm-registry-packages"}},"13.1.1":{"name":"mongodb-connection-model","version":"13.1.1","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@13.1.1","maintainers":[{"name":"aherlihy","email":"anna@mongodb.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"cilix","email":"matthewlevenstein@gmail.com"},{"name":"daprahamian","email":"dan.aprahamian@gmail.com"},{"name":"deafgoat","email":"deafgoat@gmail.com"},{"name":"deepshah","email":"deepcshah@gmail.com"},{"name":"dpercy","email":"davetp425@gmail.com"},{"name":"durran","email":"durran@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"glowe","email":"graham.lowe@gmail.com"},{"name":"gregg.b","email":"gregg.brewster@mongodb.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"jimol","email":"jim.oleary@gmail.com"},{"name":"jon.franco","email":"jon.franco@mongodb.com"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"lrlna","email":"shestak.irina@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"micheal.parks","email":"michealparks1989@gmail.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"mpobrien","email":"mpobrien005@gmail.com"},{"name":"redondos","email":"aolivera@gmail.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"sampoonachot","email":"joy.sampoonachot@10gen.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"schwartzrw","email":"schwartzrw@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"terakilobyte","email":"terakilobyte@gmail.com"},{"name":"thomaslangston-mongodb","email":"thomas.langston@mongodb.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"8b42ecf6895615876ad47722409128e42ff3630a","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-13.1.1.tgz","fileCount":13,"integrity":"sha512-5LcZP7fh1403p3xAIOSJQ1wxQ21npsskocuenajEGgXXvrhLLQicWwl0UBLw+hq0z1E0E2jpzMhHscgBaTsk1Q==","signatures":[{"sig":"MEQCIH6db0yMu+DPgtCQwjrRwzJd00C7cFksmBdCtr7y56mNAiA17FzolSxL+KpEgSYmKi/SANjSrlBk+cxFQZmOGhP5bA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":78214,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcnkPXCRA9TVsSAnZWagAAcbAQAI/qdEKm04fQ5LKl3u/e\nHWSQ6r07yJDI27EV1+TTDsEfoxMTxrMyT7y0D6ZYQeGOOWYsHCivn6uVMp0o\nNPclZYQB7d9kf+C9EX3wnYRbcBz5ct15+dWNEdSED44iP5gqLbaN5hodImE3\nYKKm/aPGUoXLEVN2Mg7dNbprrYrAczoaVQuNnnGOrApdcE1rEQmJ1zTNpthd\nqCpXdnY/4jCGOturltBouw45TjQqQNVlVZCumit3NGn2YOsnrouBWoqc6xSC\ntZ7jePACdtndQcXXnk1hp4eh1aM7HuMfU6KuRei1N6JVgfOzVhrWbhWnOkBv\nm+zbyJwUtpYLqqKCTeReXM2jDQi/aZjKnLdQMWdSlTvIHLsWfqKkxRVKe2k7\nKQtbyrG2HdxA798IVFSzCDH1kS1iGbiepdQ6nHhRY71hibQFIc95rJYKGrHL\n8SJeNBq0YAq8jfouLac6F7bP4rfCowvMRfkIJzFkOs3IHiTMhcMBZTIwO4g+\nI/1YoBgNX02lWP2YDjFU7Be35sPUiJiCIAZ1XgO39Zb05JQVDVr8UZQ+JIrp\n2mzk47HqltRv+w3w/rehDT/PtrALrDtNYGaZySWZqIwjZwd49AN8Xh8oKq0O\nL6XHXZgaKiYbdRdvj1Pr4SE0EDlmj0CLVi/q49Ieuqkk2b6IMS8GRl2KhRfC\nSB0b\r\n=3D13\r\n-----END PGP SIGNATURE-----\r\n"},"gitHead":"843c2aa202d9ad0f4ed8cff33d24d3cb513f477d","scripts":{"ci":"npm run check && npm test","fmt":"mongodb-js-fmt ./*.js lib/*.js ./test/*.js","test":"mocha","check":"mongodb-js-precommit","pretest":"mongodb-runner install"},"_npmUser":{"name":"durran","email":"durran@gmail.com"},"precommit":["check"],"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"6.4.1","description":"MongoDB connection model.","directories":{},"_nodeVersion":"10.2.1","dependencies":{"ssh2":"^0.5.4","async":"^2.1.5","debug":"^2.6.0","backoff":"^2.4.1","mongodb":"^3.2.2","kerberos":"^1.1.2","lodash.omit":"^4.5.0","mongodb-url":"^3.0.2","lodash.clone":"^4.5.0","mongodb-core":"^3.2.2","lodash.assign":"^4.2.0","ampersand-model":"^8.0.0","lodash.defaults":"^4.2.0","lodash.includes":"^4.3.0","lodash.isstring":"^4.0.1","lodash.isfunction":"^3.0.8","ampersand-rest-collection":"^6.0.0"},"_hasShrinkwrap":false,"devDependencies":{"raf":"^3.4.1","bson":"^4.0.1","uuid":"^3.3.2","mocha":"^3.2.0","sinon":"^1.17.7","electron":"^4.0.6","pre-commit":"^1.1.2","mock-require":"^2.0.1","storage-mixin":"^2.0.0","lodash.foreach":"^4.5.0","mongodb-js-fmt":"^0.0.3","mongodb-runner":"^4.6.0","mongodb-js-metrics":"^4.2.0","mongodb-data-service":"^12.4.17","mongodb-js-precommit":"^0.2.9","eslint-config-mongodb-js":"^2.2.0","mongodb-connection-fixture":"^0.0.14"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_13.1.1_1553875926870_0.0021451195741393203","host":"s3://npm-registry-packages"}},"13.1.2":{"name":"mongodb-connection-model","version":"13.1.2","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@13.1.2","maintainers":[{"name":"aherlihy","email":"anna@mongodb.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"cilix","email":"matthewlevenstein@gmail.com"},{"name":"daprahamian","email":"dan.aprahamian@gmail.com"},{"name":"deafgoat","email":"deafgoat@gmail.com"},{"name":"deepshah","email":"deepcshah@gmail.com"},{"name":"dpercy","email":"davetp425@gmail.com"},{"name":"durran","email":"durran@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"glowe","email":"graham.lowe@gmail.com"},{"name":"gregg.b","email":"gregg.brewster@mongodb.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"jimol","email":"jim.oleary@gmail.com"},{"name":"jon.franco","email":"jon.franco@mongodb.com"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"lrlna","email":"shestak.irina@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"micheal.parks","email":"michealparks1989@gmail.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"mpobrien","email":"mpobrien005@gmail.com"},{"name":"redondos","email":"aolivera@gmail.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"sampoonachot","email":"joy.sampoonachot@10gen.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"schwartzrw","email":"schwartzrw@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"terakilobyte","email":"terakilobyte@gmail.com"},{"name":"thomaslangston-mongodb","email":"thomas.langston@mongodb.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"3cc9e3748e8d8c45be72255879b31904b3b75e5c","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-13.1.2.tgz","fileCount":13,"integrity":"sha512-rN+TxvZ7i2UjJeo+t0sXyUr/4sWiIO6xZ41MIw+2uH5ppsfBPCB6IGYAqp7LqmmISjEwEdWDG8IK1T00URwMnA==","signatures":[{"sig":"MEQCIAXxBnrybVj0pfq4wkJ1ha1IEy/h4KeGmWuJChSIQSfqAiBZqujL9//bKllmKJBWN9mc0EEMnsefjjZeVJiGRXv4BQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":78297,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcnkVyCRA9TVsSAnZWagAA/UkP/iD9vGYxOX9s2Be8rgRU\nMOqfC6/w1pZmTlJy300sz9GA4M2BcWrEZlgZraWYSSXCgcrqF9OAabloi+Ef\nQJCwzY0PsEEFPnj1sY0jtm1hoR3VeS1gd43mXj0hSlMdQ0GCS80UYhtCo8nS\nBIbjqHsc0/yL7yvctOJjJXa3/DJiA+aqEfGDF1ChQasxKPl0fD8/oDcsm2e4\nBv8CuL0zzr/sUBhpW//OO9xs9mKFrso0Wch5EHLorBqQ1ZXQY7O39nK+QvGx\n2mlu/83WoWIXeL/gw47WWdAZrO4vgeZ8QLWq01MIZI8UsPh4BOJFWfiyrrP3\nb+tJWLv/sqYPrJkN1u00gaqj3LCg8D7centuvVpPRwHe6fVxG+eAynREALh1\nOX5odibREGjrODgsCOsU6ISgqsQ+zNaeYK4BsfYgzFs65oSlKNUIK1CtwtdT\nD3G+iD1f8b8EmB/qLHa90HmmUd0gL92x6gxDlJpEH2eUAH1iW81ULKOUEsi8\nNEzgrXDE5y55r81/x1/1uJQKizpy2oUK3oH34UMKKQCAr6oX0ciikIiJySrn\nmEUY2HfdaF0wvhySVXlHEW37+foXUaRhQp0oGKhbqzlHd5sa/WKZXkDXj6hw\nfAopWTeKA3eHLcDSdBEjdMJC/4hpiLTF+4yttaZ+cy2QjdqQTmQPLHwwgbwt\nzBtP\r\n=5o+2\r\n-----END PGP SIGNATURE-----\r\n"},"gitHead":"0a0b5a4a1a3c48c10398083b38c21e2a77862433","scripts":{"ci":"npm run check && npm test","fmt":"mongodb-js-fmt ./*.js lib/*.js ./test/*.js","test":"mocha","check":"mongodb-js-precommit","pretest":"mongodb-runner install"},"_npmUser":{"name":"durran","email":"durran@gmail.com"},"precommit":["check"],"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"6.4.1","description":"MongoDB connection model.","directories":{},"_nodeVersion":"10.2.1","dependencies":{"ssh2":"^0.5.4","async":"^2.1.5","debug":"^2.6.0","backoff":"^2.4.1","mongodb":"^3.2.2","kerberos":"^1.1.2","lodash.omit":"^4.5.0","mongodb-url":"^3.0.2","lodash.clone":"^4.5.0","mongodb-core":"^3.2.2","lodash.assign":"^4.2.0","ampersand-model":"^8.0.0","lodash.defaults":"^4.2.0","lodash.includes":"^4.3.0","lodash.isstring":"^4.0.1","lodash.isfunction":"^3.0.8","ampersand-rest-collection":"^6.0.0"},"_hasShrinkwrap":false,"devDependencies":{"raf":"^3.4.1","bson":"^4.0.1","uuid":"^3.3.2","mocha":"^3.2.0","sinon":"^1.17.7","electron":"^4.0.6","pre-commit":"^1.1.2","mock-require":"^2.0.1","storage-mixin":"^2.0.0","lodash.foreach":"^4.5.0","mongodb-js-fmt":"^0.0.3","mongodb-runner":"^4.6.0","mongodb-js-metrics":"^4.2.0","mongodb-data-service":"^12.4.17","mongodb-js-precommit":"^0.2.9","eslint-config-mongodb-js":"^2.2.0","mongodb-connection-fixture":"^0.0.14"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_13.1.2_1553876337575_0.828966542147199","host":"s3://npm-registry-packages"}},"13.1.3":{"name":"mongodb-connection-model","version":"13.1.3","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@13.1.3","maintainers":[{"name":"aherlihy","email":"anna@mongodb.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"cilix","email":"matthewlevenstein@gmail.com"},{"name":"daprahamian","email":"dan.aprahamian@gmail.com"},{"name":"deafgoat","email":"deafgoat@gmail.com"},{"name":"deepshah","email":"deepcshah@gmail.com"},{"name":"dpercy","email":"davetp425@gmail.com"},{"name":"durran","email":"durran@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"glowe","email":"graham.lowe@gmail.com"},{"name":"gregg.b","email":"gregg.brewster@mongodb.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"jimol","email":"jim.oleary@gmail.com"},{"name":"jon.franco","email":"jon.franco@mongodb.com"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"lrlna","email":"shestak.irina@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"micheal.parks","email":"michealparks1989@gmail.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"mpobrien","email":"mpobrien005@gmail.com"},{"name":"redondos","email":"aolivera@gmail.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"sampoonachot","email":"joy.sampoonachot@10gen.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"schwartzrw","email":"schwartzrw@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"terakilobyte","email":"terakilobyte@gmail.com"},{"name":"thomaslangston-mongodb","email":"thomas.langston@mongodb.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"440ae01127d6e771075ba9bc914e95ba4e749060","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-13.1.3.tgz","fileCount":13,"integrity":"sha512-iXePNgSgCN7xXRLV42rZCeVwvgb7fmupIOUy/NQxWHPUng8//ZAaBx6v4rARTARGLpop8hGcYjKa5b36Uy7D2Q==","signatures":[{"sig":"MEUCIQCyxR6Cd2C0EKjEEFTEufrASqVoQ6cH5ozcpObRONC0QQIgbdOwDbUM+UOpI41bgJBZO4q9ysyqhjHSwQ9A3MH4RmU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":78384,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcnkX3CRA9TVsSAnZWagAALmUP/1gLUIvf/vmNpCT6UTuy\n5aZG3M+i/Fms/aMyhvwN9SOzgIbkTAaoij6CjUUFH4tQY2qXIJK0KgmRBZfk\nBbZJL2tKx/YvimciempcIt5enTFqmcZ1RseBx1NuiIHZc6U26b90mZ/SoSup\nFn+U7t2M5BnaK6lX83oqPUX4Rm5EvHrvTdZjq57A/Fn1zQNz4whgEMq1sqTN\n4HDy7S6aWgarSY1EO+EiF1xfftRPyMZM0UsfifeeEOP5kxGUmMVBUPfJ1SLZ\nk/pp69m3gPasdDS90nbpVsjbnZ8Qf+Sgv+KhMls2mHCtsQZ6MqCBaQOWNzer\nUpTLz45jkUw9pYg1NED61UBZgHOlHUN6U6vCYFkODjwO0SZ9rzaJnJVSr3XR\nbF1fmNQXKHwBYAsMv3n8f1oU7Cgcs8DmCuTIQoQpjbk2mma7Cbg+Saaz2j0b\nl9IKYghtz2hUE1gBB24Q+Ue6wgimyrtCN4rTL0pgdpHeS6h1bbHtfj/nFiIG\nmhYNbq2ZADLOTxBWdhUJzEA63kFU4mg2C9zmaDqdMpGA+Voi/88CG1SNxEVe\nvHRrS30xTS8CBzPUowPW8Ux6eZHvPxX1w+7ihp1t2+uoYy+rNhhuADztSgcB\nHHrFHfHNPewgnjD9gRqULfYtnP++oJAYeu4xaTw5IkTfQMsf1vEI5Ec7YMuE\nQt0T\r\n=mnhd\r\n-----END PGP SIGNATURE-----\r\n"},"gitHead":"af715fc428c0ec89bb56a3a403441f2ab399b71b","scripts":{"ci":"npm run check && npm test","fmt":"mongodb-js-fmt ./*.js lib/*.js ./test/*.js","test":"mocha","check":"mongodb-js-precommit","pretest":"mongodb-runner install"},"_npmUser":{"name":"durran","email":"durran@gmail.com"},"precommit":["check"],"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"6.4.1","description":"MongoDB connection model.","directories":{},"_nodeVersion":"10.2.1","dependencies":{"ssh2":"^0.5.4","async":"^2.1.5","debug":"^2.6.0","backoff":"^2.4.1","mongodb":"^3.2.2","kerberos":"^1.1.2","lodash.omit":"^4.5.0","mongodb-url":"^3.0.2","lodash.clone":"^4.5.0","mongodb-core":"^3.2.2","lodash.assign":"^4.2.0","ampersand-model":"^8.0.0","lodash.defaults":"^4.2.0","lodash.includes":"^4.3.0","lodash.isstring":"^4.0.1","lodash.isfunction":"^3.0.8","ampersand-rest-collection":"^6.0.0"},"_hasShrinkwrap":false,"devDependencies":{"raf":"^3.4.1","bson":"^4.0.1","uuid":"^3.3.2","mocha":"^3.2.0","sinon":"^1.17.7","electron":"^4.0.6","pre-commit":"^1.1.2","mock-require":"^2.0.1","storage-mixin":"^2.0.0","lodash.foreach":"^4.5.0","mongodb-js-fmt":"^0.0.3","mongodb-runner":"^4.6.0","mongodb-js-metrics":"^4.2.0","mongodb-data-service":"^12.4.17","mongodb-js-precommit":"^0.2.9","eslint-config-mongodb-js":"^2.2.0","mongodb-connection-fixture":"^0.0.14"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_13.1.3_1553876469969_0.8739667639952005","host":"s3://npm-registry-packages"}},"13.1.4":{"name":"mongodb-connection-model","version":"13.1.4","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@13.1.4","maintainers":[{"name":"aherlihy","email":"anna@mongodb.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"cilix","email":"matthewlevenstein@gmail.com"},{"name":"daprahamian","email":"dan.aprahamian@gmail.com"},{"name":"deafgoat","email":"deafgoat@gmail.com"},{"name":"deepshah","email":"deepcshah@gmail.com"},{"name":"dpercy","email":"davetp425@gmail.com"},{"name":"durran","email":"durran@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"glowe","email":"graham.lowe@gmail.com"},{"name":"gregg.b","email":"gregg.brewster@mongodb.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"jimol","email":"jim.oleary@gmail.com"},{"name":"jon.franco","email":"jon.franco@mongodb.com"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"lrlna","email":"shestak.irina@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"micheal.parks","email":"michealparks1989@gmail.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"mpobrien","email":"mpobrien005@gmail.com"},{"name":"redondos","email":"aolivera@gmail.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"sampoonachot","email":"joy.sampoonachot@10gen.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"schwartzrw","email":"schwartzrw@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"terakilobyte","email":"terakilobyte@gmail.com"},{"name":"thomaslangston-mongodb","email":"thomas.langston@mongodb.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"6373e1df38994737c705fa423f26a3fca441b627","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-13.1.4.tgz","fileCount":13,"integrity":"sha512-ChQxDW2t8Qq4QmrO/9RtxefrSLhvp/4acsmvq4665DNTBEYQvkfoZxVD4ypkC1lOa9Sv+Xq/jxEmNj3v4y4lKQ==","signatures":[{"sig":"MEYCIQDiNjUs/Nt3SO6FJe7zqk2HiTUnUbq3/blJmrZIP7OPogIhAONlAr6RaBEADquJ9KYwBnDlARga/BtCC9xophTbkpGK","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":78348,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcnkb/CRA9TVsSAnZWagAAZ0MP/jMK7Mw6vTuorgGiLli/\nDxeaotjJb9iaThzUaMeTWh9iqs4nt4udVXmAEe0XSO8m0kDmQk20BqsQBnTn\nTuePfAmK6Y+u2plbGQafVVSNKg6ljZJjBlvlJDSy91mzNWeFGEEtHCR/TnT/\nPL9SVIP/Q0GNJ5icoI+rrK5YccgrrX1jRWXZxeN84Ji8+cmchn//EXhoQwSg\nDg/RTflQ0PWh0BxK3JXhIk9yrC2N7Lep05g02fOQrV3a7jXwoWMHkkk2TeJY\nuMw9xhXFnDGPibg5LkLOAVX5Oz1RMkmSdAZO3n7bWVSrsJtRg2ciYWA/CvZM\nAsf1hY2ayuGyAVa71M+sXREMOA7G2iPpVD/CWAc+bR3jQgJENoh/7Mkl47pG\n3dT0lSq1xT0OG7uK6wQQ897lCXlyaBc4gdxyC5I0pl+mnD7RuDdPL2ztRWU8\nZZ49+RWnDMmRx9z8NoYeK0GikEsxa4xwmlXiv0oOv9uS9iJzHCmZmFOqOe4W\njku4ll2ratAnMux6w2Lh6T4u0qFV1Vst508hZryv8iNix/VClhNQB7jCDJqk\nAP03P+HrfIoVTrVmP7acUuWDIjUizGg81VTwUBfc+gcDoI24JDLepj+bPhlP\n6eO62pgqT8lAd4K4lepYEDBPMiOhUEACVqrUVz5j85c3ppSJfp5wH8jIwT+X\ncOcF\r\n=l/yz\r\n-----END PGP SIGNATURE-----\r\n"},"gitHead":"376b4ae914046ebe3ede3a8290b13c393e787bd1","scripts":{"ci":"npm run check && npm test","fmt":"mongodb-js-fmt ./*.js lib/*.js ./test/*.js","test":"mocha","check":"mongodb-js-precommit","pretest":"mongodb-runner install"},"_npmUser":{"name":"durran","email":"durran@gmail.com"},"precommit":["check"],"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"6.4.1","description":"MongoDB connection model.","directories":{},"_nodeVersion":"10.2.1","dependencies":{"raf":"^3.4.1","ssh2":"^0.5.4","async":"^2.1.5","debug":"^2.6.0","backoff":"^2.4.1","mongodb":"^3.2.2","kerberos":"^1.1.2","lodash.omit":"^4.5.0","mongodb-url":"^3.0.2","lodash.clone":"^4.5.0","mongodb-core":"^3.2.2","lodash.assign":"^4.2.0","storage-mixin":"^2.0.0","ampersand-model":"^8.0.0","lodash.defaults":"^4.2.0","lodash.includes":"^4.3.0","lodash.isstring":"^4.0.1","lodash.isfunction":"^3.0.8","ampersand-rest-collection":"^6.0.0"},"_hasShrinkwrap":false,"devDependencies":{"bson":"^4.0.1","uuid":"^3.3.2","mocha":"^3.2.0","sinon":"^1.17.7","electron":"^4.0.6","pre-commit":"^1.1.2","mock-require":"^2.0.1","lodash.foreach":"^4.5.0","mongodb-js-fmt":"^0.0.3","mongodb-runner":"^4.6.0","mongodb-data-service":"^12.4.17","mongodb-js-precommit":"^0.2.9","eslint-config-mongodb-js":"^2.2.0","mongodb-connection-fixture":"^0.0.14"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_13.1.4_1553876734114_0.9912085943756395","host":"s3://npm-registry-packages"}},"13.1.5":{"name":"mongodb-connection-model","version":"13.1.5","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@13.1.5","maintainers":[{"name":"aherlihy","email":"anna@mongodb.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"cilix","email":"matthewlevenstein@gmail.com"},{"name":"daprahamian","email":"dan.aprahamian@gmail.com"},{"name":"deafgoat","email":"deafgoat@gmail.com"},{"name":"deepshah","email":"deepcshah@gmail.com"},{"name":"dpercy","email":"davetp425@gmail.com"},{"name":"durran","email":"durran@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"glowe","email":"graham.lowe@gmail.com"},{"name":"gregg.b","email":"gregg.brewster@mongodb.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"jimol","email":"jim.oleary@gmail.com"},{"name":"jon.franco","email":"jon.franco@mongodb.com"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"lrlna","email":"shestak.irina@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"micheal.parks","email":"michealparks1989@gmail.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"mpobrien","email":"mpobrien005@gmail.com"},{"name":"redondos","email":"aolivera@gmail.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"sampoonachot","email":"joy.sampoonachot@10gen.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"schwartzrw","email":"schwartzrw@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"terakilobyte","email":"terakilobyte@gmail.com"},{"name":"thomaslangston-mongodb","email":"thomas.langston@mongodb.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"34815c58ebee05a8adc7f2b5f9ad5b506da738ce","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-13.1.5.tgz","fileCount":20,"integrity":"sha512-nhRdxULysugf868UWwpH3C8b27zJRmYbRSqkHuJgvbJrauojMTuE3jIilxvr1EAFBmZgrO4Muu/JxvAQ2ekwMQ==","signatures":[{"sig":"MEUCIQCyBTia7f40HB7rPJuMKAX5qa70hH1UnWSkbSpG7PZaBwIgbZFulx/frMJquBOCrJDm4HRTVGNgInUz6qMe9S6Zdbw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":95752,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJctzTMCRA9TVsSAnZWagAAIlQP/3L3MQns/8Hwey1oRz2k\nIR0Y14/Oe6Bw7JiqszIa2lTDX9a6MRB/TlsSZI1M0xKA6SFaXOqNs8tKJi+O\nIXIBwWzcxkf6DBnH9Eeu2l6FgLBLS8MAfkFynGDdptsqYyb8TtkBeme/Ghqo\nm3iCenYHaFAYzx530OKZICjzNCaCB9vVti3k78MPnSwrrvZYNVbc3vvXlDAL\ne5cIJan+71SoU1EK26ZYWiC8NTq4bp6zgVQYbcTlSckLfmDb5xKk5HR8xc75\nBtr2jDhPqJPqvqm0FY6MzuYOEC4GX1DhVgMfoWpV0i8zQaCpc/5cLAW+W3Zo\njjgPrXP+C5nGxp6rn35TRmQFrCgxINGXvflsgFYWCGhXlr5+IY7RNWX1AgE9\nEg7X+grFkobsc4Y7P5TszjEaB0GvH87w6ZiYJBECMtDgIlk029pUx2+5IFnL\n/pR16udyxrFnydKexX1n4Prbmjg/4lfv29FuutKFnl9yIoF4g+BFieVekkx9\n9Subk0Yao4zBsTE9w9dHZbgGaRPo4Mew0pQaFtvphsJkVUkAafqYBV/4O310\nnHnUZvccIjr7FzwOc+wMOki/m1TFSmsVPfnVuO9cgsVVrCwQL1FbOgoJrxaP\npOyy/ajLFhc13hIO+3dMGahjg65Dsl+5+zPjFsW4bxRFxu1fWH0w6L2doyrm\nG084\r\n=1BUg\r\n-----END PGP SIGNATURE-----\r\n"},"gitHead":"1e58ed4da67c44acd0f631881bffceb2d4d614e6","scripts":{"ci":"npm run check && npm test","fmt":"mongodb-js-fmt ./*.js lib/*.js ./test/*.js","test":"mocha","check":"mongodb-js-precommit","pretest":"mongodb-runner install"},"_npmUser":{"name":"aherlihy","email":"anna@mongodb.com"},"precommit":["check"],"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"6.7.0","description":"MongoDB connection model.","directories":{},"_nodeVersion":"10.2.1","dependencies":{"raf":"^3.4.1","ssh2":"^0.5.4","async":"^2.1.5","debug":"^2.6.0","backoff":"^2.4.1","mongodb":"^3.2.2","kerberos":"^1.1.2","lodash.omit":"^4.5.0","mongodb-url":"^3.0.2","lodash.clone":"^4.5.0","mongodb-core":"^3.2.2","lodash.assign":"^4.2.0","storage-mixin":"^2.0.0","ampersand-model":"^8.0.0","lodash.defaults":"^4.2.0","lodash.includes":"^4.3.0","lodash.isstring":"^4.0.1","lodash.isfunction":"^3.0.8","ampersand-rest-collection":"^6.0.0"},"_hasShrinkwrap":false,"devDependencies":{"bson":"^4.0.1","uuid":"^3.3.2","mocha":"^3.2.0","sinon":"^1.17.7","electron":"^4.0.6","pre-commit":"^1.1.2","mock-require":"^2.0.1","lodash.foreach":"^4.5.0","mongodb-js-fmt":"^0.0.3","mongodb-runner":"^4.6.0","mongodb-data-service":"^12.4.17","mongodb-js-precommit":"^0.2.9","eslint-config-mongodb-js":"^2.2.0","mongodb-connection-fixture":"^0.0.14"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_13.1.5_1555510475705_0.29173562014627263","host":"s3://npm-registry-packages"}},"14.0.0":{"name":"mongodb-connection-model","version":"14.0.0","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@14.0.0","maintainers":[{"name":"aherlihy","email":"anna@mongodb.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"cilix","email":"matthewlevenstein@gmail.com"},{"name":"daprahamian","email":"dan.aprahamian@gmail.com"},{"name":"deafgoat","email":"deafgoat@gmail.com"},{"name":"deepshah","email":"deepcshah@gmail.com"},{"name":"dpercy","email":"davetp425@gmail.com"},{"name":"durran","email":"durran@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"glowe","email":"graham.lowe@gmail.com"},{"name":"gregg.b","email":"gregg.brewster@mongodb.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"jimol","email":"jim.oleary@gmail.com"},{"name":"jon.franco","email":"jon.franco@mongodb.com"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"lrlna","email":"shestak.irina@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"micheal.parks","email":"michealparks1989@gmail.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"mpobrien","email":"mpobrien005@gmail.com"},{"name":"redondos","email":"aolivera@gmail.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"ryantimmons","email":"ryan@rytim.com"},{"name":"sampoonachot","email":"joy.sampoonachot@10gen.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"schwartzrw","email":"schwartzrw@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"terakilobyte","email":"terakilobyte@gmail.com"},{"name":"thomaslangston-mongodb","email":"thomas.langston@mongodb.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"224e6c8b13010f0299551afa04666f0808804192","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-14.0.0.tgz","fileCount":21,"integrity":"sha512-R5c/DMOK2xhZlvo8+w7X/rKWw6NBiHXEPQFvh8Z+a0KMhPIFoutS/uuaDXZqlk0puQORGv+5GrOTpCRQqqebrg==","signatures":[{"sig":"MEUCIQCJa56i0dCSQNc0C3Dz/yLEVhvCjpk+03qY2dGRrxRF6wIgFYASehEEv56vmWGmsI/8P1tejJAOIhAGEtk3Hvv4kC8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":89603,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdGf8vCRA9TVsSAnZWagAAppEP/jjrSoJsd2EDtQZYPaB+\ndCO6+toM8bkRKf6DyGJONdUp/q/e1yvwgvQmhbSq/sM0vMdMCXP8DQ7fPCZd\nXcm3jYvyvt7HZ6Hc97bCPie8J7RXzn0aqncoyTgCYoll5KRuPbeRZF4LAkqn\nW0C66hSKz9WptyRKEjTtDxd37jGktX4uJ16nNvTeAU5+jikzkO8zheYmQUeq\nPcGobztaCK5+8Rv21ZpH4y2MBYeVTLyuXf/HKJMGw560r/g1gKdDVQ35HZTa\nNEL8L4cLowzCchHx1ZQVkFFyWttIJwxauUqDTIm7bS7a05v63V2ORwTrsRi3\ncAPAsj8gmfkYo4AYUtG6Ibk7elC+UpSc11DDxapOUJq3oQlnKrGVbNYlbI/G\nzVw4u9EnPJf0GgvxzSc4vQvPQxgxB7uSISH30v4ZCghrF/VdhGv+9sO67Qw3\nxpSqgsJbgPoOJPCF6tXIAq7Cisbwb23m+teNY8gZmyTI/CBX/5lL8YupjJh0\nwJUaeJfswnhTyl37ZyWklTon37kkKnAmC7arlGen7p1WjXbZ6NtiwJ2mq7gr\nZV4ZR/HBVdKut4Tdu6NRDUX3WDnOp6PXBOK9pzht42q/jbIycTycBpYT3Bxo\ndakUbC9xBYgzczSwh+W2m6GayZnf8pBUanX3kwUTHihEPvFpdL5UdxGruDdx\nfCqR\r\n=6DEB\r\n-----END PGP SIGNATURE-----\r\n"},"gitHead":"fcfe074106fc92a49273a0349d4300b4253be337","scripts":{"ci":"npm run check && npm test","fmt":"mongodb-js-fmt ./*.js lib/*.js ./test/*.js","test":"mocha","check":"mongodb-js-precommit","pretest":"mongodb-runner install"},"_npmUser":{"name":"alena.khineika","email":"alena.khineika@gmail.com"},"precommit":["check"],"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"6.6.0","description":"MongoDB connection model.","directories":{},"_nodeVersion":"10.15.0","dependencies":{"raf":"^3.4.1","ssh2":"^0.5.4","async":"^2.1.5","debug":"^2.6.0","backoff":"^2.4.1","mongodb":"^3.2.2","kerberos":"^1.1.2","lodash.omit":"^4.5.0","lodash.clone":"^4.5.0","mongodb-core":"^3.2.7","lodash.assign":"^4.2.0","storage-mixin":"^2.0.0","ampersand-model":"^8.0.0","lodash.defaults":"^4.2.0","lodash.includes":"^4.3.0","lodash.isstring":"^4.0.1","lodash.unescape":"^4.0.1","lodash.isfunction":"^3.0.9","ampersand-rest-collection":"^6.0.0"},"_hasShrinkwrap":false,"devDependencies":{"bson":"^4.0.1","chai":"^4.2.0","uuid":"^3.3.2","mocha":"^3.2.0","sinon":"^1.17.7","electron":"^4.0.6","pre-commit":"^1.1.2","chai-subset":"^1.6.0","mock-require":"^2.0.1","lodash.foreach":"^4.5.0","mongodb-js-fmt":"^1.0.0","mongodb-runner":"^4.6.0","mongodb-data-service":"^14.0.5","mongodb-js-precommit":"^2.0.0","eslint-config-mongodb-js":"^5.0.3","mongodb-connection-fixture":"^0.0.14"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_14.0.0_1561984814510_0.8265718687456107","host":"s3://npm-registry-packages"}},"14.0.1":{"name":"mongodb-connection-model","version":"14.0.1","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@14.0.1","maintainers":[{"name":"aherlihy","email":"anna@mongodb.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"cilix","email":"matthewlevenstein@gmail.com"},{"name":"daprahamian","email":"dan.aprahamian@gmail.com"},{"name":"deafgoat","email":"deafgoat@gmail.com"},{"name":"deepshah","email":"deepcshah@gmail.com"},{"name":"dpercy","email":"davetp425@gmail.com"},{"name":"durran","email":"durran@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"glowe","email":"graham.lowe@gmail.com"},{"name":"gregg.b","email":"gregg.brewster@mongodb.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"jimol","email":"jim.oleary@gmail.com"},{"name":"jon.franco","email":"jon.franco@mongodb.com"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"lrlna","email":"shestak.irina@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"micheal.parks","email":"michealparks1989@gmail.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"mpobrien","email":"mpobrien005@gmail.com"},{"name":"redondos","email":"aolivera@gmail.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"ryantimmons","email":"ryan@rytim.com"},{"name":"sampoonachot","email":"joy.sampoonachot@10gen.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"schwartzrw","email":"schwartzrw@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"terakilobyte","email":"terakilobyte@gmail.com"},{"name":"thomaslangston-mongodb","email":"thomas.langston@mongodb.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"3ef192b9683d42090ebeabe1e0db3233ed9dd560","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-14.0.1.tgz","fileCount":21,"integrity":"sha512-YhkcbQ/EepQw8dSAqroQvWiBEKTfhjuni87yCOROVD9WgonGLvXKNwatcnkEqDaeHQrRU5nKT8CN8Se+wdc2Ig==","signatures":[{"sig":"MEQCICo8bb2gAsd6PHjOJH0YYJuMG9jlC5Gs+4O2kOqQsqd4AiAXOPZd6lrNvHn5sPi/CgnMGcfj7jQtTpLKk5F3EWMu7A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":90882,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdLbzGCRA9TVsSAnZWagAAVx4P/1nMq5e7uFfWtfCSvu7z\n1jodd6gb3Nembp+/RcN8PEKI8zEQCzpiJlL/2hVkIqPKE5af4Wa/CwWsCzNe\nQ2aJT4FnXreAP7FFmJoJrqVa+Kweu2cHLcrFwCRKy7iMpkRxMh+gsko1oEec\nyzqN+3OUPl3IP6O4evR64uqeMp5AOiebWHGwGFQtgAIjN2X8nbT0ckaZf7QN\nCLvmA4lAjtFQG9y8NIaADDojQe9a+/umibktcF6NFXVv8aK9xbl2iMZx0KX0\nUgwjX0GG6ehvp/TaavlGIWVExF4NzCrxLLyngQTCqf3KB0EhxWQXUCHrKrIy\nwPM7pxZyHVJLUdBZGdxcCdR8dgmmspefuQLNOmZvz1KE9NHq5aGfJ8aIQgHS\nnHDbvSKNyJ3XfzCUkUkdA/UJTP2MOETVnnvruGcRC9zUGCOrG03nzOC9viln\nQ7UfVySYA49VlI2czaEbwyl9iTL3svK01OrlHoyf2QqcioJ4+cW5suSaf61I\nV09iDcpkExWDf/9y7qque2MBwS4uQROQYJ4QI5dUJL+sOE3otkz03U9dwY2M\nfrcG9MyMEXw5vjv4LhlGQmjEcpbOULNOrUsFqUM1edVDWVJft7WRFRT7OGjf\nXa6jXIo0W+20l5w5TsGozLZdwubUeVnNyiV5Lx3ubAkibCkLU544E/q5rM/6\nwr2s\r\n=kle6\r\n-----END PGP SIGNATURE-----\r\n"},"gitHead":"9a695b104223e339e62d501b7fcbe1d9c985fdc2","scripts":{"ci":"npm run check && npm test","fmt":"mongodb-js-fmt ./*.js lib/*.js ./test/*.js","test":"mocha","check":"mongodb-js-precommit","pretest":"mongodb-runner install"},"_npmUser":{"name":"alena.khineika","email":"alena.khineika@gmail.com"},"precommit":["check"],"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"6.6.0","description":"MongoDB connection model.","directories":{},"_nodeVersion":"10.15.0","dependencies":{"raf":"^3.4.1","ssh2":"^0.5.4","async":"^2.1.5","debug":"^2.6.0","backoff":"^2.4.1","mongodb":"^3.2.2","kerberos":"^1.1.2","lodash.omit":"^4.5.0","lodash.clone":"^4.5.0","mongodb-core":"^3.2.7","lodash.assign":"^4.2.0","storage-mixin":"^2.0.0","ampersand-model":"^8.0.0","lodash.defaults":"^4.2.0","lodash.includes":"^4.3.0","lodash.isstring":"^4.0.1","lodash.unescape":"^4.0.1","lodash.isfunction":"^3.0.9","ampersand-rest-collection":"^6.0.0"},"_hasShrinkwrap":false,"devDependencies":{"bson":"^4.0.1","chai":"^4.2.0","uuid":"^3.3.2","mocha":"^3.2.0","sinon":"^1.17.7","electron":"^4.0.6","pre-commit":"^1.1.2","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^2.0.2","lodash.foreach":"^4.5.0","mongodb-js-fmt":"^1.0.0","mongodb-runner":"^4.6.0","mongodb-data-service":"^14.0.5","mongodb-js-precommit":"^2.0.0","eslint-config-mongodb-js":"^5.0.3","mongodb-connection-fixture":"^0.0.14"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_14.0.1_1563278533477_0.9015867921013412","host":"s3://npm-registry-packages"}},"13.1.6":{"name":"mongodb-connection-model","version":"13.1.6","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@13.1.6","maintainers":[{"name":"aherlihy","email":"anna@mongodb.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"cilix","email":"matthewlevenstein@gmail.com"},{"name":"daprahamian","email":"dan.aprahamian@gmail.com"},{"name":"deafgoat","email":"deafgoat@gmail.com"},{"name":"deepshah","email":"deepcshah@gmail.com"},{"name":"dpercy","email":"davetp425@gmail.com"},{"name":"durran","email":"durran@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"glowe","email":"graham.lowe@gmail.com"},{"name":"gregg.b","email":"gregg.brewster@mongodb.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"jimol","email":"jim.oleary@gmail.com"},{"name":"jon.franco","email":"jon.franco@mongodb.com"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"lrlna","email":"shestak.irina@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"micheal.parks","email":"michealparks1989@gmail.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"mpobrien","email":"mpobrien005@gmail.com"},{"name":"redondos","email":"aolivera@gmail.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"ryantimmons","email":"ryan@rytim.com"},{"name":"sampoonachot","email":"joy.sampoonachot@10gen.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"schwartzrw","email":"schwartzrw@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"terakilobyte","email":"terakilobyte@gmail.com"},{"name":"thomaslangston-mongodb","email":"thomas.langston@mongodb.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"99e19fb6c65ba155eb383a971855376d07fd93a7","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-13.1.6.tgz","fileCount":13,"integrity":"sha512-ucQMNrAsEPuhpzMMc//zpaYrNVN2GBRNDiTAun29rysCPQhYaWJMFatyqQ5f6xOyrFtcNYdjTv+tV4lIiOIn2g==","signatures":[{"sig":"MEYCIQCyguiG5UsTG3tWWm0D8LMmmo614RFl1zwBhkWY4k7ZrQIhAIuQkaVM+DGCk6fUeVlEWBVZQPSIbGXRLq6zy/OzcpfJ","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":78467,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdUVvWCRA9TVsSAnZWagAAeIEQAInd57AWtYBbxDtShQh/\nfN6M30Syj6kiqZdNwQn9I6Y4ewbygBby6kq2ZvtNZnnzp3YrmVImUjHx7WsD\nlMNL6MPuXj9sPKeZRGpD164wdAIXlKksLiKOhqKS/1ji2hYvsCB2GrYjNTRA\nXDuS5h1WOrUUuy1Sq9LSkxdOoNNkCtMN1f7hdLYjN+JqujZT+UVvzOsSDrIA\nv2Rxy7bWtnfNVfx2TFnu/lbHR0gfgwc/pz2QC7eL5VpkILzQ+GO51qRCZOkq\nVQTnqRzl5aOH2HOGGhM0eLoLsVpXUp9XvYmQLqi043F+RspUbFA9n5FcMNHu\nf13D72kTOahe9WyCnQVRQz8vppyrE7f+IqFfopw0ri9ryEg3pBdsVxxehmLf\nZAGdMyMEe4NsxHoX0p7LQES8a32yUp+mHPAS3juwq6b8LY3zvoUZ953BfYxN\npg5hs6qpXP86EPQsB7cuDB8vp5gPKXNoeG7llyEG8wQIzDnjtWbKXLbZ4vDn\n9NEJ5+yPw5VNVnLK19u55kh3NpR3t1VjqYUwUeyOVTP2dw46xQpzbkPVnlRm\nXN2Erby9tM7XAxA1TygZuVRGLMGJ7L6cnjzpBndjXHrJ2Ibq7ltgxEVPkBv6\nxtphKVMZo4JJUuQpgRLyKusPjSAn52j7dCP1XF+6fOpeCdaTvK/gbW+GM9BX\n5ydp\r\n=D8xN\r\n-----END PGP SIGNATURE-----\r\n"},"gitHead":"a7485e74299409447acd2a7d0164baa0a12c71cd","scripts":{"ci":"npm run check && npm test","fmt":"mongodb-js-fmt ./*.js lib/*.js ./test/*.js","test":"mocha","check":"mongodb-js-precommit","pretest":"mongodb-runner install"},"_npmUser":{"name":"durran","email":"durran@gmail.com"},"precommit":["check"],"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"6.7.0","description":"MongoDB connection model.","directories":{},"_nodeVersion":"10.2.1","dependencies":{"raf":"^3.4.1","ssh2":"^0.5.4","async":"^2.1.5","debug":"^2.6.0","backoff":"^2.4.1","mongodb":"^3.2.2","kerberos":"^1.1.2","lodash.omit":"^4.5.0","mongodb-url":"^3.0.2","lodash.clone":"^4.5.0","mongodb-core":"^3.2.2","lodash.assign":"^4.2.0","storage-mixin":"^2.0.0","ampersand-model":"^8.0.0","lodash.defaults":"^4.2.0","lodash.includes":"^4.3.0","lodash.isstring":"^4.0.1","lodash.isfunction":"^3.0.8","ampersand-rest-collection":"^6.0.0"},"_hasShrinkwrap":false,"devDependencies":{"bson":"^4.0.1","uuid":"^3.3.2","mocha":"^3.2.0","sinon":"^1.17.7","electron":"^4.0.6","pre-commit":"^1.1.2","mock-require":"^2.0.1","lodash.foreach":"^4.5.0","mongodb-js-fmt":"^0.0.3","mongodb-runner":"^4.6.0","mongodb-data-service":"^12.4.17","mongodb-js-precommit":"^0.2.9","eslint-config-mongodb-js":"^2.2.0","mongodb-connection-fixture":"^0.0.14"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_13.1.6_1565613014068_0.0472447126654838","host":"s3://npm-registry-packages"}},"14.0.2":{"name":"mongodb-connection-model","version":"14.0.2","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@14.0.2","maintainers":[{"name":"aherlihy","email":"anna@mongodb.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"cilix","email":"matthewlevenstein@gmail.com"},{"name":"daprahamian","email":"dan.aprahamian@gmail.com"},{"name":"deafgoat","email":"deafgoat@gmail.com"},{"name":"deepshah","email":"deepcshah@gmail.com"},{"name":"dpercy","email":"davetp425@gmail.com"},{"name":"durran","email":"durran@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"glowe","email":"graham.lowe@gmail.com"},{"name":"gregg.b","email":"gregg.brewster@mongodb.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"jimol","email":"jim.oleary@gmail.com"},{"name":"jon.franco","email":"jon.franco@mongodb.com"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"lrlna","email":"shestak.irina@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"micheal.parks","email":"michealparks1989@gmail.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"mpobrien","email":"mpobrien005@gmail.com"},{"name":"redondos","email":"aolivera@gmail.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"ryantimmons","email":"ryan@rytim.com"},{"name":"sampoonachot","email":"joy.sampoonachot@10gen.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"schwartzrw","email":"schwartzrw@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"terakilobyte","email":"terakilobyte@gmail.com"},{"name":"thomaslangston-mongodb","email":"thomas.langston@mongodb.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"a576d9c654015c81eef8b48a41e569b736671a2e","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-14.0.2.tgz","fileCount":21,"integrity":"sha512-7kRao1JmtspPC5RbG1KrlDld4geO4222LFu817y93zZGHaU1SlIzvCEDYSv1C1rhRaJ2CyqBikwzRX4jFu/jOQ==","signatures":[{"sig":"MEQCIA0/Q7h05DMDjSWBZJRTVPol2pdGMRXIjc0BdOf9ItW2AiAyR177NKB8iuaOcj8vDfUvzu/p27LLa8zpnjS6db6/Tw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":90889,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdUpkRCRA9TVsSAnZWagAAowEP/RRQXRwrvJSaCCPpiOWe\nuSCMBmZnNTcvsF97DDhl6MuGxh2ztbn4EyT4GHeJN32RiNHFftfy2Y799WKi\nW4Eo2KiPfJAGfs0q6/zIsHHlObL7R3xXu3/lexiIGRJIPcObC2wkG/VyJMjd\nBqsqBLmxq+d/K0S8heP8WZ3kanPy/HwgXr+Os6c/DudwCXBoHAHspZTpCAqk\ni7TwC+9XQcLa/XFYju6C1sZDZiFU2S3R95NzAjjVOdy1d8ANxG2WNJAER7xr\nc5oTdw5IFQq+1Qfa3GBs+g2w+vCHE3WPU9aDdMC1XnKWAfWNVZyO/rmxGIMF\n5xi6bED8zQoStX4T876Bfhnvrk+9kp0e1kQY4zwbb20SThTSN0KPFqnYxrGF\nPotEYMfO7aN8SvDiW/j4+gPMMf/EhTtrzq+UnnvBZnww8eQRPDkVt0KJ3TX6\nHB+4F3GNN0riK8gataPTTq6kaWhO2BBI4Y8TrVisdCOF4kHM0fN6lOfFAsVp\nRuA8xtXloNlS18Ksy5tGFJi8x1c76fERHtqo4dLdtvnzLCoS4mZcHPfY3Cxo\nW2BlR1A2N33yKUUiHdo9mGMgNYJPHiN+6GHGfPv26F/+IHAI6Dcb1UPjq0yE\nPlq9oGipG0xO9aNSuQQoYjSa+0w6B6i4noniYRA7HoRSMEzzDXF1/lVuj3EY\nYayv\r\n=XihK\r\n-----END PGP SIGNATURE-----\r\n"},"gitHead":"50c5af19f7f5e5c960186ed14585c2be88f1683a","scripts":{"ci":"npm run check && npm test","fmt":"mongodb-js-fmt ./*.js lib/*.js ./test/*.js","test":"mocha","check":"mongodb-js-precommit","pretest":"mongodb-runner install"},"_npmUser":{"name":"durran","email":"durran@gmail.com"},"precommit":["check"],"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"6.4.1","description":"MongoDB connection model.","directories":{},"_nodeVersion":"10.2.1","dependencies":{"raf":"^3.4.1","ssh2":"^0.5.4","async":"^2.1.5","debug":"^2.6.0","backoff":"^2.4.1","mongodb":"^3.2.7","kerberos":"^1.1.2","lodash.omit":"^4.5.0","lodash.clone":"^4.5.0","mongodb-core":"^3.2.7","lodash.assign":"^4.2.0","storage-mixin":"^2.0.0","ampersand-model":"^8.0.0","lodash.defaults":"^4.2.0","lodash.includes":"^4.3.0","lodash.isstring":"^4.0.1","lodash.unescape":"^4.0.1","lodash.isfunction":"^3.0.9","ampersand-rest-collection":"^6.0.0"},"_hasShrinkwrap":false,"devDependencies":{"bson":"^4.0.1","chai":"^4.2.0","uuid":"^3.3.2","mocha":"^3.2.0","sinon":"^1.17.7","electron":"^4.0.6","pre-commit":"^1.1.2","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^2.0.2","lodash.foreach":"^4.5.0","mongodb-js-fmt":"^1.0.0","mongodb-runner":"^4.6.0","mongodb-js-precommit":"^2.0.0","eslint-config-mongodb-js":"^5.0.3","mongodb-connection-fixture":"^0.0.14"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_14.0.2_1565694224518_0.6976450948850563","host":"s3://npm-registry-packages"}},"14.0.3":{"name":"mongodb-connection-model","version":"14.0.3","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@14.0.3","maintainers":[{"name":"aherlihy","email":"anna@mongodb.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"cilix","email":"matthewlevenstein@gmail.com"},{"name":"daprahamian","email":"dan.aprahamian@gmail.com"},{"name":"deafgoat","email":"deafgoat@gmail.com"},{"name":"deepshah","email":"deepcshah@gmail.com"},{"name":"dpercy","email":"davetp425@gmail.com"},{"name":"durran","email":"durran@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"glowe","email":"graham.lowe@gmail.com"},{"name":"gregg.b","email":"gregg.brewster@mongodb.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"jimol","email":"jim.oleary@gmail.com"},{"name":"jon.franco","email":"jon.franco@mongodb.com"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"lrlna","email":"shestak.irina@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"micheal.parks","email":"michealparks1989@gmail.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"mpobrien","email":"mpobrien005@gmail.com"},{"name":"redondos","email":"aolivera@gmail.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"ryantimmons","email":"ryan@rytim.com"},{"name":"sampoonachot","email":"joy.sampoonachot@10gen.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"schwartzrw","email":"schwartzrw@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"terakilobyte","email":"terakilobyte@gmail.com"},{"name":"thomaslangston-mongodb","email":"thomas.langston@mongodb.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"d25be4983a16c5353539e5fabf1997864e1da7b2","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-14.0.3.tgz","fileCount":21,"integrity":"sha512-QAWo5jeiM8KY4bSHv2Rhqahxk40hNp3eB1iSSan8ugVFIukgogxIFyCDbZVAKBPdcCJoCH4BecE7V3EHmUFbYQ==","signatures":[{"sig":"MEUCIGbFa34CCF8k228VFr6mUhwBDv6JO9GWdL03LO1Iqx9cAiEA3VTyJeJKf+db7b8BN2sce4d+aCMiiVzzJQAs9zzRKsU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":91218,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdVn0VCRA9TVsSAnZWagAA/+wP/1NSyvCDcNP8F0FNESMk\n7210igIosn4/JmU1RFtqJa0pJ3G/9TvEDxIe99IYPUoFapv0k0wVOK3Zbemh\nR+rPyn7+O24NHpMEZrJ0Xw3AbyWemVhznmsDt7DOiuG6vGdsm8Uf3j0TOxgZ\nueGo0VAERB4nFQevUmjEc4zU/p594dKDdIQgcg+KvTWqYoMdidjOiDvgq3YH\nHC2AF7z9fMhL54irEmIvIX6mbOTdEbR9vHdTpRfeYu0V73gOSL18RFoqIz3r\n3rVzkujAqY3ZWTraY4oq9ar6Xo+ytaD9VXoDuBcf7IX82UUWRqoXa/He01ah\nYWk5J14bj7FCiooOEMIQRbG5d2aOd8WAwKrH8xNTriEPpEibQh5hVwcgSAs3\n6sJdb85VxVdOoeFmQ33AW9Irf+D3ZfCt2MBnyHI9fk5n139hYmN4cES4HCjs\nHHFF78nIFbZwBg6Klgw/BxwPI4QZ/fxmstOcW7yUHokeYxfkOpLD4vGnO7iG\naBPkqbqXf/gJHyGFmQc+k+mIsaRcrhfZF7icwvCFU4BP5S7ENNZHW5k5hAHQ\nwYH47KD9w48fX5v5136z06dE7RN//boPut1JBlTfNyGswllAA95hS8wHpf+F\nmETjt8K0mQyqPGbLoSlPp9e+DNTm+l/5F2Z3IfNIFxXS/KIq4tWmcevZdoKj\n6ybk\r\n=tBIi\r\n-----END PGP SIGNATURE-----\r\n"},"gitHead":"0e485f357582810ac9677f219ab843726b189630","scripts":{"ci":"npm run check && npm test","fmt":"mongodb-js-fmt ./*.js lib/*.js ./test/*.js","test":"mocha","check":"mongodb-js-precommit","pretest":"mongodb-runner install"},"_npmUser":{"name":"alena.khineika","email":"alena.khineika@gmail.com"},"precommit":["check"],"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"6.7.0","description":"MongoDB connection model.","directories":{},"_nodeVersion":"10.2.1","dependencies":{"raf":"^3.4.1","ssh2":"^0.5.4","async":"^2.1.5","debug":"^2.6.0","backoff":"^2.4.1","mongodb":"^3.2.7","kerberos":"^1.1.2","lodash.omit":"^4.5.0","lodash.clone":"^4.5.0","mongodb-core":"^3.2.7","lodash.assign":"^4.2.0","storage-mixin":"^2.0.0","ampersand-model":"^8.0.0","lodash.defaults":"^4.2.0","lodash.includes":"^4.3.0","lodash.isstring":"^4.0.1","lodash.unescape":"^4.0.1","lodash.isfunction":"^3.0.9","ampersand-rest-collection":"^6.0.0"},"_hasShrinkwrap":false,"devDependencies":{"bson":"^4.0.1","chai":"^4.2.0","uuid":"^3.3.2","mocha":"^3.2.0","sinon":"^1.17.7","electron":"^4.0.6","pre-commit":"^1.1.2","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^2.0.2","lodash.foreach":"^4.5.0","mongodb-js-fmt":"^1.0.0","mongodb-runner":"^4.7.2","mongodb-js-precommit":"^2.0.0","eslint-config-mongodb-js":"^5.0.3","mongodb-connection-fixture":"^0.0.14"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_14.0.3_1565949204453_0.4818751270844057","host":"s3://npm-registry-packages"}},"14.1.0":{"name":"mongodb-connection-model","version":"14.1.0","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@14.1.0","maintainers":[{"name":"aherlihy","email":"anna@mongodb.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"cilix","email":"matthewlevenstein@gmail.com"},{"name":"daprahamian","email":"dan.aprahamian@gmail.com"},{"name":"deafgoat","email":"deafgoat@gmail.com"},{"name":"deepshah","email":"deepcshah@gmail.com"},{"name":"dpercy","email":"davetp425@gmail.com"},{"name":"durran","email":"durran@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"glowe","email":"graham.lowe@gmail.com"},{"name":"gregg.b","email":"gregg.brewster@mongodb.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"jimol","email":"jim.oleary@gmail.com"},{"name":"jon.franco","email":"jon.franco@mongodb.com"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"lrlna","email":"shestak.irina@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"micheal.parks","email":"michealparks1989@gmail.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"mpobrien","email":"mpobrien005@gmail.com"},{"name":"redondos","email":"aolivera@gmail.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"ryantimmons","email":"ryan@rytim.com"},{"name":"sampoonachot","email":"joy.sampoonachot@10gen.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"schwartzrw","email":"schwartzrw@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"terakilobyte","email":"terakilobyte@gmail.com"},{"name":"thomaslangston-mongodb","email":"thomas.langston@mongodb.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"628b6c09a8b36ea62715632399ba2bbf26c354ad","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-14.1.0.tgz","fileCount":21,"integrity":"sha512-DEt+bibEDPMQL+R7OgjcaCosUYX1E/TkR760zYmho3q+AYZMQtasF8n+K7TBu5maW0SUBZHJejH/Pg3qeOL3Yg==","signatures":[{"sig":"MEUCIQCVxDOuh61nrWtuDvKaCNEmaahfvEeR1Rab7TLAVUrpbgIgSfZPTRAIlpELhMvEvl/+MF+E1mCj3bwsOBPhAUNQ3nI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":91623,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdX99xCRA9TVsSAnZWagAAv8EP/AsmGbDlcBBWYSINA2Tw\nVX5RqxWlp2Hf4YbPN7e6oLC329lZoRrA9GvfM9sNEm5rrngzMaMi1TW4dMz9\narJL9PctJUsQujRYNkaiLklwjKS8eMQUHkaCvLrx49gCFt4UWeatnISgCRu+\nFETbbGXWN8s2nSaWzRKLRjmCx4MJD07/c7tJYX0pjEMrNWraSGyebkqUQ3l6\nJkre61GcXYrhHRPU5+lfXkrE69+/vXDSsEk/VGAjlcqalQ79dElIdekjkJh+\nNgM7XrbDRvc+OXmuKpiGgbIyhZeNoIOGI95RSpcCcFx0Sw86in2R0p+e/+x8\nLcnwpzjBel3gj+bM9T/Ddy3CakBa0izAYhSQjgMUSt6SXek4hl+t04LmH8VC\nJVJDord0LPXLxZAMi6MEabtR1M3VUCfpM2pwDWfPW0d7B3v658xMCWRaOXn/\nkATtz5eEPeNYSQmlpFovS6h7hU5BYac4RfxPWzQffcFNL9aEK7qpswh1qEqO\npEz2Uy0TKVtlrKDLKCgt20ggHR6kzffN2dfj3nmeHgt9xV3cfDtvq4Wzuam7\neUeaSSnTm5KEgmcUifbCnukWUhexqY+9YBlZkxmy/meCzLYu6jWIUQXcXFvH\n0YcZfoUSvCOCxQbuyQkokRBHErBzA9QHDgmqibWUAoYFfzbEeNQDELDEs7cU\nveY7\r\n=g+iW\r\n-----END PGP SIGNATURE-----\r\n"},"gitHead":"1e95c1c967c03411bbb8c02bbcaac44ee2a766ad","scripts":{"ci":"npm run check && npm test","fmt":"mongodb-js-fmt ./*.js lib/*.js ./test/*.js","test":"mocha","check":"mongodb-js-precommit","pretest":"mongodb-runner install"},"_npmUser":{"name":"durran","email":"durran@gmail.com"},"precommit":["check"],"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"6.4.1","description":"MongoDB connection model.","directories":{},"_nodeVersion":"10.2.1","dependencies":{"raf":"^3.4.1","ssh2":"^0.5.4","async":"^2.1.5","debug":"^2.6.0","backoff":"^2.4.1","mongodb":"^3.2.7","kerberos":"^1.1.2","lodash.omit":"^4.5.0","lodash.clone":"^4.5.0","mongodb-core":"^3.2.7","lodash.assign":"^4.2.0","storage-mixin":"^3.1.0","ampersand-model":"^8.0.0","lodash.defaults":"^4.2.0","lodash.includes":"^4.3.0","lodash.isstring":"^4.0.1","lodash.unescape":"^4.0.1","lodash.isfunction":"^3.0.9","ampersand-rest-collection":"^6.0.0"},"_hasShrinkwrap":false,"devDependencies":{"bson":"^4.0.1","chai":"^4.2.0","uuid":"^3.3.2","mocha":"^3.2.0","sinon":"^1.17.7","electron":"^4.0.6","pre-commit":"^1.1.2","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^2.0.2","lodash.foreach":"^4.5.0","mongodb-js-fmt":"^1.0.0","mongodb-runner":"^4.7.2","mongodb-js-precommit":"^2.0.0","eslint-config-mongodb-js":"^5.0.3","mongodb-connection-fixture":"^0.0.14"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_14.1.0_1566564209065_0.09064498231962492","host":"s3://npm-registry-packages"}},"14.1.1":{"name":"mongodb-connection-model","version":"14.1.1","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@14.1.1","maintainers":[{"name":"aherlihy","email":"anna@mongodb.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"cilix","email":"matthewlevenstein@gmail.com"},{"name":"daprahamian","email":"dan.aprahamian@gmail.com"},{"name":"deafgoat","email":"deafgoat@gmail.com"},{"name":"deepshah","email":"deepcshah@gmail.com"},{"name":"dpercy","email":"davetp425@gmail.com"},{"name":"durran","email":"durran@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"glowe","email":"graham.lowe@gmail.com"},{"name":"gregg.b","email":"gregg.brewster@mongodb.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"jimol","email":"jim.oleary@gmail.com"},{"name":"jon.franco","email":"jon.franco@mongodb.com"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"lrlna","email":"shestak.irina@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"micheal.parks","email":"michealparks1989@gmail.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"mpobrien","email":"mpobrien005@gmail.com"},{"name":"redondos","email":"aolivera@gmail.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"ryantimmons","email":"ryan@rytim.com"},{"name":"sampoonachot","email":"joy.sampoonachot@10gen.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"schwartzrw","email":"schwartzrw@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"terakilobyte","email":"terakilobyte@gmail.com"},{"name":"thomaslangston-mongodb","email":"thomas.langston@mongodb.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"7705e5673e97304907604b4b01dc8a21c460534c","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-14.1.1.tgz","fileCount":21,"integrity":"sha512-JdL6VroYRPrRi/jJ6J/oQAsm31vXas+3FWbOlTZU5zTNjubJVGt9BBiReBq1Yc3U9c5sS/x+aexfXZMmwLHJ0g==","signatures":[{"sig":"MEQCIB2+DzMVh9Hvoa6RwMYzB07MbApTZuixY5UU5+F88INBAiBVJaHI8cKf9bsOewAVOnAwYOiF9RPRfdlLO2A4RNI1qQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":91623,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdYv66CRA9TVsSAnZWagAAloUP/1U+xXrEHw7+ygamKQUh\najjcS8Cwp/gnL1pnGrKA0DXZf/6+1G96t4PXMkbUpt7LqUtXffBq2XNJ1Gya\n6IpV8VtDgtICw4oKMbzXXSa1A95+pLDsygWNe5gHFaZPq5HT6PNvD0DZLmFR\nZaSh1yFNmzCliWZfvdPE/qd2G9F/dg4bFhE+A64/2jfj8WNpROk4+xFG0sCn\novx8zyKcBPrRC05kcfcidTPEnI0ULgzNqWq843rtejqxS+ajGspBxvT1Ne41\nH09BQ3Y67gWKsDypnmEIk17EDbO35+2yYbZO1b2TxN/JT+JLdRBq2wD1O3hi\nzpgq8T3xCERBgFAWCCCGLoBBquPCnnD9DNX0EAnVUKGOdBSiUFarJcpBMeeq\nexiOIeWm77PJT1EVAArM9v342Eqi413oddenCBvWHYJ7GnnlWlPdJ+Y6c3mx\nuMpOk1A2m5ZpMZf2uJnP7Lm83ouDCF4ep+QT/sMRMmIGRsEo4+n7ptFFdchd\n29JZccbPZfO4wpAm89VpY8V3uvKzIAK1/MrmH/P2fsJwsIqwxEFB6IHAG1A+\nWuFpQKFmHN99dtNcq0jQhL9q4ld5yaje8wX3hGtJAPUhmswc/ol1PoLYh+hc\nh8aeiv648y5fkebsdFuVzazr6W9vumKw5uMIcPAUzdD0l4wUA/GITOg7YxcW\n4hS5\r\n=WcDN\r\n-----END PGP SIGNATURE-----\r\n"},"gitHead":"aa0a27f38f067ed5d174846c953aaa1e64674959","scripts":{"ci":"npm run check && npm test","fmt":"mongodb-js-fmt ./*.js lib/*.js ./test/*.js","test":"mocha","check":"mongodb-js-precommit","pretest":"mongodb-runner install"},"_npmUser":{"name":"durran","email":"durran@gmail.com"},"precommit":["check"],"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"6.4.1","description":"MongoDB connection model.","directories":{},"_nodeVersion":"10.2.1","dependencies":{"raf":"^3.4.1","ssh2":"^0.5.4","async":"^2.1.5","debug":"^2.6.0","backoff":"^2.4.1","mongodb":"^3.2.7","kerberos":"^1.1.2","lodash.omit":"^4.5.0","lodash.clone":"^4.5.0","mongodb-core":"^3.2.7","lodash.assign":"^4.2.0","storage-mixin":"^3.1.1","ampersand-model":"^8.0.0","lodash.defaults":"^4.2.0","lodash.includes":"^4.3.0","lodash.isstring":"^4.0.1","lodash.unescape":"^4.0.1","lodash.isfunction":"^3.0.9","ampersand-rest-collection":"^6.0.0"},"_hasShrinkwrap":false,"devDependencies":{"bson":"^4.0.1","chai":"^4.2.0","uuid":"^3.3.2","mocha":"^3.2.0","sinon":"^1.17.7","electron":"^4.0.6","pre-commit":"^1.1.2","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^2.0.2","lodash.foreach":"^4.5.0","mongodb-js-fmt":"^1.0.0","mongodb-runner":"^4.7.2","mongodb-js-precommit":"^2.0.0","eslint-config-mongodb-js":"^5.0.3","mongodb-connection-fixture":"^0.0.14"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_14.1.1_1566768825766_0.9368652726383704","host":"s3://npm-registry-packages"}},"14.2.0":{"name":"mongodb-connection-model","version":"14.2.0","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@14.2.0","maintainers":[{"name":"aherlihy","email":"anna@mongodb.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"brookescarlett","email":"brooke.yalof@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"cilix","email":"matthewlevenstein@gmail.com"},{"name":"daprahamian","email":"dan.aprahamian@gmail.com"},{"name":"deafgoat","email":"deafgoat@gmail.com"},{"name":"deepshah","email":"deepcshah@gmail.com"},{"name":"dpercy","email":"davetp425@gmail.com"},{"name":"durran","email":"durran@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"glowe","email":"graham.lowe@gmail.com"},{"name":"gregg.b","email":"gregg.brewster@mongodb.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"jimol","email":"jim.oleary@gmail.com"},{"name":"jon.franco","email":"jon.franco@mongodb.com"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"lrlna","email":"shestak.irina@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"micheal.parks","email":"michealparks1989@gmail.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"mpobrien","email":"mpobrien005@gmail.com"},{"name":"redondos","email":"aolivera@gmail.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"ryantimmons","email":"ryan@rytim.com"},{"name":"sampoonachot","email":"joy.sampoonachot@10gen.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"schwartzrw","email":"schwartzrw@gmail.com"},{"name":"scottsidwell","email":"developer@scottsidwell.id.au"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"srv-charts-read-only","email":"team-charts@10gen.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"terakilobyte","email":"terakilobyte@gmail.com"},{"name":"thomaslangston-mongodb","email":"thomas.langston@mongodb.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"469aab09c931b6470eb816c7cf13492860d946ca","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-14.2.0.tgz","fileCount":21,"integrity":"sha512-kpLKeJEr8d/41EmW+x+1zegFFhwv6RseDVM10u+MuEMxzohFkIlICSVRUB0wCRGp9oyoEQ07z8H9rq4mishhAA==","signatures":[{"sig":"MEYCIQCloK46u51t157lnGgTJErsB2ZNKpC4/h4KsEQwKqu4VgIhAMW5KMTymeswK5iAyNqT6ZgTLfqvJ97RaLqaVoTlpBWF","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":91627,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJddma0CRA9TVsSAnZWagAARqwP/RkHlfh5vrXEifCWc46j\n/8nUFImzK2GauonzuEB4Hpm0sa07B+YujYD8D3CydNgUVgAfPBH+Aa2Fr7nC\nZdu3jvzKISSBhPPMCyMvTfkbyNbu7M6x+MDGRwU40qwLXlpnzTiKjkftindg\noJpQfoWIepTAH2qgObnrTc+ttqVIAbjPPmKU/6Tsloegt5yFRX2QozWhaltH\nnJq9ZKACBBgFWt8ZtSSQetJHlCk4FHnU3zvDPoK+l5909X4LxHey5CwUXLom\neXcdEe1A7mRSpKrPMPR6AH2nhisgOoExE1M6QshKfb2FvGYAtQ4QGv5aKWpc\nt8GYIQxZ9AfTNFc1J15SJgwJFNZvd3Lz6xOvTJgAkqDUfdNXe1W+RCQMhRXK\nADFgkIB9DBdjpiiJ2VPcaQR2X/yh2uWYsSfuCIKcygIhoU4ilrV4SWHEzNWj\nLt902C/e6iacPuA16BfFgXki7ZU6ohDj/aWn5b3S2tBOzBw4GSANbDudOMzq\nn97LewF6MARHg+p99YYfhUsILEl4a4rRYYY4YaLLBjo+vQXlt8P0JKaGEuWY\nEB1WOZfvIA6rIMT/dtB5Yradfkp6RgkFAE9+0zeHSBT5Tpwzf6tzD9DJmMZk\nfKKQAY2AYEWuzpyck9udcZLUqGCAatFodtN16bfIGV2r7cT+OK5yuCrCGqWX\nXc5p\r\n=eatR\r\n-----END PGP SIGNATURE-----\r\n"},"gitHead":"01fdb80718bc9f7fdd73afe218c913aba903a33c","scripts":{"ci":"npm run check && npm test","fmt":"mongodb-js-fmt ./*.js lib/*.js ./test/*.js","test":"mocha","check":"mongodb-js-precommit","pretest":"mongodb-runner install"},"_npmUser":{"name":"durran","email":"durran@gmail.com"},"precommit":["check"],"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"6.4.1","description":"MongoDB connection model.","directories":{},"_nodeVersion":"10.2.1","dependencies":{"raf":"^3.4.1","ssh2":"^0.5.4","async":"^2.1.5","debug":"^2.6.0","backoff":"^2.4.1","mongodb":"^3.2.7","kerberos":"^1.1.2","lodash.omit":"^4.5.0","lodash.clone":"^4.5.0","mongodb-core":"^3.2.7","lodash.assign":"^4.2.0","storage-mixin":"^3.2.0","ampersand-model":"^8.0.0","lodash.defaults":"^4.2.0","lodash.includes":"^4.3.0","lodash.isstring":"^4.0.1","lodash.unescape":"^4.0.1","lodash.isfunction":"^3.0.9","ampersand-rest-collection":"^6.0.0"},"_hasShrinkwrap":false,"devDependencies":{"bson":"^4.0.1","chai":"^4.2.0","uuid":"^3.3.2","mocha":"^3.2.0","sinon":"^1.17.7","electron":"^4.0.6","pre-commit":"^1.1.2","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^2.0.2","lodash.foreach":"^4.5.0","mongodb-js-fmt":"^1.0.0","mongodb-runner":"^4.7.2","mongodb-js-precommit":"^2.0.0","eslint-config-mongodb-js":"^5.0.3","mongodb-connection-fixture":"^0.0.14"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_14.2.0_1568040627354_0.22908264071620033","host":"s3://npm-registry-packages"}},"14.2.2":{"name":"mongodb-connection-model","version":"14.2.2","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@14.2.2","maintainers":[{"name":"aherlihy","email":"anna@mongodb.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"brookescarlett","email":"brooke.yalof@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"cilix","email":"matthewlevenstein@gmail.com"},{"name":"daprahamian","email":"dan.aprahamian@gmail.com"},{"name":"deafgoat","email":"deafgoat@gmail.com"},{"name":"deepshah","email":"deepcshah@gmail.com"},{"name":"dpercy","email":"davetp425@gmail.com"},{"name":"durran","email":"durran@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"glowe","email":"graham.lowe@gmail.com"},{"name":"gregg.b","email":"gregg.brewster@mongodb.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"jimol","email":"jim.oleary@gmail.com"},{"name":"jon.franco","email":"jon.franco@mongodb.com"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"lrlna","email":"shestak.irina@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"micheal.parks","email":"michealparks1989@gmail.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"mpobrien","email":"mpobrien005@gmail.com"},{"name":"redondos","email":"aolivera@gmail.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"ryantimmons","email":"ryan@rytim.com"},{"name":"sampoonachot","email":"joy.sampoonachot@10gen.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"schwartzrw","email":"schwartzrw@gmail.com"},{"name":"scottsidwell","email":"developer@scottsidwell.id.au"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"srv-charts-read-only","email":"team-charts@10gen.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"terakilobyte","email":"terakilobyte@gmail.com"},{"name":"thomaslangston-mongodb","email":"thomas.langston@mongodb.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"1aacc396095a9b13f96d5ad66de137fddca87fb8","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-14.2.2.tgz","fileCount":21,"integrity":"sha512-wXB/0lhcL9PiWBvLDDTrJvAnpSdX6RAY3C/cRE0LCTW/pdjDAZXFcK9Ok424JcikCMicZkFG2FsHGtF2rs+IWg==","signatures":[{"sig":"MEUCIQD5Ea4pBva/EG+RyDq76YfutfqIwohLfmMjnNoCefVhbQIgMTMNlzttYlVI/DG4xHWS56fAns/UnyDuWX7qG5eGkdA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":91684,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdd3WKCRA9TVsSAnZWagAA+vIP+gONBUHM2xAoyTgC8pG5\nghp68tnt9YoosrIMU6pwnU4RFno4L2zyOCCxETpiSzZDyj6Jaj6T4hbkpIQd\n59hD4bnT5yZYBzDW+B5GHIFy4Xk6R/uHw5EWGLSwvIZdL1SBAO0Vdj7ib1g3\n7XR9eRGuI6FBZJYXIBRjRL7T1bmguoaXibrhU2jInZl8l+eINtyQf/SRoB2T\n7AeWuKs2QiuAB1ZzRar/wM1FIHeftZPX1rZ5bfUZiz9dqlfP5MJpHi7IoMgX\nG4QroSQdySGdGdPgT+Q1h1xJqM/Bi82FSJJZoB/UZDfZ6GsFkg7x4eoSyMdC\na/gdCnewQFCiFbBcMjnFlBZjppyZhKly6FAKIF3sEtwxDA/3sQRXtlMXHqDP\noWoCD+Ei0MY8UfXcoUBY66lXGzFOVb4Tti1oyfjZl6xRRdKzYafjHXbLVHLO\nX9Urvl/2f6q/KpJNqNqxZNOPjPhmmUMdbgyomNL/EeP7GuWtGW1K0kvrHDS8\n09S/93tVKU1LlmVMXbgW5zk6/iIuhbAa4eVhDpSpLBRDIznMkBHOFxetaBS6\nYzbieFTBkVhILAYu/8WNbqr1Y4NITcSKHcmy9nXdrBcunjBVXpdPWW2UMgI1\n4xy14PehxtYq9iGZYpAY2+Pq9p7H8OBNpThM+CiFnRnXykbBCXxycEHY+sb0\nGgsv\r\n=yHM1\r\n-----END PGP SIGNATURE-----\r\n"},"gitHead":"25147762ecfae8265c4d1a54ad65cce25b29bb99","scripts":{"ci":"npm run check && npm test","fmt":"mongodb-js-fmt ./*.js lib/*.js ./test/*.js","test":"mocha","check":"mongodb-js-precommit","pretest":"mongodb-runner install"},"_npmUser":{"name":"durran","email":"durran@gmail.com"},"precommit":["check"],"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"6.4.1","description":"MongoDB connection model.","directories":{},"_nodeVersion":"10.2.1","dependencies":{"raf":"^3.4.1","ssh2":"^0.5.4","async":"^2.1.5","debug":"^2.6.0","backoff":"^2.4.1","mongodb":"^3.2.7","kerberos":"^1.1.2","lodash.omit":"^4.5.0","lodash.clone":"^4.5.0","mongodb-core":"^3.2.7","lodash.assign":"^4.2.0","storage-mixin":"^3.2.1","ampersand-model":"^8.0.0","lodash.defaults":"^4.2.0","lodash.includes":"^4.3.0","lodash.isstring":"^4.0.1","lodash.unescape":"^4.0.1","lodash.isfunction":"^3.0.9","ampersand-rest-collection":"^6.0.0"},"_hasShrinkwrap":false,"devDependencies":{"bson":"^4.0.1","chai":"^4.2.0","uuid":"^3.3.2","mocha":"^3.2.0","sinon":"^1.17.7","electron":"^4.0.6","pre-commit":"^1.1.2","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^2.0.2","lodash.foreach":"^4.5.0","mongodb-js-fmt":"^1.0.0","mongodb-runner":"^4.7.2","mongodb-js-precommit":"^2.0.0","eslint-config-mongodb-js":"^5.0.3","mongodb-connection-fixture":"^0.0.14"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_14.2.2_1568109961796_0.24674021424667103","host":"s3://npm-registry-packages"}},"14.2.3":{"name":"mongodb-connection-model","version":"14.2.3","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@14.2.3","maintainers":[{"name":"aherlihy","email":"anna@mongodb.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"brookescarlett","email":"brooke.yalof@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"cilix","email":"matthewlevenstein@gmail.com"},{"name":"daprahamian","email":"dan.aprahamian@gmail.com"},{"name":"deafgoat","email":"deafgoat@gmail.com"},{"name":"deepshah","email":"deepcshah@gmail.com"},{"name":"dpercy","email":"davetp425@gmail.com"},{"name":"durran","email":"durran@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"glowe","email":"graham.lowe@gmail.com"},{"name":"gregg.b","email":"gregg.brewster@mongodb.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"jimol","email":"jim.oleary@gmail.com"},{"name":"jon.franco","email":"jon.franco@mongodb.com"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"lrlna","email":"shestak.irina@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"micheal.parks","email":"michealparks1989@gmail.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"mpobrien","email":"mpobrien005@gmail.com"},{"name":"redondos","email":"aolivera@gmail.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"ryantimmons","email":"ryan@rytim.com"},{"name":"sampoonachot","email":"joy.sampoonachot@10gen.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"schwartzrw","email":"schwartzrw@gmail.com"},{"name":"scottsidwell","email":"developer@scottsidwell.id.au"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"srv-charts-read-only","email":"team-charts@10gen.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"terakilobyte","email":"terakilobyte@gmail.com"},{"name":"thomaslangston-mongodb","email":"thomas.langston@mongodb.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"e1116fdbaab60b5739cb7a8492447a3775dd13cd","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-14.2.3.tgz","fileCount":21,"integrity":"sha512-ADnRITMmGj/+g0t0S8nXtQXw9GFKwUUlxmbsllsa1teH4IZ1WYJUeqP+uJQFLxrXQs7S4Ggu5uUNuC4252jHYw==","signatures":[{"sig":"MEQCIDywrZ7tVxJ0RKckcmUaDJ1a9JtOXEpaUEl5nqHE0Q6jAiBHTBBbHmJ5FVgLHdKaGuyYVmEPrYj0XDKDRrgH+voJkQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":91688,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdd31FCRA9TVsSAnZWagAAEOUP/2bFOrzKYraoXkEQtpLY\nXPVGJMNANDEADsM7hpWmP/nURUXbUhnsnfAhs6cLBRY5bbNhIjUzvXGKWdwu\nMPVA1yT5YgwUZCt+KSPe6cqiPRwEctxhclE2+/gq17JXdyY24u1a23TEipX0\nBvcsRCLbs2bo8KrrZgZzuEqBDZYkFj/0SesUXujv5W5HcQH2T3P0FmzZl9F2\nLlC8xuZj5qRZ/YSaQsMhDZ1nmod8QVY34H9Y9gloaX68sNpJoZn2zUKXM4cZ\n0qmhZo+u2XUFszMrB2Vk792s9RPOc7wev75g+1tkKs2LncSlMIER6SYyNtZV\nKvGUrmAmjzBofR0EKMQ0TeJweqvHPUrVzUhyx8tNB7t4iT8Vx3C1AS9YSBdq\nK1ttOsg22Zk9ZaSCQthlCwmHtEgfXYsspwU/wq4gUwpdWjtaKp/1G7ajv9F6\no6xJpwkEU0SYk7XwlzRH34UIvtyuCm9GpMV52/pg8ewnq1Cc2wvp8MWB0fha\nGrRmSOaXNEqZ2cjkGZCICPl4+Q42ocDB5Yq/WqnvcjJezJap4bxeOOhTqEXq\nL2yknFMnhxgzjL1LabVFy2ak3Zyuwc8SK1ckwSHZo63NSG+fBNpiWQkyD+dz\nIDb8OdbAaSXJO4eW/wDM2pC8h4JBprGZl7luglM1Vaa+7y1Jhe4j0DtROVWq\nfvSr\r\n=Jbse\r\n-----END PGP SIGNATURE-----\r\n"},"gitHead":"867916326eaa1a99ffc94c9219d9e1a0c3f30fac","scripts":{"ci":"npm run check && npm test","fmt":"mongodb-js-fmt ./*.js lib/*.js ./test/*.js","test":"mocha","check":"mongodb-js-precommit","pretest":"mongodb-runner install"},"_npmUser":{"name":"durran","email":"durran@gmail.com"},"precommit":["check"],"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"6.4.1","description":"MongoDB connection model.","directories":{},"_nodeVersion":"10.2.1","dependencies":{"raf":"^3.4.1","ssh2":"^0.5.4","async":"^2.1.5","debug":"^2.6.0","backoff":"^2.4.1","mongodb":"^3.2.7","kerberos":"^1.1.2","lodash.omit":"^4.5.0","lodash.clone":"^4.5.0","mongodb-core":"^3.2.7","lodash.assign":"^4.2.0","storage-mixin":"^3.2.3","ampersand-model":"^8.0.0","lodash.defaults":"^4.2.0","lodash.includes":"^4.3.0","lodash.isstring":"^4.0.1","lodash.unescape":"^4.0.1","lodash.isfunction":"^3.0.9","ampersand-rest-collection":"^6.0.0"},"_hasShrinkwrap":false,"devDependencies":{"bson":"^4.0.1","chai":"^4.2.0","uuid":"^3.3.2","mocha":"^3.2.0","sinon":"^1.17.7","electron":"^4.0.6","pre-commit":"^1.1.2","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^2.0.2","lodash.foreach":"^4.5.0","mongodb-js-fmt":"^1.0.0","mongodb-runner":"^4.7.2","mongodb-js-precommit":"^2.0.0","eslint-config-mongodb-js":"^5.0.3","mongodb-connection-fixture":"^0.0.14"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_14.2.3_1568111940284_0.6187588424997135","host":"s3://npm-registry-packages"}},"14.2.4":{"name":"mongodb-connection-model","version":"14.2.4","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@14.2.4","maintainers":[{"name":"aherlihy","email":"anna@mongodb.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"brookescarlett","email":"brooke.yalof@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"cilix","email":"matthewlevenstein@gmail.com"},{"name":"daprahamian","email":"dan.aprahamian@gmail.com"},{"name":"deafgoat","email":"deafgoat@gmail.com"},{"name":"deepshah","email":"deepcshah@gmail.com"},{"name":"dpercy","email":"davetp425@gmail.com"},{"name":"durran","email":"durran@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"glowe","email":"graham.lowe@gmail.com"},{"name":"gregg.b","email":"gregg.brewster@mongodb.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"jimol","email":"jim.oleary@gmail.com"},{"name":"jon.franco","email":"jon.franco@mongodb.com"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"lrlna","email":"shestak.irina@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"micheal.parks","email":"michealparks1989@gmail.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"mpobrien","email":"mpobrien005@gmail.com"},{"name":"redondos","email":"aolivera@gmail.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"ryantimmons","email":"ryan@rytim.com"},{"name":"sampoonachot","email":"joy.sampoonachot@10gen.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"schwartzrw","email":"schwartzrw@gmail.com"},{"name":"scottsidwell","email":"developer@scottsidwell.id.au"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"srv-charts-read-only","email":"team-charts@10gen.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"terakilobyte","email":"terakilobyte@gmail.com"},{"name":"thomaslangston-mongodb","email":"thomas.langston@mongodb.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"863385b2773fccbf97e20039e9c0abf5bcfe4ce1","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-14.2.4.tgz","fileCount":21,"integrity":"sha512-Nuu3hIg+9ogsM1ZRVkj/C/FOMlrwZT/kjXwRGQuHs+9F7QCnG01WIAJYFbjSy/gS0d2yifzCMDsoIVHqXxy8Bg==","signatures":[{"sig":"MEYCIQDucCnuY/VYNj3PXnRRAV1EUasKChL+PJAXVh5W8CxJZwIhAI3QBeP6aZseVQP86vV0GLwepsB+3yAqcMGdYic8p+MQ","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":91691,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdd58+CRA9TVsSAnZWagAA/bwQAI9bZvCHEshTXGCUs2xC\nsrpTMfjyApi5MlZLqfikqR0uq5k/hPBy+2JPFoGh5rmqmMXHbCVFyfExu7RY\nmBw6yDULpPKsn4uuUfru6+9LAGByNit5QFd5RaLlA4P9azNirhupLnEaI4Po\nO8iFprVrN9zoN2u8C+TEKHMfKNswyxD1rPtU7YY77Sv++flk9vuUytI4GoH/\nZXi3P26r4K+GCY+GrYULeyrtCfq2jH66Ej+PUW4YJwf0EqoeZ2PimwGikLg/\nglNco5b1moZTX8ZWoLHIGOK0zT9pYFP9CtzUu9zfJCyhqGOdoCtq6VDLnwFr\nJdrZnn/PUJuIAiqyf+m2adFo2QjOmNmlmKI9GSP7Ly6jEy7lrjjMwSpR36Bc\n+SLj8riKgkV3r/Sm1tJdPS7ei0HLezlVyqiN46xqFI5i/9pmzqfJ1Lm8nym4\ndI4PZPBh0rxzq+az+4v7pmoWGiDM9XGSGG5DA9LTr0Z1HiAwetsqFhucx6L/\nxXCDSALMjNbU+QR4d+PmIVxMyaAOqB2V8zIkl5f6002t2b97ve5mnClIFnGZ\nL4HvR5ufnqFr443XO7z7wkDdGQngFS7fcnjsIqTM4z3q+3xWGy8L0fSE6f6e\nfL4nMYrrpMYOsl54rNAsy3SfgZOWecNCCngTf/wnU8KyeJ0dTiReCDXE9cP1\nuhvW\r\n=kl7+\r\n-----END PGP SIGNATURE-----\r\n"},"gitHead":"e5b51be2503c7f49c7c2cfe752d7340162405e89","scripts":{"ci":"npm run check && npm test","fmt":"mongodb-js-fmt ./*.js lib/*.js ./test/*.js","test":"mocha","check":"mongodb-js-precommit","pretest":"mongodb-runner install"},"_npmUser":{"name":"alena.khineika","email":"alena.khineika@gmail.com"},"precommit":["check"],"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"6.7.0","description":"MongoDB connection model.","directories":{},"_nodeVersion":"10.2.1","dependencies":{"raf":"^3.4.1","ssh2":"^0.5.4","async":"^2.1.5","debug":"^2.6.0","backoff":"^2.4.1","mongodb":"^3.2.7","kerberos":"^1.1.2","lodash.omit":"^4.5.0","lodash.clone":"^4.5.0","mongodb-core":"^3.2.7","lodash.assign":"^4.2.0","storage-mixin":"^3.2.3","ampersand-model":"^8.0.0","lodash.defaults":"^4.2.0","lodash.includes":"^4.3.0","lodash.isstring":"^4.0.1","lodash.unescape":"^4.0.1","lodash.isfunction":"^3.0.9","ampersand-rest-collection":"^6.0.0"},"_hasShrinkwrap":false,"devDependencies":{"bson":"^4.0.1","chai":"^4.2.0","uuid":"^3.3.2","mocha":"^3.2.0","sinon":"^1.17.7","electron":"^4.0.6","pre-commit":"^1.1.2","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^2.0.2","lodash.foreach":"^4.5.0","mongodb-js-fmt":"^1.0.0","mongodb-runner":"^4.7.2","mongodb-js-precommit":"^2.0.0","eslint-config-mongodb-js":"^5.0.3","mongodb-connection-fixture":"^0.0.14"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_14.2.4_1568120637696_0.3590810730992773","host":"s3://npm-registry-packages"}},"14.2.5":{"name":"mongodb-connection-model","version":"14.2.5","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@14.2.5","maintainers":[{"name":"aherlihy","email":"anna@mongodb.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"brookescarlett","email":"brooke.yalof@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"cilix","email":"matthewlevenstein@gmail.com"},{"name":"daprahamian","email":"dan.aprahamian@gmail.com"},{"name":"deafgoat","email":"deafgoat@gmail.com"},{"name":"deepshah","email":"deepcshah@gmail.com"},{"name":"dpercy","email":"davetp425@gmail.com"},{"name":"durran","email":"durran@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"glowe","email":"graham.lowe@gmail.com"},{"name":"gregg.b","email":"gregg.brewster@mongodb.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"jimol","email":"jim.oleary@gmail.com"},{"name":"jon.franco","email":"jon.franco@mongodb.com"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"lrlna","email":"shestak.irina@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"micheal.parks","email":"michealparks1989@gmail.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"mpobrien","email":"mpobrien005@gmail.com"},{"name":"redondos","email":"aolivera@gmail.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"ryantimmons","email":"ryan@rytim.com"},{"name":"sampoonachot","email":"joy.sampoonachot@10gen.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"schwartzrw","email":"schwartzrw@gmail.com"},{"name":"scottsidwell","email":"developer@scottsidwell.id.au"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"srv-charts-read-only","email":"team-charts@10gen.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"terakilobyte","email":"terakilobyte@gmail.com"},{"name":"thomaslangston-mongodb","email":"thomas.langston@mongodb.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"be6ac7203e600c6a9b08a61abc14832c7aa3cc56","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-14.2.5.tgz","fileCount":21,"integrity":"sha512-Arpd/vkBoDXXYInMUcoR5Veet3j0mvw7oefMn+7RqhyAocwcw34JVL+dZYm7jhUqq25r/Jcb/HJtXAiDcJMBcA==","signatures":[{"sig":"MEYCIQC7N9kSqbl2HthvptQdmeLHg3mV1v8eQUbLr0wXrrQaNQIhAPDKTW5QCw8536iuSGRa9x+iucTXe+JcMvHuFu87mUPG","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":91691,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdehbhCRA9TVsSAnZWagAAZGkQAJeCzC45V34/fomWLJBe\nbS4sKy9pAzL0GI2na7PIf8QsJMC3/eQDee+U8dkI7CypcGt01DKko0sT2Ntn\n/PdFSJ96/wDhbuFojnfqPAm/PnIfNKi+HCY5hUEIuAbKH8LY7sFfVpgnVj8H\nWm7GNPfavK0ftdgaZybiNdqRT5x7gdgDs8OrUbzS4liMAkdllDC6e51JX5cv\nD2Yd4FgjlZa5En6FpOt7C8hbsZNktZ5Rt7h5XXe3ccElKe4TpjM+jHm2Vnyt\nTAzOtl+YdJ190xWLek/t5CqmkkZp+oTrMYBqdRp+isGmyHDZOMexrUIvvrSn\nw74S5vR/dFaNUD7w0zbZg6xIjRZGnLKBfzhLE9c7nNqZ94sNC6tuWYjhFYlD\n8xWRjI2DKQ3jwIGFJ1sIIbTqWwxhc3t8l0eyoRZwIb/IWknv3lTDszGv8+lx\n9GpEdiPEKab+AZN7XcGlG3xKB19QQdehVSch6ApIT1zAIawH9XGCpKOKlUcg\nIOFX/KD653hVo5xKYq9rTDd2M5Tkx+BbMZZbRtZgRAiMf3RpfJCtvC7OLqtk\nOTFZt0kOzIUYSJjwiuplsEtYnQUtonJ4CIXL/qhAoSwY9qnDhxzoJKtHG9f2\nTOi3CZmHUryUHGr+iNovusxAzaQHeI5Cv5ZkYsoh7YRvuFqUxomSwnu9975m\nv+Eu\r\n=iAO2\r\n-----END PGP SIGNATURE-----\r\n"},"gitHead":"0b5ca140a46b5bc1205cceb4fa557434ef875b2f","scripts":{"ci":"npm run check && npm test","fmt":"mongodb-js-fmt ./*.js lib/*.js ./test/*.js","test":"mocha","check":"mongodb-js-precommit","pretest":"mongodb-runner install"},"_npmUser":{"name":"durran","email":"durran@gmail.com"},"precommit":["check"],"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"6.4.1","description":"MongoDB connection model.","directories":{},"_nodeVersion":"10.2.1","dependencies":{"raf":"^3.4.1","ssh2":"^0.5.4","async":"^2.1.5","debug":"^2.6.0","backoff":"^2.4.1","mongodb":"^3.2.7","kerberos":"^1.1.2","lodash.omit":"^4.5.0","lodash.clone":"^4.5.0","mongodb-core":"^3.2.7","lodash.assign":"^4.2.0","storage-mixin":"^3.2.4","ampersand-model":"^8.0.0","lodash.defaults":"^4.2.0","lodash.includes":"^4.3.0","lodash.isstring":"^4.0.1","lodash.unescape":"^4.0.1","lodash.isfunction":"^3.0.9","ampersand-rest-collection":"^6.0.0"},"_hasShrinkwrap":false,"devDependencies":{"bson":"^4.0.1","chai":"^4.2.0","uuid":"^3.3.2","mocha":"^3.2.0","sinon":"^1.17.7","electron":"^4.0.6","pre-commit":"^1.1.2","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^2.0.2","lodash.foreach":"^4.5.0","mongodb-js-fmt":"^1.0.0","mongodb-runner":"^4.7.2","mongodb-js-precommit":"^2.0.0","eslint-config-mongodb-js":"^5.0.3","mongodb-connection-fixture":"^0.0.14"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_14.2.5_1568282336276_0.19720376287847774","host":"s3://npm-registry-packages"}},"14.2.6":{"name":"mongodb-connection-model","version":"14.2.6","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@14.2.6","maintainers":[{"name":"aherlihy","email":"anna@mongodb.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"brookescarlett","email":"brooke.yalof@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"cilix","email":"matthewlevenstein@gmail.com"},{"name":"daprahamian","email":"dan.aprahamian@gmail.com"},{"name":"deafgoat","email":"deafgoat@gmail.com"},{"name":"deepshah","email":"deepcshah@gmail.com"},{"name":"dpercy","email":"davetp425@gmail.com"},{"name":"durran","email":"durran@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"glowe","email":"graham.lowe@gmail.com"},{"name":"gregg.b","email":"gregg.brewster@mongodb.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"jimol","email":"jim.oleary@gmail.com"},{"name":"jon.franco","email":"jon.franco@mongodb.com"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"lrlna","email":"shestak.irina@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"micheal.parks","email":"michealparks1989@gmail.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"mpobrien","email":"mpobrien005@gmail.com"},{"name":"redondos","email":"aolivera@gmail.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"ryantimmons","email":"ryan@rytim.com"},{"name":"sampoonachot","email":"joy.sampoonachot@10gen.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"schwartzrw","email":"schwartzrw@gmail.com"},{"name":"scottsidwell","email":"developer@scottsidwell.id.au"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"srv-charts-read-only","email":"team-charts@10gen.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"terakilobyte","email":"terakilobyte@gmail.com"},{"name":"thomaslangston-mongodb","email":"thomas.langston@mongodb.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"5abfa152ffbcb858135028f6c1ecf5949c4f1aee","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-14.2.6.tgz","fileCount":21,"integrity":"sha512-W4aQJHioMZalZE5Jf+eGCorBRo8420iW593LohtUHCYOaVydehLyzfIiY1VaXTRsYy4T95kPRq2uzSQKqUFE5Q==","signatures":[{"sig":"MEQCICSpbqx0FpvBhcxs+nQIQ+N+IqrBpQYsR1DO6mobaAnWAiAL1Pw31egbxiOb7++Y/SZiRVMTacpxvHKCMyzqdodJYw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":91652,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJde2FnCRA9TVsSAnZWagAAHjkQAIhVEuieNWGFGV1SkV04\nLhOudB1kiSwqIiw3KEVCby5QOMFGJmduNqDNIoK7utPQziRvmbjxUgQJiwrN\nhP9vPRXxpjZjMq61uBYzUXUUADHn3NG+B++bUM9m1riSXGKgRnMB5vnXmQCk\nXCktBOtotCZFJ+8+ddCsol3TK6tGbiQA32di6UBNsV46Q4z+XENciCdpu6Vs\nlIYRCJqLrRSvY3K64et+94rsM5CnXt49CvJKI2rWj1FwyB0sc1RggEcs+Mm1\nniYmW3IpxBL9GpKjfMJp/6iw8UyIduYr7hS4JM4fxWHmSJwz5x/PF9VVnsb4\n4mFXpdNpTpQrvbieZj/8eC1yeIvH0zYseTGawGQWKG/AXJ1KiC+/4MR0H9DU\nXXsuw3xgqY2fjIw2kjo5n2+dKOykITrKpriyc3v6P5Zt7GWTppAdpiVnrkMG\nV7K2mbA33bfazM7cpJcr7ROy56uYb+n6RHaPbfzWuIZ9nMoWbuX6xUiFDnfF\nJwxFk5OHWQE+jfCExyNmJrZJqe2ldSRQSDsW/mAFdYCoAII9D5KF/IeSV2du\nMJzY4Jj+MEfcBvpzVvaQ8Vysi1b/kyAkUC2zTvxLhzgcffYDV/kv2gDugfC4\n/xdbgErYhoNRH4go4vUo27qN3gjebFUIFYTLPV5BOkpCXj+ncaBTseNoB7/l\n5BsJ\r\n=pJlT\r\n-----END PGP SIGNATURE-----\r\n"},"gitHead":"82be65567617e18b2cb97106fd115ac4a8e8a916","scripts":{"ci":"npm run check && npm test","fmt":"mongodb-js-fmt ./*.js lib/*.js ./test/*.js","test":"mocha","check":"mongodb-js-precommit","pretest":"mongodb-runner install"},"_npmUser":{"name":"alena.khineika","email":"alena.khineika@gmail.com"},"precommit":["check"],"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"6.7.0","description":"MongoDB connection model.","directories":{},"_nodeVersion":"10.2.1","dependencies":{"raf":"^3.4.1","ssh2":"^0.5.4","async":"^2.1.5","debug":"^2.6.0","backoff":"^2.4.1","mongodb":"^3.2.7","kerberos":"^1.1.2","lodash.omit":"^4.5.0","lodash.clone":"^4.5.0","mongodb-core":"^3.2.7","lodash.assign":"^4.2.0","storage-mixin":"^3.2.4","ampersand-model":"^8.0.0","lodash.defaults":"^4.2.0","lodash.includes":"^4.3.0","lodash.isstring":"^4.0.1","lodash.unescape":"^4.0.1","lodash.isfunction":"^3.0.9","ampersand-rest-collection":"^6.0.0"},"_hasShrinkwrap":false,"devDependencies":{"bson":"^4.0.1","chai":"^4.2.0","uuid":"^3.3.2","mocha":"^3.2.0","sinon":"^1.17.7","electron":"^4.0.6","pre-commit":"^1.1.2","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^2.0.2","lodash.foreach":"^4.5.0","mongodb-js-fmt":"^1.0.0","mongodb-runner":"^4.7.2","mongodb-js-precommit":"^2.0.0","eslint-config-mongodb-js":"^5.0.3","mongodb-connection-fixture":"^0.0.14"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_14.2.6_1568366950221_0.6714157623027788","host":"s3://npm-registry-packages"}},"14.2.7":{"name":"mongodb-connection-model","version":"14.2.7","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@14.2.7","maintainers":[{"name":"aherlihy","email":"anna@mongodb.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"brookescarlett","email":"brooke.yalof@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"cilix","email":"matthewlevenstein@gmail.com"},{"name":"daprahamian","email":"dan.aprahamian@gmail.com"},{"name":"deafgoat","email":"deafgoat@gmail.com"},{"name":"deepshah","email":"deepcshah@gmail.com"},{"name":"dpercy","email":"davetp425@gmail.com"},{"name":"durran","email":"durran@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"glowe","email":"graham.lowe@gmail.com"},{"name":"gregg.b","email":"gregg.brewster@mongodb.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"jimol","email":"jim.oleary@gmail.com"},{"name":"jon.franco","email":"jon.franco@mongodb.com"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"lrlna","email":"shestak.irina@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"micheal.parks","email":"michealparks1989@gmail.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"mpobrien","email":"mpobrien005@gmail.com"},{"name":"redondos","email":"aolivera@gmail.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"ryantimmons","email":"ryan@rytim.com"},{"name":"sampoonachot","email":"joy.sampoonachot@10gen.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"schwartzrw","email":"schwartzrw@gmail.com"},{"name":"scottsidwell","email":"developer@scottsidwell.id.au"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"srv-charts-read-only","email":"team-charts@10gen.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"terakilobyte","email":"terakilobyte@gmail.com"},{"name":"thomaslangston-mongodb","email":"thomas.langston@mongodb.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"b899278a10f7c3e41de0f4daad280497c70f7926","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-14.2.7.tgz","fileCount":21,"integrity":"sha512-9iC0QDUcALh+wLkmeH5TYnRiYk42AzDpJkcX67WZ+1PN5BM4zeZu969cL4mWOKCSnjweNKgu8rdzoIS+I/nXjw==","signatures":[{"sig":"MEYCIQCb/UGMBaJULhmN+PGB2J5JTx8PxINpAtilWtIDJBlR2wIhAKlZloNpbJ5Du16WeYzBbJhtsyvjHfXCrgqOrTmgVHxS","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":91652,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdgi+ZCRA9TVsSAnZWagAAlWYP/0cVhF8D9fuknLf3u/fs\nzMOEV2WSAFLT8ZAe3i7N1Y4h6VOSWt9s+O7KqtmnTvYLxkH++DxsppnVqspo\n5akFsC+9nUiFStEHUQVy42CJUZzdhZuhQeVCnwKlgoxP0+mMSRmu7nkkj4CM\noSGxvgm8uAXPyLs7KLh/uUyMUFHxTcyQUdBe1gvoezieBwA6JIBpjdQIWhuA\ncf3LLX/Xsg/zXCCBnyWrQrytXi7CtLI4yRCnjXGxozxH8TKmhUqedes+Y8k4\nQDTinIIkobEFL7Js4JNmHUz65dEWwQ1xDOtgKtMmlrOPgN5JRYq3VL8SaK0D\nvpADnaiiP/i4AFcCag4TmLDZzHdIK/tohzOU5azcsegYpo1pP6EYMGvwa+qA\nVfSIN+F6UVvfQjXMx5YEs424wbsb6P+BP+jEE992p7g9cpRy39m37XXVy52n\nfJl9FeotvVA3kzqfpT8UnEaxvbaAJQpyO6gWWRTVXEDHu5mK2BOUr+3uo2en\n2kOE7GQOfO5i6W2AJO4RlXRTsPhL9yKtaH5hF6vgcX+rC/Fuvhp19icBkghT\nwaGCFKg6eBu1ZweiRlEUF/whj+YCaYEov6HWr70Uq9wdPUKCQAruSAHXdBUD\nkZoGEeoEk72ai6UPVtI+MxVyPjZHcGX95yLk/TidkNjtZg9s/beyB9Twkfih\nGuYZ\r\n=WgZE\r\n-----END PGP SIGNATURE-----\r\n"},"gitHead":"49e217feadb165b4407f3ee71b07e0d8ab3f1880","scripts":{"ci":"npm run check && npm test","fmt":"mongodb-js-fmt ./*.js lib/*.js ./test/*.js","test":"mocha","check":"mongodb-js-precommit","pretest":"mongodb-runner install"},"_npmUser":{"name":"durran","email":"durran@gmail.com"},"precommit":["check"],"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"6.4.1","description":"MongoDB connection model.","directories":{},"_nodeVersion":"10.2.1","dependencies":{"raf":"^3.4.1","ssh2":"^0.5.4","async":"^2.1.5","debug":"^2.6.0","backoff":"^2.4.1","mongodb":"^3.2.7","kerberos":"^1.1.2","lodash.omit":"^4.5.0","lodash.clone":"^4.5.0","mongodb-core":"^3.2.7","lodash.assign":"^4.2.0","storage-mixin":"^3.2.5","ampersand-model":"^8.0.0","lodash.defaults":"^4.2.0","lodash.includes":"^4.3.0","lodash.isstring":"^4.0.1","lodash.unescape":"^4.0.1","lodash.isfunction":"^3.0.9","ampersand-rest-collection":"^6.0.0"},"_hasShrinkwrap":false,"devDependencies":{"bson":"^4.0.1","chai":"^4.2.0","uuid":"^3.3.2","mocha":"^3.2.0","sinon":"^1.17.7","electron":"^4.0.6","pre-commit":"^1.1.2","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^2.0.2","lodash.foreach":"^4.5.0","mongodb-js-fmt":"^1.0.0","mongodb-runner":"^4.7.2","mongodb-js-precommit":"^2.0.0","eslint-config-mongodb-js":"^5.0.3","mongodb-connection-fixture":"^0.0.14"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_14.2.7_1568812951278_0.3120506414818447","host":"s3://npm-registry-packages"}},"14.2.8":{"name":"mongodb-connection-model","version":"14.2.8","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@14.2.8","maintainers":[{"name":"aherlihy","email":"anna@mongodb.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"brookescarlett","email":"brooke.yalof@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"cilix","email":"matthewlevenstein@gmail.com"},{"name":"daprahamian","email":"dan.aprahamian@gmail.com"},{"name":"dcoupal","email":"daniel.coupal@mongodb.com"},{"name":"deafgoat","email":"deafgoat@gmail.com"},{"name":"deepshah","email":"deepcshah@gmail.com"},{"name":"dpercy","email":"davetp425@gmail.com"},{"name":"durran","email":"durran@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"glowe","email":"graham.lowe@gmail.com"},{"name":"gregg.b","email":"gregg.brewster@mongodb.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"jimol","email":"jim.oleary@gmail.com"},{"name":"jon.franco","email":"jon.franco@mongodb.com"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"lrlna","email":"shestak.irina@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"micheal.parks","email":"michealparks1989@gmail.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"mpobrien","email":"mpobrien005@gmail.com"},{"name":"redondos","email":"aolivera@gmail.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"ryantimmons","email":"ryan@rytim.com"},{"name":"sampoonachot","email":"joy.sampoonachot@10gen.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"schwartzrw","email":"schwartzrw@gmail.com"},{"name":"scottsidwell","email":"developer@scottsidwell.id.au"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"srv-charts-read-only","email":"team-charts@10gen.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"terakilobyte","email":"terakilobyte@gmail.com"},{"name":"thomaslangston-mongodb","email":"thomas.langston@mongodb.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"9772933b5eddfd2c940c8201b78d67167e8b07e2","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-14.2.8.tgz","fileCount":25,"integrity":"sha512-dvjryF90UyPmF6x9ENx3LwEuOR9z9mx8DNSN86Vy4RVp7eTmtnbGpDgKJwqFWguu3zFJlq5n2vHtXtWLwzGpBQ==","signatures":[{"sig":"MEQCIFcR7mikrq87h0O3a30k0CZrLkeWrpikoe4EYilhTfq6AiAe3dLvJUT0rVxMLYjJVs33QqSnl7XKeYI2IHtLW5uoaw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":94990,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdilrrCRA9TVsSAnZWagAAiFQP/3kX8q1seNz2coO/GhoG\nuLQHylndOb/O/iGx6dmATCw1BzPtntzV3jYGtp5ivE0uKieAZoSz4c/fpnno\nI4Ms6skaLuQPyX2jSnx/oEeXrcMbeReFXwgUdKumYl3g2yE/a+Lkbvb1msya\nlX949jEFeH/4Yi/Au7BOKtKpP3XmFNSnav7sBFI4hjrk8G7nSsBA8jsd5C8/\nNfZ5OSBhDb/LSqYKpO6GWsPU5WM4NLSFETnVU/lc4lFivyMYghuEikDVYLZW\nd1S9eY86a/eJ9Zn64Jtqxtt9QjI3ecNvar3C1eF+OYZCiHmSQJSeYMQGxMS0\nahbliHvHJvZBvU5oDPJRLyXxaK/AeFjM7g8NX+Utyewwn+gCrW0Be0zLfCtO\nFSBNTGS0ISxE8P0/hX0XiK0wKj2AkmKmt0z79Ll8WTtiAsIqM0Id6qm/wVej\nEk3M+THnsIqvD8eQLz+hyyYdJay3ItkNnTnC8DIqfH8YEzpuQFRhtg89YAgL\naHZoPSG7R0WSAQevBpnbi6c6f4WwUTutPs6JaXgXBJ/pgWXu5KOAs4LTYTSl\nRBk/lEek5HfRbIFRbMpUyatDNJyd+jqaHIOEfx+1/ooWV6l1LQYW6VZHtmmG\nbPPhcUvA+u8Pz0Vy+9UKswYwLA6H117YwICQmw1wo25y56U7lG6NroQNBMSF\nNotC\r\n=eSSF\r\n-----END PGP SIGNATURE-----\r\n"},"gitHead":"6a37e7b955124812584a5f4834cd321642cc2ff7","scripts":{"ci":"npm run check && npm test","fmt":"mongodb-js-fmt ./*.js lib/*.js ./test/*.js","test":"mocha","check":"mongodb-js-precommit","pretest":"mongodb-runner install"},"_npmUser":{"name":"durran","email":"durran@gmail.com"},"precommit":["check"],"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"6.4.1","description":"MongoDB connection model.","directories":{},"_nodeVersion":"10.2.1","dependencies":{"raf":"^3.4.1","ssh2":"^0.5.4","async":"^2.1.5","debug":"^2.6.0","backoff":"^2.4.1","mongodb":"^3.2.7","kerberos":"^1.1.2","lodash.omit":"^4.5.0","lodash.clone":"^4.5.0","mongodb-core":"^3.2.7","lodash.assign":"^4.2.0","storage-mixin":"^3.2.6","ampersand-model":"^8.0.0","lodash.defaults":"^4.2.0","lodash.includes":"^4.3.0","lodash.isstring":"^4.0.1","lodash.unescape":"^4.0.1","lodash.isfunction":"^3.0.9","ampersand-rest-collection":"^6.0.0"},"_hasShrinkwrap":false,"devDependencies":{"bson":"^4.0.1","chai":"^4.2.0","uuid":"^3.3.2","mocha":"^3.2.0","sinon":"^1.17.7","electron":"^4.0.6","pre-commit":"^1.1.2","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^2.0.2","lodash.foreach":"^4.5.0","mongodb-js-fmt":"^1.0.0","mongodb-runner":"^4.7.2","mongodb-js-precommit":"^2.0.0","eslint-config-mongodb-js":"^5.0.3","mongodb-connection-fixture":"^0.0.14"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_14.2.8_1569348330585_0.9713034690534965","host":"s3://npm-registry-packages"}},"14.3.0":{"name":"mongodb-connection-model","version":"14.3.0","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@14.3.0","maintainers":[{"name":"aherlihy","email":"anna@mongodb.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"brookescarlett","email":"brooke.yalof@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"cilix","email":"matthewlevenstein@gmail.com"},{"name":"daprahamian","email":"dan.aprahamian@gmail.com"},{"name":"dcoupal","email":"daniel.coupal@mongodb.com"},{"name":"deafgoat","email":"deafgoat@gmail.com"},{"name":"deepshah","email":"deepcshah@gmail.com"},{"name":"dpercy","email":"davetp425@gmail.com"},{"name":"durran","email":"durran@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"glowe","email":"graham.lowe@gmail.com"},{"name":"gregg.b","email":"gregg.brewster@mongodb.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"jimol","email":"jim.oleary@gmail.com"},{"name":"jon.franco","email":"jon.franco@mongodb.com"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"lrlna","email":"shestak.irina@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"micheal.parks","email":"michealparks1989@gmail.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"mpobrien","email":"mpobrien005@gmail.com"},{"name":"redondos","email":"aolivera@gmail.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"ryantimmons","email":"ryan@rytim.com"},{"name":"sampoonachot","email":"joy.sampoonachot@10gen.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"schwartzrw","email":"schwartzrw@gmail.com"},{"name":"scottsidwell","email":"developer@scottsidwell.id.au"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"srv-charts-read-only","email":"team-charts@10gen.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"terakilobyte","email":"terakilobyte@gmail.com"},{"name":"thomaslangston-mongodb","email":"thomas.langston@mongodb.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"ef265a75474e8f01652a8c5c36e520568ee7ebf4","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-14.3.0.tgz","fileCount":25,"integrity":"sha512-hOv/HrKxn6dt47FZK0ziOu69UEAigqvMplgTVOie/2yhxd24mwX/sjUC1tYML/bNIY3fTizdFqsBvLCGagtJ/g==","signatures":[{"sig":"MEYCIQCbxP0jrXbRRIXz1N1QbyTWPUpOnjU45rHpgoLXnEitRQIhAKRcgUupW6pgNdZflY5jW2QdVEg6q/+vr13AkSkdssla","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":94973,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdkdtpCRA9TVsSAnZWagAAWm8P/0qjiYihuBGOWbDJpUtZ\nbubwPpdXH1L5eQEDe11aE605YNxAr4B46yVSSxFVSpu11YMFShr0FMN7KHjv\nUXbaZCiRKKWSZcRE3khsek2+IdK9qQYaPczxEK5y1QbDfTNa3eafQ95rjegt\nZbCseRTSW1tmJ9XRY/lyFzg1Mh/AhBrNo65Hhbn9wvQgItaMQm1HPN+4C2Gq\nkEITfJ03kz+Ftts0dbXisFAt1oVY1Y2Yt7EDf+YpL4vBaZnuAqaPL4Kcfl5h\n8JYPKDJgLJC9jcIqVfR7qpIoxv1i5hmMupaM76pODamGcWnMZb6LYsSqxp21\nZHePOo5JPsMKZKpUvs1/9glO2JdUPg1av2+8Srp1UJd0Zi8VM5uDFWBpbjAr\nuzafdfuOiDgVnxYhTPRRiBP6ovYUMndf2dg0E/iyw/+izFtc0PCWqygpaoUt\nlD4lzhVq0zoQ/niW6ViBLwUSmCWeUW7sVU8m5a8+jHoIcVFLIgm4WCfqQdIZ\nfcXqaiguTOJO1iH1XgofOZQB+piReWs7RmPLsaooQFhSnaYdDK2zH+kivDIs\nDBnaJrTkzfnHi8m0bA7Rp9tE8HHeejN1sf8rhXMSljV5at5Su/UhHZ/KUo9M\nzySSPFpCECw0m1lHY9jTr+8jHVn7FaP+YuUgQIP/RSAPE2TedSMTMK24OEEy\nn9NU\r\n=I2H5\r\n-----END PGP SIGNATURE-----\r\n"},"gitHead":"08f91a07e557c7f3cdc06f3873401ab48236892b","scripts":{"ci":"npm run check && npm test","fmt":"mongodb-js-fmt ./*.js lib/*.js ./test/*.js","test":"mocha","check":"mongodb-js-precommit","pretest":"mongodb-runner install"},"_npmUser":{"name":"alena.khineika","email":"alena.khineika@gmail.com"},"precommit":["check"],"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"6.7.0","description":"MongoDB connection model.","directories":{},"_nodeVersion":"10.2.1","dependencies":{"raf":"^3.4.1","ssh2":"^0.5.4","async":"^2.1.5","debug":"^2.6.0","backoff":"^2.4.1","mongodb":"^3.2.7","kerberos":"^1.1.2","lodash.omit":"^4.5.0","lodash.clone":"^4.5.0","mongodb-core":"^3.2.7","lodash.assign":"^4.2.0","storage-mixin":"^3.2.6","ampersand-model":"^8.0.0","lodash.defaults":"^4.2.0","lodash.includes":"^4.3.0","lodash.isstring":"^4.0.1","lodash.unescape":"^4.0.1","lodash.isfunction":"^3.0.9","ampersand-rest-collection":"^6.0.0"},"_hasShrinkwrap":false,"devDependencies":{"bson":"^4.0.1","chai":"^4.2.0","uuid":"^3.3.2","mocha":"^3.2.0","sinon":"^1.17.7","electron":"^4.0.6","pre-commit":"^1.1.2","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^2.0.2","lodash.foreach":"^4.5.0","mongodb-js-fmt":"^1.0.0","mongodb-runner":"^4.7.2","mongodb-js-precommit":"^2.0.0","eslint-config-mongodb-js":"^5.0.3","mongodb-connection-fixture":"^0.0.14"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_14.3.0_1569839976203_0.9468248655089462","host":"s3://npm-registry-packages"}},"14.3.1":{"name":"mongodb-connection-model","version":"14.3.1","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@14.3.1","maintainers":[{"name":"aherlihy","email":"anna@mongodb.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"brookescarlett","email":"brooke.yalof@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"cilix","email":"matthewlevenstein@gmail.com"},{"name":"daprahamian","email":"dan.aprahamian@gmail.com"},{"name":"dcoupal","email":"daniel.coupal@mongodb.com"},{"name":"deafgoat","email":"deafgoat@gmail.com"},{"name":"deepshah","email":"deepcshah@gmail.com"},{"name":"dpercy","email":"davetp425@gmail.com"},{"name":"durran","email":"durran@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"glowe","email":"graham.lowe@gmail.com"},{"name":"gregg.b","email":"gregg.brewster@mongodb.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"jimol","email":"jim.oleary@gmail.com"},{"name":"jon.franco","email":"jon.franco@mongodb.com"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"lrlna","email":"shestak.irina@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"micheal.parks","email":"michealparks1989@gmail.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"mpobrien","email":"mpobrien005@gmail.com"},{"name":"redondos","email":"aolivera@gmail.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"ryantimmons","email":"ryan@rytim.com"},{"name":"sampoonachot","email":"joy.sampoonachot@10gen.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"schwartzrw","email":"schwartzrw@gmail.com"},{"name":"scottsidwell","email":"developer@scottsidwell.id.au"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"srv-charts-read-only","email":"team-charts@10gen.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"terakilobyte","email":"terakilobyte@gmail.com"},{"name":"thomaslangston-mongodb","email":"thomas.langston@mongodb.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"85bed15562f1b4962e2fa42cd96040a736be3fb8","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-14.3.1.tgz","fileCount":25,"integrity":"sha512-vSUghlOLMg69+G3iiXkv7q4PlJgS4O00CkB4wF3mTAQz/HaxwL03E0VZMKAcYzxfeKgioy9kWTaTZBvpkycgtA==","signatures":[{"sig":"MEQCIDfuVXJXo7NrAdC6OwSe59SQnqjX3IGe/CpRE2of0HCYAiAUtn73LDyjgkt/EjIKPX2Gm1ibwn6nN8OAI/KpBrBInA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":94876,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdkey4CRA9TVsSAnZWagAACtMQAKSDI+Oyewg0SsRSP1Lv\nhsMOgsUxcm+eGBIS6HUBn7TboO6oMWf9YbjcqAQYf9HhWL8lxLlRQQBC/5TT\nsNdt0SOuWkfEAeEiivH/ZTb8U6e/4bmE60aZOq5yFfddi5YIy0HEjX4tl6FH\nB5ENUxbrJ6j28bIhGJ+1GnQauj2w2GCFntHePmQzcKwULRWR24xMqsdZqCUA\nLNYfGvKFcZVvVSAA5U/o2DkJjXUsGRAC2suqAvjMLKugtfKUwD3pol8WYJrp\niOhlLAjkB2I+W/uyoT8ThcxgxnoYrfn5SigVZy3iHVrkkw9FJzhgoX7DYSsR\nUUDoGpmIrhxQU0HE0UajOptk6Nmw8jlq7GF8fnevDfKTGGXx2RR6uU1916LO\ncxWTdYp81fMX5vJwlSNl65+/mLdCsI6BeXsDz+hU+kd3UgBzJypqMYQmHNBD\nJGZNIjy6qorwEInuw03Iq3Y0yQ87DeN/FslTpfo+PJKG24C8un1Ni8SXokzr\n1Lshhq0za8JYYj9ua27UkXwtM731YzzpGPttdHJWyakWvZpxrnW7/vM8bRQ0\n3fWat7kGgJv7jI5c4a9kQmpGvhSY5VlOlVaD+mqxpICFeHQVKiQzerwbz4Ar\nLB00hWlSc8GZDJSMC3pgYi6WehFQ0+Du49BbzS8g0papX3zfMEuvgmRUz3Ap\nzqF7\r\n=uFCu\r\n-----END PGP SIGNATURE-----\r\n"},"gitHead":"87fd2d3f108e4382c7b4b81974a3af8c9c7eabf7","scripts":{"ci":"npm run check && npm test","fmt":"mongodb-js-fmt ./*.js lib/*.js ./test/*.js","test":"mocha","check":"mongodb-js-precommit","pretest":"mongodb-runner install"},"_npmUser":{"name":"alena.khineika","email":"alena.khineika@gmail.com"},"precommit":["check"],"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"6.7.0","description":"MongoDB connection model.","directories":{},"_nodeVersion":"10.2.1","dependencies":{"raf":"^3.4.1","ssh2":"^0.5.4","async":"^2.1.5","debug":"^2.6.0","backoff":"^2.4.1","mongodb":"^3.2.7","kerberos":"^1.1.2","lodash.omit":"^4.5.0","lodash.clone":"^4.5.0","mongodb-core":"^3.2.7","lodash.assign":"^4.2.0","storage-mixin":"^3.2.6","ampersand-model":"^8.0.0","lodash.defaults":"^4.2.0","lodash.includes":"^4.3.0","lodash.isstring":"^4.0.1","lodash.unescape":"^4.0.1","lodash.isfunction":"^3.0.9","ampersand-rest-collection":"^6.0.0"},"_hasShrinkwrap":false,"devDependencies":{"bson":"^4.0.1","chai":"^4.2.0","uuid":"^3.3.2","mocha":"^3.2.0","sinon":"^1.17.7","electron":"^4.0.6","pre-commit":"^1.1.2","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^2.0.2","lodash.foreach":"^4.5.0","mongodb-js-fmt":"^1.0.0","mongodb-runner":"^4.7.2","mongodb-js-precommit":"^2.0.0","eslint-config-mongodb-js":"^5.0.3","mongodb-connection-fixture":"^0.0.14"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_14.3.1_1569844408156_0.18839571425777035","host":"s3://npm-registry-packages"}},"14.3.2":{"name":"mongodb-connection-model","version":"14.3.2","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@14.3.2","maintainers":[{"name":"aherlihy","email":"anna@mongodb.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"brookescarlett","email":"brooke.yalof@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"cilix","email":"matthewlevenstein@gmail.com"},{"name":"daprahamian","email":"dan.aprahamian@gmail.com"},{"name":"dcoupal","email":"daniel.coupal@mongodb.com"},{"name":"deafgoat","email":"deafgoat@gmail.com"},{"name":"deepshah","email":"deepcshah@gmail.com"},{"name":"dpercy","email":"davetp425@gmail.com"},{"name":"durran","email":"durran@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"glowe","email":"graham.lowe@gmail.com"},{"name":"gregg.b","email":"gregg.brewster@mongodb.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"jimol","email":"jim.oleary@gmail.com"},{"name":"jon.franco","email":"jon.franco@mongodb.com"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"lrlna","email":"shestak.irina@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"micheal.parks","email":"michealparks1989@gmail.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"mpobrien","email":"mpobrien005@gmail.com"},{"name":"redondos","email":"aolivera@gmail.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"ryantimmons","email":"ryan@rytim.com"},{"name":"sampoonachot","email":"joy.sampoonachot@10gen.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"schwartzrw","email":"schwartzrw@gmail.com"},{"name":"scottsidwell","email":"developer@scottsidwell.id.au"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"srv-charts-read-only","email":"team-charts@10gen.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"terakilobyte","email":"terakilobyte@gmail.com"},{"name":"thomaslangston-mongodb","email":"thomas.langston@mongodb.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"8f4020ccfa8b4db82770dff9cafdbaeb4b1a7d8e","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-14.3.2.tgz","fileCount":25,"integrity":"sha512-ItpgB/0Dvobp9SSh4LKl9da/i6fz+cZU3GPDwxeRuOL4KKRwKM/qhvkVWgWnSvMg9BR8SSoXwE1yNLWRZz5pIQ==","signatures":[{"sig":"MEYCIQCIk4T0JYiapZOGGAqxk9dNYm+Qw5wg7+T4TKnyNx4E9AIhANN1OnLUJBL6CYoiowIH7E/ZkK9sX/Msou6mN3e/Gllg","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":94798,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdtvPoCRA9TVsSAnZWagAAAuwP/1TWJFHZ+ZA0uF58wezR\ngPFMN52+0pvxELaIpFvqwSz4u5qDqaw11DltiawN4XZmcU69qmQh85iviFES\nwJgGG6QiTgeVPun4VbbJtdrslG6FrT7PXLZ0x/0mTlRHUgLaxKF0/Vtz1gcj\nIdZoPKbeuFqwl6kk9vw20evaeSd6toASFP4zVdlmy9OYC3Ek/7CyN208tNb7\nNBVLmTbFtDNcrun3/+cb6/vPKdxhbosQq+B4DSEXTIEq8xcEhmONR+wWa4pV\nhvPLCspLfgb6enCUEe5xZiEaiNTmXWWa7sNiKt+LL/4q5vVnTxSq7IZqFCy6\nrNSP4f+hlFlGAyZfhl35LHpFvCrJ9Knr6UNSJVksOweXy9riE7/8hboc2t/9\n9espNUMVpwHN966JAmczHi00UhsWHD1KWrIX6N5yPuN6OpxuFXwVqOyiuvrn\nM+egKK03sVf/rnDlV6eqZ2HA098yYfNKayuFNeguRHGuYcc+hdzFf3H+BhLc\nAkPvEPdcahqf1nVdqGftsDlkWXWubFu3R4wOGyKiXErs2yhbDmj/qAePHAww\nSFT8fDw+tM2/XDbBbFygxiADBR6wO3Ftjw4tmP7rWrzQGHcVIjKCqEiK6MKB\nCWijKExX9xHeeJPVVmyGZ//N+7DdPSrO1C5KIO71gaGeIC0nlcKSAnkpgKPh\nvuBT\r\n=+pZ9\r\n-----END PGP SIGNATURE-----\r\n"},"gitHead":"97f381dde0b4c748d9b91d48c34bcd421aa0233c","scripts":{"ci":"npm run check && npm test","fmt":"mongodb-js-fmt ./*.js lib/*.js ./test/*.js","test":"mocha","check":"mongodb-js-precommit","pretest":"mongodb-runner install"},"_npmUser":{"name":"durran","email":"durran@gmail.com"},"precommit":["check"],"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"6.7.0","description":"MongoDB connection model.","directories":{},"_nodeVersion":"10.2.1","dependencies":{"raf":"^3.4.1","ssh2":"^0.5.4","async":"^2.1.5","debug":"^2.6.0","backoff":"^2.4.1","mongodb":"^3.2.7","kerberos":"^1.1.2","lodash.omit":"^4.5.0","lodash.clone":"^4.5.0","mongodb-core":"^3.2.7","lodash.assign":"^4.2.0","storage-mixin":"^3.2.7","ampersand-model":"^8.0.0","lodash.defaults":"^4.2.0","lodash.includes":"^4.3.0","lodash.isstring":"^4.0.1","lodash.unescape":"^4.0.1","lodash.isfunction":"^3.0.9","ampersand-rest-collection":"^6.0.0"},"_hasShrinkwrap":false,"devDependencies":{"bson":"^4.0.1","chai":"^4.2.0","uuid":"^3.3.2","mocha":"^3.2.0","sinon":"^1.17.7","electron":"^4.0.6","pre-commit":"^1.1.2","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^2.0.2","lodash.foreach":"^4.5.0","mongodb-js-fmt":"^1.0.0","mongodb-runner":"^4.7.2","mongodb-js-precommit":"^2.0.0","eslint-config-mongodb-js":"^5.0.3","mongodb-connection-fixture":"^0.0.14"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_14.3.2_1572271080281_0.025284445043082027","host":"s3://npm-registry-packages"}},"14.3.3":{"name":"mongodb-connection-model","version":"14.3.3","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@14.3.3","maintainers":[{"name":"aherlihy","email":"anna@mongodb.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"brookescarlett","email":"brooke.yalof@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"cilix","email":"matthewlevenstein@gmail.com"},{"name":"daprahamian","email":"dan.aprahamian@gmail.com"},{"name":"dcoupal","email":"daniel.coupal@mongodb.com"},{"name":"deafgoat","email":"deafgoat@gmail.com"},{"name":"deepshah","email":"deepcshah@gmail.com"},{"name":"dpercy","email":"davetp425@gmail.com"},{"name":"durran","email":"durran@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"glowe","email":"graham.lowe@gmail.com"},{"name":"gregg.b","email":"gregg.brewster@mongodb.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"jimol","email":"jim.oleary@gmail.com"},{"name":"jon.franco","email":"jon.franco@mongodb.com"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"lrlna","email":"shestak.irina@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"micheal.parks","email":"michealparks1989@gmail.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"mpobrien","email":"mpobrien005@gmail.com"},{"name":"redondos","email":"aolivera@gmail.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"ryantimmons","email":"ryan@rytim.com"},{"name":"sampoonachot","email":"joy.sampoonachot@10gen.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"schwartzrw","email":"schwartzrw@gmail.com"},{"name":"scottsidwell","email":"developer@scottsidwell.id.au"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"srv-charts-read-only","email":"team-charts@10gen.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"terakilobyte","email":"terakilobyte@gmail.com"},{"name":"thomaslangston-mongodb","email":"thomas.langston@mongodb.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"vrachev","email":"vlad.rachev@mongodb.com"},{"name":"wz3chen","email":"waleycz@gmail.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"6c0ea25ceb4271823e58f7b8291c790702497534","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-14.3.3.tgz","fileCount":25,"integrity":"sha512-VPA7rgRQ3zif4VHx2bH2hftXxVLrPq377wQWK5uoS8PBq5wRLMYKYibcxw/IINlaSm0OEjKjGX9h9DjnrAmO1A==","signatures":[{"sig":"MEUCIAr0ouZfTR2ShEDP9TGFHE8fvKQTleVBxC2fYMdPn3VkAiEAh5pEROO9UN5uoPYeMtHDm5BwWOi9Pf9DCfOWMo8K6bU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":94801,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd2/xOCRA9TVsSAnZWagAABu4P/3wwKooRpz+rVutD6ij2\nUsxz5nw4eWXYf1N1+PK9DYi3RZ+jLzlvnWoq403RtXgYLVXOa1nG73qDPkSk\nAgz8Saki6VLKFkBS7JDdmjZINk1oWey3rLahMHzIrfthKA2jD+SHA/VAdfmd\nyofX4CVpL2weAkuxzR5ZGPuYJoS2YGxQvv9dh5bCGQrHKkwi9mGLjcNlLYdO\nbn/7yKp3eR5bMA/dwgMlwS4DwNiCcmGLH1LMvbkQNGFS2dz0kegOnVGZnudq\n/43Nit6b5+Lyhcfs1DRe2l/TDzf0YHNlOVF05xUFAlrrz1TzEGWsKC5FeSsb\nwf8hcv5G39ixzHs2x30RZj6dvJrQe3Ef/YcZ4Ic3YWYq34HBK7BIrjr4Q27N\nm8V1qFq6FpaFwDfd2goA9ifJHJlIJtlte+BMJHoCCAhkHGgEOSpeCL08TDUt\n4bJg/SuLwQXPqeCCtAPQQlpAWfc9vl2NRVwQuIuR3nixc8tt3nujFJ8hJslT\nBZbhTcMOl65oyICPsXNxXm0Yep3nGDmV+jUPjxvRdEBiuv24aoFwlAY7IwX9\nVE+lOvlmfppB3UBaZBhZMgwjYi55iEvzuAh54ZHxdJV0qeR2aBZBMTTEHnK/\nGChOpXykWMX9G5wU9pZh9qlrOdhbFDwdQDPFyqSdcJtbel8BACHRWLbjW9mL\nRzCS\r\n=9umW\r\n-----END PGP SIGNATURE-----\r\n"},"gitHead":"0e8db264bb535d512371467895c159d73ca8388f","scripts":{"ci":"npm run check && npm test","fmt":"mongodb-js-fmt ./*.js lib/*.js ./test/*.js","test":"mocha","check":"mongodb-js-precommit","pretest":"mongodb-runner install"},"_npmUser":{"name":"alena.khineika","email":"alena.khineika@gmail.com"},"precommit":["check"],"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"6.7.0","description":"MongoDB connection model.","directories":{},"_nodeVersion":"10.2.1","dependencies":{"raf":"^3.4.1","ssh2":"^0.5.4","async":"^2.1.5","debug":"^2.6.0","backoff":"^2.4.1","mongodb":"^3.2.7","kerberos":"^1.1.2","lodash.omit":"^4.5.0","lodash.clone":"^4.5.0","mongodb-core":"^3.2.7","lodash.assign":"^4.2.0","storage-mixin":"^3.2.7","ampersand-model":"^8.0.0","lodash.defaults":"^4.2.0","lodash.includes":"^4.3.0","lodash.isstring":"^4.0.1","lodash.unescape":"^4.0.1","lodash.isfunction":"^3.0.9","ampersand-rest-collection":"^6.0.0"},"_hasShrinkwrap":false,"devDependencies":{"bson":"^4.0.1","chai":"^4.2.0","uuid":"^3.3.2","mocha":"^3.2.0","sinon":"^1.17.7","electron":"^4.0.6","pre-commit":"^1.1.2","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^2.0.2","lodash.foreach":"^4.5.0","mongodb-js-fmt":"^1.0.0","mongodb-runner":"^4.7.2","mongodb-js-precommit":"^2.0.0","eslint-config-mongodb-js":"^5.0.3","mongodb-connection-fixture":"^0.0.14"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_14.3.3_1574698062361_0.4075227040456395","host":"s3://npm-registry-packages"}},"14.3.4":{"name":"mongodb-connection-model","version":"14.3.4","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@14.3.4","maintainers":[{"name":"aherlihy","email":"anna@mongodb.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"brookescarlett","email":"brooke.yalof@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"cilix","email":"matthewlevenstein@gmail.com"},{"name":"daprahamian","email":"dan.aprahamian@gmail.com"},{"name":"dcoupal","email":"daniel.coupal@mongodb.com"},{"name":"deafgoat","email":"deafgoat@gmail.com"},{"name":"deepshah","email":"deepcshah@gmail.com"},{"name":"dpercy","email":"davetp425@gmail.com"},{"name":"durran","email":"durran@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"glowe","email":"graham.lowe@gmail.com"},{"name":"gregg.b","email":"gregg.brewster@mongodb.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"jimol","email":"jim.oleary@gmail.com"},{"name":"jon.franco","email":"jon.franco@mongodb.com"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"lrlna","email":"shestak.irina@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"micheal.parks","email":"michealparks1989@gmail.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"mpobrien","email":"mpobrien005@gmail.com"},{"name":"redondos","email":"aolivera@gmail.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"ryantimmons","email":"ryan@rytim.com"},{"name":"sampoonachot","email":"joy.sampoonachot@10gen.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"schwartzrw","email":"schwartzrw@gmail.com"},{"name":"scottsidwell","email":"developer@scottsidwell.id.au"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"srv-charts-read-only","email":"team-charts@10gen.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"terakilobyte","email":"terakilobyte@gmail.com"},{"name":"thomaslangston-mongodb","email":"thomas.langston@mongodb.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"vrachev","email":"vlad.rachev@mongodb.com"},{"name":"wz3chen","email":"waleycz@gmail.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"baf255f6df514c282905fe9b0a5cdc3394d70e36","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-14.3.4.tgz","fileCount":25,"integrity":"sha512-92IBYwoKRt+1KyiCHQONyBb/yIsdIcLEYdUKpY2ltewB5GQt3EcmvVoyhs5pd5bFhfYaSQcwXGNanV7XSCeffA==","signatures":[{"sig":"MEYCIQCHjN7qx9swMMpsRb+dYzDioEoQmz90kzAF8JR6YuR/YAIhALVyKVtg9km8WTuJAV75lzoRyChGmaU1R47S0OZ04c+z","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":94832,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd3Tg2CRA9TVsSAnZWagAAS9gP/RhcvBxET8pWLomhM9wE\n0zPVhbI6UwdWQ7UJZq/woavqx67fxpaMFH9vj/OExmhjmnx385Ji9ncMRvlX\npup0OxWtiu91Cz+JH7bheZ6DEaB2EDzREkRWqoqH821xugF/oFm/LY2lnmkY\nG8xY1JaWDejdIyNXO1tClRi+Jp6iul+jQCmGQyS/sOE/YSoY8y+RUYj92UdC\nBw3YUk/siwhUIJeYY3XumL3gVfeJcxPV8VVPRgjWsA9ozVih4nHlztGB3ogs\n3SuMr2vaLhfvz5h5dQo2oK+aKBnqzJSAWbBQic7VC1BB0wEsKhgVAA8aKI/N\nx5Vchpt6cBx2J/BMmlVB+DSI2EkWP8+kc1JtfmO5ZfK75x4qWu/IVdaAUPES\nIXu6LmMIEAD2D827uEFp5c2bJXHJfAwjI2PsIFP4YKDB6v70UQ34vLHv0KgQ\n4vFuTdp7iPTm0wpeIjBqtmZxFY0pUggCguPTbOM3Co6k9JXYJ5c4g1CUI429\nveifH1xcv6f4hUmnPjxUwR+vgE85QMtxLCiDBmQxVhxQb7wOsDqddZOc6WsT\n/fThnRo9Dg7ruNTOrXXPonjMPaCbaE4mjjggYbkREbgLy6ESaSp2j3CVbeB6\njUOwy6VOrWWRmena34pKS2ZJeNIHx3zWT6uUkmWW2MJBJov2dSDnaMC5Qsrj\nxE/K\r\n=EpwL\r\n-----END PGP SIGNATURE-----\r\n"},"gitHead":"cc7d40f92659b849e258fbc72cd9b9cb651c7c30","scripts":{"ci":"npm run check && npm test","fmt":"mongodb-js-fmt ./*.js lib/*.js ./test/*.js","test":"mocha","check":"mongodb-js-precommit","pretest":"mongodb-runner install"},"_npmUser":{"name":"alena.khineika","email":"alena.khineika@gmail.com"},"precommit":["check"],"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"6.7.0","description":"MongoDB connection model.","directories":{},"_nodeVersion":"10.2.1","dependencies":{"raf":"^3.4.1","ssh2":"^0.5.4","async":"^2.1.5","debug":"^2.6.0","backoff":"^2.4.1","mongodb":"^3.2.7","kerberos":"^1.1.2","lodash.omit":"^4.5.0","lodash.clone":"^4.5.0","mongodb-core":"^3.2.7","lodash.assign":"^4.2.0","storage-mixin":"^3.2.7","ampersand-model":"^8.0.0","lodash.defaults":"^4.2.0","lodash.includes":"^4.3.0","lodash.isstring":"^4.0.1","lodash.unescape":"^4.0.1","lodash.isfunction":"^3.0.9","ampersand-rest-collection":"^6.0.0"},"_hasShrinkwrap":false,"devDependencies":{"bson":"^4.0.1","chai":"^4.2.0","uuid":"^3.3.2","mocha":"^3.2.0","sinon":"^1.17.7","electron":"^4.0.6","pre-commit":"^1.1.2","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^2.0.2","lodash.foreach":"^4.5.0","mongodb-js-fmt":"^1.0.0","mongodb-runner":"^4.7.2","mongodb-js-precommit":"^2.0.0","eslint-config-mongodb-js":"^5.0.3","mongodb-connection-fixture":"^0.0.14"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_14.3.4_1574778933504_0.5261784908697171","host":"s3://npm-registry-packages"}},"14.3.5":{"name":"mongodb-connection-model","version":"14.3.5","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@14.3.5","maintainers":[{"name":"aherlihy","email":"anna@mongodb.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"brookescarlett","email":"brooke.yalof@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"cilix","email":"matthewlevenstein@gmail.com"},{"name":"daprahamian","email":"dan.aprahamian@gmail.com"},{"name":"dcoupal","email":"daniel.coupal@mongodb.com"},{"name":"deafgoat","email":"deafgoat@gmail.com"},{"name":"deepshah","email":"deepcshah@gmail.com"},{"name":"dpercy","email":"davetp425@gmail.com"},{"name":"durran","email":"durran@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"glowe","email":"graham.lowe@gmail.com"},{"name":"gregg.b","email":"gregg.brewster@mongodb.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"jimol","email":"jim.oleary@gmail.com"},{"name":"jon.franco","email":"jon.franco@mongodb.com"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"lrlna","email":"shestak.irina@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"micheal.parks","email":"michealparks1989@gmail.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"mpobrien","email":"mpobrien005@gmail.com"},{"name":"redondos","email":"aolivera@gmail.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"ryantimmons","email":"ryan@rytim.com"},{"name":"sampoonachot","email":"joy.sampoonachot@10gen.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"schwartzrw","email":"schwartzrw@gmail.com"},{"name":"scottsidwell","email":"developer@scottsidwell.id.au"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"srv-charts-read-only","email":"team-charts@10gen.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"terakilobyte","email":"terakilobyte@gmail.com"},{"name":"thomaslangston-mongodb","email":"thomas.langston@mongodb.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"vrachev","email":"vlad.rachev@mongodb.com"},{"name":"wz3chen","email":"waleycz@gmail.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"25b02bd1b2bacd347dc895adaa29f5cd48ac480d","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-14.3.5.tgz","fileCount":25,"integrity":"sha512-oNxtBeD5KSZdufTReXp31HNmK0hDuSP8ATRzaYFr1b/pP2OjlRVPSJgjAT2i3QJlqinpzb9YBNguYi5kzVXbGQ==","signatures":[{"sig":"MEUCIEtsspLPoZAqfutz1ABWpPea1UYDXPmnW6cDJcl6sC+4AiEA9stRb60KTiIixbgKEuBtD+O5w69DXxMoU/NZ47hmUpQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":94852,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd3reDCRA9TVsSAnZWagAAM3gQAJLMhw6+zznUuTGSO9it\nPPPn4sYSIKchGfbpjJX7Ix9We3DyvNiEvE5fQCRBReF9+i0E3Oj+bcMx5jEE\nZkuLmuNZTzPL4hD8fSu/481R4JlaxUVaDp4JZH0+AGAKkvILK8BKwWFAlVyn\nquW2Lm8NOTtIA6F6Z5wjAN8cCJEu6PjNOV6A/buhUbdJgCX3IQh4lFmbMKsg\naXplC4BiBHobG1wPkZjc2C/wgqw3tJHWsyJLMpxKQPpBC9KZhj3V0RW9KLSm\nqWsmWujN/hlqXmsKCYlvb59xkJvSQ8+V2AbS1nnlpyH7+kXJsg/b5h4iJUke\ncXptXUG2oJHaQy3rjfF4NELmBW7CzCyODZTtA0e8vRJhQVlafKKA6hjhg1cZ\nKnsJwz7Ajpp/W/CHdkrqyiNqHW11PUnqfsAdiQaqZmVmdkzqB/ZH/kGY0svE\n7INhLjey4XNsRlCONSHFtMZpdtHZqgOBck8DUxpH5ClLu97FXI4Kg/jlaChZ\n7aWAPfITCB3H1/dLrPBFte5Uwx1y4uFcPqO++5gxzV5sEbtDh0kAK0X0vYY7\noeWyfXzQTh8oALg8NjrhV+P5CI5MjIeZ66gaMzCRkmjVazBTAI2n3xqYYEKt\ny8WOmdJa8Hwp4B5/VqnfAq4soSBLHVkkMPDlixsQCWiDykAFqmuH9tm79Llq\nsAKo\r\n=0iDa\r\n-----END PGP SIGNATURE-----\r\n"},"gitHead":"36e54c78beba17eb17cec464c53634bde043ecc5","scripts":{"ci":"npm run check && npm test","fmt":"mongodb-js-fmt ./*.js lib/*.js ./test/*.js","test":"mocha","check":"mongodb-js-precommit","pretest":"mongodb-runner install"},"_npmUser":{"name":"alena.khineika","email":"alena.khineika@gmail.com"},"precommit":["check"],"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"6.7.0","description":"MongoDB connection model.","directories":{},"_nodeVersion":"10.2.1","dependencies":{"raf":"^3.4.1","ssh2":"^0.5.4","async":"^2.1.5","debug":"^2.6.0","backoff":"^2.4.1","mongodb":"^3.2.7","kerberos":"^1.1.2","lodash.omit":"^4.5.0","lodash.clone":"^4.5.0","mongodb-core":"^3.2.7","lodash.assign":"^4.2.0","storage-mixin":"^3.2.7","ampersand-model":"^8.0.0","lodash.defaults":"^4.2.0","lodash.includes":"^4.3.0","lodash.isstring":"^4.0.1","lodash.unescape":"^4.0.1","lodash.isfunction":"^3.0.9","ampersand-rest-collection":"^6.0.0"},"_hasShrinkwrap":false,"devDependencies":{"bson":"^4.0.1","chai":"^4.2.0","uuid":"^3.3.2","mocha":"^3.2.0","sinon":"^1.17.7","electron":"^4.0.6","pre-commit":"^1.1.2","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^2.0.2","lodash.foreach":"^4.5.0","mongodb-js-fmt":"^1.0.0","mongodb-runner":"^4.7.2","mongodb-js-precommit":"^2.0.0","eslint-config-mongodb-js":"^5.0.3","mongodb-connection-fixture":"^0.0.14"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_14.3.5_1574877058473_0.26756840396148784","host":"s3://npm-registry-packages"}},"14.3.6":{"name":"mongodb-connection-model","version":"14.3.6","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@14.3.6","maintainers":[{"name":"aherlihy","email":"anna@mongodb.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"brookescarlett","email":"brooke.yalof@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"cilix","email":"matthewlevenstein@gmail.com"},{"name":"daprahamian","email":"dan.aprahamian@gmail.com"},{"name":"dcoupal","email":"daniel.coupal@mongodb.com"},{"name":"deafgoat","email":"deafgoat@gmail.com"},{"name":"deepshah","email":"deepcshah@gmail.com"},{"name":"dpercy","email":"davetp425@gmail.com"},{"name":"durran","email":"durran@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"glowe","email":"graham.lowe@gmail.com"},{"name":"gregg.b","email":"gregg.brewster@mongodb.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"jimol","email":"jim.oleary@gmail.com"},{"name":"jon.franco","email":"jon.franco@mongodb.com"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"lrlna","email":"shestak.irina@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"micheal.parks","email":"michealparks1989@gmail.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"mpobrien","email":"mpobrien005@gmail.com"},{"name":"redondos","email":"aolivera@gmail.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"ryantimmons","email":"ryan@rytim.com"},{"name":"sampoonachot","email":"joy.sampoonachot@10gen.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"schwartzrw","email":"schwartzrw@gmail.com"},{"name":"scottsidwell","email":"developer@scottsidwell.id.au"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"srv-charts-read-only","email":"team-charts@10gen.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"terakilobyte","email":"terakilobyte@gmail.com"},{"name":"thomaslangston-mongodb","email":"thomas.langston@mongodb.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"vrachev","email":"vlad.rachev@mongodb.com"},{"name":"wz3chen","email":"waleycz@gmail.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"6c6de242a6180c64fc0148fce3127251e51db94b","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-14.3.6.tgz","fileCount":25,"integrity":"sha512-DIWw2LsJCz+3OwYCOo/lO3VN/mNYNbT7vTqkaUpls5umetwqbLYtOg/Nlk61v2LpGuMtLzdo8rE5GeY2ikfgFQ==","signatures":[{"sig":"MEUCIQCJoFIkXdxfjDnaxAtF4NP3W1IO5JMSuxiobi7Bkqj4XwIgVK1QiK3O3Shau39Gxiumz7x+3OtWmQI4ajmr0pNSNWo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":94852,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd6SbXCRA9TVsSAnZWagAA95kP/A+oO5mz8iVyAgrhFhdi\nEuPgjPTloy/RjW2KCfdHSN4vx6b9ag+4YvBAdixwdoURunewGVFmUkWxfEEr\n+1jXX2uvYfkH0deXnxQFtCf4IpMeKZfpLXOBJIgu5gN6UlDaDVbkHyZ9+kf0\nbjUS9+nmdmoaQdKLvEq4hMTrSykG24/E7V63leqDRdLh8VtFAzUkd3uzpHwt\n2ybAiGXTlEsg706y5FhAxwhpdyFOcmvsV07SlAJtEpuzGFc7vYFA1UvFqIGM\nlOBwuXNlg9PmJeB5gnfEGy1pgvr25NbxAfyXHlShsJvSuUq+p0mUAvuANs9Z\n4SvH0tJ4uyldCfuOBJgoH4fdBHFvbVMqteChmaHC6X8T6ng3iuQ9tyb1F6YI\nEu9Fe3Ro1tOo4VulEgOp4NvfWsUfwqGxt89/rxylLvL6NrZ9AO/lbbhCneTI\nrY4dfcbpjz4kHmZx9YJedOflh86Ku1QGyEys3LLLPqKk3CkeQsHw1vBv6RRB\nDcCxfxKLhs7w5IvXlYWxOmvZS2mN16yKWEuT/UCbyLjWjV+WhmBNcfKNo+/x\nyN9pssOBzpRsLZRdDtX35nucMorPzQmZrxnDXZjpq/jPpeeyJL6Z6KaPLToq\nJ9ueRJmFCfzfZUzS0o55IpTtSIVB9t876hTMVpESGa3Et9y5fhHU69rbkWgB\nDGSo\r\n=A1Nv\r\n-----END PGP SIGNATURE-----\r\n"},"gitHead":"52b78c9790b7e19568d78865404b491ee39a2866","scripts":{"ci":"npm run check && npm test","fmt":"mongodb-js-fmt ./*.js lib/*.js ./test/*.js","test":"mocha","check":"mongodb-js-precommit","pretest":"mongodb-runner install"},"_npmUser":{"name":"alena.khineika","email":"alena.khineika@gmail.com"},"precommit":["check"],"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"6.7.0","description":"MongoDB connection model.","directories":{},"_nodeVersion":"10.2.1","dependencies":{"raf":"^3.4.1","ssh2":"^0.5.4","async":"^2.1.5","debug":"^2.6.0","backoff":"^2.4.1","mongodb":"^3.3.5","kerberos":"^1.1.2","lodash.omit":"^4.5.0","lodash.clone":"^4.5.0","mongodb-core":"^3.2.7","lodash.assign":"^4.2.0","storage-mixin":"^3.2.7","ampersand-model":"^8.0.0","lodash.defaults":"^4.2.0","lodash.includes":"^4.3.0","lodash.isstring":"^4.0.1","lodash.unescape":"^4.0.1","lodash.isfunction":"^3.0.9","ampersand-rest-collection":"^6.0.0"},"_hasShrinkwrap":false,"devDependencies":{"bson":"^4.0.1","chai":"^4.2.0","uuid":"^3.3.2","mocha":"^3.2.0","sinon":"^1.17.7","electron":"^4.0.6","pre-commit":"^1.1.2","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^2.0.2","lodash.foreach":"^4.5.0","mongodb-js-fmt":"^1.0.0","mongodb-runner":"^4.7.2","mongodb-js-precommit":"^2.0.0","eslint-config-mongodb-js":"^5.0.3","mongodb-connection-fixture":"^0.0.14"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_14.3.6_1575560919285_0.210266378464399","host":"s3://npm-registry-packages"}},"14.3.7":{"name":"mongodb-connection-model","version":"14.3.7","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@14.3.7","maintainers":[{"name":"aherlihy","email":"anna@mongodb.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"brookescarlett","email":"brooke.yalof@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"cilix","email":"matthewlevenstein@gmail.com"},{"name":"daprahamian","email":"dan.aprahamian@gmail.com"},{"name":"dcoupal","email":"daniel.coupal@mongodb.com"},{"name":"deafgoat","email":"deafgoat@gmail.com"},{"name":"deepshah","email":"deepcshah@gmail.com"},{"name":"dpercy","email":"davetp425@gmail.com"},{"name":"durran","email":"durran@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"glowe","email":"graham.lowe@gmail.com"},{"name":"gregg.b","email":"gregg.brewster@mongodb.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"jimol","email":"jim.oleary@gmail.com"},{"name":"jon.franco","email":"jon.franco@mongodb.com"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"lrlna","email":"shestak.irina@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"micheal.parks","email":"michealparks1989@gmail.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"mpobrien","email":"mpobrien005@gmail.com"},{"name":"redondos","email":"aolivera@gmail.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"ryantimmons","email":"ryan@rytim.com"},{"name":"sampoonachot","email":"joy.sampoonachot@10gen.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"schwartzrw","email":"schwartzrw@gmail.com"},{"name":"scottsidwell","email":"developer@scottsidwell.id.au"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"terakilobyte","email":"terakilobyte@gmail.com"},{"name":"thomaslangston-mongodb","email":"thomas.langston@mongodb.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"vrachev","email":"vlad.rachev@mongodb.com"},{"name":"wz3chen","email":"waleycz@gmail.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"53151ab67442ae5be2cf468750d67fb0381231ae","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-14.3.7.tgz","fileCount":25,"integrity":"sha512-Y5Hq2RU3/Rb5xbiHQh8gOjwNghqfnsE+rpkwGrqNTGtdJS5adM8mr6dcOckmqKigZ456+R5biMMntPIfs20YzA==","signatures":[{"sig":"MEUCIBwa9y9nnIo/iyQ7iVUJBvI7ukBtJhsajiaWlTPw5YF6AiEAiLvhXyqNTqZDuXkz0T96jJEC7d7xY6HkKRU6hpm4VfU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":95493,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd8sV3CRA9TVsSAnZWagAApJcQAKSwLxxlfmaE6uUoMNG2\njwnG5dlzqHoZpgF/I+POFreSxrMHgZGKSMP6rJyXc3QWxMSH4jfTRUd6OW+O\n6CDpaDLerKWpRzjDxEC46kaoFPeuRPLRwHBfAsq6TJK62APx+4lQJkrjwMyO\n8/OKASjVs+DavxsWFmkVU9OSLTQaIZDLMOlBDliR4b0YXRV4mEIsZeBZ6jAt\nXT1EXlpHNmg59HNDDvDGFtg1Wiiprw/+SYKMCaKiR6rInftR52tOAPks98iz\nfL0qBoImZ6JtJcfZ+ZTPWEMMqOBPSWpUYxrroL0qStRz88lHvb3guHcnQsUX\n1Gd11Tk3EvlNDEdFD3otT10XReQmtosKw3GH2nz8cqq5ybQAhJr5g/wo0UNW\ncHR++30oSJgvqFzv5X6y6X8mJwXUZgIRRAk2QM03o4JxzQSiKY4LTQaFTmzG\nBm17hMPeQ04vuHhaPA9JANWYKpmEkFYt4lns6lWD5cKeD82vnXm1NlNdv2Pt\n7Q3QFKelNF/0nrLr0a69iyJYulyTG6GKbykG4xMeoJgftxX3Bzg/Lx91/pnM\nqbeHXMFdTZkQxNPQXBJeyjKN5AhD/ccHumTkZOKgyGEdYHjLgggDAWQ43OKH\nbSIqZOftAhIyRbt/bP4KY3P0uJuz27y63QRQivmbwIkma1qxn+iKq599p1Fq\ndMsx\r\n=NugD\r\n-----END PGP SIGNATURE-----\r\n"},"gitHead":"0d7d84c1a5e867c38a22fa6f2244850a1a38640a","scripts":{"ci":"npm run check && npm test","fmt":"mongodb-js-fmt ./*.js lib/*.js ./test/*.js","test":"mocha","check":"mongodb-js-precommit","pretest":"mongodb-runner install"},"_npmUser":{"name":"durran","email":"durran@gmail.com"},"precommit":["check"],"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"6.13.2","description":"MongoDB connection model.","directories":{},"_nodeVersion":"10.2.1","dependencies":{"raf":"^3.4.1","ssh2":"^0.5.4","async":"^2.1.5","debug":"^2.6.0","backoff":"^2.4.1","mongodb":"^3.3.5","kerberos":"^1.1.2","lodash.omit":"^4.5.0","lodash.clone":"^4.5.0","mongodb-core":"^3.2.7","lodash.assign":"^4.2.0","storage-mixin":"^3.2.7","ampersand-model":"^8.0.0","lodash.defaults":"^4.2.0","lodash.includes":"^4.3.0","lodash.isstring":"^4.0.1","lodash.unescape":"^4.0.1","lodash.isfunction":"^3.0.9","ampersand-rest-collection":"^6.0.0"},"_hasShrinkwrap":false,"devDependencies":{"bson":"^4.0.1","chai":"^4.2.0","uuid":"^3.3.2","mocha":"^3.2.0","sinon":"^1.17.7","electron":"^4.0.6","pre-commit":"^1.1.2","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^2.0.2","lodash.foreach":"^4.5.0","mongodb-js-fmt":"^1.0.0","mongodb-runner":"^4.7.2","mongodb-js-precommit":"^2.0.0","eslint-config-mongodb-js":"^5.0.3","mongodb-connection-fixture":"^0.0.14"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_14.3.7_1576191350865_0.41463800654323824","host":"s3://npm-registry-packages"}},"14.4.0":{"name":"mongodb-connection-model","version":"14.4.0","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@14.4.0","maintainers":[{"name":"aherlihy","email":"anna@mongodb.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"brookescarlett","email":"brooke.yalof@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"cilix","email":"matthewlevenstein@gmail.com"},{"name":"daprahamian","email":"dan.aprahamian@gmail.com"},{"name":"dcoupal","email":"daniel.coupal@mongodb.com"},{"name":"deafgoat","email":"deafgoat@gmail.com"},{"name":"deepshah","email":"deepcshah@gmail.com"},{"name":"dpercy","email":"davetp425@gmail.com"},{"name":"durran","email":"durran@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"glowe","email":"graham.lowe@gmail.com"},{"name":"gregg.b","email":"gregg.brewster@mongodb.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"jimol","email":"jim.oleary@gmail.com"},{"name":"jon.franco","email":"jon.franco@mongodb.com"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"lrlna","email":"shestak.irina@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"micheal.parks","email":"michealparks1989@gmail.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"mpobrien","email":"mpobrien005@gmail.com"},{"name":"redondos","email":"aolivera@gmail.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"ryantimmons","email":"ryan@rytim.com"},{"name":"sampoonachot","email":"joy.sampoonachot@10gen.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"schwartzrw","email":"schwartzrw@gmail.com"},{"name":"scottsidwell","email":"developer@scottsidwell.id.au"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"terakilobyte","email":"terakilobyte@gmail.com"},{"name":"thomaslangston-mongodb","email":"thomas.langston@mongodb.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"vrachev","email":"vlad.rachev@mongodb.com"},{"name":"wz3chen","email":"waleycz@gmail.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"cfcafe6968039997eda8a5f5c3ebb92d37ee08f3","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-14.4.0.tgz","fileCount":24,"integrity":"sha512-Cn9I5O6WddZN/vwhh41MTQVSXzBuI5QqRO+z74tPlGlHPQyyS82Z5PRfF5nRDlYviHJW44r8HeRacPx45SF6mQ==","signatures":[{"sig":"MEQCIBOx+Qd+EErNWPLQe7JKKTb304mLXlC38y/SCK2ncg7xAiBvQudh5WQNByFCASSz241OU4EwA0SZSpMGks/XoZF2pQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":94216,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeE3GtCRA9TVsSAnZWagAAtkoP/3ZDdnHoLHYvwL/Q+krt\nJm1gtxfSkw4DVaf3W8Z1M32df+6+hoNwuBbQd7mG0uoXutfgi9UxKEegvDSv\nN7RLj2ujaI3oN99qrJ0ZmVQVA4YYOIT++1HCheugZAAwFu1WWtDtOjDkN8/r\nsEQ9WC4slT0bvaUb6j/t1T/7ZHIcf+VBjsSehXHoDpqt0FWgx3jYVfoHkRDY\nggqrw150qq9hQIOcuVjmHY+Hc02oBBMBX4a8aPH0qWat7Aj3TQIMB9ZPvJXc\nrxxZEkLqYYbzbwHt1lsS0JiSnpaRc9T2aY8kgnKZuDYWXnyHtBhKOJdbMuL2\nwMiybzlOZl8/hB4vi3TPkDsSqmTovvWRTniddR1hDpSQeBNWXjvy9rWh+0H2\ntiIyxe005oKXUh7P5NCS9pXnI2gb2cNLRQlqEmpH4A4Ti1QetwEHsswCfzbT\n5DagPtOv7NkMN8ZbU17zTF0AufNfenTGrz5LocVFEWBp5jwNrUrg87ytc2JA\nRQLPz4mJgBKYYNXQNoY7uqKPk4hKGDyUZakvHac6CNqMrg0UMXyBfMb8AX8z\nScFvfZTiHzgUT6eBMJFZmeWDlK/DmBkIS1lg+QtANnJtQUJI6emjMlairN/M\nggMnN3Mxjf5gUcuaIBQCvniD5NyCAbmQp9/RGA9mceWypv9TyvsZ0mPgdM2D\n2LtD\r\n=Zf+E\r\n-----END PGP SIGNATURE-----\r\n"},"gitHead":"480d7164f11133ff4630db215ac8c8df78cda87b","scripts":{"ci":"npm run check && npm test","test":"mocha","check":"mongodb-js-precommit","pretest":"mongodb-runner install"},"_npmUser":{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"6.13.4","description":"MongoDB connection model.","directories":{},"_nodeVersion":"12.4.0","dependencies":{"raf":"^3.4.1","ssh2":"^0.5.4","async":"^2.1.5","debug":"^2.6.0","lodash":"^4.17.15","mongodb":"^3.4.0","kerberos":"^1.1.3","storage-mixin":"^3.2.7","ampersand-model":"^8.0.0","ampersand-rest-collection":"^6.0.0"},"_hasShrinkwrap":false,"devDependencies":{"bson":"^4.0.1","chai":"^4.2.0","uuid":"^3.3.2","mocha":"^6.2.2","sinon":"^1.17.7","electron":"^6.0.0","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^2.0.2","mongodb-runner":"^4.7.2","mongodb-js-precommit":"^2.0.0","eslint-config-mongodb-js":"^5.0.3","mongodb-connection-fixture":"^0.0.14"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_14.4.0_1578332588993_0.5868442413697339","host":"s3://npm-registry-packages"}},"14.4.1":{"name":"mongodb-connection-model","version":"14.4.1","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@14.4.1","maintainers":[{"name":"aherlihy","email":"anna@mongodb.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"brookescarlett","email":"brooke.yalof@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"cilix","email":"matthewlevenstein@gmail.com"},{"name":"dcoupal","email":"daniel.coupal@mongodb.com"},{"name":"deafgoat","email":"deafgoat@gmail.com"},{"name":"deepshah","email":"deepcshah@gmail.com"},{"name":"dpercy","email":"davetp425@gmail.com"},{"name":"durran","email":"durran@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"glowe","email":"graham.lowe@gmail.com"},{"name":"gregg.b","email":"gregg.brewster@mongodb.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"jimol","email":"jim.oleary@gmail.com"},{"name":"jon.franco","email":"jon.franco@mongodb.com"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"lrlna","email":"shestak.irina@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"micheal.parks","email":"michealparks1989@gmail.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"mpobrien","email":"mpobrien005@gmail.com"},{"name":"redondos","email":"aolivera@gmail.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"ryantimmons","email":"ryan@rytim.com"},{"name":"sampoonachot","email":"joy.sampoonachot@10gen.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"schwartzrw","email":"schwartzrw@gmail.com"},{"name":"scottsidwell","email":"developer@scottsidwell.id.au"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"terakilobyte","email":"terakilobyte@gmail.com"},{"name":"thomaslangston-mongodb","email":"thomas.langston@mongodb.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"vrachev","email":"vlad.rachev@mongodb.com"},{"name":"wz3chen","email":"waleycz@gmail.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"bf3348bbf72e41c2d4bf83db57a2ccf6087dd0d5","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-14.4.1.tgz","fileCount":24,"integrity":"sha512-DtR1XuWyuMjztW+VeR9h7NZ//RNKnv523LH+zfmZOUBubp1GGbkDSXDXfzkFmRaPjBxaSvLo5QsNSnXO/hEtNQ==","signatures":[{"sig":"MEUCIF26h6kuqoARcH/EvDhRQkyAfZmd1Kmg4WU1JJ2Ia3TaAiEA5ZVDjk1bKHoKOBrK0rWgEmC7PxKaLW3XzKwEnhtDUa0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":94216,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeHfGMCRA9TVsSAnZWagAAcLUP/3OOrqH4FA99BaQ/BKc2\nUaXox9VNVAdnHvZsuIqtPslmdjn8y2KSY2pgkjsj6K7OmP7NxKoWOIb990dM\nhTxPpnPP0g5VVztkq5lMnMhvfPjcuAWptvUOJR6KInOjz1iuy0MIIUZcf2TM\nJGnPudDEujjVL7DguZz1zWfDhjOcxDZDCFQf8f4M8lwnZQ8EqaIEhBlnxCLP\nggmJnpZs5RKqEPXIeERkEYWga37/K+Nrh2zTP9jWfEvfcGCCQhBIwr8FT6VL\nb/EL+rm5kZWO1ObSuLD6/KWlKYjH7AaeBsZlP6y9jcSGFsUuwFBw9AKQ0PAL\n1+zT2qqhy7UweVQisz7BIs2aFNtJqym9KfWIgYUoh5j7EXWyQmMhHZBNJc6v\nYPoazH0m3gI1zR/XWXTiw9I9+LMKo7psFrVMSEBAVY58f05L2dG3wMhMrEJn\nBPIz5bnxi/Hty+w9Q3wKBbdgjru04tx88hT6kGlRb6RuMJk3/4ElplrkTyNO\nxNl1OAb7BisFjRfX5BLYV7BrrLzb3htIpL1xmb9F47dEbEInQHBreuxlEWj/\n2rbzAD/2do2vwDYpcdhWG2qbdfriwkUdQoOIDqzrnBpy/PYPBH5939/w3kBb\nLoDXWK/bgGJDRNm0xEXov7KsfugQrujRfWB5KF4FELbqX5PMJq6qUJadUPdE\nR/vO\r\n=Sh/1\r\n-----END PGP SIGNATURE-----\r\n"},"gitHead":"c1f2df0c6ac8f02f32b0dda5208fb85ac93766dc","scripts":{"ci":"npm run check && npm test","test":"mocha","check":"mongodb-js-precommit","pretest":"mongodb-runner install"},"_npmUser":{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"6.13.6","description":"MongoDB connection model.","directories":{},"_nodeVersion":"12.4.0","dependencies":{"raf":"^3.4.1","ssh2":"^0.5.4","async":"^2.1.5","debug":"^2.6.0","lodash":"^4.17.15","mongodb":"^3.4.0","kerberos":"^1.1.3","storage-mixin":"^3.2.7","ampersand-model":"^8.0.0","ampersand-rest-collection":"^6.0.0"},"_hasShrinkwrap":false,"devDependencies":{"bson":"^4.0.1","chai":"^4.2.0","uuid":"^3.3.2","mocha":"^7.0.0","sinon":"^1.17.7","electron":"^6.0.0","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^2.0.2","mongodb-runner":"^4.7.2","mongodb-js-precommit":"^2.0.0","eslint-config-mongodb-js":"^5.0.3","mongodb-connection-fixture":"^0.0.14"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_14.4.1_1579020683812_0.3453604716614891","host":"s3://npm-registry-packages"}},"14.4.2":{"name":"mongodb-connection-model","version":"14.4.2","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@14.4.2","maintainers":[{"name":"aherlihy","email":"anna@mongodb.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"brookescarlett","email":"brooke.yalof@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"cilix","email":"matthewlevenstein@gmail.com"},{"name":"dcoupal","email":"daniel.coupal@mongodb.com"},{"name":"deafgoat","email":"deafgoat@gmail.com"},{"name":"deepshah","email":"deepcshah@gmail.com"},{"name":"dpercy","email":"davetp425@gmail.com"},{"name":"durran","email":"durran@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"glowe","email":"graham.lowe@gmail.com"},{"name":"gregg.b","email":"gregg.brewster@mongodb.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"jimol","email":"jim.oleary@gmail.com"},{"name":"jon.franco","email":"jon.franco@mongodb.com"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"lrlna","email":"shestak.irina@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"micheal.parks","email":"michealparks1989@gmail.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"mpobrien","email":"mpobrien005@gmail.com"},{"name":"redondos","email":"aolivera@gmail.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"ryantimmons","email":"ryan@rytim.com"},{"name":"sampoonachot","email":"joy.sampoonachot@10gen.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"schwartzrw","email":"schwartzrw@gmail.com"},{"name":"scottsidwell","email":"developer@scottsidwell.id.au"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"terakilobyte","email":"terakilobyte@gmail.com"},{"name":"thomaslangston-mongodb","email":"thomas.langston@mongodb.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"vrachev","email":"vlad.rachev@mongodb.com"},{"name":"wz3chen","email":"waleycz@gmail.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"76b389c293d2e89f9b54da21027373e855a90cf5","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-14.4.2.tgz","fileCount":19,"integrity":"sha512-pOV57/WBxo8D+XbX2c+tBjzE7dctTyL9rDAnMYhQmTyJBiQNO3TFDMXd2UJbbPQhiIPEUlrQODJwtorYZhL+RQ==","signatures":[{"sig":"MEUCIQCNXdl10lB/ktIjfIDStI6isikebBAtLT1kupi/LMt8QwIgWNeYKENUT++69K2N/zti38ZdK2oPTsa7nRTqAzF8b/4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":90792,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeHfHrCRA9TVsSAnZWagAAnEgP+gOKY3NHsMI1jJKfc5F+\nZM7GrGEszhwBBkW+0/45AHwGNYyAEXno2YK00gc7Ayo9pz7Eue64bq7ubwCw\nyM8CdDaMX6jiLzorVBL9FHkpV2xH49HIEOFc0UDWSYYgawOe56s2KL9khMki\njebqvXtU4K4IQWvDOFsvU04LBYRPo+DE+VUCzL67KJv/e/unoGUrsmCwN8V0\n6tDNh1Wd/5op1xZ0C8Zk32DGfHgjDOyhZS0U0uZfmpZBSX9BXdjbQWYXqZ1b\n4gVCrsl8MU25KIEHlIOeo0bp9y6buHm2DiznTO58SsOT0T1ANmsYwlJgq+pf\nuLLetMvIABCMWJnL0IoQppzcuK4wgvHsI2smx6ebQ41D2QfU1vGeJMon4LDp\niMTTJN8b8AILW9gK9sfE7LzgbnonPi6K/UZuetjqL9Fe2Z++8PTZZO7iS0uk\n9tZvrdY9eHgGCyL/CsR7pwIRkuPEe0AjUl34IVTu5YIj0K3thlDjtrIJxrGL\nodk/AaaT+MEbK7+kpaV/BxZ/z6MxLCmojh1vEOitoAvHa91k8PCVVqN6uI8H\nUGOx6d6xdNQYMLmAMoyG1CtVuaAqAPhtpOrS5J9XMhB5YlZUvRaknBb2rjqI\n6LA1FoBlh+UwNxFVvfyAaNjRWkMz5Cw5YfqBAtHjPyHpQm0iq8461zddKHC9\nuiam\r\n=7nSx\r\n-----END PGP SIGNATURE-----\r\n"},"gitHead":"ee966a7934cf7b46cb997bd019111bbd69c3e15f","scripts":{"ci":"npm run check && npm test","test":"mocha","check":"mongodb-js-precommit","pretest":"mongodb-runner install"},"_npmUser":{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"6.13.6","description":"MongoDB connection model.","directories":{},"_nodeVersion":"12.4.0","dependencies":{"raf":"^3.4.1","ssh2":"^0.5.4","async":"^2.1.5","debug":"^2.6.0","lodash":"^4.17.15","mongodb":"^3.4.0","kerberos":"^1.1.3","storage-mixin":"^3.2.7","ampersand-model":"^8.0.0","ampersand-rest-collection":"^6.0.0"},"_hasShrinkwrap":false,"devDependencies":{"bson":"^4.0.1","chai":"^4.2.0","uuid":"^3.3.2","mocha":"^7.0.0","sinon":"^1.17.7","electron":"^6.0.0","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^2.0.2","mongodb-runner":"^4.7.2","mongodb-js-precommit":"^2.0.0","eslint-config-mongodb-js":"^5.0.3","mongodb-connection-fixture":"^0.0.14"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_14.4.2_1579020779390_0.16781340927226984","host":"s3://npm-registry-packages"}},"14.5.0":{"name":"mongodb-connection-model","version":"14.5.0","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@14.5.0","maintainers":[{"name":"aherlihy","email":"anna@mongodb.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"brookescarlett","email":"brooke.yalof@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"cilix","email":"matthewlevenstein@gmail.com"},{"name":"dcoupal","email":"daniel.coupal@mongodb.com"},{"name":"deafgoat","email":"deafgoat@gmail.com"},{"name":"deepshah","email":"deepcshah@gmail.com"},{"name":"dpercy","email":"davetp425@gmail.com"},{"name":"durran","email":"durran@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"glowe","email":"graham.lowe@gmail.com"},{"name":"gregg.b","email":"gregg.brewster@mongodb.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"jimol","email":"jim.oleary@gmail.com"},{"name":"jon.franco","email":"jon.franco@mongodb.com"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"lrlna","email":"shestak.irina@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"micheal.parks","email":"michealparks1989@gmail.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"mpobrien","email":"mpobrien005@gmail.com"},{"name":"redondos","email":"aolivera@gmail.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"ryantimmons","email":"ryan@rytim.com"},{"name":"sampoonachot","email":"joy.sampoonachot@10gen.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"schwartzrw","email":"schwartzrw@gmail.com"},{"name":"scottsidwell","email":"developer@scottsidwell.id.au"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"terakilobyte","email":"terakilobyte@gmail.com"},{"name":"thomaslangston-mongodb","email":"thomas.langston@mongodb.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"vrachev","email":"vlad.rachev@mongodb.com"},{"name":"wz3chen","email":"waleycz@gmail.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"5d9a08f49590071e2f1fa7af2a61e9d72a767f78","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-14.5.0.tgz","fileCount":19,"integrity":"sha512-agG2qgjInXVC22XCX3g/wW5Vs7k2BL2/7x5DNnqIo90xA0M8Y1xKb2V3XfSzNs2N8mLByhNafuCGYUrbn39daQ==","signatures":[{"sig":"MEQCIDZDPsdVFg2mYghSTleDp20Ns2d09NJfvOB0SYDCFUh5AiBm2H+XEWImntUGyrPYQ2QvoPZXcERcAVyc/IFui7vmNw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":90791,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeH1xvCRA9TVsSAnZWagAAhSQP/0SWyRdFORV1MTKy4HVx\nMZJ/G5TlApmH9w0hkFrTfeGfYM3yWf84kk7gPF7hzQ5vXt2yj1RzBYFBlBhU\n8gCGlHvVB4oBWjImlHBC60IUQ8QWFGVNmNSVlvxJAJXMD0JLFfMOUaU1o6x5\nTIiDuzhIY8y8hPZsAVYglLoimeHqlQQ0e9V2ylG6+7HRxrzjnucbQUIaj3R6\nTBvUxfcW63HdJe29+aD+mVlEn+gCnEdpnU6KofhIWxBBoDm9cyH7CTCHFm0z\nCWz5FSuRv0WHybpEDAng4F1boM3SD7JLyB2Wzoj/4rrsbXAe3THiE6hVaamW\nlNu5+waIs3SE7uu1xugOd9KfwM5FzhR4p8tWxU9i/3iLUgfCaTeJAN5/H1WJ\n5B3dM9RrGHsG5ZxeOA3xkN4knekdmjWLfMa1AxPCMVfKIq9dZoP9sfljrfyc\nnscMyXSTuBn2YSESXjBznPin1BxxJeTO0Lppt+o6WsMhRUbxBhSNHAMoiw3S\ni7uaYSwQwcYm5FdPSKEK+4RdNBb14WGGcCHvFDikAOj0HeqhFdrBXgXZ/ahV\nUOKC2mqn0ouLyHWbJvwzRIStLkp7JxUytA5q0GmJIDLL9ShinV5AnCsNb88/\n2VIas7mDrm81ncHRUaQWgYlk+JutTH/SzVXJrumZSGtEwdB208TrVYbfvpDP\nNl5N\r\n=KiKg\r\n-----END PGP SIGNATURE-----\r\n"},"gitHead":"d291f3b448e377d22524dede7beb4da4a0b28560","scripts":{"ci":"npm run check && npm test","test":"mocha","check":"mongodb-js-precommit","pretest":"mongodb-runner install"},"_npmUser":{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"6.13.6","description":"MongoDB connection model.","directories":{},"_nodeVersion":"12.4.0","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","async":"^3.1.0","debug":"^4.1.1","lodash":"^4.17.15","mongodb":"^3.4.0","kerberos":"^1.1.3","storage-mixin":"^3.2.7","ampersand-model":"^8.0.0","ampersand-rest-collection":"^6.0.0"},"_hasShrinkwrap":false,"devDependencies":{"bson":"^4.0.1","chai":"^4.2.0","uuid":"^3.3.2","mocha":"^7.0.0","sinon":"^8.0.4","electron":"^6.0.0","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.7.2","mongodb-js-precommit":"^2.0.0","eslint-config-mongodb-js":"^5.0.3","mongodb-connection-fixture":"^0.0.14"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_14.5.0_1579113583190_0.45511611874855395","host":"s3://npm-registry-packages"}},"14.4.3":{"name":"mongodb-connection-model","version":"14.4.3","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@14.4.3","maintainers":[{"name":"aherlihy","email":"anna@mongodb.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"brookescarlett","email":"brooke.yalof@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"cilix","email":"matthewlevenstein@gmail.com"},{"name":"dcoupal","email":"daniel.coupal@mongodb.com"},{"name":"deafgoat","email":"deafgoat@gmail.com"},{"name":"deepshah","email":"deepcshah@gmail.com"},{"name":"dpercy","email":"davetp425@gmail.com"},{"name":"durran","email":"durran@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"glowe","email":"graham.lowe@gmail.com"},{"name":"gregg.b","email":"gregg.brewster@mongodb.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"jimol","email":"jim.oleary@gmail.com"},{"name":"jon.franco","email":"jon.franco@mongodb.com"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"lrlna","email":"shestak.irina@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"micheal.parks","email":"michealparks1989@gmail.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"mpobrien","email":"mpobrien005@gmail.com"},{"name":"redondos","email":"aolivera@gmail.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"ryantimmons","email":"ryan@rytim.com"},{"name":"sampoonachot","email":"joy.sampoonachot@10gen.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"schwartzrw","email":"schwartzrw@gmail.com"},{"name":"scottsidwell","email":"developer@scottsidwell.id.au"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"terakilobyte","email":"terakilobyte@gmail.com"},{"name":"thomaslangston-mongodb","email":"thomas.langston@mongodb.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"vrachev","email":"vlad.rachev@mongodb.com"},{"name":"wz3chen","email":"waleycz@gmail.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"206d49a86edc8c5b912eae13ce2f07f6efa06ceb","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-14.4.3.tgz","fileCount":19,"integrity":"sha512-kxkphLb53h/Jz8ZPpHUyenLd8bQCNvXhrqmiGrDRQ8klhvFqcHvgTvkatWotx0F93gZgFOTOGtdzSXVUgwUs4Q==","signatures":[{"sig":"MEUCIF+XqKjsbGOB6VH84i0FOQtDHPzSOPSiSO1M57ri6vm+AiEArSpShxt/bDYgQ86f3gC6evqsy3+so8HU0Tcnhpqufes=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":90959,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeJb3jCRA9TVsSAnZWagAAQ8MP/jlkxPtsXFyEPg16qxJd\naBVn9o/vWfC7x+rDnqkui55s3EVReNNoyjLEVKU0lXrZKJHnEE0c7qKbCpX4\n9YszDq1BQAOoEewlqWRbw5yydaD+JAXLfk0TuJ21HPb2VDhONhZjYLObfe1D\nXcx1EHyuwxJWQ5450HkA9tEVrmgXMmcB7D1ttZa0sz3wOLNqN0dFE3SYjS3W\nNATWYvl9mFFSnNS7ExqmhHcPkgaJC/c/z5Qmm6E9a8bUtaxP3Le6/T+5xDpH\nisuKSov2B4Qtq43ZHj7curXuVHA58JdZ35v167pzKlrymgSVAw9PB4YQjuKY\na6SDxdenho+A+o4zqnVUNC+pBgvWzVPErwt9fpTDKDsnju6X9PgHp4IvJ38M\n5zgaOVBZFlBQ/2s2mXYA67pVjnUCzKGz3fyfZsx2yHnmUvbTWFF7VQzWbZ9x\na1dlg8+I8Ug4l81y+Dqj6keHmj2bp9/0w/pSQ8bM7ukeYL/ya8MsSlaGelH9\nOJbNwR1f1rcY/KXhkbGvh+7AwAat5j80uov2pWbyv0DrjbRoCEzo9drV9IhD\noA1d0RIPJdcQ5FwhWxE1zNng6AMR2gv7vnlPuNnNIdhfqo62ZAdZL6Y9eptz\nRGq7pIbK080o7AAMCkSAE+475OUJ8jXKdsrUBtenVAJzz+REyx4ebPOkuDJp\n+3mY\r\n=DAjT\r\n-----END PGP SIGNATURE-----\r\n"},"gitHead":"6d88f4f323ea5ba0ffcb7c4079c080b0520d73a6","scripts":{"ci":"npm run check && npm test","test":"mocha","check":"mongodb-js-precommit","pretest":"mongodb-runner install"},"_npmUser":{"name":"alena.khineika","email":"alena.khineika@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"6.13.6","description":"MongoDB connection model.","directories":{},"_nodeVersion":"10.2.1","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","async":"^3.1.0","debug":"^4.1.1","lodash":"^4.17.15","mongodb":"^3.4.0","kerberos":"^1.1.3","storage-mixin":"^3.2.7","ampersand-model":"^8.0.0","ampersand-rest-collection":"^6.0.0"},"_hasShrinkwrap":false,"devDependencies":{"bson":"^4.0.1","chai":"^4.2.0","uuid":"^3.3.2","mocha":"^7.0.0","sinon":"^8.0.4","electron":"^6.0.0","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.7.2","mongodb-js-precommit":"^2.0.0","eslint-config-mongodb-js":"^5.0.3","mongodb-connection-fixture":"^0.0.14"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_14.4.3_1579531747285_0.8663771885871807","host":"s3://npm-registry-packages"}},"14.5.1":{"name":"mongodb-connection-model","version":"14.5.1","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@14.5.1","maintainers":[{"name":"aherlihy","email":"anna@mongodb.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"brookescarlett","email":"brooke.yalof@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"durran","email":"durran@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"lrlna","email":"shestak.irina@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"scottsidwell","email":"developer@scottsidwell.id.au"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"c69e93f3f663adf9a15df2ced751513a63f45179","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-14.5.1.tgz","fileCount":19,"integrity":"sha512-GzOyKK2+90AVI7Gyn0/Zlw174u905L3a4jbnkdpuSm8hG1ROYTvrao83+c05g9g/bHKjnA2wovQ8tOl6nAUJAg==","signatures":[{"sig":"MEYCIQDyqydh/BMx0+fXte7j1ydfng+1ZobZ/Ixw/BA+W+dohAIhANeST8IZYxSXGToYX1JHTDVQSW82Ox8hkH4j/6ht0fHP","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":90993,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJePV/vCRA9TVsSAnZWagAA39IP+wcFpmer/aRDoVW3HGLK\nJSV/NJkz0mqUI8epuo8kzLRvYOSpbdZKpUdo0IMk05VcWhxDTY8uYsWknBkK\n7+OLeCfWB63rj18O3EOSkUr3GlmApG2nuwoySmxxPGsJU2AEYIo8j8KpgnOR\nxJL34i/zw3l48u5IQwld6MDQXZu/VNgwNSJKSqZTEpzm33jDJ8ujBahLI9JB\ntRirJZrybZ8+3tKrAiQRBqcLSSPi2rWsoypMDvHdiZfHE53JMO10t9XKn486\nDHlt5cDnC0EzIWQeUxy92txEaYYAf2NJoXlbP9JmvK/IUEOG09vnCC2W506G\nRRy9TPSKsrBlDTFUiEsFc4Ean33jTA8RB8r5Hj0k7gp6QdoCm7T/Qf+gp4xC\nEWBGna3dceix+mbL10cDJEIBL7wqbDL8+VAVVXX1AqAzm7tOWUyTK8ONzpsQ\nYq7pM7cP83zg4N5F5NMQFLNP0bdAKFvSz3GJl3XqkbqvYsw0Av26q8Eo1RQM\n2zThhXJjCqcdEmfyyahYwM3eMxLNqN6vf1jzmj3+taeThqpBp8ol0qVzTj31\nfvNhn8bgIIYduMDaZMQmTlJBVipaWkII7WfsquZeYWuijHwd1GHWq141gH1f\nEdbDOEKC2sHDfimNAdybgfIgwk8c78WSpqP+wFf09S7L2+uSr3vrIsXtRU19\nBnKJ\r\n=O2kK\r\n-----END PGP SIGNATURE-----\r\n"},"gitHead":"86d22b911615145db75672f18f3b6d50644e0e59","scripts":{"ci":"npm run check && npm test","test":"mocha","check":"mongodb-js-precommit","pretest":"mongodb-runner install"},"_npmUser":{"name":"alena.khineika","email":"alena.khineika@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"6.13.6","description":"MongoDB connection model.","directories":{},"_nodeVersion":"10.2.1","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","async":"^3.1.0","debug":"^4.1.1","lodash":"^4.17.15","mongodb":"^3.5.2","kerberos":"^1.1.3","storage-mixin":"^3.2.7","ampersand-model":"^8.0.0","ampersand-rest-collection":"^6.0.0"},"_hasShrinkwrap":false,"devDependencies":{"bson":"^4.0.1","chai":"^4.2.0","uuid":"^3.3.2","mocha":"^7.0.0","sinon":"^8.0.4","electron":"^7.1.10","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.7.2","mongodb-js-precommit":"^2.0.0","eslint-config-mongodb-js":"^5.0.3","mongodb-connection-fixture":"^0.0.14"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_14.5.1_1581080558833_0.6458108459455134","host":"s3://npm-registry-packages"}},"14.6.0":{"name":"mongodb-connection-model","version":"14.6.0","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@14.6.0","maintainers":[{"name":"aherlihy","email":"anna@mongodb.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"brookescarlett","email":"brooke.yalof@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"durran","email":"durran@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"lrlna","email":"shestak.irina@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"scottsidwell","email":"developer@scottsidwell.id.au"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"28dbe02386abdd747750f5ae865ce3a6844de722","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-14.6.0.tgz","fileCount":19,"integrity":"sha512-xj+Dl+219v5MsAPt7heposXcQQFgxC4vd5Dpg6uUqrDEPI3xpT3e29gJPADBPx9pwZTQzrqnpV4/4fHwj2nZOA==","signatures":[{"sig":"MEUCICUnmEUFJPPle4WPmgQVmq7jh9RZ4IHEFOMYZ3kY+yI+AiEAtJhQykKtEXZaxa32Q+DOJq0OviOZjysmdnY/loQhOPQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":91608,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeQYEvCRA9TVsSAnZWagAA75UP/A2xTdWSl8NgIhZVQL2M\nq2vIjKJJaog6qgSckiYoxfCRjIbIgyVWtyqYE9kMACBEzWZeZl3zy8hO1m8f\nXrb9TwkasGO3n7a/8dm6PBHn0/GfwupEAHTVZtg4FrwARufShKBBBh9V9BXd\njPRGyZUtT27qQGHN/4E9J6ubLaKqonh3dRXblk7LJu9NSggDWdOEbCBDq3xE\nMOCvwfvFBR3LErNATTW8Gbxuxhth+VybM3CmiFcdQi+f/URkBsiZPwP9yvDf\nwu7P8TnomC2fIoKPpLHHK8s9szBdEK6862GQ5W8ZaLb09kyjlr39pEc+F1+e\nIJ+wKs2mnKlDvSWO7JyTWsS06Rflwt1NbikgGFmhJYqqZtY+J3lOMHNKizUw\nynH2E6SR4lxxJPNdkpPIvrTw1tfGXSqBiycQKTHfMnHIDEJF32CQ0fswjwR8\njP+CnfumghTfZZ6k5nKudCIQaA5xjpYKyotcGJEpJ/V05yYyBwIkPX6VESQi\nsb9LXnasNjEtHGbSrwDY97mkus44ucRZZTV68u6o2joIZJM6jrajgZN1Evpt\njeTVhdjA/CFwf6xqy2xDp6rO1xZMAGWXkAqqvyk3fLAIynJeVFfpwLdaprRU\nQ8LDRlZ1gtGRR27BpIwjFwcEwBUy02rrBhCPWI4UiG/rgDQBX2Lh7Xm7aeje\n5so3\r\n=fo8G\r\n-----END PGP SIGNATURE-----\r\n"},"gitHead":"124ff2f1bbe8edd6460e24c246db2d6d30e5a919","scripts":{"ci":"npm run check && npm test","test":"mocha","check":"mongodb-js-precommit","pretest":"mongodb-runner install"},"_npmUser":{"name":"alena.khineika","email":"alena.khineika@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"6.13.6","description":"MongoDB connection model.","directories":{},"_nodeVersion":"10.2.1","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","async":"^3.1.0","debug":"^4.1.1","lodash":"^4.17.15","mongodb":"^3.5.2","kerberos":"^1.1.3","storage-mixin":"^3.2.7","ampersand-model":"^8.0.0","ampersand-rest-collection":"^6.0.0"},"_hasShrinkwrap":false,"devDependencies":{"bson":"^4.0.1","chai":"^4.2.0","uuid":"^3.3.2","mocha":"^7.0.0","sinon":"^8.0.4","electron":"^7.1.10","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.7.2","mongodb-js-precommit":"^2.0.0","eslint-config-mongodb-js":"^5.0.3","mongodb-connection-fixture":"^0.0.14"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_14.6.0_1581351215056_0.6461631145740685","host":"s3://npm-registry-packages"}},"14.6.1":{"name":"mongodb-connection-model","version":"14.6.1","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@14.6.1","maintainers":[{"name":"aherlihy","email":"anna@mongodb.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"brookescarlett","email":"brooke.yalof@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"durran","email":"durran@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"lrlna","email":"shestak.irina@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"scottsidwell","email":"developer@scottsidwell.id.au"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"0b27e393e4cfe65f45c535a71753b0272ba9f4da","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-14.6.1.tgz","fileCount":19,"integrity":"sha512-zXqxLvvK+IAp97bCBlynUU2SQTVX5aE7QfgkcZQ5/6V9vcCRYjHJs4HR2owbGkAXfTjxPkc6nHYWPV2AxJyjXA==","signatures":[{"sig":"MEUCICQVj9S+iEO4Ykuk3YL56mGxC/wn7mqfFWHHmmPdd5NIAiEAwLh6d4TJhkc0UI8owQDShrw/J9N6JYNYkw0vLBuLZQk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":91389,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeQskaCRA9TVsSAnZWagAAvocP/3EACsgDub5mOwtDDEyk\nuEy+PNTb6VPYzpf6yVtWAjXYaRqjd3XZ4vXTyn6jr2vPMnKVeNC2qzLhVr9b\npZNIa4t+UGgH6JYNjLgESMEE1DcNoPjxe85GvLpmlMR7PNhpjRAfVFx+Jmgc\nYar/ief2AWWBE+CvjtTcqkM0YcAhszSSfZc2HfjeZlaWVnvcgOSRc8EUyXAM\nHWM5DuaLn/WbAdh2QOX4wtGqty/Jlm1aME61bL/Gf6vH2ftA6qZ77lHieg4/\nPNbY3BD4i+yY1i62OAYpBmIM+sb1e7nzMXW8jNxAcTweYuvu8hzogPMX/li2\nNSiRg8hMKw2JAzgU7pTlByN4ix1wROg31cCZk1GCSSWxQJ5AuKMOFomTUGgw\nrWY1al8VSRwhw788W3UnepDwLkcbGVY3A718wfVMhseVjV+XRpYfgLh40iwR\n0bM9WAwfQIFlAnOm/MbdqsoiEf5iAbyQn5VJMDwwEghLcUPlbRqMCYQHiZ1U\nv8qjBAffaMEjkFS4RSNN30wQ3CEPxdUQWMutoJRZ98nDwhCG5zM+YbxkOR9j\n4ZrG3qHksNiWFLZK6S1lN82kV4t8ZNEOeOvujetuVQ9A3Xh7OZ2aIEyV7MEZ\nRDA7lWlDVDPnhPbJ1tgu+uGMIN5/Q0OweLIA2OeIaTm+zQedYcH61SzKSwGU\nFXVz\r\n=6CDi\r\n-----END PGP SIGNATURE-----\r\n"},"gitHead":"4423e4adc79e0be189160211e764c98884ad6094","scripts":{"ci":"npm run check && npm test","test":"mocha","check":"mongodb-js-precommit","pretest":"mongodb-runner install"},"_npmUser":{"name":"durran","email":"durran@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"6.13.2","description":"MongoDB connection model.","directories":{},"_nodeVersion":"12.4.0","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","async":"^3.1.0","debug":"^4.1.1","lodash":"^4.17.15","mongodb":"^3.5.2","kerberos":"^1.1.3","storage-mixin":"^3.2.7","ampersand-model":"^8.0.0","ampersand-rest-collection":"^6.0.0"},"_hasShrinkwrap":false,"devDependencies":{"bson":"^4.0.1","chai":"^4.2.0","uuid":"^3.3.2","mocha":"^7.0.0","sinon":"^8.0.4","electron":"^7.1.10","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.7.2","mongodb-js-precommit":"^2.0.0","eslint-config-mongodb-js":"^5.0.3","mongodb-connection-fixture":"^0.0.14"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_14.6.1_1581435161807_0.13779321003821532","host":"s3://npm-registry-packages"}},"14.6.2":{"name":"mongodb-connection-model","version":"14.6.2","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@14.6.2","maintainers":[{"name":"aherlihy","email":"anna@mongodb.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"brookescarlett","email":"brooke.yalof@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"durran","email":"durran@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"lrlna","email":"shestak.irina@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"scottsidwell","email":"developer@scottsidwell.id.au"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"b9e350954415aa1730b541dddcf1346665405a74","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-14.6.2.tgz","fileCount":19,"integrity":"sha512-Xa0jLNT+1j4n4NTxNiGQ+3fOQrrSuX37Bme9xFvnZe12XADS9770eb4BMOrT/FgnPY3OSzDt3CyWDyrMPcZsuA==","signatures":[{"sig":"MEUCIQC8vrUVnUSznRLdijUYWdw3vGoTvpFSUx9fsAguCRKJ+AIgYm1hvUCvda6PA3l9VuDbwFyU1SULs6QEHljyIahJdGc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":91448,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeSqNhCRA9TVsSAnZWagAAiF8P/0Rk8tAaZ7PqmefXOLiU\nA8pIHsYiV06YNyBCOfLxUF3GQSJLDx0qc4XdFWpt5f/LMx9tSWTF5rHIzGFG\nNZ0jS7PJok01SoukjW67Hs6SiV2mvgRCaPREzZT3XxokO/fvM7kEr89pjfpa\n9sprensQDpa4eYxGI3dgzrq2g6JleyNcUT7WtHkjbbtF5Z6Hlg6veoQVCbVd\nsQqccOeY5WQVkO646uSHK7QH1fpELyxvWeecr75phgokYHtynGVvn0N3+ffV\nGbP9KusE0csiNuGyRCGGHgnACOvcRixSKSKt2GbEAphGtQCCy1WGWSxyW6Dk\nBFxRDKuuIjQ8psx45Y45n4SOLvxizVAe2J0M8lnf9695mQPAzhkFyvuJ1ULg\nd2hSAPRr27Uoh84z4qHVs8CWDFa5XH/o5j0Qq7Ycj4D5ndS8mQUbsJNJo+DE\nQXfiJe0yw5R5fpFuFYS7Jn9PXzpw3OvK/cR4esKuHTh6J5mPW3M0SYKuqBht\nG+b0H6Aq67JJHRr89pbHrDfAbHXsO9fs8KhIS42scotK2Sawrq5y36XDJBhn\ntzPPdDnOTa0/8s8ZgbsOvWUht3nAlHX3qfGUa0pfHO41K6NDxFrxYj1GRdWY\nEF2yhi/I7S/h5W7D45nIN6MC3dhHYt1736wgiiGB2qK7Gt/6Ir7tY29+F+Ft\nI8s8\r\n=piPz\r\n-----END PGP SIGNATURE-----\r\n"},"gitHead":"40157fbae66dc9b5372fd824e8671b27acfbca03","scripts":{"ci":"npm run check && npm test","test":"mocha","check":"mongodb-js-precommit","pretest":"mongodb-runner install"},"_npmUser":{"name":"durran","email":"durran@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"6.13.2","description":"MongoDB connection model.","directories":{},"_nodeVersion":"12.4.0","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","async":"^3.1.0","debug":"^4.1.1","lodash":"^4.17.15","mongodb":"^3.5.2","kerberos":"^1.1.3","storage-mixin":"^3.2.7","ampersand-model":"^8.0.0","ampersand-rest-collection":"^6.0.0"},"_hasShrinkwrap":false,"devDependencies":{"bson":"^4.0.1","chai":"^4.2.0","uuid":"^3.3.2","mocha":"^7.0.0","sinon":"^8.0.4","electron":"^7.1.10","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.7.2","mongodb-js-precommit":"^2.0.0","eslint-config-mongodb-js":"^5.0.3","mongodb-connection-fixture":"^0.0.14"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_14.6.2_1581949793319_0.6334165337062758","host":"s3://npm-registry-packages"}},"14.6.3":{"name":"mongodb-connection-model","version":"14.6.3","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@14.6.3","maintainers":[{"name":"aherlihy","email":"anna@mongodb.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"brookescarlett","email":"brooke.yalof@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"durran","email":"durran@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"lrlna","email":"shestak.irina@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"scottsidwell","email":"developer@scottsidwell.id.au"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"bd4a270c815de82d54764a03af5557ba2fde2d19","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-14.6.3.tgz","fileCount":19,"integrity":"sha512-XL/2dMRplozhxJFZOJIgqwaMZ8IpJJNYrb49j3B4Y8LpUQ7tHa3+JaLpr1W5XyNER3fVy++uSK+yIAFrLxboCA==","signatures":[{"sig":"MEQCICOd50X0RnW19T1/9WBlY74B11Ie5iR6PtG4gMUrvliYAiAEzTzq5MVClmrJIIc/4jGo+0mf+6ra3FaY133NXgNbUQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":91471,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJemDvvCRA9TVsSAnZWagAACkwP/0RbaMDDMKE3ax+cp9hz\nyyoUf/5BwzuajUX/w9XWjbUW+hoPNhr8FmeCrYnTkmhY42B/ZFHMxPlMiwq7\nraUiB9M7+J98j45U0jYcOoTYvyXLqYytFhZf7zy627eKjO8Jjn1/vJSzth4l\nJDDdHdxsFvLDOl4rEurS1+d9mlzny8lOFuIJKYZcUg5BCo1nj7uv91ZEoqS9\nI0mMkTjQl7vUUPcYkmHE7UfKDJcQ9a6z2ubdQqp2Zd2OfiCqyA4brvZK9FJ5\nya3fqWf6v2uSDz89sRg4YN8Q6EBeAJRiZN9J4cGngguIvJ5LMSnBEcvkPuHT\nVQ/laGopxyLdWYkMA2iA1SDTH0zhS+ZRbTgywPyqYjyZ3XbBjtwt2C1KPrjp\nUE7bTuskSLlWs7US4lpVc0j2/zqHBVuWYaQ5QjnlKLntyLggkJnpsoTD3EfV\nm631WsyN8H4bWHpnJEMkVT+KOv5jQ2KOTxmIT7YzkS54thLPAH1DWcc9R4P8\niYhmvmOKzaak7Bbtqg6hOB5hv428m/gL5zv6yHjS0hedYzfwikaRAsbqwgrZ\n7jVWRBksQ4RhCtRKIw+QEb6nrwvPe4QVJkhS5IVAIJKToZsWxG+FYnJai/lR\npdjpNonu5WRd0dIqoVIsffmTaRsBF3aztCxM3oE7UeQX86BUC8q0WK/O4f5r\nAgkz\r\n=lpRn\r\n-----END PGP SIGNATURE-----\r\n"},"gitHead":"5dfe9c93f2d5568e1a54ff99b30852008922bef0","scripts":{"ci":"npm run check && npm test","test":"mocha","check":"mongodb-js-precommit","pretest":"mongodb-runner install"},"_npmUser":{"name":"durran","email":"durran@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"6.14.2","description":"MongoDB connection model.","directories":{},"_nodeVersion":"12.4.0","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","async":"^3.1.0","debug":"^4.1.1","lodash":"^4.17.15","mongodb":"^3.5.2","kerberos":"^1.1.3","storage-mixin":"^3.2.7","ampersand-model":"^8.0.0","ampersand-rest-collection":"^6.0.0"},"_hasShrinkwrap":false,"devDependencies":{"bson":"^4.0.1","chai":"^4.2.0","uuid":"^3.3.2","mocha":"^7.0.0","sinon":"^8.0.4","electron":"^7.1.10","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.7.2","mongodb-js-precommit":"^2.0.0","eslint-config-mongodb-js":"^5.0.3","mongodb-connection-fixture":"^0.0.14"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_14.6.3_1587035118618_0.7849051302790973","host":"s3://npm-registry-packages"}},"14.6.4":{"name":"mongodb-connection-model","version":"14.6.4","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@14.6.4","maintainers":[{"name":"aherlihy","email":"anna@mongodb.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"brookescarlett","email":"brooke.yalof@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"durran","email":"durran@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"lrlna","email":"shestak.irina@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"scottsidwell","email":"developer@scottsidwell.id.au"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"e18e9b15861dcec86e7fd9879422a4f31725fcd5","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-14.6.4.tgz","fileCount":19,"integrity":"sha512-pPjey7zqUVUnbCdX3GjnEsWdZ50xjSiCWaGRzg4PjfrrbN7WHS3d5MpKT0dKu8/ggYEw9yPJ05l280sHPVf2fQ==","signatures":[{"sig":"MEUCIQDkJ4Ytm82gjp0OvcTRTpzvMYg5XM5Cs9jTuKlPOcFpYAIgMNb8v8h6vXipWyNYApYnV8HVa2klWdMUVa5Uhh3hADo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":91479,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJemZ0wCRA9TVsSAnZWagAAE6YQAIRsaPln1UV8ovhopK33\nw/8U6FMKuP+m9EMPJIyyMzrAK0LanuMWHYHWsmzGGBZgQg+pBAbbe+z1Htud\n4TZHUOHnlJp5ZrFWMBDEP+a9TbP1KxZJrPCeT7NSpssX4zYeAehtSoDq+jHm\nS+g4GV+LweeAEyuMCP2qzrgJUQzN7fH4SDWxnbs2x3K6b/5vc25vc3/n65FK\nU6X9LJV5Fw2k8ey4HfKLi8xFx5PEWBn9HqCnLOf8/R5/xhPPN50XNd9EKu3P\nqea7rsVi3lYk5OAu33syOYCvynUTDgQIuBGMgz4Kq7bcUhRzbCnLuRyk3OF6\nN95Yu+yO4sJtxYsGRJ8np+Ek6IycdyBqnZQzG/h4czwxXjv/5I83tmcRaPwp\nisJ676sVaKCT1F/Ms0Mwxc/+bTGrOzThAu6sJjR80Y7CDtTk7sPCXcX0M1vD\niXXz8+nF2UPGtmJaNul8OIYJ4DMhl1006sRP4QzI+FZS8pgvX8LnAgOW/7FX\nAs87wv6izVONrvvr8fG94qlULss8onAnUCgaK6vBeng+lw9vifY+14C5OKc/\ne3FQALZBnVONocSMZKNc9KXi1jhLBxbEQFVxZd+14ligHw27YnX3POtJ1rmd\nj9n5nXB8fd6fRMZjoMOeCLJrf2/rcoBlgoeZe8oh6q70Qgm/dk8a3yCx84iW\ns9n1\r\n=oZGR\r\n-----END PGP SIGNATURE-----\r\n"},"gitHead":"59243680b5b31f08ecc0c96ee2882407fcbd0aca","scripts":{"ci":"npm run check && npm test","test":"mocha","check":"mongodb-js-precommit","pretest":"mongodb-runner install"},"_npmUser":{"name":"durran","email":"durran@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"6.14.2","description":"MongoDB connection model.","directories":{},"_nodeVersion":"12.4.0","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","async":"^3.1.0","debug":"^4.1.1","lodash":"^4.17.15","mongodb":"^3.5.2","kerberos":"^1.1.3","storage-mixin":"^3.2.7","ampersand-model":"^8.0.0","ampersand-rest-collection":"^6.0.0"},"_hasShrinkwrap":false,"devDependencies":{"bson":"^4.0.1","chai":"^4.2.0","uuid":"^3.3.2","mocha":"^7.0.0","sinon":"^8.0.4","electron":"^7.1.10","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.7.2","mongodb-js-precommit":"^2.0.0","eslint-config-mongodb-js":"^5.0.3","mongodb-connection-fixture":"^0.0.14"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_14.6.4_1587125552477_0.42860995292895776","host":"s3://npm-registry-packages"}},"14.6.5":{"name":"mongodb-connection-model","version":"14.6.5","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@14.6.5","maintainers":[{"name":"aherlihy","email":"anna@mongodb.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"brookescarlett","email":"brooke.yalof@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"durran","email":"durran@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"lrlna","email":"shestak.irina@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"scottsidwell","email":"developer@scottsidwell.id.au"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"ca814a960c69f6d248a4c89eb0cde63c0ed34b7c","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-14.6.5.tgz","fileCount":19,"integrity":"sha512-0XTl8j+HurP4o4wmct5jlh/gtrxcD8F4TOU7yLu5H3FZmZYt7PanS95z8PeLfDNUuYrgt7cu77cRpOQCKE81pA==","signatures":[{"sig":"MEUCIBkPN+WGgwenU3/6phc4BAHNMC8UfVw4JfnW1rx+xgsGAiEAjS9b7f4ihcvDMjGgyeA70xHyqcxCpk7OpO3gZA8u484=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":91479,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJema2LCRA9TVsSAnZWagAAuwkP/jgfmECeUXEt8J8Rfs+v\nKQsnLotaqTZjMD4ZRwdjR4zhMlkWdKXwJ9WhIhFFOtO9Rcd8OJt71zC9zAMi\neS4vSuH74fgGyYtVZAxgfj/L8A5hTRkJqfrdSzBCVRt5FsBJ3KlxXbtS/uIK\n+EI98cXr0FMb06FjddkiQ6iLWt35V9aXTjfloOAcXDUlrGIQTB2cPpq5tRjr\nGET0LGI0D9Wvh1nDDFtZfxaEUJSnFN5NHDOZoIR4xNm28jxcKOl8RunKnawg\njizC60bYEAECKJJbGGIWV7+m8K/GWo92g6/VczsqANfOpJCRQL41zmzkgjma\noTP5Jpmlh4Dtvw2FMmXpHgGELkDnX2dUYpoqj8SVHcGTL/xBB8dxhSk05Nuj\nXTgekwfgJB9AZHXxFk3MChk6kaisHiH4CEwx0ThJxVEHoVFiPLawuZokN5dy\nPZTp+TSZRgIylU4U3unplc/pLyRWKnzH1IdTY6pyC4qXpgYoawaZVRjixNIK\nh9t0pq4FFcUq7jfCvxLBZu4ndeyFm6ZR4eJGqft+Ij14l9t5pIwZNddDEwTK\n3WeNq11LhIVFhxNsCbtiIzcP4NOaLLpmCxl1PxRJnszccWM2/ws5RIZFVFcS\nT8kKlCjyrJQxzqPkiIMthEXyjKT15IdVC0EiioBfdtl5Gfs+ol8b8nDFxy4+\ng8W3\r\n=Pwhj\r\n-----END PGP SIGNATURE-----\r\n"},"gitHead":"7de0a55fafde501bcf706f8cded96b5467b0ef7d","scripts":{"ci":"npm run check && npm test","test":"mocha","check":"mongodb-js-precommit","pretest":"mongodb-runner install"},"_npmUser":{"name":"durran","email":"durran@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"6.14.2","description":"MongoDB connection model.","directories":{},"_nodeVersion":"12.4.0","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","async":"^3.1.0","debug":"^4.1.1","lodash":"^4.17.15","mongodb":"^3.5.2","kerberos":"^1.1.3","storage-mixin":"^3.3.3","ampersand-model":"^8.0.0","ampersand-rest-collection":"^6.0.0"},"_hasShrinkwrap":false,"devDependencies":{"bson":"^4.0.1","chai":"^4.2.0","uuid":"^3.3.2","mocha":"^7.0.0","sinon":"^8.0.4","electron":"^7.1.10","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.7.2","mongodb-js-precommit":"^2.0.0","eslint-config-mongodb-js":"^5.0.3","mongodb-connection-fixture":"^0.0.14"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_14.6.5_1587129738744_0.477538650098176","host":"s3://npm-registry-packages"}},"14.6.6":{"name":"mongodb-connection-model","version":"14.6.6","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@14.6.6","maintainers":[{"name":"aherlihy","email":"anna@mongodb.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"brookescarlett","email":"brooke.yalof@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"durran","email":"durran@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"lrlna","email":"shestak.irina@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"scottsidwell","email":"developer@scottsidwell.id.au"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"d19255a763afa56941bf73a669fbfadbc60ca2d6","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-14.6.6.tgz","fileCount":19,"integrity":"sha512-n5Ac699Q0r0f4fcpZ7KMeWE3W7nX0OuSgAlhLc48dWZropG4pBuoa7ODrdIpHv04rc5Qt2GcMpcSzBnubk32GA==","signatures":[{"sig":"MEYCIQDWfEs9P2ZLkKA0GTkJsVLwMIDYBYxZHFfOPhjqIAVmBQIhAPA3Ag8gFKdUEUdMYnL+OhmD8IZWbkjC0OWtwpBZHHBD","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":91452,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJenrQeCRA9TVsSAnZWagAAoV4P/1lO2QdOAVA6LE822KeU\nyv7Ac2k3bQmYmX+YgJaOO9KqBWhe3fhuGeLHNO+A/VIhHV+IbIjpkuV+R8ON\nBs6k309dKHzWvd9Rsm4ko8n7b0iU8+4YZtODL8JeLkHA1jN5VGFGEWtO5Q1V\nfcQVRiSZ4hvj7llJOym37ma5I+grpNGoRketl8ZHJ+l/8DCtzF8XU7hV0iwj\n9yeriFMD15OvxlMI99yVSndF2Kit4giDyNnY2+8/Ivdat2axvJDZjiYtTZG/\nP84CTX1UJY6hlCkMqp2MwoiOqj0cltMEpvm45NhBAHcP5Ni09P0cnCSbWEqH\nwKN2+a1SYM66Sn7GA1uVR4e1aqkD2DNPW5F7QuxcmLjxz1UwWB9Z4fwxbEQR\nuliexgrUYh6Ps2GnM9W9sSMVV2HbsocrCHNmMcUbk/wsLZdTNzMfhXfxZMzP\no1BALfSG+NqMH5W15cclAhEtAkVqnOZmXMDkgU+lgMAhHW6YyQl16DbF4U3w\n2C8ybWYHoVvh9Mf5KoJ2SyPNqj+HqBZ5BNIWNADMWsbESWBmfkSkt9kqynfc\nWGMS+mTy0cw0tXzF2XUTrKOULpPwutxVat9MF9makVx+YL03I/WCHBd+nCcq\nlGSkIWilyus18PRVOMt4GK8VdT0v1Jh3jR1bk77ZeTjVr8zCRH2UK9NgMZpO\n5UUC\r\n=NGRR\r\n-----END PGP SIGNATURE-----\r\n"},"gitHead":"a46feadb0f6306d1a8d1124239ce3ee55c640f5d","scripts":{"ci":"npm run check && npm test","test":"mocha","check":"mongodb-js-precommit","pretest":"mongodb-runner install"},"_npmUser":{"name":"alena.khineika","email":"alena.khineika@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"6.13.4","description":"MongoDB connection model.","directories":{},"_nodeVersion":"12.14.1","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","async":"^3.1.0","debug":"^4.1.1","lodash":"^4.17.15","mongodb":"^3.5.2","storage-mixin":"^3.3.3","ampersand-model":"^8.0.0","ampersand-rest-collection":"^6.0.0"},"_hasShrinkwrap":false,"devDependencies":{"bson":"^4.0.1","chai":"^4.2.0","uuid":"^3.3.2","mocha":"^7.0.0","sinon":"^9.0.2","electron":"^8.2.3","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.7.2","mongodb-js-precommit":"^2.0.0","eslint-config-mongodb-js":"^5.0.3","mongodb-connection-fixture":"^0.0.14"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_14.6.6_1587459102356_0.394595989220903","host":"s3://npm-registry-packages"}},"16.0.0":{"name":"mongodb-connection-model","version":"16.0.0","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@16.0.0","maintainers":[{"name":"aherlihy","email":"anna@mongodb.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"brookescarlett","email":"brooke.yalof@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"durran","email":"durran@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"lrlna","email":"shestak.irina@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"scottsidwell","email":"developer@scottsidwell.id.au"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"53137e527a67c3a84b300c7c403695e8a0d67794","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-16.0.0.tgz","fileCount":19,"integrity":"sha512-x1XIhvSGg7kCKuegZXIqE7OHx13hsPiSddIMRY4TDQJCdH+puduSOcIa3lw66psnj0y+hsi+m/ls4HOANqauMQ==","signatures":[{"sig":"MEUCIQDjxFgrNo77r/dFdFTo1PHPmIx5voMRn0sFO11MxtMOxQIgPSzGMZMrDCh9wQjUKn7SUNxLb19HjXx9OEtFG9Re5qc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":91451,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJent3uCRA9TVsSAnZWagAASioQAKB5dDKQFRQV16NM3h8w\nnjQLJ4n4ZnEQWjDR3bPQj1DYiCbjRMFFe4RI3g+l6Dfsoz1TwCNLeIbxKRQ5\naI6lzCo7DgDEztfDjYfHpKOWpGwE7vVjDL+cBmZxiAebJP3uhf9gnst5mn5R\nrUupGoE7Mna6mavNp/LuWBJm+iGqiBdspxhOueDP3N2Bzmf/B8cug9bfGeI4\nNpomG59m0OoeqEr/zqHKATDj3r4piSLY3jEosoDwKD7b2NqwRO6JcnwHEGy0\nVhOiRjeWSKOm8z3XuaUi7cHcxMGgUN3sHcWpDyVvupgAEky9A2A8KMXR14qf\nOz10mEtmdmYWFCPwMRAJksHEQJGAzTBr4pnY0Zu+Jpj1Lzx4Jxf20EZIjZ5q\nmYglFscUyk9/VvZGBFk+gXGFS6m0Nse3jvnMwpfuAPQXSJr1nJu1hdVT0i+s\nMRNP67mdvDlCK6grTdodATHumd1YymwCRI7iZCcC7eFj7nzH/FW3y3ZRBtCy\nEmVXiFVBCg7Xyb0GF78wG5zgKCYigBSZUcFqbK3sj6LHG94gVAXSaxTFnQKR\nHZASiMZfvU1ZCvrkNQqWS0Qxxz3u7cjzt6oG7VEj7qIY/2HaxEqJI1XtLt8R\n5u7e4xq5oi09JqEjtAHU8tsQv7aiDH3hlmHrRTuypFeLlFiXSIXWuKl/CPQh\ndPwR\r\n=vQex\r\n-----END PGP SIGNATURE-----\r\n"},"gitHead":"1355f973be570d8974e9e4302ec7a5ace23a6960","scripts":{"ci":"npm run check && npm test","test":"mocha","check":"mongodb-js-precommit","pretest":"mongodb-runner install"},"_npmUser":{"name":"alena.khineika","email":"alena.khineika@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"6.13.4","description":"MongoDB connection model.","directories":{},"_nodeVersion":"12.14.1","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","async":"^3.1.0","debug":"^4.1.1","lodash":"^4.17.15","mongodb":"^3.5.6","storage-mixin":"^3.3.3","ampersand-model":"^8.0.0","ampersand-rest-collection":"^6.0.0"},"_hasShrinkwrap":false,"devDependencies":{"bson":"^4.0.1","chai":"^4.2.0","uuid":"^3.3.2","mocha":"^7.0.0","sinon":"^9.0.2","electron":"^8.2.3","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.7.2","mongodb-js-precommit":"^2.0.0","eslint-config-mongodb-js":"^5.0.3","mongodb-connection-fixture":"^0.0.14"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_16.0.0_1587469806427_0.2132072658312245","host":"s3://npm-registry-packages"}},"16.0.1":{"name":"mongodb-connection-model","version":"16.0.1","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@16.0.1","maintainers":[{"name":"aherlihy","email":"anna@mongodb.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"brookescarlett","email":"brooke.yalof@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"durran","email":"durran@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"lrlna","email":"shestak.irina@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"scottsidwell","email":"developer@scottsidwell.id.au"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"5fd9dd01e739496320b57ba4a5bd83e98612be25","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-16.0.1.tgz","fileCount":19,"integrity":"sha512-UxXmx7MRxo37DE0ex8Nb51+1Psqlcauto5dlanKwQhlgUTUd9RYK0n9Ju+HSZmvEyZK+sC86k3etTwP1Su1w0g==","signatures":[{"sig":"MEUCIEdUH54hKxlI++848oqxUy/CQWhK5Cg6hFYibla5GvH3AiEAsWkwtoxV5zqKhBNg52ACEfrr3VqJpLJ4Noz74Q0jPYs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":91751,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeuZ31CRA9TVsSAnZWagAAtScP/1yXj8HHdEPJZxLVTneH\nR6CjeRt7gcvYQ99dh/GxaLYMm3AFqQGmS3GhIC1wo6+do2lixpWbemPeswnl\npgpStDapyc9/GyfIjRnik0D3wElz8WPXWMF3Er/c7LJ+d2kTxRD8K5cm7bbf\nrgLUuVV2zOEF98gz2pg1ir40a3z6j5UbTfY/DdgImU7CojyqaR9Lefc0rATU\nJIKrmA6KEQrUauMX+fYvQOCqqWnDZenKVudNtYQVk61JbZDqqB94SWBKeiiN\nUUXTz8R7higZsgjOIjEH8NepchTzbdUxPzMq8DhPKqr94xvCwyW81Kqdwqfi\n4O4zxa+aIZs4NE+J40R43c0IwrJi5xRUj2X1fbx7RBYzTI7SZ0BWV8WD+N86\niE+2f17ZeSZTQ1QlmR3UVowyG9DPxDVdxkwdu0jwJeeI+Xim6OF8W+1m8Y1f\nacNeiC5tPfVOiEpYXTupfmvqVrPGvjOCuYb+AhNaXFgrbnBajklbrDamKnOY\n+KClrNXJ+CdsW84QUWxaol+4mRc6r5Wqk6bHsiHu4p98G+maG4UM8lxrWczV\n+zwtmLhx2Uq5U3ekygccpBWWR5bf/+2bxn2EFefKqTCt0g5EZgNoaoR1v9bL\nCsiS/fqn/dcwvGmTjV05qEnlyoyP/icEy/qiOKcYOkWwhTHI51kfe7PKr2AV\nsrYP\r\n=sqcO\r\n-----END PGP SIGNATURE-----\r\n"},"gitHead":"6c35413c0757427066f783f1d2209bad6161bd67","scripts":{"ci":"npm run check && npm test","test":"mocha","check":"mongodb-js-precommit","pretest":"mongodb-runner install"},"_npmUser":{"name":"alena.khineika","email":"alena.khineika@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"6.13.4","description":"MongoDB connection model.","directories":{},"_nodeVersion":"12.14.1","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","async":"^3.1.0","debug":"^4.1.1","lodash":"^4.17.15","mongodb":"^3.5.6","storage-mixin":"^3.3.3","ampersand-model":"^8.0.0","ampersand-rest-collection":"^6.0.0"},"_hasShrinkwrap":false,"devDependencies":{"bson":"^4.0.1","chai":"^4.2.0","uuid":"^3.3.2","mocha":"^7.0.0","sinon":"^9.0.2","electron":"^8.2.3","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.7.2","mongodb-js-precommit":"^2.0.0","eslint-config-mongodb-js":"^5.0.3","mongodb-connection-fixture":"^0.0.14"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_16.0.1_1589222900492_0.42073238249985634","host":"s3://npm-registry-packages"}},"16.1.0":{"name":"mongodb-connection-model","version":"16.1.0","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@16.1.0","maintainers":[{"name":"aherlihy","email":"anna@mongodb.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"brookescarlett","email":"brooke.yalof@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"durran","email":"durran@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"lrlna","email":"shestak.irina@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"scottsidwell","email":"developer@scottsidwell.id.au"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"e0b3d17ab335d4406db0d3f61cb309c9e8a0c664","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-16.1.0.tgz","fileCount":19,"integrity":"sha512-f3NmkgYoSXdoYYht70LyOPyrLTkLDfxLuYcnKVp9B7YxaWoueJKP3qwxlCeB9UolV6rMQolvHtYCU+hfSs43bA==","signatures":[{"sig":"MEUCIQDEnDIm1xl4HuHOZWwEkFl5hUvxM/d4gEZMgXPtJi5X4wIgBykvuGrTWVKJ97/WSkxa3zQJ9Dh9BWm5Ypm4FZIMLfw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":91609,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJewnKVCRA9TVsSAnZWagAApdgQAJvHkqAJuO/p95OW24VC\n4nfIyYUOpgDPXYApM07vaalaKeMraZsC4jd2mF8+drA5fd+JjtLSrSSeSM58\nWOXlq9JcLOikF3d6lrylEb0RlQcfNzPzOfcaVZl+i2mKjOWqCDSty5MStRt/\n6IxnHAv4U+1p85MRxNimZLqSbWi8izQE/Xi4AI8vAAjlIdGLmtKPS6WMMwYH\ntz2DqliK/lS6VAJXvS3r6lDxXtm3Uj+dU98JARgyrlJ3RPZtqzjHN6UJK88I\n5hmDfLNFLN9yNTf8WOwzTZwL5lDCPAqdmkxcYO8UaIBboFauiFGI8qYYuQRi\nqSJJOPbCksMtAaoegE/3zBANmM6fqLgiPV0SwI9Pr5ub2R0yN2/HR7DVRbha\n31kLdt4xHf+enKQ1wcyfJ58xPFHDcw9LBDYen7Wqv6PE3Cb0/jzsTphAlQjr\nRxBVtm5lea8dqfGU3SpPgMlvDgJmhdoo5nNyPr2DhixtrGcLK2qSdBJJotO9\nHODeqwP9xjDnQ/Rttt+i9q++42et1lqAu0PLc0GJNDCbxaM3SsQEEioAj7eW\nffAdGqOdIVka71+q/7Eyv+CY97aVaFPvLUND9759Zb8bFaxgJen9hQjQZDfz\nXnQeedn7rkNCzwibBbE4IgfZwfZdKjqy/yRSD81Dt6BLbHK3aZIq/szr4gof\n/H/1\r\n=W3XI\r\n-----END PGP SIGNATURE-----\r\n"},"gitHead":"1399fa1405882a6a9e82c52d6adb1c769e3ae960","scripts":{"ci":"npm run check && npm test","test":"mocha","check":"mongodb-js-precommit","pretest":"mongodb-runner install"},"_npmUser":{"name":"alena.khineika","email":"alena.khineika@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"6.13.4","description":"MongoDB connection model.","directories":{},"_nodeVersion":"12.14.1","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","async":"^3.1.0","debug":"^4.1.1","lodash":"^4.17.15","mongodb":"^3.5.7","storage-mixin":"^3.3.3","ampersand-model":"^8.0.0","ampersand-rest-collection":"^6.0.0"},"_hasShrinkwrap":false,"devDependencies":{"chai":"^4.2.0","uuid":"^8.0.0","mocha":"^7.0.0","sinon":"^9.0.2","electron":"^8.2.5","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.7.2","mongodb-js-precommit":"^2.0.0","eslint-config-mongodb-js":"^5.0.3","mongodb-connection-fixture":"^0.0.14"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_16.1.0_1589801620860_0.5387613732175853","host":"s3://npm-registry-packages"}},"16.1.1":{"name":"mongodb-connection-model","version":"16.1.1","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@16.1.1","maintainers":[{"name":"aherlihy","email":"anna@mongodb.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"brookescarlett","email":"brooke.yalof@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"durran","email":"durran@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"lrlna","email":"shestak.irina@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"scottsidwell","email":"developer@scottsidwell.id.au"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"4a0f185fb872ffe25e7b2f232da9230d03b8a978","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-16.1.1.tgz","fileCount":19,"integrity":"sha512-UUQ9aqyW+Don5jQ7KuQ6r5THeoPo6e1W4DgCN2YYcRKXE5YMLK2zdgKMuP/17jp+cpqWHyarbxIo2JTvCefnyA==","signatures":[{"sig":"MEYCIQC+fTMc3xhQ0X+Vo5DmY5M8kIJkKo+kl8E39syFCdRF1AIhANKBrOnDDzgLjjx68hDyB3OU9Dz2fMoF5yc63K0RNTSA","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":91609,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJewryTCRA9TVsSAnZWagAAlDwP/j9ckXp7xbL/9pHPVcbT\njZMP8E+GJig+3a7hIPYm1NzGjz24UVLylR+K2YkvlP+mO5lxfDwU2wLgs3RO\nswfMk7iZlI1nmZ9a1rPleBS82E0N2lyAy4WrmqLwhjCxceVmJc3yPVmrub+N\nFF55rUXbVl2cNVn5YKaYWewSuBmwoip6RHZRzupEkSQkeQDutNKPT1lTxigu\njuMmasqMrY0hac9Tv2R31nl6X0EbaWjZRbfkE1t76RG7lz2Y871cufKAt7rs\nb5twyqWZ56sgLnyjMxogAYakz2B5ehAW7qx3ApXUni/Tw/ANLB0WcHjqerFR\ndR2HK3HXFShHHUin2J6QsFicK+GA/K9jK6aQi3d8BWgfz6gWMRGjRLwhdq0D\nfFt/AEIMzRTuwjByDbQChJEUzIb7qOL4FmgqZz+YcEn5up8Z9c4U+3NtDNwr\nLidXOUv8+cNkJt8IVwQDqaOY3FJZPIND0ONcvXbrMu2Cvf9IYmO92A6sRyv5\nm9i7EykvxlDaNy9GKvvfqyvLUFG6ARb4wCrpdDv6VaM5ZXxSe/1dgG60eqaj\nB4yDRFXMH3yj09Er2QKXhg4OvwtJ1gdEwY/UlW58WF174LzDD/pqXesiqVsx\n9uA50mfAnxLelEdbV4oN9vNuuOHruasZzbSuumw5Cbpy0F0DaeecvTUaYjUS\nidRV\r\n=AYR8\r\n-----END PGP SIGNATURE-----\r\n"},"gitHead":"c06b4eff45e8d25a99b9fb33efcec2bef1312cfc","scripts":{"ci":"npm run check && npm test","test":"mocha","check":"mongodb-js-precommit","pretest":"mongodb-runner install"},"_npmUser":{"name":"alena.khineika","email":"alena.khineika@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"6.13.4","description":"MongoDB connection model.","directories":{},"_nodeVersion":"12.14.1","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","async":"^3.1.0","debug":"^4.1.1","lodash":"^4.17.15","mongodb":"^3.5.7","storage-mixin":"^3.3.3","ampersand-model":"^8.0.0","ampersand-rest-collection":"^6.0.0"},"_hasShrinkwrap":false,"devDependencies":{"chai":"^4.2.0","uuid":"^8.0.0","mocha":"^7.1.2","sinon":"^9.0.2","electron":"^6.1.7","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.7.2","mongodb-js-precommit":"^2.0.0","eslint-config-mongodb-js":"^5.0.3","mongodb-connection-fixture":"^0.0.14"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_16.1.1_1589820563459_0.8270759146344868","host":"s3://npm-registry-packages"}},"16.1.2":{"name":"mongodb-connection-model","version":"16.1.2","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@16.1.2","maintainers":[{"name":"aherlihy","email":"anna@mongodb.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"brookescarlett","email":"brooke.yalof@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"durran","email":"durran@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"lrlna","email":"shestak.irina@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"scottsidwell","email":"developer@scottsidwell.id.au"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"36ae4fcf04d956d37ac2ab5a8abb85cf5fcb2fb0","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-16.1.2.tgz","fileCount":19,"integrity":"sha512-05rCV05dLOYrZ55Zle5fi3YZIkzRH17c0vWRxaP+ueB/2EwbtUIWZ/jxFPqHjoqaJPTHeElHN1X5lxEJ6pPrxQ==","signatures":[{"sig":"MEUCIQDlK32UOfw3JTZaAgemC+0vSnlEhVNaODvvCjxiZzLChQIgciOQ57Who2NUsiEUtb/6CECxffsvO3QrS2hfhzIb9wI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":91625,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJexQEPCRA9TVsSAnZWagAARNUP/iQ/G9j1V638PG+WoNw6\n4uWdcuKLS5EWa+EocBMfiEjGW1oI6Ha0t3zmkFCZ+4t45D/q8wppWabRiAnE\nOowyy4rhJITIMpOcQsg8GBLlg6bas91xiPYzAEnCcfOm5nofu6VQ+/mto2Q8\n5kvnc8B5t1VsICUid8vk+eHhb7FeckuFdSjNz5oQ4doqoB5n/Poj5nER0xMz\nj4Ec1ngHnTVA+zhssdS7R4VJJl3UpjC4gHg44i1XJ5hKrAd11WQ41w3/7A9e\nByu4rCaxxplBAonE5TEJEysmusmJHX6lgZshxjPHF3/WW1PVXbPK0hD5YVC0\n1IrXm/EocgX/Rdp4W8BiEvnTu8Nsm+qZ+g55qiTaqkbgfSeK8wHrqEEpnDgZ\nHOMRIvq8sm9Nyxj9piLjMkZsSkVOEVC65pqgLI2ky/dc7PLy+il5abwvsUQW\nIcFMuEiMnHKAcrFxUOaiPqOHPfc0TkJtZMIS6XSn5NpB/5whEa2AaTELsPjR\nk0eNT57CDYly1UqRVJKzg7fRjmBU2FMD+FxG1jE8J4mWLJKO/03TM6NbtMah\nYoQClgbZZeOT/3iwC8zOlEUF3Ra6SqYyDZDScZhCWXJhUwymy9veRiuEzta8\ngze1JrO269ED0sWJFj62jmaoiZPfR11rW7oRkJakxKewOnMLil4av5RtuXa0\nlmqm\r\n=tr8E\r\n-----END PGP SIGNATURE-----\r\n"},"gitHead":"d82b09198b02ded010e901c608605ac4136047fb","scripts":{"ci":"npm run check && npm test","test":"mocha","check":"mongodb-js-precommit","pretest":"mongodb-runner install"},"_npmUser":{"name":"alena.khineika","email":"alena.khineika@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"6.13.4","description":"MongoDB connection model.","directories":{},"_nodeVersion":"12.14.1","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","async":"^3.1.0","debug":"^4.1.1","lodash":"^4.17.15","mongodb":"^3.5.7","storage-mixin":"^3.3.3","ampersand-model":"^8.0.0","ampersand-rest-collection":"^6.0.0"},"_hasShrinkwrap":false,"devDependencies":{"chai":"^4.2.0","uuid":"^8.0.0","mocha":"^7.1.2","sinon":"^9.0.2","electron":"^6.1.7","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.7.2","mongodb-js-precommit":"^2.0.0","eslint-config-mongodb-js":"^5.0.3","mongodb-connection-fixture":"^0.0.14"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_16.1.2_1589969166547_0.2885202463551886","host":"s3://npm-registry-packages"}},"16.1.3":{"name":"mongodb-connection-model","version":"16.1.3","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@16.1.3","maintainers":[{"name":"aherlihy","email":"anna@mongodb.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"brookescarlett","email":"brooke.yalof@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"durran","email":"durran@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"lrlna","email":"shestak.irina@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"scottsidwell","email":"developer@scottsidwell.id.au"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"905c125ce617e85a03f14bd27ddde5bb372ab731","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-16.1.3.tgz","fileCount":19,"integrity":"sha512-X+7DsO4QhI8hvdJ86dfo7BHdhTDpMgacJzBupDmt55tuDX0ob2/A70Rn4pxIEnkccqo9sQX2wblhZsZRnGBmQg==","signatures":[{"sig":"MEYCIQDDlDoHjg1ctlU90Hd7+OKgcIT4ynYyd56m8SnGoevZwgIhAK9tF8pG5MeX57cwKH4NWdR2pmDp2pUpLusG1Xx6ybSp","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":91706,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe4lKqCRA9TVsSAnZWagAAohsP/RfXvfdhS1Mv+Mtjg7Vz\nAansiQHSPxhQiYd6wzgR1eFOSWqcfODsfVLaqApAQneY2sBTnE2UftV1RZNm\ntJ+qFF2EqvMipVtuTaB6aPd8wesrBAKQcnRn3x9j9VmfKvWUkEJsytV7h7MH\nxXEHNesLygYHYnzTlbxQfLvVCij2Go+5MpRR1xJ6qq1bJ8LQ/eu5KbP1yfd5\nGWgnI5bAQj3waNJVUo75PGT2+J2Vp0dzSIM8xELFbvwPEF/WMZlirNsOhZu1\nT0Ln1EEMqsjcWjP/A0FgmaSFHOXvPEEfUFtGLkqVdlfBqZVCvbf5urRRXpXc\nBGO2G7nf2sg52tfc7v5Ld7iuepZo+U0xgKghIL5SudgN2+IOyck+VN2JnZ9b\nrh4Mu1tIfP3eYD27FMhmNvo9TpivWfoyMNim1GI/I91H+RT6IHQJQ9fzisAs\np6lk7EvyC5LXN/AhmEOOvMwIbmo3WIHrV5ccDkZLvGE9PZk+eXs2ODW5uRm7\n1e3jwttlIriTCdBv4AX537fnZAP/1h6shdjRgFTu/4vaBpULzhfc6uiM1wBq\n0dbJkGOCcsst7uJe9G2aaan3t+AHgG+YhUl4jIq/p6h1CcoPr3CNfrmvQ+mq\nhlQuscA3Rgj8w81bKahVK2MRtm9tS4baP1nFYfdwjPpBleE8gFTOCG0N/2zq\n/DKH\r\n=MMa/\r\n-----END PGP SIGNATURE-----\r\n"},"gitHead":"bfc0cc55a128682500aca3f9017fade7abe1e1dd","scripts":{"ci":"npm run check && npm test","test":"mocha","check":"mongodb-js-precommit","pretest":"mongodb-runner install"},"_npmUser":{"name":"rhysm","email":"rhys.howell@10gen.com"},"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"6.13.7","description":"MongoDB connection model.","directories":{},"_nodeVersion":"12.18.0","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","async":"^3.1.0","debug":"^4.1.1","lodash":"^4.17.15","mongodb":"^3.5.7","storage-mixin":"^3.3.3","ampersand-model":"^8.0.0","ampersand-rest-collection":"^6.0.0"},"_hasShrinkwrap":false,"devDependencies":{"chai":"^4.2.0","uuid":"^8.0.0","mocha":"^7.1.2","sinon":"^9.0.2","electron":"^6.1.7","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.7.2","mongodb-js-precommit":"^2.0.0","eslint-config-mongodb-js":"^5.0.3","mongodb-connection-fixture":"^0.0.14"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_16.1.3_1591890601739_0.2905073071884361","host":"s3://npm-registry-packages"}},"16.1.4":{"name":"mongodb-connection-model","version":"16.1.4","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@16.1.4","maintainers":[{"name":"aherlihy","email":"anna@mongodb.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"brookescarlett","email":"brooke.yalof@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"devtoolsbot","email":"team-compass@mongodb.com"},{"name":"durran","email":"durran@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"lrlna","email":"shestak.irina@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"scottsidwell","email":"developer@scottsidwell.id.au"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"e8418a3b9c73b2facf539e916590c155673e1c5e","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-16.1.4.tgz","fileCount":20,"integrity":"sha512-QxLAuqlhxTb9b3ErklkIwx8ClPcrgQ1yMh/G7ARDqI8a/c4EFnBgbzRmtPa9XKgX30Yu1Ur7NM4RzDm4V2V3Sg==","signatures":[{"sig":"MEQCIEw9Z6E8KtYfIN+j/kSlO8gTbkg6Hj5raHnkG4NkUOCeAiBwRR5PFUrtzyQBlfrZ63lhVwvQ38vYz0/T3K0Icq2P3g==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":91878,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfBzzTCRA9TVsSAnZWagAA5coP/3TNuYYcIIDaV7V6Zf4V\nOGz+/6cC1jdLu2fsw2dOmHUsvWn52BYeQn3C+1fT94zBkFTknkafECXh5sXZ\n/vsqJ2NliOCCIQfke2toDFs7No+9JlfQJgEJsbdU6Rijz+4bE5EFPo7/uFVT\nvkbXpDWCVME3puYFTgvNk3HkmRu82lN7IZcNuntsza5wXZn6be4AbBWZqsfl\ntaXFDMt9e3UOO6Yq6EOjcbAI7NBSGVA1RyNkODU8MUdvHd00+JVKyhoNAKVq\nVa52/5IIY2id39RdrpdEex0zKPByBLmTlbm4JOAaIuoKgRNB9ELjTE2gz63a\np7Cpj2Y2jEgNo494KZl4dWw4hx8P58Cx+h3x+Lv0O9MSDJQ/lls0+kMVOwFX\nokM55+lfs/X1Kur6KAsnAb8FnR5U4aXDib7gbzLwhLzIGYRgl4v6yykk5Hxh\nmj4hPepqxJ2b4TTyzfD4Bo4fUsMOkKDBwPNeB66jCSn8AU2Qx/JrlYxSIm6K\n6Ore8N9FJD7ku3fvr/wmPEsBWDaBeQ8bcI9iGBh80VyBTojNH1JWucurb1EH\nfOnD3ow7aKsHxYa97WgEuK+gcxS8f3296CoTZC3dRbK3C7IddAsXuaNVLeXi\nBKN7nLavK0E5dXvqxMyrHaR2lCp2lv5RNG3okjmZHfgr3Re2hYFG7dis7cu2\nCcM2\r\n=Kgff\r\n-----END PGP SIGNATURE-----\r\n"},"gitHead":"ceb54332b4088630b7302d08af78173d031b245e","scripts":{"ci":"npm run check && npm test","test":"mocha","check":"mongodb-js-precommit","pretest":"mongodb-runner install"},"_npmUser":{"name":"alena.khineika","email":"alena.khineika@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"6.13.4","description":"MongoDB connection model.","directories":{},"_nodeVersion":"12.14.1","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","async":"^3.1.0","debug":"^4.1.1","lodash":"^4.17.15","mongodb":"^3.5.9","storage-mixin":"^3.3.3","ampersand-model":"^8.0.0","ampersand-rest-collection":"^6.0.0"},"_hasShrinkwrap":false,"devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","electron":"^6.1.7","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.7.2","mongodb-js-precommit":"^2.0.0","eslint-config-mongodb-js":"^5.0.3","mongodb-connection-fixture":"^0.0.14"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_16.1.4_1594309843108_0.7874129715884026","host":"s3://npm-registry-packages"}},"16.1.5":{"name":"mongodb-connection-model","version":"16.1.5","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@16.1.5","maintainers":[{"name":"aherlihy","email":"anna@mongodb.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"brookescarlett","email":"brooke.yalof@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"devtoolsbot","email":"team-compass@mongodb.com"},{"name":"durran","email":"durran@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"lrlna","email":"shestak.irina@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"scottsidwell","email":"developer@scottsidwell.id.au"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"bcb2584b904d6e888bbe79dbbbfa97edc3a0a966","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-16.1.5.tgz","fileCount":20,"integrity":"sha512-VHS1LC9TAFOsbHlHdD+EELbcMsfsVWqd0qbRJ9PJoZULRtwa2xIq+cZbfj/DIaWNN9gkal5z1dpEM0BFMkeh6w==","signatures":[{"sig":"MEYCIQCPkFEgUbcQLmz1j7du+7xNmj28YDMPCGGrLOSmq11POQIhAIvvJ/YIPND0xOlv4Rz208P/qYxvQw6WmRuiOwjgjU/p","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":91878,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfNS1HCRA9TVsSAnZWagAAPLQP+wUUpngK8yMOc203U6U+\nqGrDId6uo6cjQAF+GFzS5Kbt/F3l6N/bKK0R4IgSj2c6H+jxE+haXjMoT2lS\nqelqxWUwOoy7Mc7S6ZIbExuBdhVPw5R+zG0bs8gIcwKcs8rXyltTmrtZkgxl\n146A9Imj7dbUd7qTBqQ7PLXi6jUxadzdMuTKFk4jSQQN8VYxgDD8145Pzu6e\nM2uv4B+KEg3ZbIXRwm3rot3Ztcius01w4KIwpdFNUseb6fqZmETy/dNWAIch\n0nYYp9QNdRb/o3rdFGhw2JyUcq/2R2b0eehtlPmhS1iBWZzYM7uqGdahw4yA\nI4M5crjQses3Px/qJSH+9C04MrmBvtzD/7ABlSmvkIHN8C1KHIwD2KKvGhh7\nNkE7HqUS5Fwn0Xpp9wTwQJNFR15vshuefmE/KtKwNpwajuC4zYuGPtcQM7EQ\nbJQs9VpYirvUbRtJOZunYa8pWgkLHHdcWyF6YyMDm9LRqduWGY8ITR0/NX7z\nyic7d7CjAklIZkKxhCyyJL7tjCZNqX8P2HabCRvjBNErop2uY63gyR+6p/GV\nNBxJoeWzHmgSIWyGUGATlaGMl0ZNQWYLOYvYYYq5K+TXHMOwpaD87rJbgsOm\nCT91LW9X3Gw2X3X9ZPb9jyVBV1k1d0J0hkD5aC/mqS8ffHTcJhNku422tCUv\nIOvm\r\n=4bkt\r\n-----END PGP SIGNATURE-----\r\n"},"gitHead":"64dc0b0c4edcb126db7dae9f55244d2b6404d7b9","scripts":{"ci":"npm run check && npm test","test":"mocha","check":"mongodb-js-precommit","pretest":"mongodb-runner install"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"6.13.4","description":"MongoDB connection model.","directories":{},"_nodeVersion":"12.14.1","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","async":"^3.1.0","debug":"^4.1.1","lodash":"^4.17.15","mongodb":"^3.5.9","storage-mixin":"^3.3.3","ampersand-model":"^8.0.0","ampersand-rest-collection":"^6.0.0"},"_hasShrinkwrap":false,"devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","electron":"^6.1.7","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.7.2","mongodb-js-precommit":"^2.0.0","eslint-config-mongodb-js":"^5.0.3","mongodb-connection-fixture":"^0.0.14"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_16.1.5_1597320519443_0.5654354554236958","host":"s3://npm-registry-packages"}},"16.1.6":{"name":"mongodb-connection-model","version":"16.1.6","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@16.1.6","maintainers":[{"name":"aherlihy","email":"anna@mongodb.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"brookescarlett","email":"brooke.yalof@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"devtoolsbot","email":"team-compass@mongodb.com"},{"name":"durran","email":"durran@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"judahschvimer","email":"judah@mongodb.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"lrlna","email":"shestak.irina@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"scottsidwell","email":"developer@scottsidwell.id.au"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"0ba5d34cfdb1b78045cf4d5b71fc5b1ae199d279","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-16.1.6.tgz","fileCount":20,"integrity":"sha512-eR38NXs99g9u6kZdmw8sUR8ggJeEb5rXuu2IHS0hvyO1R4W0EaKAXf+uhefZEJ9laPJyGTHm1UGlPQWlHH/XTg==","signatures":[{"sig":"MEUCIQCOu+im6QY417UWCHxqSAnkokBgGkQWgQI5cz5g9wbEtwIgSPGCHIcsROeyfsGiA1LO/C8/V7dOvjUkT3v5SDRNQ+g=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":91878,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfVfd5CRA9TVsSAnZWagAAG5oP/0GV7yupim4tOkm7Vtob\n/a+liHOsJiDvBofIy4KK93J0DKkQ4XdV+qZp0wUWU+1tFZr/Eqkum5amWUxv\nbAPO9c8PTGsuusFQBT9V/ENWmqTGHm2JNGXe/gm7yvI59cg0e3wFv29OoodR\n5Yxlx6lfNisGIP8acxTXdcFWfa7r5uy1uwlc2ZtwBLBrFjUUp92RmCTFyoRY\n1/zB+o41ow2ds9XIl6kdpoqRrBKN8uu4sVLtQ2YO65H5oUK/7JMyP5ojrwNn\nhOalWJbh/3ZO3CAUMPH/XHx+SSpGyninM9kirzizfFkIX76k5pScbWzfBrdV\n9SuCdKNPq1dMOFmFHox0n5k0EtwDMPEDX8XptzZa/8/L/sT/94oNxfMrQwyS\nLI2wfo1NL/E3YWnHFDkbs3G9/2o43pUwkcZ/gLTUoFFNlNH1KG+yJE+MvJaZ\nBmch3sDAWTppHB1dxDInmAKadxPDC71Zt5QSXEhs5TadasV4U2cxafK5Yla9\nmUhYsiT/rtWgBhMMD2JEIapRPc2Wv5OZWjJDDll4VW0CAt0OzDiFAEzK9Bxz\nBSFv+d2GmmN89LuWEbwOEqMQv1ozh1PSUWJIMlpwlMeriXhlOdmMqGCJqhKi\nykRTnN77/+ME9iiq1Nn7NwZJqUerlsSpuytzg1dbbXy4HiuLzinyKH5E0YBO\nStpd\r\n=k74B\r\n-----END PGP SIGNATURE-----\r\n"},"gitHead":"d7a8b52c7880853fec4f4a70dc2df05e6b422efe","scripts":{"ci":"npm run check && npm test","test":"mocha","check":"mongodb-js-precommit","pretest":"mongodb-runner install"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"6.13.4","description":"MongoDB connection model.","directories":{},"_nodeVersion":"12.14.1","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","async":"^3.1.0","debug":"^4.1.1","lodash":"^4.17.15","mongodb":"^3.6.1","storage-mixin":"^3.3.3","ampersand-model":"^8.0.0","ampersand-rest-collection":"^6.0.0"},"_hasShrinkwrap":false,"devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","electron":"^6.1.7","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.7.2","mongodb-js-precommit":"^2.0.0","eslint-config-mongodb-js":"^5.0.3","mongodb-connection-fixture":"^0.0.14"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_16.1.6_1599469432466_0.5209037298939867","host":"s3://npm-registry-packages"}},"16.1.7":{"name":"mongodb-connection-model","version":"16.1.7","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@16.1.7","maintainers":[{"name":"devtoolsbot","email":"team-compass@mongodb.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"scottsidwell","email":"developer@scottsidwell.id.au"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"brookescarlett","email":"brooke.yalof@mongodb.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"aherlihy","email":"anna@mongodb.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"lrlna","email":"shestak.irina@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"47e2b8b01073cfd68c2620fc484541c558f34ffe","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-16.1.7.tgz","fileCount":20,"integrity":"sha512-T5mcCcbNJkukRqgCJgKudyBX+8tAZcfqTytY1C1HU+IUzoQOVwwH6HKzsVf0ErbXobLF433/4X3QJ57/nzIvbQ==","signatures":[{"sig":"MEQCICSUNF3RthUhDD7hWntFJ5BjTruRyl3XNd7+YTNBj9+qAiAyN0HHx7D1lKgoZb/C7A16VbVEiOXta16jBCe3bvUPtg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":91878,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfV2XyCRA9TVsSAnZWagAATAMP/jdsUj1GNXNuABnZMZhA\nh3C/EuZefmwQ9VedKS3t7Dcm2wm/JJ9T6ynBpfnWHbRTksK0ffWIj7hoLWLM\nFEtK9HVbxNu1hCB7kLtp4l5S89QP0rTjjEWX+h0O/CcO4aeRRK1S9jIdoJMi\nRkZsV+l6ZEVj8375cnZ79jlpOfjB/36Q84/845p3xQicxVpcW8LRL86YunzS\ni13p9Cw+B8MPTlPTS9OHJQCes49BgSb5iIs0BPyNFY7SXYsoq7FEc/8H4LIm\nS9P09ty52C8gkHrjYluhm6eKdJUCx7KDRHTfsT2DqYkf8eQRgKOpWZxVKl9y\nNCvig3YDDvpZnOF5afckBM2n5ab1AaYDi8QBQA0t5oSnV4jHzT/W1pEYr8cc\nx/gvptYLt2+aRpgcilvlXkOe/AQ2f4i30T4AJnUfNK9rkUXFo1yTZGVvMH+x\n84hyvVduzf7b/rLAwzl6z/aGjaoVR4mA3Wz86UHO9yb+g9hCjhMN3IukY3Fd\nbjkKEpk3za79gebkE1Fx7/qkcr0ypUuSuIn0o232P4L65rXhp4ZVzTIlyRnT\n32HjI2KHVgnz3G6Q1wzJSiSVX6p6J2Emp/KhJdedmYHws10h0iC0keKQYfTv\nni6V0IPcRWNWEZ0poB7YdU3aeY4i5HOIF6iym1aTrDtiK74SaOLY35vixs3q\njuNW\r\n=GeMa\r\n-----END PGP SIGNATURE-----\r\n"},"gitHead":"b3b4636187fe1e50f97fc1e7594a975b55a9f3ff","scripts":{"ci":"npm run check && npm test","test":"mocha","check":"mongodb-js-precommit","pretest":"mongodb-runner install"},"_npmUser":{"name":"rhysm","email":"rhys.howell@10gen.com"},"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"6.14.6","description":"MongoDB connection model.","directories":{},"_nodeVersion":"12.18.3","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","async":"^3.1.0","debug":"^4.1.1","lodash":"^4.17.15","mongodb":"^3.6.1","storage-mixin":"^3.3.4","ampersand-model":"^8.0.0","ampersand-rest-collection":"^6.0.0"},"_hasShrinkwrap":false,"devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","electron":"^6.1.7","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.7.2","mongodb-js-precommit":"^2.0.0","eslint-config-mongodb-js":"^5.0.3","mongodb-connection-fixture":"^0.0.14"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_16.1.7_1599563250023_0.5608545548941393","host":"s3://npm-registry-packages"}},"16.1.8":{"name":"mongodb-connection-model","version":"16.1.8","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@16.1.8","maintainers":[{"name":"addaleax","email":"anna@addaleax.net"},{"name":"devtoolsbot","email":"team-compass@mongodb.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"scottsidwell","email":"developer@scottsidwell.id.au"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"brookescarlett","email":"brooke.yalof@mongodb.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"aherlihy","email":"anna@mongodb.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"lrlna","email":"shestak.irina@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"0594d266f4b90cbe5e37f0fc3c0c9ba5059e4269","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-16.1.8.tgz","fileCount":20,"integrity":"sha512-PhlfLYZhicERFhFC767SdN52VpTv0ZN+GU31lRqlCfljnaKuDuocytX4XhNupCSy0c6dKrNCoP+K3fDucevJYg==","signatures":[{"sig":"MEUCIFC7tkXw2+Ka60Thq6kQd6ooldks9wYniVP0EdXJby7kAiEA2qRdi0ZYjL1OBMw1dLt1YsUygIb4hfhbDfnNss9rzCY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":91971,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfaLxoCRA9TVsSAnZWagAAzrUP+wV3QHegJK6cvbJb4XrZ\nW9/p21cGeC8cHpfP+jMD/CflBtU8gEMGGIdhH5WHdouK16xE/YjtDKnG7R9+\nELX5IZlGdvXRx2uNwwnQ6RliopY2scNiqimhv4w2+RWuXTD4z1RvktYOhHcA\nW40WJagJO5MVfyF8e0isJo3TCL56NH3fLsmS4fz4ftek0xVGyegpZM9PBMKx\nx6qiIQQk9ei2ZWTZMM9OK9+ZvudTqt7iBBZJ2bri6tzdfrKrEPt6A4kMZM5R\nYJZvAaE82aB4AmxCmyVGTeCFH9qng80O4KWXYUWt8NFAoAyh7PBuEeNE+uJf\nzwH8SYy5gPbF0mvRWQW4UjrZGQIZ79cTHgizP2LLMjpxYlwbYeU5FqW04PKO\nCPDHrsBkCq+/xYb4w3JMimqmAvqZ/Y8cB1yN/+6F/awlKdfkNE/dP8azkjcZ\n8ZPyMqoZMMaYbWn7lce0JGSEiD097fs1Vu6vhGgOf1hLs0/eDgUbUEopcKmT\nCyh02fi8CJPpo4EM2tXWg4GL2tjR5wllJmpRr20rcwHj38Ixewm6cRr3rfdO\nu7pCCv4h4R9++7tC4wbF8SewB6jJBMuDPrktrH/UuyfahYVq16xpEWcJeaH5\nQ7vKp6TJEZPrw5qALWc3ELzKi2ImmdVPeFvjBgktO4TzPpA/jTofKEaanifr\nIHdy\r\n=YU6N\r\n-----END PGP SIGNATURE-----\r\n"},"gitHead":"a4a17426c30f880fa1b5a56ed19501b2f853fc8f","scripts":{"ci":"npm run check && npm test","test":"mocha","check":"mongodb-js-precommit","pretest":"mongodb-runner install"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"6.13.4","description":"MongoDB connection model.","directories":{},"_nodeVersion":"12.14.1","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","async":"^3.1.0","debug":"^4.1.1","lodash":"^4.17.15","mongodb":"^3.6.1","storage-mixin":"^3.3.4","ampersand-model":"^8.0.0","ampersand-rest-collection":"^6.0.0"},"_hasShrinkwrap":false,"devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","electron":"^6.1.7","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.7.2","mongodb-js-precommit":"^2.0.0","eslint-config-mongodb-js":"^5.0.3","mongodb-connection-fixture":"^0.0.14"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_16.1.8_1600699495630_0.4551761747709475","host":"s3://npm-registry-packages"}},"17.0.0":{"name":"mongodb-connection-model","version":"17.0.0","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@17.0.0","maintainers":[{"name":"addaleax","email":"anna@addaleax.net"},{"name":"devtoolsbot","email":"team-compass@mongodb.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"scottsidwell","email":"developer@scottsidwell.id.au"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"brookescarlett","email":"brooke.yalof@mongodb.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"aherlihy","email":"anna@mongodb.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"lrlna","email":"shestak.irina@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"2861b6444384e49a406deccce99216a37e207265","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-17.0.0.tgz","fileCount":20,"integrity":"sha512-/HeiuT5fuUlOsmycMwmi8QVqXv5J/ms2TJMdfhO9cG2Vf0oYjvrLVHVtOJIlSaDBeoicFR1TXNAh8mTwCgvfGg==","signatures":[{"sig":"MEUCIQCovoLr6TxIpHAwNAWZ8t/CZ3WwaY8IqrbNstWdY/m8VAIgZl1Ihqe274/jFzcH1qbPuzlpiJS7xAnvVpmVKZ+vY/c=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":91321,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfbhXxCRA9TVsSAnZWagAADQYP/0sXZr+OvRDkLcb074T2\njiI16RErBiMAZRwlasU7GIa0YKNhCwg1Hd9yzxvfLbz4i/Z0GDdeMuzhQ48j\n/gb06g7pcdW5IlBHjxV7zUGKakiMeoR9l8S250te09C+lbc83+qbm6+/QvTW\nOkrOoQXr33T+yo91EcQvTfTWIiZJwBJBj7xSH+DpHKZBATTj+ypL6yh/gHK/\nKK6/451atWC2VN49SEqEpwssapII8rioPDPm+WFqk4uY4lkmFfVYEXGC5jUz\nu0ZvX/QwlrAl0D4F4t5ahbZBi8dHdQqy0HqN0MWmBBmh3F+O6J7CkccOv4ee\nK38B0VX0ruDSutAPylEyKBd+U1NW2DPSLQNOCcAQyecXxHayAIJoQFp2dzql\nrDFCHT8puAPVgHtGMQbr9aYrlp0LXWVz1U2DQkdL9ptk9AloNV27GVRjTN5V\nxKYX9ttwg+i4vgkvHFLF+xYPPxF/GSpmceONnT0gy28PpNdFeVb/LTBEr7SA\n8NtRs7rzbiigbUHbTbjYMiiAN4p9izuRkhO8fPVDP2DPu92FUXGFGGcg9LMS\nbNCY2zRpuA/g5vKYqMFt/CvmDKOiLy9PpxuGNYgbrQb5DqNUMKqsTNglhaX7\nJlI/Hp0azY6UU37zKfXsyuiuy9qsPav9ZihNq2S3EJyC5p62Of6iEzmps/vO\nZE+t\r\n=jTsX\r\n-----END PGP SIGNATURE-----\r\n"},"gitHead":"3691138e825f395567ce14298c757e2674e96e49","scripts":{"ci":"npm run check && npm test","test":"mocha","check":"mongodb-js-precommit","pretest":"mongodb-runner install"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"6.13.4","description":"MongoDB connection model.","directories":{},"_nodeVersion":"12.14.1","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","async":"^3.1.0","debug":"^4.1.1","lodash":"^4.17.15","mongodb":"^3.6.1","storage-mixin":"^3.3.4","ampersand-model":"^8.0.0","ampersand-rest-collection":"^6.0.0"},"_hasShrinkwrap":false,"devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","electron":"^6.1.7","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.7.2","mongodb-js-precommit":"^2.0.0","eslint-config-mongodb-js":"^5.0.3","mongodb-connection-fixture":"^0.0.14"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_17.0.0_1601050096771_0.4386312526491858","host":"s3://npm-registry-packages"}},"17.0.1":{"name":"mongodb-connection-model","version":"17.0.1","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@17.0.1","maintainers":[{"name":"addaleax","email":"anna@addaleax.net"},{"name":"devtoolsbot","email":"team-compass@mongodb.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"scottsidwell","email":"developer@scottsidwell.id.au"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"brookescarlett","email":"brooke.yalof@mongodb.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"aherlihy","email":"anna@mongodb.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"lrlna","email":"shestak.irina@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"85f2d7f64ddedad00a7f79b7b2c54fd2e482fe4e","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-17.0.1.tgz","fileCount":20,"integrity":"sha512-nwbe03l8eUnIveicNNxXnhuPz4u1Uf8CjI0Zhn3jXh8iJ9a2ttT8iMZER82shKJcgqLwO7DTsHPMyxSgNVevXg==","signatures":[{"sig":"MEYCIQDUgAarMoR1icYhddgSrzcGXj3QQQnhiN1QilI8zpvYuQIhAOPcTMaggpC0fX4PO48jdo6klCWxwMGc7IGRopqQCcdm","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":91363,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJflqcFCRA9TVsSAnZWagAAO9UP/1FG5agwIhXhSY1gJtJg\n7wcokzpnM+v4LvzrfSOcZ/tfElFolc2GWPVR0L7mV/0fe2N+IGJ/Q4VRuwdi\nfNn7LBmteYljdwUkf07xm+KpG55yI8gzECDpQebzBP4gVjgLZ3Jz+lt45YL5\n+gDNmkaFJps570NisUP2s4U5pQdWA5dp7d2XnPF3ObLk9W5Fg2OIr7ebCynt\nuYR6E/7RPWfsBjTnHKgdSWm5MNmkG5w8SmKsEO6vQejqiSvjxbvfE/RsNy5q\nfOVgTZfg+J22yyrtVeq91PMwcHRV25XiBIpVPOdarbeEBeOBZbTNC0Fa9Qji\n0k5ghEyrP9MSGk3CrbycTy7xke2K3OXcxW6CJ4ueUcL4TqXtWUn7vRM9rOEA\n7vKqXhX7LnLYmDMgM1z82ym1iJjevYxROdvBOjalZD5ML/8jkkcOQKlp/dNH\ntTpRNpDpPjVWLQ0pW+0avzT+3FsasZI44z51CjuHVsw1SOV34DvIOuRj5/th\nA50Qwljyi08WpIpFqxKjIT9AquAo7lmKK7qTfEOIXtyaFVPbpPlgWWRhSkz4\nGTEIb+WHZ7eW/JV7OIm2O/XF4BhzANAvX74E8vAXHwz2zk/vskIbxpFXVw2b\nJ0ovqynEom1PwypLfBaoFqdURMKxxmOCnMsHM0IUE+XdUxHJZfyvgkHli9pj\nhE+P\r\n=VRmb\r\n-----END PGP SIGNATURE-----\r\n"},"gitHead":"f3884b7554d44c24ee69991c9c395b3186b6b4ce","scripts":{"ci":"npm run check && npm test","test":"mocha","check":"mongodb-js-precommit","pretest":"mongodb-runner install"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"6.13.4","description":"MongoDB connection model.","directories":{},"_nodeVersion":"12.14.1","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","async":"^3.1.0","debug":"^4.1.1","lodash":"^4.17.15","mongodb":"^3.6.1","storage-mixin":"^3.3.4","ampersand-model":"^8.0.0","ampersand-rest-collection":"^6.0.0"},"_hasShrinkwrap":false,"devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","electron":"^6.1.7","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.7.2","mongodb-js-precommit":"^2.0.0","eslint-config-mongodb-js":"^5.0.3","mongodb-connection-fixture":"^0.0.14"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_17.0.1_1603708676906_0.9690160032794142","host":"s3://npm-registry-packages"}},"17.0.2":{"name":"mongodb-connection-model","version":"17.0.2","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@17.0.2","maintainers":[{"name":"gribnoysup","email":"petushkov.sergey@gmail.com"},{"name":"rosem","email":"michael_rose@gmx.de"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"devtoolsbot","email":"team-compass@mongodb.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"scottsidwell","email":"developer@scottsidwell.id.au"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"brookescarlett","email":"brooke.yalof@mongodb.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"aherlihy","email":"anna@mongodb.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"lrlna","email":"shestak.irina@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"299b5e3393420114bbc39fc6de9ddb86079888a5","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-17.0.2.tgz","fileCount":20,"integrity":"sha512-JTLUh11BB0PmkWYiV5hLxGRabthuc64vZ/fdfPsewMTeQoU5GLzh74DHg0HPso2iIcCgSVhZiYjBjO3+0DPNhQ==","signatures":[{"sig":"MEUCIQDY+gOoCkNFC3CKMgSd4UVVovrgRpJ5RtLQi0WcSIS1hQIgZ7mn/1HK9HmeABJdn8YTcgV9Xe7Q24NnUkkgzxsK5Ks=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":91474,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfq8YtCRA9TVsSAnZWagAARX4QAIX732eFZ8xNL4WMT0yR\nVtUSWxnyCOqO/UfkCxOMfDm1J/xzqY0PsTCZMMc3Wp8+xZ5JsJNj9V7gPTqz\nwgoFKqZoLOXUqhCk9sLGWnINJqAO3fKh1AoQnraVglEScOIuK5pMUDNdOTdo\n7uNBsu4PQE9a3hNHMeXGZAsBR8Es7zKRPiyU63sfaztYYlnpfKd1HLw7uVsX\navyXKYssT7UaF4uHkXHR71Sa2c6xsuQdJZjDeHgZ5th+iio3edhjrlSdqijy\nzh3Ki61nZ0DpRcoOHTBNSnSUowLezX2cBiyDIp+1/2e8C+CoopKFz4HzNqRw\nTsrCltHncuX5fHzBHaTc+qz1ifzUWccQ7lnhjcYtSNqnXW1DOOwutSumkY4t\ni2VF3MQ5Iqluiq7inPU7lNGsgQOYcrb0IZi65BOdSkFrRNquymlN7twnG7j2\ntT61dFAgKwMkK6sdXfo2xXWB6oCujTSrq8bn2Z8D6n99npwqbdWmzIiqKqDI\naCAYnhRFs6sW/eeNLk6pCNarAToir7EUdpCwJAXnM+QmIojeEn7RYOIgXGgI\n8TpXdg1vFX6uhSV4jbqfMAjH++lANtlDKm48ArG/POK7Hjlz2Bs2BLQnTDjQ\n8ISR1ezJjjnb8FsP7JfqfDmFxEevFYZAebUPeM3FQ0boILYn3Di7ix30wva5\nFw7B\r\n=aDCW\r\n-----END PGP SIGNATURE-----\r\n"},"gitHead":"5d5c68dd9700fb0bbea2389834bde47722ec2152","scripts":{"ci":"npm run check && npm test","test":"mocha","check":"mongodb-js-precommit","pretest":"mongodb-runner install"},"_npmUser":{"name":"rhysm","email":"rhys.howell@10gen.com"},"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"6.14.6","description":"MongoDB connection model.","directories":{},"_nodeVersion":"12.18.3","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","async":"^3.1.0","debug":"^4.1.1","lodash":"^4.17.15","mongodb":"^3.6.1","storage-mixin":"^3.3.4","ampersand-model":"^8.0.0","ampersand-rest-collection":"^6.0.0"},"_hasShrinkwrap":false,"devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","electron":"^6.1.7","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.7.2","mongodb-js-precommit":"^2.0.0","eslint-config-mongodb-js":"^5.0.3","mongodb-connection-fixture":"^0.0.14"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_17.0.2_1605092908451_0.7095720034011317","host":"s3://npm-registry-packages"}},"17.0.3":{"name":"mongodb-connection-model","version":"17.0.3","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@17.0.3","maintainers":[{"name":"gribnoysup","email":"petushkov.sergey@gmail.com"},{"name":"rosem","email":"michael_rose@gmx.de"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"devtoolsbot","email":"team-compass@mongodb.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"scottsidwell","email":"developer@scottsidwell.id.au"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"brookescarlett","email":"brooke.yalof@mongodb.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"aherlihy","email":"anna@mongodb.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"lrlna","email":"shestak.irina@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"a88dcf05ed8802ed91fbb4f044322134702c4fc8","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-17.0.3.tgz","fileCount":20,"integrity":"sha512-P30yCR1V1e/uq81MBpMWl5Th+Qx2WvymE3JocfU3NF8ggrUFJsyEWrjMBi+6hD+qTxUF2N/tw9F/YC6rNCMHVw==","signatures":[{"sig":"MEQCIFi22KGgFvnfDRJp4J108hBaq72WYFzldk6mpLZpOxkMAiB6q2VExP+PTBxcqxi66AfmjKPEP2W585fpVzWD6PC6Sg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":92143,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfspw7CRA9TVsSAnZWagAAt1oP/0nM6G1/KSSrfuEz1cDr\n9i0q4Xq+dPzLRvP0/dkOAj0XCCyrrmJVr8U/NYm/WdAyJtwsTkYoCbEhTYDk\ntBNiYrqfECrSqJQsLhNm1/kd951tm+2SKw84y4qcX0BGe9TvE4yuNkzwmkLN\nsc9ztfoJxgdHGmOCVbaBC3kqOPLYCxuAV1fdZ4P6cAfwxG9X4Ao6+TZbYm/p\nnCIdnkaj1NMr8RJkXNIDRRx2cXcP2ESeK2Mq8KyJFv8dReUf4f2MXL8Z+wmg\nAm0ECvNCbuNKSbeAXA7DkrXJySo///oZrBvDtZ7bUckIWb+sV8CD9hrikJoG\naC/KlYTx5BGAyqVHMeqCHD1rzjpOxDtgqx7CitGV9pdU2FJL+5i2fmmVzlet\niGnNaj0Sw2i2lAisUjV+xZDAA0aSgZ1Jvo9JKO0N1EZ++qsFQe4GmNp6pbCY\nKiWRmSTnUTtvwdUd7AWrOdLxIlp2FEuou+C1Ldd1CeQDsni+9KopbLDZa1iE\nVeIGCBNLoQy9r/CRp9lDujuxmNCMpZV202QwsWVBfWUi1SgKKRKkMQlPwTVy\nIOTpLRUXeP2qWY5Si3+GB4naLMEZ4k8vCJW3WaKUJKyVzLkRHLKbJXJ84l/W\nkaGfFEyDtZmjNa2vOFK82KwoJ1Bs5vtRcENuivQo5ew4x5APRplqNdxpfh9x\ndUyM\r\n=uOWm\r\n-----END PGP SIGNATURE-----\r\n"},"gitHead":"e2518759fb4bb72fdcf1cba0c33a9fa817251783","scripts":{"ci":"npm run check && npm test","test":"mocha","check":"mongodb-js-precommit","pretest":"mongodb-runner install"},"_npmUser":{"name":"alena.khineika","email":"alena.khineika@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"6.13.4","description":"MongoDB connection model.","directories":{},"_nodeVersion":"12.14.1","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","async":"^3.1.0","debug":"^4.1.1","lodash":"^4.17.15","mongodb":"^3.6.1","storage-mixin":"^3.3.4","ampersand-model":"^8.0.0","ampersand-rest-collection":"^6.0.0"},"_hasShrinkwrap":false,"devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","electron":"^6.1.7","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.7.2","mongodb-js-precommit":"^2.0.0","eslint-config-mongodb-js":"^5.0.3","mongodb-connection-fixture":"^0.0.14"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_17.0.3_1605540922727_0.4868686028551943","host":"s3://npm-registry-packages"}},"17.1.0":{"name":"mongodb-connection-model","version":"17.1.0","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@17.1.0","maintainers":[{"name":"gribnoysup","email":"petushkov.sergey@gmail.com"},{"name":"rosem","email":"michael_rose@gmx.de"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"devtoolsbot","email":"team-compass@mongodb.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"scottsidwell","email":"developer@scottsidwell.id.au"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"brookescarlett","email":"brooke.yalof@mongodb.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"aherlihy","email":"anna@mongodb.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"lrlna","email":"shestak.irina@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"bb4a275bf894f1f3745324b04b3549253a323899","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-17.1.0.tgz","fileCount":20,"integrity":"sha512-RibS2JfxbVEmjDfuRC3zfaoweOGFvUfEy9JmgYDcGOrhcKcUj4z/VUlbD+6bsg47vImpgMXvXWr22BgjKL4PQw==","signatures":[{"sig":"MEUCIQDteYqyRQyzuGnH1Y6xIunBmucAmYXRNBhBSHJihr5iPAIgAzm1DYZoF9CE15OblzFtHRX0CemuC7S4VJXBSP7WiC0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":92479,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfyfVxCRA9TVsSAnZWagAAN7MQAJWNqVD89L1d6mskfHuk\n6Wu/VCM1mrW52VxKj6+TROKb5x1MHcwp3lTW1kyW2A5RpTrgp/E9H7qrLMPA\nyloKwcRpzMUtbb18K/Vxh3x3eo/kNIwGkp1Y5lOITf4RhJKIbGXB3+3VI+TG\nitntpf2H5AmppGCr4IdJcLiO4fI6/svvKrXFWrzUuXnUBngnJRLpf4Oov3Rz\naHfbQA3BLn0a1ZavAC8iVwHsoHd2eXLnVRnQ8eBNlRjPp7iY27LMFjjMLQ+d\nWXJXXZyofLs4JZIg4RYwInnZa6NpqcMcenxfhfaCjIgkwW0jIfKEciARV55E\nKeCBqbdNuy61HLTL9f1vpBGDvqs0cbm4b6+5lg9W1ADK2JxCwGlOLmnDOIJe\nhOKrtSj9hGnZUUvkOOnhRHrqiftl0qNgfNPI74GW3teiCvT4enmeNCY7DTFf\nMPJ4O91q7C5LQwqfmetEs5iYZSstZlgt/F4AhjkDQa0PbVfKla/6pAI/6anm\nQPMABV5jwVa88jNUCwnRDb0rkHL4QmxOiNXezUUhFWbHMb2ML8ICOGb1+sza\nsRNeRt/dd6lzut72wOGJDLTr9ppxgF/87jhtULvZyZRieDo6QlG5j0QNRIY2\nSJl5O64DqUHh/1roJroa/gAehVLM4OC4C3DNZbKatQAVW2uynIVeQV+RHgt3\nS5zs\r\n=NU1C\r\n-----END PGP SIGNATURE-----\r\n"},"gitHead":"b25a4bffa6f71bb4b75cc0b4ae48b16c00970883","scripts":{"ci":"npm run check && npm test","test":"mocha","check":"mongodb-js-precommit","pretest":"mongodb-runner install"},"_npmUser":{"name":"rhysm","email":"rhys.howell@10gen.com"},"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"6.14.6","description":"MongoDB connection model.","directories":{},"_nodeVersion":"12.20.0","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","async":"^3.1.0","debug":"^4.1.1","lodash":"^4.17.15","mongodb":"^3.6.1","storage-mixin":"^3.3.4","ampersand-model":"^8.0.0","ampersand-rest-collection":"^6.0.0"},"_hasShrinkwrap":false,"devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","electron":"^6.1.7","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.7.2","mongodb-js-precommit":"^2.0.0","eslint-config-mongodb-js":"^5.0.3","mongodb-connection-fixture":"^0.0.14"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_17.1.0_1607071089155_0.3128707114566627","host":"s3://npm-registry-packages"}},"17.2.0":{"name":"mongodb-connection-model","version":"17.2.0","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@17.2.0","maintainers":[{"name":"gribnoysup","email":"petushkov.sergey@gmail.com"},{"name":"rosem","email":"michael_rose@gmx.de"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"devtoolsbot","email":"team-compass@mongodb.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"scottsidwell","email":"developer@scottsidwell.id.au"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"brookescarlett","email":"brooke.yalof@mongodb.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"aherlihy","email":"anna@mongodb.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"lrlna","email":"shestak.irina@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"04bf3f3833be94fb192ac4b3d770818dd8c86c74","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-17.2.0.tgz","fileCount":20,"integrity":"sha512-Jte4z8H76vCGk9aCmoWmN52lIKVcFXI8bblSOHx2C8d5c6xhnXrRQUwO6e+9zFXjRiGs8irJlLhWZJAuVM5Lzg==","signatures":[{"sig":"MEUCICXT8YkdeVwzLTf2e3IGWfj2SZajGCCUuxuHNqQZtGq0AiEA5OwzSRdu/W0pse7quCRTp0ChQW03Tr3jjKukplLvxlA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":92850,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfzlhqCRA9TVsSAnZWagAAh3sP/jxMmhgKUfvuk6/E9FFK\nvAAbnWPmI1KkdCn5n8ydvipjv9MCtWzKGSEZGAESVfjeNlW8i/Ouna3rbItp\nq7QSOzhn5inrdUwer4MQuoOUZoM6+rm087jugTwCbjgQ78UMn4LOCQlgnM/v\nBd3UNTUTqN69ooKahFhDG7qvnlBagLcpumWpHH7KBwSTjVg9KdzT3yb0WzQF\niRSRv6Zp4PY9uqur+xO33YAEfyBXiPM099eqt++9/kMLt/xTjhZULIYTTCXy\nnDOpEr80dW0UMH+KqcHsq5Vl76YWMeTrgdcQDoFTAfUKhEKG2J+4Df/8Wd5w\nClBWQrF/hm2atgjEL+UgvAwb5TBvungmE71nmDEW9Lw1iExfTFVdPZp3GP9J\nVPBi8MWqk9VZs0bhrjb4+PuhUWqopw8HfN2RK2cukPznYHfeZEvHarLDyfN+\nC0bQXonYZURtB6J33W9e/B9mKdZyx5NInQAzn2Q0Vo5kkYkrEERdOROEd+bY\nhejU34N848nuldCYM3OvIAXqMEYAK1LtDzDIhUJJUSscHHtsjYppCFPMrmHj\nKMSPVPKWvG7oFL0UoTueSHh2mVgwGB56/DJtq6l/2mePbCaUZHo5vfTINRn3\nYeJESTC+hp4RK57jMqPKT+DAEOVuGlZ/N1lozmEBJ8Sr3jq2L1izs7k8Y+Zd\nsUFf\r\n=37jW\r\n-----END PGP SIGNATURE-----\r\n"},"gitHead":"c011ba17a7b412c7f1521ef019b0246c63101874","scripts":{"ci":"npm run check && npm test","test":"mocha","check":"mongodb-js-precommit","pretest":"mongodb-runner install"},"_npmUser":{"name":"gribnoysup","email":"petushkov.sergey@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"6.14.8","description":"MongoDB connection model.","directories":{},"_nodeVersion":"12.19.0","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","async":"^3.1.0","debug":"^4.1.1","lodash":"^4.17.15","mongodb":"^3.6.1","storage-mixin":"^3.3.4","ampersand-model":"^8.0.0","ampersand-rest-collection":"^6.0.0"},"_hasShrinkwrap":false,"devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","electron":"^6.1.7","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.7.2","mongodb-js-precommit":"^2.0.0","eslint-config-mongodb-js":"^5.0.3","mongodb-connection-fixture":"^0.0.14"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_17.2.0_1607358570120_0.6574017580770197","host":"s3://npm-registry-packages"}},"17.3.0":{"name":"mongodb-connection-model","version":"17.3.0","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@17.3.0","maintainers":[{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"aherlihy","email":"anna@mongodb.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"lrlna","email":"shestak.irina@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"brookescarlett","email":"brooke.yalof@mongodb.com"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"scottsidwell","email":"developer@scottsidwell.id.au"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"team-compass@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"rosem","email":"michael_rose@gmx.de"},{"name":"gribnoysup","email":"petushkov.sergey@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"678132aef360865a67461be8940578a1f7b4af0c","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-17.3.0.tgz","fileCount":20,"integrity":"sha512-loaAlu6xoEyz7th+f4lkFd07BZZawZYl2Q4EvImAp45kZxo8AH9RmuPCCUsxUlcTHP35i5pDHnCVxzAOb+LB3A==","signatures":[{"sig":"MEYCIQCI7z1LneYYlefqWl7JSMDgPpGpe68MZDw2dnal7MWc6AIhAPepIotnUC4v1oE7htz0FbB0yzHcQDEUOzvrxv+4wFeC","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":93447,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf17z7CRA9TVsSAnZWagAAlQAP/j+Rkah3NzQTGUHseUq8\nwr99UYRNHAikk3jqTQBNUtGLBCymp3JRHlwylvlPKE1Ch84jr2lF7+YNG5lA\n1hnQdZCOCcbUn1LBrKixxl4xSawrXiiGcOXR6NA9luMylAOeRNH+Go5nWGzv\nwcBfTeJC6/rw4W2aNxEvJya+9c5ojKPTl4iyVeIZAwguAJX1o2Ef9QQHefnr\nB6OpXetAKClTz8iAvr6bCvbQTtl3LycPeOVeHk0VcDMth0T6EsNGqq/W+xRl\nG4tsNkjVpjQJpP8twbSNwMVPx/FB3qJ9DKAPCfeduSnROb6cYa1KKaSk22MN\nhxiPoa3SI4rlcLqu4m6zR7V1NgusQXhWfwaYWW+eAybb3xU/ywd7oxuRRUcu\neZIh+P4m/hBIv2+ywfGkB5jRfwVzPzvEnRwjRSlr8zNT9LSQqAfLXYOLSRo4\nS1qANx9hHZknA2slkABjTe84o5NsQOJGpOc8PQxk2MZONFnjYh0rom55tX9d\nS8xNrZacMyTfui0E35STTJPNo8cPPTu01bkQ56X87GeF6tOFswiVcz9H5taR\n1tEvCygtfyYpy1HbpIdn9A3LvvX79Oudu1X1fBK3LMubt5LtyW81peMmVk2X\nh9QNImfkY/iKAt4mdk9t2yS+E5JyaMdMqAGq6iVVgn1qluK9iGewx9av129E\nFXgC\r\n=muHr\r\n-----END PGP SIGNATURE-----\r\n"},"gitHead":"e01e4ef64d9b6c7c8bcb81c41076b12836e5e717","scripts":{"ci":"npm run check && npm test","test":"mocha","check":"mongodb-js-precommit","pretest":"mongodb-runner install"},"_npmUser":{"name":"rhysm","email":"rhys.howell@10gen.com"},"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"6.14.6","description":"MongoDB connection model.","directories":{},"_nodeVersion":"12.20.0","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","async":"^3.1.0","debug":"^4.1.1","lodash":"^4.17.15","mongodb":"^3.6.3","storage-mixin":"^3.3.4","ampersand-model":"^8.0.0","ampersand-rest-collection":"^6.0.0"},"_hasShrinkwrap":false,"devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","electron":"^6.1.7","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.7.2","mongodb-js-precommit":"^2.0.0","eslint-config-mongodb-js":"^5.0.3","mongodb-connection-fixture":"^0.0.14"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_17.3.0_1607974138668_0.6555575778644576","host":"s3://npm-registry-packages"}},"18.0.0":{"name":"mongodb-connection-model","version":"18.0.0","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@18.0.0","maintainers":[{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"aherlihy","email":"anna@mongodb.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"lrlna","email":"shestak.irina@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"brookescarlett","email":"brooke.yalof@mongodb.com"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"scottsidwell","email":"developer@scottsidwell.id.au"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"team-compass@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"rosem","email":"michael_rose@gmx.de"},{"name":"gribnoysup","email":"petushkov.sergey@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"55368f7edaad031d590a122c7272d4d3d675ce0a","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-18.0.0.tgz","fileCount":20,"integrity":"sha512-X5OtFijmCP6HNfsCETEYiBH3M+hvW+p+E7gHqA2CQcVaXaeoojYpX2Nsr7YKwW1oKUbQURfM4szt1Ds9rBAzvw==","signatures":[{"sig":"MEUCIQClsuWVAkHApKxdhi6TG8O3Y5vJWf9VPVY7iajOTDQvTwIgBwdws5LuRpJZEeYzAhY1h6jWir4BIekLWlaxIQbSyPE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":93497,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf2Q3kCRA9TVsSAnZWagAAPDsP/0HyZSNj5cTfVKEn00H9\nOPalBEYhVdKk7WXFxxcfxd7rJPDQhpm29ruerEPEAo7qlpia7DmookKe0OxK\nryIda+63SktsfYMGBufYaqkgeXECXT3/sj/FX/rwDkM5QPl5Z554U2vZ7oiX\nS2xUNup+phVdh772CHcgXu43ksKbhKnv+9aVMQ6jDOUQ4hyjUwdBof4aCVKn\nqXUyrZVF4Dv1kgnKTq0qEy8tPYw7aH7XbSuzcDJjdTNWA0IFBaDGyTsDdWrE\ne60Weo8QPdqKx7ElSULEj9Ypbmojr62ADGB4qyZJoMyWs9VNKdPSRTs5X7uL\ni9Ou5eaBBqlpEccoimI94xs0C7p02xSrWudRWPY962WQjsXDrKd2NMtYW2HF\nu5Nne2/+J3n9EvLRIbINRfyKZ3mVL35b3ZhjcoF3xmOlMw0cquQ0tRS5YF2A\n+DhiCsOzCY0YKtTC1cLGz1Vidij6lD7VK2X52DTlWAWv4OOk3Ac5uWLjJYX3\n2m8DdB7O9L+vzxmNoVYkOjahkkh7q5iSckTFNgAgz3uXuEmP+Soz3LRgVCad\njWUr97H/7UlhjoGJnslWe0e5+OJ1EjDfbQApuwhmIzTdlbaI15lOnuS2nl0R\na87FGm+zlISw+93xBvJN+dBbtSZu+FSptooZO0iEFR119HZkaaUgVRCVHb5c\nfoaf\r\n=iSvi\r\n-----END PGP SIGNATURE-----\r\n"},"gitHead":"07b21e58fa72dbf9e3776515ddc5fb041d83bb97","scripts":{"ci":"npm run check && npm test","test":"mocha","check":"mongodb-js-precommit","pretest":"mongodb-runner install"},"_npmUser":{"name":"rhysm","email":"rhys.howell@10gen.com"},"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"6.14.6","description":"MongoDB connection model.","directories":{},"_nodeVersion":"12.20.0","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","async":"^3.1.0","debug":"^4.1.1","lodash":"^4.17.15","storage-mixin":"^3.3.4","ampersand-model":"^8.0.0","ampersand-rest-collection":"^6.0.0"},"_hasShrinkwrap":false,"devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","mongodb":"^3.6.3","electron":"^6.1.7","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.7.2","mongodb-js-precommit":"^2.0.0","eslint-config-mongodb-js":"^5.0.3","mongodb-connection-fixture":"^0.0.14"},"peerDependencies":{"mongodb":"3.x"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_18.0.0_1608060388111_0.722064886631494","host":"s3://npm-registry-packages"}},"18.0.1":{"name":"mongodb-connection-model","version":"18.0.1","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@18.0.1","maintainers":[{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"aherlihy","email":"anna@mongodb.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"lrlna","email":"shestak.irina@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"brookescarlett","email":"brooke.yalof@mongodb.com"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"scottsidwell","email":"developer@scottsidwell.id.au"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"team-compass@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"rosem","email":"michael_rose@gmx.de"},{"name":"gribnoysup","email":"petushkov.sergey@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"09f34086e3c870849b2095444567b19d48d2d816","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-18.0.1.tgz","fileCount":20,"integrity":"sha512-eGFn9QBTnrJNu86zfkVhUSKiC13xFqibfwNwXJYXmpAT0lCeEqIzwUCMqAVItHzua+JNzkYeef+4iDRlnE9D0Q==","signatures":[{"sig":"MEUCIEExI3L3COljBwiZk+sFR9vqvfRQWCAuO9utAROv4lhtAiEA+id8xUB823hu8NOFnJ5jp0oORyrw5d7eL7LRJbaOV5Q=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":93527,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf2lUtCRA9TVsSAnZWagAApJoP/2DCWk0lm+9wuX52yPa6\nSXLj6yt+1whvjqr0ZHQV6PpBcxKM1rGs7GAT5G8vd4nenh/SYifRNQfgiF12\nNCJ1S4xO+TlqKwbXB7yrq1R7GgPRXlgKl4o2038zAF/CV04LwyP29mOBLICS\nvIrPDffZ0jbtMsxz07PX3fBjH+cbp8T2cGUqi4cOrs0WLu8/30FNhUzqgOLG\nqv7RwX8UyS/fBwxGfw4pmuVOVBqe3xsoEoAARgPktlNpbHf/z3uQp7n1g7jj\noECLnVnAgtoGpo6KSQxmq4IwVp6EenEqHxp2xNwyWjOyV6QwZm869eAgKdxg\n74RJqmnABzA1f0TtmW1wLxKk70SDEQrX7JvB/Gd0xGA6bHdP7O8nZ1+zq/oB\nShUeLw1eo/u49CdgJIS/0GiwD53A0pJWJaf8bPGQnIOL574gMmJuKwZ98XZN\nOSUfTvPq4fabd7dG04gNe6JEShtDPFvm8FR7MQTc/9Dp2nJIeQU84nPbiA74\nVOyvIzHjgwBP8uvzP9ARDsf2hCUj9soPuWZrZ9bVyNBvEfJcGfcsj4AqSv5+\nLDv2QZ+0ZW+ZfBWyl7kd4BnJ+O9XQS5lJZOimdHHDt1TPl/wRrzqVVaqYYst\niMUgnOjOyl5p2y/j/897Kkpls5uc4bicX84TxvGlKGP8FtjTobf0Uc0sISW6\nDF76\r\n=HwYO\r\n-----END PGP SIGNATURE-----\r\n"},"gitHead":"585e9b0a63a880a02b7c831e59a759d26d5ee170","scripts":{"ci":"npm run check && npm test","test":"mocha","check":"mongodb-js-precommit","pretest":"mongodb-runner install"},"_npmUser":{"name":"rhysm","email":"rhys.howell@10gen.com"},"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"6.14.6","description":"MongoDB connection model.","directories":{},"_nodeVersion":"12.20.0","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","async":"^3.1.0","debug":"^4.1.1","lodash":"^4.17.15","storage-mixin":"^3.3.4","ampersand-model":"^8.0.0","ampersand-rest-collection":"^6.0.0"},"_hasShrinkwrap":false,"devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","mongodb":"^3.6.3","electron":"^6.1.7","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.7.2","mongodb-js-precommit":"^2.0.0","eslint-config-mongodb-js":"^5.0.3","mongodb-connection-fixture":"^0.0.14"},"peerDependencies":{"mongodb":"3.x"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_18.0.1_1608144172717_0.7010221642782859","host":"s3://npm-registry-packages"}},"18.1.0":{"name":"mongodb-connection-model","version":"18.1.0","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@18.1.0","maintainers":[{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"aherlihy","email":"anna@mongodb.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"lrlna","email":"shestak.irina@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"brookescarlett","email":"brooke.yalof@mongodb.com"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"scottsidwell","email":"developer@scottsidwell.id.au"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"team-compass@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"rosem","email":"michael_rose@gmx.de"},{"name":"gribnoysup","email":"petushkov.sergey@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"c8c6553733ae94b3f91451d11d053e3da621e299","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-18.1.0.tgz","fileCount":20,"integrity":"sha512-u6k4yAq3rT4AGOyC8kuVrbd5pUErNv8o420oFjA4Y9Ese5ZQo9ZA0r0dQJcVChrzOhqutvVueow7RGEs3MoFvQ==","signatures":[{"sig":"MEQCIAnqu+MoxGXEwOyMBLxA+Apfxhxx5nxVaUOmru8TtkNuAiAp7kVpNxiG0YNMWiIBFS/wr8KZ5+EtxTKmKzPICAZXBw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":94040,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf2zjSCRA9TVsSAnZWagAAorgP/1H1/anhI5JqYyeMiPGV\nVsk9Oich86noQqDkDNyN/8K9pZY59VtSVNSFXXxWED2FR8Sv53WU6f2eGwaR\nqUkg/9d1RdGgEqLOz7arwXWDhvsIUx/Id2yqYbeVKRzxtkrvt3FI+MMnguXI\nDx+LSBtc1WsuPs3amyyONSkvjTGZJJQ6BLO0XEkV2+FcDOB7fo2gnAUvDGnj\nxfHZcFWwiqXxThX/A/3iNSm5Vu6r2TaSwfqQRGs5lT/QxXZpyl57WsTccyCz\nzNQq5745Mrhptl7hk3ylg5ngVS+IiOnt1sNPbQ+sf1ZhKTUJC03E8CsSYX39\ngc8QPUxAWnV8/rUpY5V30j5Hb/WgOZ4HhNPFm/xe3eCJQ1NWwv0Lp4FFXWw7\nwne9G0Q8oRs47hJ6JyS6c/zMLyMPZRDjHSEt9iNRf5LhH8Nz3faIyz5ljFB8\nxL+zIKQwAICXQS8/XHkEblMWXq3E3eAxczJqUd3pioHzk6lXrGLfpWkd+SP3\n8YnPD0Sz7a0MEvh5F7UOvVkvds3/5ZREKgp1IsHJBGifGxbDSN6NEl3WdaVO\n7PhW6FRXn9ElHEhmwQAeq42rANklEewmaufQBDXvuWTidq7aQlfMLiMnbHiw\n6u9rxvRkHfjuYRRGWaV4xK54ucrfZD01yc5LFMR/1JG9LS+Uaes8o9JZwk6d\nKahp\r\n=Utgu\r\n-----END PGP SIGNATURE-----\r\n"},"gitHead":"9f285d2c3c58e719abb35a6f7a8267e9e9da8e1e","scripts":{"ci":"npm run check && npm test","test":"mocha","check":"mongodb-js-precommit","pretest":"mongodb-runner install"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"6.13.4","description":"MongoDB connection model.","directories":{},"_nodeVersion":"12.14.1","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","async":"^3.1.0","debug":"^4.1.1","lodash":"^4.17.15","storage-mixin":"^3.3.4","ampersand-model":"^8.0.0","ampersand-rest-collection":"^6.0.0"},"_hasShrinkwrap":false,"devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","mongodb":"^3.6.3","electron":"^6.1.7","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.7.2","mongodb-js-precommit":"^2.0.0","eslint-config-mongodb-js":"^5.0.3","mongodb-connection-fixture":"^0.0.14"},"peerDependencies":{"mongodb":"3.x"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_18.1.0_1608202449902_0.6997251658157533","host":"s3://npm-registry-packages"}},"19.0.0":{"name":"mongodb-connection-model","version":"19.0.0","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@19.0.0","maintainers":[{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"aherlihy","email":"anna@mongodb.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"lrlna","email":"shestak.irina@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"brookescarlett","email":"brooke.yalof@mongodb.com"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"scottsidwell","email":"developer@scottsidwell.id.au"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"team-compass@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"rosem","email":"michael_rose@gmx.de"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"bce393f68209b12e77d47ece06e7c059c5440705","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-19.0.0.tgz","fileCount":19,"integrity":"sha512-CFfJAOIpCcVycuXhceRx8iEf1OSRWJiRFXRA5IwL5B0lDLhNLJhID8euXVtCnlO8LFanKZ5VAbD0UydeeY4twA==","signatures":[{"sig":"MEUCIHRAO1vFGQoT6OMZQ1B4ab3DdfVhb6h9W/DrLjjUOAq/AiEAiCb28StLrYQsmYtT9icf6u70OfD2xGCXH7EqyNbX7LI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":93559,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf+FWRCRA9TVsSAnZWagAAB/EP/jYPOJpY/CBY4sfM93qr\nrnwUSG1rU2SCSbBnRukhXSh5ORkV9ccn6Y8GbVwIMN84Yh0xKE5QlRzYhkSA\nG8a8evkJMBD2QzNuUsjs4B1yYpS4cJYL8SD9dQebFQE6+SzMx4mCOMbl/WmQ\n92b/goJPThXOMozD4WSPou81V2Ixq2UMBDFji5U3j+yzd/F7KpVjpVZ28O8k\nC351UOPqTL9hsUxJF0rY/0KWCFuoH3caFbOHgz5+qckjsbvynOlNSQHpbB6j\nm4xgOMmbaONe7d2iBfKLbBda/lb10LafUCxaL1Z/TeG/Dc30ZG4nqlBClEiS\n99k9Lai2kpvXDW2Dd2YJbi0GP7YHaGCJbxD2Mxk61HlKPUjoSnjKr29Jnd9p\nUi32glM6puh1CVp08YCZXiXUCA+lMExnLhJYUMmAHw8le2xBxzbfjmwcUIxo\nlMxkoZ5aNZPHGAAr3d5tCfUzmzF6A6H57KG2NeXNF/W1HW/qkMD9XE4l1ovs\nWyVAQWE1rWY6iCdG6eTkdTsRBgI0rIaB4GdFjxBShOqTFdDzaAj72BihjN9u\nLA6hWuVzEAJoaw8l9nbNpm1x5ncI6LOXX7OeYnbAPKNlolh0TW9pkitRs/Qv\nfbI3FHwfqMj++rVXVB9/oxQybF4NzikHTXQLZRc4A4xTFdLAkZuvfuG2W4Pi\nqc8j\r\n=C2tG\r\n-----END PGP SIGNATURE-----\r\n"},"gitHead":"750d093fa27c5e4daba34f1f450fada27d6d8a9f","scripts":{"ci":"npm run check && npm test","test":"mocha","check":"mongodb-js-precommit","pretest":"mongodb-runner install"},"_npmUser":{"name":"addaleax","email":"anna@addaleax.net"},"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"6.14.10","description":"MongoDB connection model.","directories":{},"_nodeVersion":"12.20.1","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","async":"^3.1.0","debug":"^4.1.1","lodash":"^4.17.15","storage-mixin":"^3.3.4","ampersand-model":"^8.0.0","ampersand-rest-collection":"^6.0.0"},"_hasShrinkwrap":false,"devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","mongodb":"^3.6.3","electron":"^6.1.7","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.7.2","mongodb-js-precommit":"^2.0.0","eslint-config-mongodb-js":"^5.0.3","mongodb-connection-fixture":"^0.0.14"},"peerDependencies":{"mongodb":"3.x"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_19.0.0_1610110352804_0.22420060365371608","host":"s3://npm-registry-packages"}},"19.0.1":{"name":"mongodb-connection-model","version":"19.0.1","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@19.0.1","maintainers":[{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"aherlihy","email":"anna@mongodb.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"lrlna","email":"shestak.irina@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"brookescarlett","email":"brooke.yalof@mongodb.com"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"scottsidwell","email":"developer@scottsidwell.id.au"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"team-compass@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"rosem","email":"michael_rose@gmx.de"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"f1b378969f56a579713398b8fc9ea529befe5d89","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-19.0.1.tgz","fileCount":20,"integrity":"sha512-wxCkgmjGkEKGdxdIDbPcZuuyRfnGCRj6tsorgqZFGyarKkxM9wpNbUKP2ChJPwW5AHlfROOhE1IF4RdMsauQeA==","signatures":[{"sig":"MEQCICSs0Vc1En3DwRzfLaHqfVy3NREjd85InQbMRfIsHenwAiAGuAfhuDmSbci0eEF/HwZchKKapD34NLHdTTZIH8FPXQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":93707,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf/X40CRA9TVsSAnZWagAAv7sP/iRSuW0/mPeG2QElGqHy\nlfVrp86HAidrHXv9bCBlQKPkowlmhW6+VXl6vudGa5PG5aSOYemWQP+HTWR8\n89ufEd0xyVQcqqrVH/NbTpej9BiHBIvlbpDhuVTN9X5pFFMYQezIs+0cBi7F\nvE/prvamc6657V4lFYTgppBig9h14qCVHqD+fY+mEHQOM0QVfmuUHkjWARBi\nKE96OWei9Q9PnQ1h3BEI/USPWbzkeoP1A11+EDbjp90xivsP9Qlz3RM2RkK9\nFXJ8TAlU72Fh6yJtuMK+vXz84sWFEoftDmrKmfkKGSyKM18cykFvzN7GeSHc\nqbp327rFz0ry6YpuhyqvMJnXwHoFv2UgvsJvBYcyAAEyGti5n9vmirSYXPam\nO3UZM5dJzX/2/7iGN8INmAnzjEcd4LzuifsuvEZQeRo0Kgi/B/HM9AyiB83e\nuBwyLGelV8U49AbinkQoWNVWmx/cFxcviWbm6NazcpZdU7AOf23y+fGzxUOX\nPMozn2cqmqf9S59oNeNV6eZi2oP9b9XCGI3ThsVYnjaGT+IY5tkSFWSzrkXB\n+YYXk0qFD3IgappQ29UddrWwCry1zJIg9lIT0cVRq5paRdxeo5ilV8q3j7D6\ngD1LYwmYoPPCieruAdq0V4RxGzWJS6r3AE457VJZXTL3i4Cs0vLxC+1ZqiIn\ny7qw\r\n=CMTb\r\n-----END PGP SIGNATURE-----\r\n"},"gitHead":"802fae6731ad7d16c403f601efe154323da67192","scripts":{"ci":"npm run check && npm test","test":"mocha","check":"mongodb-js-precommit","pretest":"mongodb-runner install"},"_npmUser":{"name":"rosem","email":"michael_rose@gmx.de"},"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"6.14.8","description":"MongoDB connection model.","directories":{},"_nodeVersion":"14.15.1","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","async":"^3.1.0","debug":"^4.1.1","lodash":"^4.17.15","storage-mixin":"^3.3.4","ampersand-model":"^8.0.0","ampersand-rest-collection":"^6.0.0"},"_hasShrinkwrap":false,"devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","mongodb":"^3.6.3","electron":"^6.1.7","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.7.2","mongodb-js-precommit":"^2.0.0","eslint-config-mongodb-js":"^5.0.3","mongodb-connection-fixture":"^0.0.14"},"peerDependencies":{"mongodb":"3.x"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_19.0.1_1610448436034_0.8948026931679145","host":"s3://npm-registry-packages"}},"19.0.2":{"name":"mongodb-connection-model","version":"19.0.2","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@19.0.2","maintainers":[{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"kay-kim","email":"kay@mongodb.com"},{"name":"aherlihy","email":"anna@mongodb.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"lrlna","email":"shestak.irina@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"brookescarlett","email":"brooke.yalof@mongodb.com"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"scottsidwell","email":"developer@scottsidwell.id.au"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"team-compass@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"rosem","email":"michael_rose@gmx.de"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"d7980d51ba5df07bc56f6fefe50220afb6e2539d","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-19.0.2.tgz","fileCount":20,"integrity":"sha512-0wFhxk248kLG287NlbPzT7pbHgtFUaj0fl10UBFHLDLw4mfuGxgRa0IOOxiyz30we3Rv4AfAth4/iM5oVnjEIw==","signatures":[{"sig":"MEQCIEDVRiOv+6N8osnaH3NN1ra6mDcoHMKZWtRw5d9aZSI8AiA11jPsRhlVqbBJ2kCAJ8Bp393IM9sYTlsf6own3t2jPw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":92469,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgBwt6CRA9TVsSAnZWagAA0KgP/3vm39xu1V/IQl037avT\nMKvDxcjo+NE3ilIK6aOAGqhP1DVe4nG7l3PgXfL3ZJykeXp7rSXhqoCBGbps\nwm2/ftmRaGO0GOZk0ri2r3YzfbT/uwctSCqLLAuxU43IBtdx0rCT1J1sqEWQ\nR1gJe2duKfSn1p3n06xvJ+iJYWtU7cSyTVjHWCk1LImJXsL7bhEmJHfgYfwQ\ne1wJtmpzLpvoX7NNPYEOAimic/dQGrSKoiXNyWgAJBIAd9zXSal3i4ZBhhIZ\nPlSx17ng/x8Cenp1swQi5SONHeCEcEgr5EYudAbgjGU1i51HhCdleUP6vbi9\n10ThhhKCdGMcNrb7QwKedrDuKSPo7op1BmH/oM+5E5C5J2qltfYuofDGO7Fm\nuonsGZn33qOsY9cM2WYnGNIdrBJx30gUgTViz7P7UG/0TIDVPuRC47BPh4Qt\nLfrfup5XHADyR2bzId12gQqCs26pT6A3wUWC6RnGImXd7QUcTYdpkua2t7vv\nkfV5wktZIb5/to4j5ZwfuL4ToxfsrjMKZ/Yplp+Cc0+ANXtSw1cjuf9cau2o\n4VvznJf7le4nftrSDxObFsALGhKoT5AGwfIf/pmAx+T0YdMb4u3gv/QBm34x\nh3UGALhuttHHhpsb4ZEAS/agoOnmsLPIcVuARRPOc/W1nEV/70xCneZQMORM\nj3Jm\r\n=CL8G\r\n-----END PGP SIGNATURE-----\r\n"},"gitHead":"37bb63db26f384f393d0615c0436a48bd7383223","scripts":{"ci":"npm run check && npm test","test":"mocha","check":"mongodb-js-precommit","pretest":"mongodb-runner install"},"_npmUser":{"name":"rosem","email":"michael_rose@gmx.de"},"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"6.14.8","description":"MongoDB connection model.","directories":{},"_nodeVersion":"14.15.1","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","async":"^3.1.0","debug":"^4.1.1","lodash":"^4.17.15","storage-mixin":"^3.3.4","ampersand-model":"^8.0.0","ampersand-rest-collection":"^6.0.0"},"_hasShrinkwrap":false,"devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","mongodb":"^3.6.3","electron":"^6.1.7","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.8.1","mongodb-js-precommit":"^2.0.0","eslint-config-mongodb-js":"^5.0.3","mongodb-connection-fixture":"^0.0.14"},"peerDependencies":{"mongodb":"3.x"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_19.0.2_1611074425270_0.34546424426974354","host":"s3://npm-registry-packages"}},"19.0.3":{"name":"mongodb-connection-model","version":"19.0.3","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@19.0.3","maintainers":[{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"aherlihy","email":"anna@mongodb.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"lrlna","email":"shestak.irina@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"brookescarlett","email":"brooke.yalof@mongodb.com"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"team-compass@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"rosem","email":"michael_rose@gmx.de"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"77508f39f52d5259033ae9d392847e487c61fb03","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-19.0.3.tgz","fileCount":20,"integrity":"sha512-l2h4Ap6UEdpWXa8ujFWBlPCbnuQ6qqbAdKWf90PkaorFaIOaVUVQWTpHVxQChJxeU9lzTXFgHFs7l5hQw3zq4A==","signatures":[{"sig":"MEYCIQDTKv4nmDGmEzP5/5euQaj5FCUWml80s+LxHVWFg9neaQIhALY4GuaLzqaUfW+ao3LoeCqnPvBSGRSPWg2h3gG+FhRu","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":92491,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgIuA2CRA9TVsSAnZWagAAszQP/0njIkoseooIGzZZSaoU\n1OMhsNOd5O9dUYqhTc2X3j4OCYWcCs0TO+mEB6Bv6h+W4PCHLgqb27ChcKpx\njJ5ghwdPpbeHBFS/7R1vqju8Bqq2uy9pr6IBiW+b9695Z6im8e3RjzvLa/8e\naDvIC/tkp+iabP+/eholbZi6YwgLVeeGdRVV5Ek0KcmHkRuaBsMjmN079uQN\nsjM/OG0gothl7YsQtzLBZDY1LcXMm7jjnR3w+wdZc8stECW8g2JRSm9WOVeh\ntKbjmkfS0zQb0AteYOu3sNfix+BtratDF4YlDnk20nP6/VuG3VJqCNryEZR3\n7KgYXVi168aWyDQfnNaX8CzaDNTCcK43XEr3TenLH6ABzgOPQVk1qEAAYHMS\nqWaStQygoomrrBPX9Rie7DQsm6E1ZPzYeaNaGPqgoEFi/YTXdINDL6V7q+FJ\na04VjKs9PTPWS298qYMBr15SQXQT9P9iQpr/mCwsQgdpK7g7Zgc6eGQFrW9z\nH3ONCmSI4zXXZRrsJEGT8p/TFRJi/XZyjXo+ry2ivSiTxyfWaqzW7T2OXEam\nu960hgX937tgZIxfPQW2cTwSqlguemZ7irnpBUtPTNHtIeI3tQCuOmVvu4z6\n74kJ9MwxdTRIdt3YntOSKS3Bf6ILqLKzyjDfor7P//TJRCyk5aruOh2q9PMo\nE7Z+\r\n=iHDn\r\n-----END PGP SIGNATURE-----\r\n"},"gitHead":"6bf4c431ad3c063bd478f54535ac71cb11e40d4f","scripts":{"ci":"npm run check && npm test","test":"mocha","check":"mongodb-js-precommit","pretest":"mongodb-runner install"},"_npmUser":{"name":"rhysm","email":"rhys.howell@10gen.com"},"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"6.14.6","description":"MongoDB connection model.","directories":{},"_nodeVersion":"12.20.0","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","async":"^3.1.0","debug":"^4.1.1","lodash":"^4.17.15","storage-mixin":"^3.3.4","ampersand-model":"^8.0.0","ampersand-rest-collection":"^6.0.0"},"_hasShrinkwrap":false,"devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","mongodb":"^3.6.3","electron":"^6.1.7","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.8.1","mongodb-js-precommit":"^2.0.0","eslint-config-mongodb-js":"^5.0.3","mongodb-connection-fixture":"^0.0.14"},"peerDependencies":{"mongodb":"3.x"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_19.0.3_1612898358106_0.6196291058678081","host":"s3://npm-registry-packages"}},"19.1.0":{"name":"mongodb-connection-model","version":"19.1.0","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@19.1.0","maintainers":[{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"aherlihy","email":"anna@mongodb.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"lrlna","email":"shestak.irina@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"brookescarlett","email":"brooke.yalof@mongodb.com"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"team-compass@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"rosem","email":"michael_rose@gmx.de"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"ee468cf40135f8fb4ae123b9862194c705b420af","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-19.1.0.tgz","fileCount":19,"integrity":"sha512-7SgZLpozwudXjPeiqVQrd8gM+CtJnd1go897SfExOdL+S3UVdhBdhyI/1yBNwjpZbmK34qDm8OP3J9IGur+H1g==","signatures":[{"sig":"MEUCIQC+4vbOtdRkeRbzVVbq60IsVj56m3LJu8PHkcFMUTlJTAIgK5o/a7qMOm7ofq+ypaI3u1++zW15cj3QpoOJfbN8M8M=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":88373,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgQQqgCRA9TVsSAnZWagAAZuQP/2F/wsBznBp7uRqXjBux\niqgRuw3weAbrXq0BxDn3vP7i+gnszOhdIarmwWKNkAznXSNPtSo2OY9MKSBl\nVuLz3MYLIsKAEnQzc717rsGamF8igdU2u8hVFfkUwCJVvr0QGjjwnm3yhGtx\nLmomBm+3a0bUApepHS5z6TgOyVWODo1cM3+rra/JXWWWPpcz+2bGhPxECMWO\nDVvwFo6MIksg+1aC5tIThnLL7+Y9butqkd5i0qrUvyTDwYUG9qpwgjgfd6MH\nspWgXMgu2h00k1eseetEWPlaNhWAc20N4le58H4nNGDHO5A49rTIDKynD1Rp\nA9XMhbrUZfAFRtVKvJP8fGXmRIlkw+AI0xJiQV+u4amtIHvMbTHoEfFsd8dG\nrp4HxgWH7SISyD77/Xyhvj91YEry3+aI8aREbLbclOogr27UkgO+SeOEedTY\ndb4XUXnab1DP/xqSaYwh65Ehbpyf/dTIxDQ+U89+/REdAekxOsLYMNSCLFJq\n4rVoDHfQsg9TTU3nv6/MXy5rOf71gSsxt+QQYJ19TehV9ar9yWLZ+/C27Rwq\nWdTWBqZz/t2QO6pGwm2hyhCaiC4Yt5De+1KLaZMvFTOAHa0JH2XSgyOErxKL\nFFegnFw8X6360Ayov/bX2Ghd30aEXaN7w4JdevsZQI4gJmFrwtx6SARuwoCF\n6BDN\r\n=haBA\r\n-----END PGP SIGNATURE-----\r\n"},"gitHead":"87139729fbef4434b86deb87d388573b0cb5d676","scripts":{"ci":"npm run check && npm test","test":"mocha --timeout 15000","check":"mongodb-js-precommit","pretest":"mongodb-runner install"},"_npmUser":{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"6.14.8","description":"MongoDB connection model.","directories":{},"_nodeVersion":"14.15.0","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","async":"^3.1.0","debug":"^4.1.1","lodash":"^4.17.15","storage-mixin":"^3.3.4","ampersand-model":"^8.0.0","@mongodb-js/ssh-tunnel":"^1.2.0","ampersand-rest-collection":"^6.0.0"},"_hasShrinkwrap":false,"devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","mongodb":"^3.6.3","electron":"^6.1.7","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.8.1","mongodb-js-precommit":"^2.0.0","eslint-config-mongodb-js":"^5.0.3","mongodb-connection-fixture":"^0.0.14"},"peerDependencies":{"mongodb":"3.x"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_19.1.0_1614875295997_0.812213637049713","host":"s3://npm-registry-packages"}},"19.1.1":{"name":"mongodb-connection-model","version":"19.1.1","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@19.1.1","maintainers":[{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"aherlihy","email":"anna@mongodb.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"lrlna","email":"shestak.irina@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"brookescarlett","email":"brooke.yalof@mongodb.com"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"team-compass@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"rosem","email":"michael_rose@gmx.de"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"cf978495f850f0dee4293403456b74fc5d9a8414","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-19.1.1.tgz","fileCount":19,"integrity":"sha512-wCh3h6cafHFNctLhVMN0eQhaUsvGFDRGUPjB43MctidkXrIywwIPYgiCk+ygjxIUQv7kcqvmwI2Isn6PKxpBNg==","signatures":[{"sig":"MEYCIQC2tB6WAM6wruc8eLUPrKb5dfY2j+5hXHCD5N0mH/PuiAIhANRtr154tkVFtAi1+Ueb3kFkt8pBq8GcOpYouqD2jgTw","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":88409,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgZKKrCRA9TVsSAnZWagAAfTYP/0VN9308sNEDhqHCiwUX\nWCUet/NtsHzKejbc3q1ZVxa2isHXmtHRNfNGrgQbUDzXEf5hJbnp2FnWC1wE\neqQQJTrt5vOvrhtGa9M59BTWJhUWaz86h4ePeXt1giDKiUenv2bGXrAX6Jo0\nNyKJUElRfrigYOkWv3vlOhIxufCHvJC0FDf9jhCuY6aXBPqT59MF0Mfc7Pn3\n0gDAAqepo54XgG6zgQYobXog4S34pc4P+QP8ub1vJyOziCeH8EaoLv7kMg85\ni7263SK/tPaWyvW1CDDyI6luKVNYD5Hw/TFYi83qeL1PN2CXcRepngPAnGbK\n6V1O39GrWJ7sKyr7RQt0+aCaRM+yWXylwTPwKPHsu9L9Jiy24ZAo4T5QSkDC\nmXW/kYT7edvheg4rvCRYS+PVkK9IKqz8r9nP6l5vIe5aUZ9ikUScS9SFKdOf\nfo4RZKjEk3wwizZ0alLac1diX7HflATDwOGIN31wRNYIJhbPBkXnHNLk7Rdg\nAKM7YajMuEeyfpHdUGHlS+78eIhkRuZ7n6D4AFFosrQldLDVPHjLAqyeJIoP\nvsaZId/GC+QoyIXTsq25xaCiNKp6QD4adAyBTWhEXOIeq5qY75uLa15YTFR2\n/jSWw86kOsj+emyBVBGLE9br0IZ1+BImF2wiz01Z0sG3uaN4hf0W8SAUw7AI\nz1S9\r\n=jCUH\r\n-----END PGP SIGNATURE-----\r\n"},"gitHead":"6e5dfbd97a1bf45464c417c438b6df427da22657","scripts":{"ci":"npm run check && npm test","test":"mocha --timeout 15000","check":"mongodb-js-precommit","pretest":"mongodb-runner install"},"_npmUser":{"name":"rhysm","email":"rhys.howell@10gen.com"},"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"6.14.12","description":"MongoDB connection model.","directories":{},"_nodeVersion":"12.21.0","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","async":"^3.1.0","debug":"^4.1.1","lodash":"^4.17.15","storage-mixin":"^3.3.4","ampersand-model":"^8.0.0","@mongodb-js/ssh-tunnel":"^1.2.0","ampersand-rest-collection":"^6.0.0"},"_hasShrinkwrap":false,"devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","mongodb":"^3.6.3","electron":"^6.1.7","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.8.1","mongodb-js-precommit":"^2.0.0","eslint-config-mongodb-js":"^5.0.3","mongodb-connection-fixture":"^0.0.14"},"peerDependencies":{"mongodb":"3.x"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_19.1.1_1617207978779_0.9677460713552422","host":"s3://npm-registry-packages"}},"19.2.0":{"name":"mongodb-connection-model","version":"19.2.0","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@19.2.0","maintainers":[{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"aherlihy","email":"anna@mongodb.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"lrlna","email":"shestak.irina@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"brookescarlett","email":"brooke.yalof@mongodb.com"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"team-compass@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"rosem","email":"michael_rose@gmx.de"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"94f922f14d58d73b57816f1c2b9e9f5d07d4dc2e","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-19.2.0.tgz","fileCount":19,"integrity":"sha512-x92l6SlnrCC/cMb2LWdjPIeAWho53zszrP3s5HmRk0a2FiXEwpbFMODNnrTBDTzeehWe5t5Z6pagCTB2bA8yAQ==","signatures":[{"sig":"MEYCIQDUlJ8sDOXnS7Y2TFJIUK2pd4nlBgwrFrmom5t7tnVxqwIhAPB3GhRYDI0B471d/ScFrN0EH8WHXJE1OwlMvRuU4Nx7","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":89223,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgrpB9CRA9TVsSAnZWagAAeIcP/RVBvg3V9QEIVn7SSw19\nMRGI8MB/7W/mF89N+P08yvxZw3jX2hzGezuM8QgvbxbMzyyatSYZhYgEZ/Fb\nBwe0l9isuXGxbjTjWxL+KVRjwgymR52cWRdrSNzwUuGUHAcE4Zj68hy9Oy6R\n6wIajmyE252M85cym8nO0RLMP5TEhTDZnntRAW8+BlHwS6rme/qkyHvmCQy3\noX/3C8qebTp3LXG7sxI0npzhCZnZnpDG2xqf34caG66dn7+YcSCDT9XkZUWI\nV8iWBX2Z47zwVk5/bIYkhHwPYgdFKGO7YqKeEtTIVEg/3ljSw2dLpJHXASCr\nNTIjepf3XJ0M+lAPxfeVyDbA/7vguJ7bbw3eutnBl0wcFRPLvHiFAj1hg1pp\nFlwLKv4V7p1vVuOXCJyRjXs3KtVFNZNWxr8ul6iD5btcf9txNvmZ6FmuyvC5\nxQpOKOGLZ5QtWNPxzocuO4lq/mBJMRLxVkJOZGvd7u0FaAGfEomBurh+SVSU\nxCYHufq6eru5oGiBxJwvxXx8DscXHk+B0CuPCuIoVbPQEw8GFkMhnFIwXDan\nhUFzkPJLTPraXRbARdC7dIF11WNiGgJtF+6wfzUU+tvFdWFiv7WO0+iRqj3U\nB+UV3ciErLLRp96tQXqX1sCWAD4y5veGCSnJcom7H011r4EHEP6NXRfhaVf7\ny2wb\r\n=LE6T\r\n-----END PGP SIGNATURE-----\r\n"},"gitHead":"170c704d3e22d335d5bf380dafe2b87569d7c4be","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","test":"mocha","check":"npm run lint && npm run depcheck","pretest":"mongodb-runner install","test-ci":"npm run test","depcheck":"depcheck || echo \"!!! Dependency check failed, but the failure is ignored by now. This should be addressed in COMPASS-4772 !!!\"","posttest-ci":"node ../../scripts/killall-mongo.js","test-check-ci":"npm run check && npm test"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v12.18.4+x64 (darwin)","description":"MongoDB connection model.","directories":{},"_nodeVersion":"12.18.4","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","async":"^3.1.0","debug":"^4.1.1","lodash":"^4.17.15","storage-mixin":"^3.4.0","ampersand-model":"^8.0.0","@mongodb-js/ssh-tunnel":"^1.2.0","ampersand-rest-collection":"^6.0.0"},"_hasShrinkwrap":false,"devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"^3.6.3","depcheck":"^1.4.0","electron":"^6.1.7","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.8.1","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"3.x"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_19.2.0_1622052988752_0.7094963115941388","host":"s3://npm-registry-packages"}},"19.2.1":{"name":"mongodb-connection-model","version":"19.2.1","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"Apache-2.0","_id":"mongodb-connection-model@19.2.1","maintainers":[{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"aherlihy","email":"anna@mongodb.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"lrlna","email":"shestak.irina@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"brookescarlett","email":"brooke.yalof@mongodb.com"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"team-compass@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"rosem","email":"michael_rose@gmx.de"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"925e4ff37936d163e72a26a8238e9acd0368f428","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-19.2.1.tgz","fileCount":19,"integrity":"sha512-qBXfslLE0DfuYsPZM1rZrTiRcD2aiNcornZS4hfej+kl6zbiKHnjkPSLo8f31ZRIzEhhCflPnofQrkEgCD8Xqg==","signatures":[{"sig":"MEUCIAErWiwMk90atwxuoyZhyovDwax7dI0RmiSxvVDVM0NqAiEAsW6dQyR3Wed31HKStJIL5gPqs4+H/WrqMrsGeJbbYgs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":89166,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgr8OmCRA9TVsSAnZWagAAHtoP/2nYP5tUhq10xSUv9DzE\nS2zrFW8KNI5qJH52qmv8g9T+DDiPF3+Heo747RKYW/Zd71GGEPRZQVz8+NOj\np21oeEkevDlqNTWpbS3QHQHFx57dGmqQ95sEwn/tdpyKlf7Sr6R6UKvjtA4q\nq238OeuA1BuSVANR2+6UjwIlU5wG6yYicA57lhcaNCJBm6HFI7Qb5ZONVYAz\nBz/oJ8+D05CCquY7HViDcHXRwEICt4CVooJ2WLPZk9Xz7MNYwLEm2cGH9uHp\nR7szKRx2RlZd123mgAS+tAO3KJMSLo0XXk3tX5KLLN8mukOZ1ZJ4iVP04ymw\nLns9tsKNjcDBuJ9cuDkTl6kqMh6tS4bXhRhUFMjYuQOpcgHLyeqSr3NbEoeT\nlQQYE0PjrrQmRbUxc94iCPPxN7hjs4Tg5qGBvL/wvYgTMqG2O1oALoBUxD7R\ny//UrHyGcnx6eGIisTzIIV37nXqwS5flZIQhNoplId6RPyD7UAQ3tbFI+hjO\nbMTEvhyKbUkDHmPaqbpxhSx0udU/YktoO5xokTBHzcMgfLkXtoKuYP5UKQcd\nT2F7xErYptD1CBVRvaoOqnT8S7k4+b/o6/YXPKaCwZX0C1vUXSsWYldEKUjN\nO69ND/pOjEV1NmpCayjXt1X4Vd1gIeRTJF5VMG6mKNLtv4UXZ1v5q1ICxrxq\n5cXP\r\n=G1sr\r\n-----END PGP SIGNATURE-----\r\n"},"scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","test":"mocha","check":"npm run lint && npm run depcheck","pretest":"mongodb-runner install","test-ci":"npm run test","depcheck":"depcheck || echo \"!!! Dependency check failed, but the failure is ignored by now. This should be addressed in COMPASS-4772 !!!\"","posttest-ci":"node ../../scripts/killall-mongo.js","test-check-ci":"npm run check && npm test"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"6.14.6","description":"MongoDB connection model.","directories":{},"_nodeVersion":"12.18.4","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","async":"^3.1.0","debug":"^4.1.1","lodash":"^4.17.15","storage-mixin":"^3.4.1","ampersand-model":"^8.0.0","@mongodb-js/ssh-tunnel":"^1.2.0","ampersand-rest-collection":"^6.0.0"},"_hasShrinkwrap":false,"devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"^3.6.3","depcheck":"^1.4.0","electron":"^6.1.7","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.8.1","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"3.x"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_19.2.1_1622131621958_0.35827537489591976","host":"s3://npm-registry-packages"}},"20.0.0":{"name":"mongodb-connection-model","version":"20.0.0","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@20.0.0","maintainers":[{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"aherlihy","email":"anna@mongodb.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"lrlna","email":"shestak.irina@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"brookescarlett","email":"brooke.yalof@mongodb.com"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"team-compass@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"rosem","email":"michael_rose@gmx.de"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"91c1231e6811ddcefb711f044807fcbc5e9a3df0","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-20.0.0.tgz","fileCount":18,"integrity":"sha512-qbBrjz2ffh07ZbONyKq2FWS9wi83tqZ6KZBeb20yL9iSBjzhjDZZWtugeS7vYL7NnsXpl3gh2ezssB+xeB5tGQ==","signatures":[{"sig":"MEYCIQDxYdX9s6d/9Bn8Qq2qRtTQeReMKcjk5OhxkmS5eaynsAIhAPOM/Wza0bTc7pjsaEXPi+gdz0L0PEgscD2kcvNlVj57","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":78905,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJguSlKCRA9TVsSAnZWagAApbEP/iKQO/eeCv/C5JUUlSQm\nl509YxjJL6ATy/Ax41d9S2LJ9gYZnAB1aamR3Q2J/fkN/vBp6x2/5yEkwHAF\ntrcwMB2y4e/5OSDv2uymlj2jvlKIqMGJxOC/CBFfNxFuEl0eL1HqYyxfBWMz\n/DxzntSsgbYe1inqLvfgKqGEMRf/MvFcgbd79RBGMWzAnoB+Gegn5A49sQXp\nShWZrVbMJrI41igikAry6MHuuYmq9JqohPPA35a18wdD4edLwdXAL/KkfNcM\nxncGxgBMrH6TYLbMVRYGn4oiNNTyTP1HWTIWxEX1ynBOG/hf9/8g6m7Rda9d\n3Inl0yrlKOxFOkwZwkWjhoWrvlzIQCX4va0RABuixGz0cjqci7GVc4+V7yP/\nX7dqLYWBny+D4nf7OQOK8pq/GVQN86soy19ENieiTuKp9bgVAvFnkqaYWG6G\n9btkYecejfgCYWtx2v6we60vbS8m2i7EeIHwWzwMDkFFrpAvFYG0o9kd8YIE\nYP/UDxnwKusI3SB643KaQOKPL4RxWS7O8l1g+Qwv8YPMNNdXJJLkhuo52G32\nhsn1zIPbvY6F4CBg7Y0F6Dy4ni8iwN1wOQWzDhA44D43NGudOxESkjlNHiaX\nL6bx38im8DBaHXRqisbAgonl1e/R9KrfiQp2mqZ+JO1otzppoRdXDMFNtkkG\nvG7n\r\n=yv+I\r\n-----END PGP SIGNATURE-----\r\n"},"scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","test":"mocha","check":"npm run lint && npm run depcheck","pretest":"mongodb-runner install","test-ci":"npm run test","depcheck":"depcheck || echo \"!!! Dependency check failed, but the failure is ignored by now. This should be addressed in COMPASS-4772 !!!\"","posttest-ci":"node ../../scripts/killall-mongo.js","test-check-ci":"npm run check && npm test"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"6.14.6","description":"MongoDB connection model.","directories":{},"_nodeVersion":"12.18.4","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","async":"^3.1.0","debug":"^4.1.1","lodash":"^4.17.15","storage-mixin":"^4.0.0","ampersand-model":"^8.0.0","@mongodb-js/ssh-tunnel":"^1.2.0","ampersand-rest-collection":"^6.0.0"},"_hasShrinkwrap":false,"devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"^3.6.3","depcheck":"^1.4.0","electron":"^6.1.7","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.8.1","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"3.x"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_20.0.0_1622747466353_0.321516107680738","host":"s3://npm-registry-packages"}},"20.1.0":{"name":"mongodb-connection-model","version":"20.1.0","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@20.1.0","maintainers":[{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"aherlihy","email":"anna@mongodb.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"lrlna","email":"shestak.irina@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"brookescarlett","email":"brooke.yalof@mongodb.com"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"team-compass@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"rosem","email":"michael_rose@gmx.de"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"e8bb45da2803163f0126706ffb9c7ea2bbbea6a3","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-20.1.0.tgz","fileCount":18,"integrity":"sha512-4XvMN+fa9ZvCSXlUjofGm0iUfCh1+qteYa0Y6y2rSDLiLhTuEd3CnwBscbDq6bhBuFfGEQcOYEhxNl4JNNa3pg==","signatures":[{"sig":"MEQCIHulO45AWLKZ5nGBsjH6rARootUQerT7WHpVJ5QGixPUAiBHL7UXSpl+DV1yfYYnMmMMVvyXIlmNrQ/iard7Nhb1ZQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":78906,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgwMjwCRA9TVsSAnZWagAAVTMP/R/zpzktPFSqq/TVu2/y\nindbi1zoCvXMTQQUwVCFI8XQSQWIjDFhw7FxrWZkh45lsoFSIyb0I6FMR3/W\nB5s5ii6u++u67vYcFNB80hl8IpRqnxz2FzcMxf0DjsNWI/p4/FBQ4ZVi8Ed9\nAlK7WnPW0mjL+Wc7kvNAHUtdpfhtcvZs6hK6AuXCSunIjFEYKkJZA1ZFHBpM\nmxiPN3pXHwg5BK3rtRCdQd7ELGhHJYUqT5PMGIWEKQV23PsSOtB1FCJinmvb\nRrvLcEGqTDVMyi3Tgv8L/wl4vS3Pw1/Wux5L3ZGgxC4ftSkpBBh/2s/d9yXQ\nYGIYhuoSVobBnK4LTqd17OzT2Qlf94Ewxht+2sA6UeuVy95QyUhuCUvWf3//\nG29SnUFyS8usEya9iQ5fwTatp/aafuo9zJykEQAmuJWrC8gEdNMW4WcQ6Qfj\nUZfpGy/kCHYBRDilbMY5Fg3PivyhqB/0ImSKxHHYlYGsk+vKUTYT46NnulNQ\nkgbcm8TVGNiQhuGBatqY2KCgNjaPuQVcSsRMFRlkOb7HHhQmbhrKW+VcOe0C\nh0RouNX4KOZGtTU5RllDisykeEdf1LbzqWZcA2tk1NsOr6TAHcNil+UnPOEV\njRgSDXY/q847ofem7b1DiMi8Hq58kOxBIKdQ2cfY91eGfQuo/ndlB6ZBfBAR\ngguI\r\n=HM2p\r\n-----END PGP SIGNATURE-----\r\n"},"scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","test":"mocha","check":"npm run lint && npm run depcheck","pretest":"mongodb-runner install","test-ci":"npm run test","depcheck":"depcheck || echo \"!!! Dependency check failed, but the failure is ignored by now. This should be addressed in COMPASS-4772 !!!\"","posttest-ci":"node ../../scripts/killall-mongo.js","test-check-ci":"npm run check && npm test"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"6.14.6","description":"MongoDB connection model.","directories":{},"_nodeVersion":"12.18.4","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","async":"^3.1.0","debug":"^4.1.1","lodash":"^4.17.15","storage-mixin":"^4.1.0","ampersand-model":"^8.0.0","@mongodb-js/ssh-tunnel":"^1.2.0","ampersand-rest-collection":"^6.0.0"},"_hasShrinkwrap":false,"devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"^3.6.3","depcheck":"^1.4.0","electron":"^6.1.12","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.8.1","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"3.x"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_20.1.0_1623247088660_0.0979231210945466","host":"s3://npm-registry-packages"}},"20.2.0":{"name":"mongodb-connection-model","version":"20.2.0","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@20.2.0","maintainers":[{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"brookescarlett","email":"brooke.yalof@mongodb.com"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"team-compass@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"rosem","email":"michael_rose@gmx.de"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"c5b613300da5f08c02b35d1889acc89671618d1f","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-20.2.0.tgz","fileCount":19,"integrity":"sha512-pbD2aCHJb0pZojDP69hmTGck2sZOg0YzDylTpgRrnAZolVP+nzBgQixzcf4rUA2ltxZXpIkY+TLVrywyNzTZMw==","signatures":[{"sig":"MEUCIQCRti1fI6g2ANy1XdifyScLRn5HSsSl5KXlUxVAqJPK/QIgKjilRQS2IS6Z8fXajPF0sqNze40FU+39haC1r+AnHZc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":109496,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgyjb9CRA9TVsSAnZWagAAsEgQAIEMoajQTvPtDdTzdA9Z\nSGQIAO4Z9Eh2AYrqBo71PpDLEXAdE5eVhWkUyF44tULUrEcyD7O53m2ycPfs\nFY7rq5wdo7L7Iw4YDkSjFj3YJKxdzlDi4KAKDptVCwlOJFjGbPInu+CPLZTM\nuuf9pQJh7THA9ZhmurS1EfhD8E1DR8wQSGIUzQNOmBphd0Khb46DWj80t3k8\nJkomdITw6DzUdblok772jScVIGompmqcv5LvW9uzwHJC4GvypXbQYE/S5MvB\n6leBMdY2xprNGBcfpLvvYQV06uUCbqEZe8lUuhRoli4J+YIsDYclfpkr+7eI\nZ9M5FjYUKaI+dxAQmtHM0Q4ddAiC2T7KxW2JTA17oVzmH4eG590rGkhDumiC\n/WSR4dkG0GHTb36cUIl1pPI7fGXsI6tI6V4AQNIbliXZ74KoRd4q88wpMiR5\npmKbsVm2sWvZmZdURajFPMj9G6pMGjw1/eNNNplFbF/QCTE3od8YZDK6UR8S\nA9kT0tWJVvXfeABcr4g1Z9jbBOyB0phHJ0W3tDX203eaGUGaFaSvrV2C0z3v\nIGeOkv5Q3gKLCoXaik4reBRrgg85Kuq5qwwiy7gNSmnZHXKsRdrjnYCcpVFu\nj9/5hokUvh2Rwgf71a3M+TfgdsXE7RLZhLtFdGCpxvL8AJg/podaFtkEl795\nb7T1\r\n=7UZS\r\n-----END PGP SIGNATURE-----\r\n"},"gitHead":"cd0a29248dc71d8ab4e3428dcc04f534fcc48e3e","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","test":"mocha","check":"npm run lint && npm run depcheck","pretest":"mongodb-runner install","test-ci":"npm run test","depcheck":"depcheck || echo \"!!! Dependency check failed, but the failure is ignored by now. This should be addressed in COMPASS-4772 !!!\"","posttest-ci":"node ../../scripts/killall-mongo.js","test-check-ci":"npm run check && npm test"},"_npmUser":{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v12.22.1+x64 (darwin)","description":"MongoDB connection model.","directories":{},"_nodeVersion":"12.22.1","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","async":"^3.1.0","debug":"^4.1.1","lodash":"^4.17.15","mongodb":"^3.6.3","storage-mixin":"^4.2.0","ampersand-model":"^8.0.0","@mongodb-js/ssh-tunnel":"^1.2.0","ampersand-rest-collection":"^6.0.0"},"_hasShrinkwrap":false,"devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","eslint":"^7.25.0","depcheck":"^1.4.0","electron":"^6.1.12","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.8.1","eslint-config-mongodb-js":"^5.0.3"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_20.2.0_1623865085414_0.8504500635739445","host":"s3://npm-registry-packages"}},"21.0.0":{"name":"mongodb-connection-model","version":"21.0.0","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@21.0.0","maintainers":[{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"brookescarlett","email":"brooke.yalof@mongodb.com"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"team-compass@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"rosem","email":"michael_rose@gmx.de"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"45367cae5a3df21fd34d75689267aedde7b678dd","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-21.0.0.tgz","fileCount":20,"integrity":"sha512-jgmJ6ZQLnhHoOD4/vBpZNxh3u2nz3Kt582Um5IHQfm1U7ZLvTMh4FgrmNI4mlD7wKC6O0ri1wf17RmaZq3DKDw==","signatures":[{"sig":"MEUCIFL1qwB+jmsZtBl7UKZRLVDNyWwOpUWvAx0a9UY8EjQkAiEA6BsopAZWR9ZQOkQKF7ZqiTH7X6eYpuh6QTKaMxOCouM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":109268,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgzLtNCRA9TVsSAnZWagAAtNMP/iF/K23VjN4TsPeWBHQu\nMpEL9nY5dGkE/STckhVjdPuMM62bUjdRqN//8+jDSm4uuPuv7RTFjUQu6/T0\nb17fNSXYkIqdmVII4dQQEI8A1+Q2aNDQdhsERLv017iCwjxWcjVDRSXUH0Y3\ntXNxpPrPfC+AC9S/WA7QjHP6eUfafQlFo1AqpoWADmgLGUTonUBcMXZnywf6\nMOfwumRqJ86Pu0MBk99hGFvhIp+rCifZcUmuTzegZVr5SosXynEsZWsvUqIv\nNwegLv4rM40aCN6ieE0zC0mH8LGbVDhXkZ/b6evHjwFCerxg/LBrv0LqbCV9\ndXNhfUn+/vpKhYT2WmuHAvoEBoLEKhrqyUZiMbLdIupJXB2O1nUuxn24+cCx\nPJlPHAtvsCeLKzjDc7EoR26zN4Om7PL+yTN7IHkrGIuyrdJET/RjHW7R0+up\nllH3ZbfNJlf84UlH3Ei7Dp6tuxjjSAydwKdeTjB6sykbJw2ca4aS84VATkwO\ne992rrFhomddDbEmp32WdjFWz4liRBd9oU7ildNEAi0MKBkFVLPRXDjpe9OO\njAratM8HFY7OB4royfbEBuCsrJQm1UCFtoDoj+nvOywbiysBm+P9EjGJx80A\nEl+iTZ9+b4Gcll0C/d9isVJORIZ4WgfMy5FY6PharqUeIF904M3LqJMuWa1C\nQPu7\r\n=rXH7\r\n-----END PGP SIGNATURE-----\r\n"},"gitHead":"cac56f0836005f093bdc5967102e957a270d806c","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","test":"mocha","check":"npm run lint && npm run depcheck","pretest":"mongodb-runner install","test-ci":"npm run test","depcheck":"depcheck","posttest-ci":"node ../../scripts/killall-mongo.js","test-check-ci":"npm run check && npm test"},"_npmUser":{"name":"addaleax","email":"anna@addaleax.net"},"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v12.22.1+x64 (darwin)","description":"MongoDB connection model.","directories":{},"_nodeVersion":"12.22.1","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","async":"^3.1.0","debug":"^4.1.1","lodash":"^4.17.15","mongodb3":"npm:mongodb@^3.6.3","storage-mixin":"^4.2.1","ampersand-model":"^8.0.0","@mongodb-js/ssh-tunnel":"^1.2.0","ampersand-rest-collection":"^6.0.0"},"_hasShrinkwrap":false,"devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"4.0.0-beta.5","depcheck":"^1.4.0","electron":"^6.1.12","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.8.1","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"4.x"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_21.0.0_1624030028770_0.7227456937325627","host":"s3://npm-registry-packages"}},"21.1.0":{"name":"mongodb-connection-model","version":"21.1.0","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@21.1.0","maintainers":[{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"brookescarlett","email":"brooke.yalof@mongodb.com"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"team-compass@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"rosem","email":"michael_rose@gmx.de"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"829892a44a15cc36d180bdc6e708b709dfeb174a","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-21.1.0.tgz","fileCount":20,"integrity":"sha512-EjZumzHLj1ZqD0AZpdQSHxZz5pEr6kstH2RCQ1j8Gy9YwlXOnV5XE9XLOr7fLe27gTYGCVH/4QeAx0AyDANrJA==","signatures":[{"sig":"MEYCIQDgtLjhWWm6SEejJTfDRyu/elGAXf6jbVG5tJsgV9kbsAIhAIFEg0WU3RDJv6XR/5+WP8XI8Z7NYC6GuDpGQNpx/BWe","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":109268,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg0FsLCRA9TVsSAnZWagAAAQoP/3vR/+/0cVc9nj8McfMU\n+bImbWQE27m1+RsrPVPIcJ4gfEu2zN0haKLYFSpFg76nHR9vBXsrxbKc58Rm\ntQiMaEl6dKEPG73Ylx87BkFE/1gawxYunhZf2hX0xF/2HQy97jjnWBa2sOVG\nAc/R+eK/sbN9DCxSdcqCp0PHQ4aeILvrKhbhG1AkBQ+wWeAFqXhUwS/yTJWE\nAKAF19vLsqzJwhxVDp2KxVmVDa4h8zJ2EuE30sWYO2qCwMuJoZU3bO88hpC2\n4mXo1r/P66hCK0PDQKRYtNcaL6F1jTM0GEL45G7ptuV555I002gEJxlFNMrz\nOXk4RrNn5X7oohh6a961fUUupxxJ3vbdZkx0x1S8qioW4KDsv/ofGFN/ZRxL\nNBwJ5mASI3IiwXEE7K0orYEmfpSVELojYc/kMS/mUegamXdQG9KTZx1gayrA\nNi40s8WiCIzjQw9GJWSvsb9xrTuNOlrxLo5gZnzFTE+pMGEl1/UQkGQ0dzxv\nnXSo1X+EdO51lGQWshEPGiWfh+lsJWxD44u0+/9qvpahWZxUPA4MxuTONRPM\nCWNPefwpvo9LlbMgl2IHfE3Jr+0paMzi3Ly32g2FdYTNoeKAKpuf61aekS8M\nqYA1U7lRHDHK3YwGBGi/cj7XZxsWCQqBQFhEZORoEHnxVlhlzg9X66owN463\ndE5k\r\n=RSol\r\n-----END PGP SIGNATURE-----\r\n"},"gitHead":"558b869fdc5c6c9cd59229974f214e1a40158413","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","test":"mocha","check":"npm run lint && npm run depcheck","pretest":"mongodb-runner install","test-ci":"npm run test","depcheck":"depcheck","posttest-ci":"node ../../scripts/killall-mongo.js","test-check-ci":"npm run check && npm test"},"_npmUser":{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v12.22.1+x64 (darwin)","description":"MongoDB connection model.","directories":{},"_nodeVersion":"12.22.1","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","async":"^3.1.0","debug":"^4.1.1","lodash":"^4.17.15","mongodb3":"npm:mongodb@^3.6.3","storage-mixin":"^4.3.0","ampersand-model":"^8.0.0","@mongodb-js/ssh-tunnel":"^1.2.0","ampersand-rest-collection":"^6.0.0"},"_hasShrinkwrap":false,"devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"4.0.0-beta.5","depcheck":"^1.4.0","electron":"^6.1.12","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.8.1","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"4.x"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_21.1.0_1624267530862_0.038964051956113854","host":"s3://npm-registry-packages"}},"21.2.0":{"name":"mongodb-connection-model","version":"21.2.0","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@21.2.0","maintainers":[{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"brookescarlett","email":"brooke.yalof@mongodb.com"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"team-compass@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"rosem","email":"michael_rose@gmx.de"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"1be10a7ca9ccce69433137fa2b0c96f52815abe1","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-21.2.0.tgz","fileCount":20,"integrity":"sha512-WcdDD/+MxEvmS5vhQxE2sca1BuULsNvphpb9CW+e819SMkdOMvU29ThifYtaPMg3Tv/wZX7RQ9gp0NEZfNAl4w==","signatures":[{"sig":"MEUCIC8ghxyRI7c44XAV8VdRmpPke+3Xd/kWZ2kvY0eMYLfVAiEAreezSTvnuPbbNsYER5RYK0Ml0WeDhRz36gZUmS5qe9k=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":109268,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg0ZH1CRA9TVsSAnZWagAAgqAP/3EnFFgKwU87nNP2Ku6T\niOqASR1sW5FF9BRHbmXZGGWbhQ3i/fKtRxOqu3RubmpMqxhuYtfZ/7hPPCOP\nCyistR03QzZAJbakEP60aqjLdPdhD/fNUfdZt3MkDf2hHiXTpAotXxoTMrCJ\nFwbbxcG2oJC0URxTC6xLxrYfb+0eafUJmh+EyFZtQ7ue3hbbkSYqC3Aiu+6P\nAV9Q8RdLezSyxturXDjX2HNqRHHeILu1g4tjVvt3Pmwu1MZJmAKwa6hBufaf\nPL1ewDqISzJSkC3BMJqMD370KHm3suD7jx3xJjTWZPK13WwQj6e04GkYrZrt\nUH06mP6Dr/1CydtsHeeykjaDQ9SXLTAktejm+c6hKaLy/Q73qg9jP1g4NkdB\nIJSWw0VZliO1Z6uSIZ+Pb93qQmnsvKifl8h635PNRYh/RRjoWtdfgcInt0Ue\n2ebgGMal04DTWgwg7l0hfi3Dhwvmr3h2qpE8eAyiVknh98eOzVptiNtaZ7sC\n4mF77GybkkYMpfw1pjne6ELwJqU3TYG+P37JrmNRFwNjGyPtvutCQJwg1sfD\n+tc6VrjAG/iy4Ohlw5eoROzbQfi6g51Zek1UKU2GtIKWPHg/peCY1HbQSkZu\ns6brxn0FRMwo9kG8V/bfnE7uof01bOST0htyEltvQeCTdrusF4wIuoStNrRL\nmc3C\r\n=eUOS\r\n-----END PGP SIGNATURE-----\r\n"},"gitHead":"34f63c07f35cc146ec42b0c7011b4a91ddbaffc0","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","test":"mocha","check":"npm run lint && npm run depcheck","pretest":"mongodb-runner install","test-ci":"npm run test","depcheck":"depcheck","posttest-ci":"node ../../scripts/killall-mongo.js","test-check-ci":"npm run check && npm test"},"_npmUser":{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v12.22.1+x64 (darwin)","description":"MongoDB connection model.","directories":{},"_nodeVersion":"12.22.1","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","async":"^3.1.0","debug":"^4.1.1","lodash":"^4.17.15","mongodb3":"npm:mongodb@^3.6.3","storage-mixin":"^4.4.0","ampersand-model":"^8.0.0","@mongodb-js/ssh-tunnel":"^1.2.0","ampersand-rest-collection":"^6.0.0"},"_hasShrinkwrap":false,"devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"4.0.0-beta.5","depcheck":"^1.4.0","electron":"^6.1.12","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.8.1","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"4.x"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_21.2.0_1624347125075_0.3798661899013671","host":"s3://npm-registry-packages"}},"21.3.0":{"name":"mongodb-connection-model","version":"21.3.0","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@21.3.0","maintainers":[{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"brookescarlett","email":"brooke.yalof@mongodb.com"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"team-compass@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"rosem","email":"michael_rose@gmx.de"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"5507954db9c25ebbe0275e8924ea5255379bf58d","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-21.3.0.tgz","fileCount":21,"integrity":"sha512-5b2wkMekhRcDrhciKuheQTfELhB24yyN1r+FihBMeb6TjstHrQKgJwsrQptRVr0r4aByX+xqlrDk9vgVzSeuTA==","signatures":[{"sig":"MEYCIQD8aTUZpfILPp+CF2mArHLHKFbLLfJJGDGX/WC23yGLAgIhAM5UAkdAXHHwjUkT36eBHZhK8sfu4/kYuzZy9qdnmKrt","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":103927,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg2Y0YCRA9TVsSAnZWagAAQCAP/01GfYS3zpbZEn8cZD3a\ny9J6bj2NG9SYCmBGVGWoSz7E7MMXd8ICquZhNSLrj4ajVecHYWu9LEXhlWLR\n3PlGGlYYlJxKNa0A+0Q1sG97fJ7+WW8Yy/B8fw7sts0dN2QBp1R8WRkQE3tZ\nlblvQ2HqfS1gPPB3KiVtevF6oby/P8bjqN0FOb/P+Q4biuS+Ajzg9hC3/aPA\nAHx1MxAfULW1Y+3xDVRPqgm8/LvIuXWTvYdAhEIYey4YsSwyRic20VaRz6va\njF3s0BvJeOP1Dv2OAjSlHsHOUWFo85mDP2yeW6FYnszSbN/Bf3nGfoBT2his\nxgauvfq9xDRjbaLZlec7Gg0gn03uAn6eT3T86J3VekGh+RJ7PE7ZyOUGDuaS\nEz7ZfG9hTc/RFfFv7lPHbsD/w2Pigdv9Az7ve7Sf8q9klgO8I4sKA3hheTEW\ngihy10Ni0UCvEGrEYTORAurbJV7nG4aFLFLLka277UbVp+Af+B+deee+a1vU\nXcvgU5UN9THT22GG/fn2hYsTItoUZ8ZBMTvwAdTn9yO776IFcW+ROcGDTam6\nlld0yVbVT1BbjAN/chFkv5rRv8GAyLvl78DRnouJNwYjWp1ryFs9GrUlgisI\nbwFKobNqCGTwoRYaa38Pvvwzok9WmFIWihxNBGzOHbEI35rBmV+WnBjvsKVW\nYLKt\r\n=dalG\r\n-----END PGP SIGNATURE-----\r\n"},"gitHead":"0819b7be289d05d770a45071692cb772806e61f0","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","test":"mocha","check":"npm run lint && npm run depcheck","pretest":"mongodb-runner install && node ../../scripts/rebuild.js keytar","test-ci":"npm run test","depcheck":"depcheck","posttest-ci":"node ../../scripts/killall-mongo.js","test-check-ci":"npm run check && npm test"},"_npmUser":{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v12.22.1+x64 (darwin)","description":"MongoDB connection model.","directories":{},"_nodeVersion":"12.22.1","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","debug":"^4.1.1","lodash":"^4.17.15","mongodb3":"npm:mongodb@^3.6.3","storage-mixin":"^4.5.0","ampersand-model":"^8.0.0","@mongodb-js/ssh-tunnel":"^1.2.0","ampersand-rest-collection":"^6.0.0"},"_hasShrinkwrap":false,"devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"4.0.0-beta.5","depcheck":"^1.4.0","electron":"^6.1.12","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.8.1","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"4.x"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_21.3.0_1624870168252_0.2315427938842245","host":"s3://npm-registry-packages"}},"21.4.0":{"name":"mongodb-connection-model","version":"21.4.0","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@21.4.0","maintainers":[{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"brookescarlett","email":"brooke.yalof@mongodb.com"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"team-compass@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"rosem","email":"michael_rose@gmx.de"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"b94c541d798653c3539e7c798f56c3b42cc23244","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-21.4.0.tgz","fileCount":21,"integrity":"sha512-z9AjTlN0hd7R17zH+8Ox/RGoqttZcpayxSl6trEM/tOfFmZzLNuSmH4BDuUt430sMFIIVHRyvZJw5bb0x3aGmQ==","signatures":[{"sig":"MEYCIQD9FnObbwonFkliirPrngW1WUYxtZPl36vUFIh/dSCyLAIhAK0Z86++PM6xvQdlTXeIcioItBZxktdluBn+AtbsI2iX","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":104236,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg3CKeCRA9TVsSAnZWagAAjKgP/igdRWnPmDCN55ZE8reS\n+DbMcgYeA4xewojCX/TNIAM3yaBb3WrHm5us3t5r4JucHQFJdXfPzsfMDTvz\nB69De6aBxfbeFRnf4FPVVLl3NK6W6TPaGd4bDxi8BuXRryEv8Q4hvOQZeKzV\nl2NC+e0NOV9tYiYdBSHWjIt7y6hAnKuohO97t03sMCQ8Scqblf55iKlKfhrp\n7rYDLL+RsGm5qZBdkNzmrtr5C/C2PcIxL6qgIQwJEj8UG/7fbaKx1W3Rr7uM\nWdoZJWu4hHZOo4ZGC7i0+txfJTRYf36UewaJDA7qxccArtjtsgbrEOzmg7gE\nDpcKbwcwWS/ZBK5HHbtjOf37bbU0shv3lki+QvXjBfinfOKiWh5M6JlC5E7j\n30dbm7pEA4b21TbE7RnKAr2Oqp6qRX120+qdFsUssOLxGPXvYSKdSaHefa1A\n5jH0Xlkt1xdq34lBQiXDWqkq0eRwnudq97fqY8RqcfyjdYCU2wfdN862Q+Tn\nHY6K/84aok0pAT5Dh7FGCScptGfxDQVQwyTW1cKEtexadmzO2NN9kyDvHYWW\nZUZOPzAEH/+HDSY9OseautQvTwfoX9LrP2sm/2mwAGFlv+hQj6vtybeU6ku7\nxvk1hq4WFa8K8i2oL0D8pouxQkc366+1cNjDoD5B+JlHza4o/HwrkNX2ADjV\n2cnl\r\n=AEy6\r\n-----END PGP SIGNATURE-----\r\n"},"gitHead":"6910bf828de3d14d44e60715f9dda2666ee94a71","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","test":"mocha","check":"npm run lint && npm run depcheck","pretest":"mongodb-runner install && node ../../scripts/rebuild.js keytar","test-ci":"npm run test","depcheck":"depcheck","posttest-ci":"node ../../scripts/killall-mongo.js","test-check-ci":"npm run check && npm test"},"_npmUser":{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v12.22.1+x64 (darwin)","description":"MongoDB connection model.","directories":{},"_nodeVersion":"12.22.1","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","debug":"^4.1.1","lodash":"^4.17.15","mongodb3":"npm:mongodb@^3.6.3","storage-mixin":"^4.5.0","ampersand-model":"^8.0.0","@mongodb-js/ssh-tunnel":"^1.2.0","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^1.0.0"},"_hasShrinkwrap":false,"devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"4.0.0-beta.5","depcheck":"^1.4.0","electron":"^6.1.12","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.8.1","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"4.x"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_21.4.0_1625039518030_0.008253761789698943","host":"s3://npm-registry-packages"}},"21.5.0":{"name":"mongodb-connection-model","version":"21.5.0","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@21.5.0","maintainers":[{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"brookescarlett","email":"brooke.yalof@mongodb.com"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"team-compass@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"rosem","email":"michael_rose@gmx.de"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"541d04b19d5dd21a2182e213a07093fc790bf68f","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-21.5.0.tgz","fileCount":21,"integrity":"sha512-HKYMAE6KSKmzTs6YqkPnX6ufB70L0Yg2rJVf3eGT8JGe29mnnhLeFl2sguLQR96mBXL8AijuUwGMbsucJMaLFw==","signatures":[{"sig":"MEQCIHRYGy9jKWa88LyyeDiBo7alHDfwEaphQRR4wMazDRmAAiB3R9VDTxmEhSDxtLy2HDJ5ZwuxEYEEokkxcajLMY0XbA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":104325,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg3Wq0CRA9TVsSAnZWagAAb7gP/2pG7eRUP4U41HWTFtj0\n5rX+W55SkeuYojARTkeSJblGMFLj20CwavMPXa2rv9h/IzrxDTrzPEHTSYfi\n01z688WXtQMFHs4MEtHdWAQV+YtW1qPiqMjPOfzKxoC2evttfoMiCW3MKfH+\nTA01tfr65+BW+XSKEvf5wyuWoo4QFIJ7CIEhtOrRB2jkOp/r+2IqknHfDw9M\nGdG6P80Gc6tym4EjS9YqYBFypIrIbe+jPq3G+a4iV1F4w2pszCD1zADYuJ6T\nTmBBRy2eJ6o/6aaEswZVD60z+jT6HCrUVZP0SsMftUMqOGw2RR5B4haAcHOi\nYNwwbZuv8cFiThIfRrSW9qOoJ4T3y1eE6+JeMAozpx/ZlfK3uQdOceOhU4u7\n0O+m/bvvmoWXdOJMCH7v/VCuvl8mnxC9wJF8WtWsuBaaz2E7U0iErgV2xMvt\nw6JsF/pJ4sbgfPCNposDqXzMvJCw7JNGevf596dAYvwjZM/iT3IFwtRogyvh\ncXnvvfWHYfVl+kc4Rcfo2LHpwXwgrwDBaGqnMtUn5JR0+d1xVYkf70ojSYUF\nVWvJLLBPYyXSx7J8kH8NzR6ncuyjtKRqE4H9Mcdvhab5Dnqmr4P93kj52jEi\nnMuiKikFiIUH1ePovuYZJjsHRVZ+zuxvPh/YpDBaE44IgXIcyBAvprthKKnl\nX04r\r\n=EdAP\r\n-----END PGP SIGNATURE-----\r\n"},"gitHead":"2cedde9f5ef67a85c2f21bd6c48be8f4a41bafd5","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","test":"mocha","check":"npm run lint && npm run depcheck","pretest":"mongodb-runner install && mongodb-runner start --port=27018 && node ../../scripts/rebuild.js keytar","test-ci":"npm run test","depcheck":"depcheck","posttest":"mongodb-runner stop --port=27018","posttest-ci":"node ../../scripts/killall-mongo.js","test-check-ci":"npm run check && npm test"},"_npmUser":{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v12.22.1+x64 (darwin)","description":"MongoDB connection model.","directories":{},"_nodeVersion":"12.22.1","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","debug":"^4.1.1","lodash":"^4.17.15","mongodb3":"npm:mongodb@^3.6.3","storage-mixin":"^4.5.0","ampersand-model":"^8.0.0","@mongodb-js/ssh-tunnel":"^1.2.0","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^1.0.0"},"_hasShrinkwrap":false,"devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"4.0.0-beta.5","depcheck":"^1.4.0","electron":"^6.1.12","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.8.1","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"4.x"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_21.5.0_1625123508238_0.0009644405857764937","host":"s3://npm-registry-packages"}},"21.5.1":{"name":"mongodb-connection-model","version":"21.5.1","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@21.5.1","maintainers":[{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"brookescarlett","email":"brooke.yalof@mongodb.com"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"team-compass@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"rosem","email":"michael_rose@gmx.de"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"a09b2255c61979ae758a632515fc21949c7e25c6","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-21.5.1.tgz","fileCount":21,"integrity":"sha512-tAVOeUmrwIbQlYnKAtZi23eIkz/QqdYTZEq7bduI/sTUlQwCbQPGpiUo/auTuo+K6tgVXCntEndawj9AkEQgnA==","signatures":[{"sig":"MEQCIHLp6dGeqEivdeLLjyjgGJCxHtNr3kJzZEFq+GRQ4Q/PAiB8NnMaf4SHE+dCtTIC0uiDFudLpHf4TVBB1SFz8L3L6Q==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":104497,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg3xtECRA9TVsSAnZWagAAMdMP/RA57BI9kQIiZRqrlyMC\njyFvKyys54GXXvgcMzHPFHDsmldU5lNm/j6JdvvHIr/gwKRSc4rTcIpEcsxW\npJf1duf3HrmlLJz6BVzvGtGq1SRANTPdP0KtPYmqEW3nm/2E5BjnAC3zMGB5\nNBDXjqj+fxdYk7zv6I4x0+r9QAalNEO+Ebt065oyX8JBwE+a27hK6g8PBGQA\nJ+22KyOhYlNQVwJiKczQBbxl8y/DuGV69akmm6uJwzBuO60TnlljehwpeJi4\n2LXj2SAyH0AX5gV2PvuoEjLfKfRVBSF/t5W7t+3X9yce7y0GKBy6YxWTzFfS\n8TIHSEJ1ltCbU3aTilq4PsyvtGMZaOxrMmCncbdJLYDIUhXQ4Gpn1GYr8EuW\n4wN4TwFvbmLudtSiaDw/xARi1KzmJM4FSRi3Gjb8mTlH5dQtPotT3R5rMyi/\nlgq6w2e1mP1HjfNJL1urCNoG30xf1jiTUoEZAOnTss/wyq0jM/tMalYJdh8H\nYtzj3+da4OwkOOsC//2oHz/2hyFra9k+J0+OVzYpPjpM0ggutRe6TDjKXazh\nt5ikJIsX8WwP7yfKOq0XJe5tSxRxUVekIeFYbCrGsc9PBDYeQOz1vAAb26br\ne5e1IOrf1B5yl6qzEv8E9pLyi5UU8xGs0cdtx77PHSic9yjVG0tgRVX6FAah\nIKOr\r\n=98U1\r\n-----END PGP SIGNATURE-----\r\n"},"gitHead":"dcae3824f466fea3a204eb9d4684b49db11b81a9","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","test":"mocha","check":"npm run lint && npm run depcheck","pretest":"mongodb-runner install && mongodb-runner start --port=27018 && node ../../scripts/rebuild.js keytar","test-ci":"npm run test","depcheck":"depcheck","posttest":"mongodb-runner stop --port=27018","posttest-ci":"node ../../scripts/killall-mongo.js","test-check-ci":"npm run check && npm test"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v12.18.4+x64 (darwin)","description":"MongoDB connection model.","directories":{},"_nodeVersion":"12.18.4","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","debug":"^4.1.1","lodash":"^4.17.15","mongodb3":"npm:mongodb@^3.6.3","storage-mixin":"^4.5.0","ampersand-model":"^8.0.0","@mongodb-js/ssh-tunnel":"^1.2.0","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^1.0.0"},"_hasShrinkwrap":false,"devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"4.0.0-beta.5","depcheck":"^1.4.0","electron":"^6.1.12","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.8.1","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"4.x"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_21.5.1_1625234244318_0.48767555445299293","host":"s3://npm-registry-packages"}},"21.5.2":{"name":"mongodb-connection-model","version":"21.5.2","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@21.5.2","maintainers":[{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"brookescarlett","email":"brooke.yalof@mongodb.com"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"team-compass@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"rosem","email":"michael_rose@gmx.de"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"c995621ff5dce842b30611bb81aa6691c6e7fca7","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-21.5.2.tgz","fileCount":20,"integrity":"sha512-7s0YuyOjawVm8EPBLzFVYy1a0RY44J5DDlaANRuRYejdPNnPqj7j0+mU01xdM0b5KM01fI6b8/i29GKLW3VgQA==","signatures":[{"sig":"MEUCIQDKf/xDvJYBXgSreSWBSNIdxWrNmwbCBY26AAf368+bBwIgNxoDJ3FSS6rlR4ulvFryZ3y7pnp8S1Vy6QQf9TXybPU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":106009,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg6JFKCRA9TVsSAnZWagAAQ7UP/j7paEb6GE0RB5XKAbIf\ndCPk2V50pXJjEmsoLtfmPpI/umSZvKu8Hne73bi/Q8bd1REu35BMeDn1vgio\n//sM+UZ+W33TbyPxDBXHMoftj/JdVBjsBW7EvwJQz6uYt51xSbh5WdywjzFP\nDAnjyYaXurSoFiZNJWHLyXHFHzUX0u7P16Y4j4C5VGD03CNFGjKswTaKDcmv\nwBMhD4mfAWgYEgAwZJfy1D5MrRQzNiKVwbc5AA+4yVQgjInUiomoJm2Iz0/J\nlSZppMUGpDGpyrMz/Z3l63VGIT3UjeEe35M4czeelgF5Z0BgCWliTISSs9HO\noL5nvM3lzpCsHJeSf6BOriGwcvFKjZkM/8DLY+H54XNKfA51/6eY57Dp5qWw\nr0UIrNdeg8Ndt5DW4lAZovZRHPG9eApcMsQ0nEaVjX+O/gLGxlBM52diu3ut\n/b6u0K7J53ayPGdMVkWOYoA2618sS7+Z+KXKqQcEygir/3lMpkpG50KP7NFg\no84SRFQ/kdcRbVibzyeVPa4eofTqGRRZeobFxbCDj/UaxrwzoGeTp1ewrF2f\nHBJbYrXQ1o69ovNymp0/Sc6lhdFlHZDxeqVgPxmVZg7WbmKpr6D5xXp8o2di\nYI9Bc07C0h9+Lu4OkaibaGBGeqEj/jxMOeTXWS68XHaMOtYymlr4sb/xzNpB\noQ+l\r\n=DfCS\r\n-----END PGP SIGNATURE-----\r\n"},"gitHead":"4200b0aaf1f6be5d883315b1090b899c79b1686c","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","test":"mocha","check":"npm run lint && npm run depcheck","pretest":"mongodb-runner install && mongodb-runner start --port=27018 && node ../../scripts/rebuild.js keytar","test-ci":"npm run test","depcheck":"depcheck","posttest":"mongodb-runner stop --port=27018","posttest-ci":"node ../../scripts/killall-mongo.js","test-check-ci":"npm run check && npm test"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v12.18.4+x64 (darwin)","description":"MongoDB connection model.","directories":{},"_nodeVersion":"12.18.4","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","debug":"^4.1.1","lodash":"^4.17.15","mongodb3":"npm:mongodb@^3.6.3","storage-mixin":"^4.5.0","ampersand-model":"^8.0.0","resolve-mongodb-srv":"^1.1.0","@mongodb-js/ssh-tunnel":"^1.2.0","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^1.0.0"},"_hasShrinkwrap":false,"devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"github:addaleax/node-mongodb-native#71d4c39e5c858f49d10e840df626eca4da653e28","depcheck":"^1.4.0","electron":"^6.1.12","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.8.1","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"4.x"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_21.5.2_1625854282267_0.5457472496596163","host":"s3://npm-registry-packages"}},"21.5.3":{"name":"mongodb-connection-model","version":"21.5.3","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@21.5.3","maintainers":[{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"brookescarlett","email":"brooke.yalof@mongodb.com"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"team-compass@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"rosem","email":"michael_rose@gmx.de"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/connection-model","bugs":{"url":"https://github.com/mongodb-js/connection-model/issues"},"dist":{"shasum":"3da51f88ab0c0b31d7bc1f204dbcef7f585dc4f4","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-21.5.3.tgz","fileCount":20,"integrity":"sha512-VCqgBNzJjWbWUdotJqvSyzWOjn5Ob1Z2kS9hXL4g9x/xlGZb778LwMEqg2vc5FAQIVTfRzrZBneElmAjHjHLvA==","signatures":[{"sig":"MEQCIAR9vbUElzXvi8/uwmoVN/dBB+cVqH65WYMA441Qgd4+AiBbc185NdbZBt9J23en3bTOu0xTvkOBa6fspkPlITyNdg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":106168,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg7B6aCRA9TVsSAnZWagAAtzkP/Ahy2OPDyfbAcQKWD6+r\nN7j3iYWrgcAAwGnSZGh2JqAqnZ3QRMnlfZkbGNx6AC/F/R42YanPgHFhBJrv\no3iLUh8WH6BrCEqkvI0rxTqV2qeXyj6aHxVWrSNUTfHniK6L0S+ZH5Q9dkQA\nvxDtf/YeJsuf9T3CtGsD0i+DzifhRgLQmJpIrvLotO4dQzwgWbdcf7Kb2czo\nAyQr/1795P1Eq0bdvPy6VKAfByWosCFGIAQGXC4rf8T1xkXPNL2sSYB96Ifh\n9m0Ento5Mt9PoSKjxjkIiBxchLSjFFFeItDEjDN0FKgPI7COszDYWmP7Q7U8\nLEd7GJFWILasr/hOeIK1wVtziBJYvEsBsYsa8mrmHlNSEglPtHfBFz1kIENa\niIzkrnnH7kJ02V3vOLelBlR9tqLtNNi0mqbVLVzchxhOP+zqeKop/9nrqCLO\nRZ2FDZGkuzIFUMRAPHKYc/oZCS6w1acJ3+OMvierTP9rO37Ohmd0DSbSgnXn\n0ObrdaONKbYm/POVYc9vLH3ga+UPGmNz+wq8jnwycEAF+krElKfRScUrMrjM\nrSvWzrVpZ2x7ND9NAFiYweTfcQdpGhZuT9/9HCn7kYYhlJQc5bCqZjPjWVem\n1MR9mr4H9Z9e1d3CMQMlzP927TCbGmBoYBfA5oU7OzYWYzpmxQGyLQKNpP90\nLbgi\r\n=ZE7S\r\n-----END PGP SIGNATURE-----\r\n"},"gitHead":"f46948c37c24aeeebe19d424ffc50ec85d7f0d9b","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","test":"mocha","check":"npm run lint && npm run depcheck","pretest":"mongodb-runner install && mongodb-runner start --port=27018 && node ../../scripts/rebuild.js keytar","test-ci":"npm run test","depcheck":"depcheck","posttest":"mongodb-runner stop --port=27018","posttest-ci":"node ../../scripts/killall-mongo.js","test-check-ci":"npm run check && npm test"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/connection-model.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v12.18.4+x64 (darwin)","description":"MongoDB connection model.","directories":{},"_nodeVersion":"12.18.4","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","debug":"^4.1.1","lodash":"^4.17.15","mongodb3":"npm:mongodb@^3.6.3","storage-mixin":"^4.5.0","ampersand-model":"^8.0.0","resolve-mongodb-srv":"^1.1.0","@mongodb-js/ssh-tunnel":"^1.2.0","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^1.0.0"},"_hasShrinkwrap":false,"devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"github:addaleax/node-mongodb-native#71d4c39e5c858f49d10e840df626eca4da653e28","depcheck":"^1.4.0","electron":"^6.1.12","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.8.1","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"4.x"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_21.5.3_1626087065836_0.7368204449800497","host":"s3://npm-registry-packages"}},"21.5.4":{"name":"mongodb-connection-model","version":"21.5.4","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@21.5.4","maintainers":[{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"brookescarlett","email":"brooke.yalof@mongodb.com"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"team-compass@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"rosem","email":"michael_rose@gmx.de"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"f58ba074cdb81afdc33b2e97669b8207bef87fef","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-21.5.4.tgz","fileCount":20,"integrity":"sha512-X6tk81IStBSe0omu7kN5ao5qUzv6Gk7h6wMSorOf1fuaFDk3e3KDNdYkJ9LAesTcmCslAaY2DqlGwVNAELWPag==","signatures":[{"sig":"MEYCIQDz+p8NiH42MkqnuwOFhOzcI7s7uAmJNpWHnH3PN44MkgIhAItHZWIijovIwsrJvdH1Y5GCw5yrSH94bj+aw06HKrKk","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":107864,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhC9JiCRA9TVsSAnZWagAAXLoQAI9BADZETPhlOD4uH3Cm\ncew/M605xddXkrKE5RONUFoeIiD2QdY3I3td2CKRTYsV2krq5+DgcCZLu8Zn\nyrz1MQQqfxDVIeMs361VydCE3K08FHk6UZw2ROUC5fYMqQZWv+j+fMkuPhA4\n0EohMyDX7hvOt/Oh4sMaIWrDguowUz8/RHrjA+Q/EuL8QM664+3kgKngQfbL\nXZH7o0BFzvGaZeVcNFQ9HZdJKfcxWcoUa46nnSqTjfEk7nCntn0TJIMHg6PX\nZhtO7YBbzMhEgsHyWD6z8bb8P0k8dcP9Z185nwO+l4vHc/7qrRHWDztoDymr\nmvkxWm+IZyjgs0zih73ZsqyYxISrKRqGogOEtr1g5ynwYTUP2zY24Vl96hQi\nBijdhbujxbQsGIKmzRjTxU1iWDmw37WOPFiF5uzalaAYu4DhXZQ065Dn3bLR\nn2VEZKg+usbovqWF96V2gcQJXrkh4w8i0Uy52EFYq3e81xIZ/m1rxJAyMR5J\nOpnistyuPikTJ6b42tmD7kgk6YvExhMJFYU9wA28gUYaUKrjz4u2NLpqKKkY\nqmIPVuR8yWpZ31jzLnJZ0hug4awVHtxpuY2Ddrb52+FWd2igx3Vh0mM9MJou\n891XCJJPeLyPIGjO1mSST4OTWdHCJAq5GoQkRtmzVj/yfzVZr+BEvmlViLYI\n03wH\r\n=qm4h\r\n-----END PGP SIGNATURE-----\r\n"},"gitHead":"8ec19acfe461d3f9c3e6eddc550669aefc029180","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","test":"mocha","check":"npm run lint && npm run depcheck","pretest":"mongodb-runner install && mongodb-runner start --port=27018 && node ../../scripts/rebuild.js keytar","test-ci":"npm run test","depcheck":"depcheck","posttest":"mongodb-runner stop --port=27018","posttest-ci":"node ../../scripts/killall-mongo.js","test-check-ci":"npm run check && npm test"},"_npmUser":{"name":"addaleax","email":"anna@addaleax.net"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v12.22.1+x64 (darwin)","description":"MongoDB connection model.","directories":{},"_nodeVersion":"12.22.1","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","debug":"^4.1.1","lodash":"^4.17.15","mongodb3":"npm:mongodb@^3.6.3","storage-mixin":"^4.5.1","ampersand-model":"^8.0.0","resolve-mongodb-srv":"^1.1.0","@mongodb-js/ssh-tunnel":"^1.2.0","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^1.0.0"},"_hasShrinkwrap":false,"devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"^4.1.0","depcheck":"^1.4.0","electron":"^6.1.12","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.8.1","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"4.x"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_21.5.4_1628164706812_0.7260383873035727","host":"s3://npm-registry-packages"}},"21.6.0":{"name":"mongodb-connection-model","version":"21.6.0","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@21.6.0","maintainers":[{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"brookescarlett","email":"brooke.yalof@mongodb.com"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"team-compass@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"rosem","email":"michael_rose@gmx.de"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"21c533704ec6c4663219b8b39f300fa52cb8a864","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-21.6.0.tgz","fileCount":20,"integrity":"sha512-EDbVhwTudqG4RvUqvK/FU6ywBZilYyiJ2YqhbvP3aUwv1B0Vn5JQdzbmmJgx5uV7Eoz9mEKQjL3OO/yM9lWsLQ==","signatures":[{"sig":"MEYCIQDhkE+2MkacHJpMl+lj74ub6axNIDLzVez8uhLneZLISwIhANDaGFtBtiFWb/TJ9mYwQcEG55xPJB8dwHPRqInNvFEx","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":107947,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhE7aNCRA9TVsSAnZWagAA168P/jEqPXa8lJduzyIOjfr6\neDnzrBTqT/TAaAvDx+C9zU3ww+7zoy209WoL0auNG066Igqf3/npMe5SoLjN\nJWj1cX7zb0pqJpwcM9rMMtxORDawTLG9OgJClBwaYJARHZ8PuX/ZIYWfXaxe\nMEH2eR5LNzdd0oD3paQ/d1OGXgZVmC8ILFTHqvh9Alrbw9hBXo6x4l3gCPJM\nvY0fl0QBKYjPcg9cNzwl+K+dIES0St5FzQdjJlLuJZwlFD44vMdbBvp4w8yS\ndqPeaIvNtMrOsCYvFxDjpyTUjINj+DXdYc4xZWju95QqmnPzprbZZhHsVDsD\nKLDzcv4nU/OrUEG0uvIqHoENtHGMGAiSJHZBh55nRMGNfZOF4vk5YWXyuLvp\neNB99ixBYvw6j2xfiIM8A2lxDq396TUDERNIProWW1BIPMBBaldodVxZ2J79\np9g36pTJV5Desl+jvV6XcNtAuz6sMJTrgw5U3bVZ44GY+LFU8ugJiyR2Isum\njyvopDvEQEBHC8xQZ3psnq9799C6NT+ywc1jAPiOoBcVsmZnk2eZonkN8VoC\npmzHo2lTS0IaRH5SmjX/E8Le9Z8UO8WBa95hVsQSOdB6YJuFT//+8s80IIpX\nUcBr5s8xP9cZMFQatvEkp/N1g9pkzpNU/gSB+QYjxrItNSqxqeu7jkHPRTXK\nhSXv\r\n=oU96\r\n-----END PGP SIGNATURE-----\r\n"},"gitHead":"e00da432655fbd1b723fd693527bf481f4c1e645","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","test":"mocha","check":"npm run lint && npm run depcheck","pretest":"mongodb-runner install && mongodb-runner start --port=27018 && node ../../scripts/rebuild.js keytar","test-ci":"npm run test","depcheck":"depcheck","posttest":"mongodb-runner stop --port=27018","posttest-ci":"node ../../scripts/killall-mongo.js","test-check-ci":"npm run check && npm test"},"_npmUser":{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v12.22.1+x64 (darwin)","description":"MongoDB connection model.","directories":{},"_nodeVersion":"12.22.1","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","debug":"^4.1.1","lodash":"^4.17.15","mongodb3":"npm:mongodb@^3.6.3","storage-mixin":"^4.6.0","ampersand-model":"^8.0.0","resolve-mongodb-srv":"^1.1.0","@mongodb-js/ssh-tunnel":"^1.2.0","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^1.0.0"},"_hasShrinkwrap":false,"devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"^4.1.0","depcheck":"^1.4.1","electron":"^6.1.12","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.8.1","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^4.1.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_21.6.0_1628681869226_0.5686528998455398","host":"s3://npm-registry-packages"}},"21.7.0":{"name":"mongodb-connection-model","version":"21.7.0","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@21.7.0","maintainers":[{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"brookescarlett","email":"brooke.yalof@mongodb.com"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"team-compass@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"rosem","email":"michael_rose@gmx.de"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"cbd6630fa88e3e1eed115da1f0a3cbeebbe9fd07","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-21.7.0.tgz","fileCount":20,"integrity":"sha512-lvhTmc8DQbCKaZYMZmZUUUdgxgQaAU5sJoaIMq+SKTR6YHQwmz0hF6Fak8OE7RBu0zXKJ3e3zSVi8T4NcXFmgg==","signatures":[{"sig":"MEQCIDB4BUZoVO56lNIaRU2CNumZTryV9vHfSaEO7PmgxgVNAiBRT71KBHIj1sQntxOTrnrG8AtBT2kV03LmOyqIJVTPrA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":107947,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhJQ58CRA9TVsSAnZWagAAEyEP/ReLoajZE/J3kIGk6Rhb\nNYRW7H905DYKIWXOZFbTvZGI4d93xgdaGtSG8EX0420jz8qJn+WbYgbp0PLs\n21rsyMLBAXrbqieF9HU2pnkEoF6HuLjgqDms1YMLj/jW3WhGNF1LxtTWlaws\n1lrFrDxA6UpOso4xLl8AQ7mBEl3Qa+K/7aqbhmtE269Jnq9QpA/8u+sc2DBq\nOGQCc6VCA9VYiGR/yYFkrMrncvOBk9dxRDrlkIeCrEQU+Fhzte/qrXlaMryr\nshAX0Ycb+F5YBwOObBi/o8NNYEu2ti6YXkWqOQ3CnpXL0XvmSure6l+ynU9L\nQ5uThITV2YV9OHB4q0xjrcnnqz5lE7pYVOZXw9kRlAK/rKFcKxuE3LUjq9ed\nIHnqEnXXrU2i/hnA7T5p0w36Db7MK/eeRri5FdKZh/yQ7ZjWisBqKcrV9Wgy\nc51l7u0bmbKD6LofPEzPR5T0t9NQaBwq7PyXxPwCd04R7fKgwmn+jF1YXYBn\n49G5IdE6PXAZBWxU1c9yp0CIg9gtgc5V+uRaTGJa4zRxeB7msTf/KJ3Dmk5l\nbATh8Qgm6wkL/9AN/fyh8PPPeiGcRGe1RYZbdPV2NcgSvsjnusOwlAenzKn4\ngGztjviEdsHUSId5GF14nT5jY2iGE+Nq4YCqnSqh7n5RzZlXW8zUv+DiklZX\n7jA1\r\n=xNfn\r\n-----END PGP SIGNATURE-----\r\n"},"gitHead":"abc524ccbba843235e4ca5ee12d5553cfe65388c","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","test":"mocha","check":"npm run lint && npm run depcheck","pretest":"mongodb-runner install && mongodb-runner start --port=27018 && node ../../scripts/rebuild.js keytar","test-ci":"npm run test","depcheck":"depcheck","posttest":"mongodb-runner stop --port=27018","posttest-ci":"node ../../scripts/killall-mongo.js","test-check-ci":"npm run check && npm test"},"_npmUser":{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v12.22.1+x64 (darwin)","description":"MongoDB connection model.","directories":{},"_nodeVersion":"12.22.1","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","debug":"^4.1.1","lodash":"^4.17.15","mongodb3":"npm:mongodb@^3.6.3","storage-mixin":"^4.6.0","ampersand-model":"^8.0.0","resolve-mongodb-srv":"^1.1.0","@mongodb-js/ssh-tunnel":"^1.2.0","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^1.0.0"},"_hasShrinkwrap":false,"devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"^4.1.0","depcheck":"^1.4.1","electron":"^6.1.12","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.8.3","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^4.1.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_21.7.0_1629818492465_0.5480157743897571","host":"s3://npm-registry-packages"}},"21.8.0":{"name":"mongodb-connection-model","version":"21.8.0","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@21.8.0","maintainers":[{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"brookescarlett","email":"brooke.yalof@mongodb.com"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"team-compass@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"rosem","email":"michael_rose@gmx.de"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"a1c7d6e36231c5cd88f77428ead3365930bbd51f","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-21.8.0.tgz","fileCount":20,"integrity":"sha512-TQA2zZrzCMpSqmGpgyjRGXWjJRwFaZE8MJLjN/mTZqSjYKLhy4lJDqvDfNnk/uFHRulg+AhGB/YAjffEufPyhQ==","signatures":[{"sig":"MEUCIQDuovWzhTw27wat/VdgrOyvwUj3h6x2DYSeMthqVVeBYQIgb7usXmbD+BtGs31tbaZYFbraE+CAxzuNZIjGO8brbyw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":107947,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhQdACCRA9TVsSAnZWagAAVjIP/26HcyZ4WH/KcF/MZzrr\n34Z+GocDuRD/K5rJtgD1uF+X0zoGFeKoI+widi2wcP+Fra3oABQRQePgnSBr\nuTyLJFAU1sL3kBfRKlMJbabfJigAkqr+vz/CK9gZ92rc/XjzZGJRLRGPAQW5\ndp8ySRJndsAEsNOx/4zizLHXZ0tBCJ7EqIhLU1u3CT90W7swddTLS2DgJnp4\nqOzO6SdDXqNLRuUbhFoXM0uTsoxhmwskgRwYHml8eqfw9jRlZ0ET2fJlhTA7\nlGF8gG7zKqMp/iw4fLdHoZqa60jIf69iCmVjYoJn67Vb0eJqCknc97rLssiI\n347Bl67t15lTYpIsu6nAQqO46YmO7+tZD0bcD3vItLwX3I3NtihiFGGETWKM\nUu+R4c+sEq8ogZfLHvHBcRj96Ov8+N9LbwJltzKIaSDbe3dnnR2rb54VwVLU\nMExKHHBWwxa6LiDsUc26hx6sfe2FeeGRjrkkCXrQHWprlHKYUf11l2O31eZI\nBQWArLC3wYc5nkCrwm4EuOfuJsMShwZYO9I0FPNDGN8Hij+eBx9FXYu9K6Qy\ngb+S8Bf1Rw6Vvt3oU13+HBt+AWyFjZJYBEtFXqYnLA/+etNUJKtViY+KF4Dd\nE4cBSbT7YSu+zqtM/ND13q3T6q6gxPeAYMMaH0M3Lqcz21wIijD7gHcdTqep\nnvL8\r\n=j57k\r\n-----END PGP SIGNATURE-----\r\n"},"gitHead":"455c6523f99a08c6796480d59727b53bdfa441f0","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","test":"mocha","check":"npm run lint && npm run depcheck","pretest":"mongodb-runner install && mongodb-runner start --port=27018 && node ../../scripts/rebuild.js keytar","test-ci":"npm run test","depcheck":"depcheck","posttest":"mongodb-runner stop --port=27018","posttest-ci":"node ../../scripts/killall-mongo.js","test-check-ci":"npm run check && npm test"},"_npmUser":{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v12.22.1+x64 (darwin)","description":"MongoDB connection model.","directories":{},"_nodeVersion":"12.22.1","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","debug":"^4.1.1","lodash":"^4.17.15","mongodb3":"npm:mongodb@^3.6.3","storage-mixin":"^4.7.0","ampersand-model":"^8.0.0","resolve-mongodb-srv":"^1.1.0","@mongodb-js/ssh-tunnel":"^1.2.0","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^1.0.0"},"_hasShrinkwrap":false,"devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"^4.1.0","depcheck":"^1.4.1","electron":"^6.1.12","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.8.3","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^4.1.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_21.8.0_1631703042254_0.2941521393654236","host":"s3://npm-registry-packages"}},"21.9.0":{"name":"mongodb-connection-model","version":"21.9.0","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@21.9.0","maintainers":[{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"brookescarlett","email":"brooke.yalof@mongodb.com"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"team-compass@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"rosem","email":"michael_rose@gmx.de"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"dd46a3c2be7c7e683f908ddb376b28a7be0a8dc7","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-21.9.0.tgz","fileCount":20,"integrity":"sha512-V8rgd6ssauIbQGVvmdszGaLda8zRd3nVMJzDExniLVQQAZbCWeDvdcp4pIVWqJtD3dAMZMn/jyYJmYC4wqZpRg==","signatures":[{"sig":"MEQCIG1Uzuj4gwQmrRZ8WkO7U92HD0x8ajilihlAKBk6GX4lAiAHtG6uVk6sAPFN3fCtH3j3IvznPj1mHSWcEcmnywzN1w==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":108313,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhl4XXCRA9TVsSAnZWagAAF7cP/1EqhauGZu1PSUj5giaV\nX6l2xW8bnGntaljvPzKozzRHskj/yAGMRBbH8uiJkIBwVteykIa7u3YeyCxX\ncUSxzVplx0ZOdKVe67gFMYhneT+MJXe4wns7UMDJ48isXjXkFTaebicVjB4w\nUHSFFVqkrhuueduiZyaLmS90o9kV6LfCohULA7oG6AfgVmRKx/oCH6Vjb4lP\nqtYcWYjEi8T1YMZYuMABS1XsgdLrV+Dw67NW9zlRFVehJ1P4fVPtYOL8g8Wh\n+Ou6kQ5iqWIDVKRoH52Hpl8nknY0Jwl/gDWYRtPt8MOqGLX7pOIb3kOD9asw\ntQ+Ap+/iZwLw/K2j84pxU8tAS3kk2kSYGMNynF+AmjqFFnOC0pQGV29KShRF\noX5dJKpUMcOOyR1wh63IW7NviGyB3Ccj5Lj4Tc9NWbEtPZU1hqkMBXhp5bEO\nrAIk4VybYmQIGtIMNli/z0UgAGrx0ZFPGiDErudnJUxnbQz01oHO3LyjokVY\nSXGRawVgNcKs5d3cnbq6Ub1OyZyouHvYOvKuc2HWXNcSPd7Msb1It8Hq7GVk\nbE+d1XSrBEZ9Fa7vPBid7Pl++cuTYroQyQflhlUKINXmGKuNDbKhvTPOgBZm\n6KAynKAVlqZyCv5/yHSi1vJ/UEdm5mZj/I+xv+T0Z2Ly8QFJNqoTtqK0TMYJ\nKTl2\r\n=Nkr/\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","exports":{"require":"./index.js","webpack":"./index.js"},"gitHead":"8ef2cccaaab6d84a5fcd633ea8dfc4c7a4db551f","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","test":"mocha","check":"npm run lint && npm run depcheck","pretest":"mongodb-runner install && mongodb-runner start --port=27018 && node ../../scripts/rebuild.js keytar","test-ci":"npm run test","depcheck":"depcheck","posttest":"mongodb-runner stop --port=27018","posttest-ci":"node ../../scripts/killall-mongo.js","test-check-ci":"npm run check && npm test"},"_npmUser":{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.17.6+x64 (darwin)","description":"MongoDB connection model.","directories":{},"_nodeVersion":"14.17.6","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","debug":"4.3.0","lodash":"^4.17.15","mongodb3":"npm:mongodb@^3.6.3","storage-mixin":"^4.8.0","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.0","@mongodb-js/ssh-tunnel":"^1.2.1","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.1.0"},"_hasShrinkwrap":false,"devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"^4.1.0","depcheck":"^1.4.1","electron":"^13.5.1","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.8.3","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^4.1.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_21.9.0_1637320151730_0.41769976003567266","host":"s3://npm-registry-packages"}},"21.10.0":{"name":"mongodb-connection-model","version":"21.10.0","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@21.10.0","maintainers":[{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"brookescarlett","email":"brooke.yalof@mongodb.com"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"team-compass@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"rosem","email":"michael_rose@gmx.de"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"62755c969f1db9387a476aafb8c1b2839b559c29","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-21.10.0.tgz","fileCount":20,"integrity":"sha512-CmADVBdi7mTnl8LVPScqfmbYU/GnzCWcM+xTlNAkBQa0M4JSAmry7yf9AewdtwB1mO6Lyu6P97fWK8vTEp1K5g==","signatures":[{"sig":"MEUCIQCGnx3eotpWWuc4CQuB71QNJnuBqrs3GQ9JMDdjkpI++AIgJEox8bti6fyS9jyUai4gPBNBB4MVshJ80D+dU65vYuQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":108080,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhweFsCRA9TVsSAnZWagAAPpAP/Ap9FttWw5fAt1zv9NJM\nLQG6lODM4Xgz9KXqmcPZ48UHk8Gb94Kfw0V8wLz8YSp9TKq0BINTfN7MjEb/\nNsXjSMoYF9UuYwr9FoDeg9hQGtk6+AulXrPDuRYjT2Lv7kzmfsL63L8gaOhO\nCGhsY/J80LvyqJf3DkxA2FVYj1OMaJ9YDJb91iwPsap+OOvIKzQw9aGe+otx\n9WUhXBc81UQ9PR3r2RkOrLUIG3M0yqF/8EcJrrE1Sv4ToQlX6TqJuRkJl/Io\niFVR1z0r2l1oSrhBTem9xOpe50h1pqPHA8N2baChXr07hiDgYm0lYpxcBf2v\nfd5nUikvDbz22PlLxx6W/AD9i2pb6+gbF7A90UbAtxAESA1JeLGKd5XDebaQ\nSrPU8Zpe6XjlHLKMxh3n9VOlOYjJzi/IAhosVbFZ1QswDXgDtjIwYlk6fdes\n0xKOGleUR6K/6O7EABiCX6bijhacMkGs22b9nUJAnJcO3b4mRix9mJPgaFNb\nRzegQQInRhJhD0HT15xuRfowGm+ObXSDl3qDtBOw6H69Hr1NHsB1Ng7MGT5y\nlcYEcgXckexe60fYZvyQGGUOWE26zU1IyPIkmincMukH+qFOrHUB5QAuVj7V\nTpwdk4Zokg5ISFo8iZicbQ7tS/pXxNNbfiGL2/pkB18shArVKBeeVUyrtlAN\nAuSr\r\n=OaiN\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","exports":{"require":"./index.js","webpack":"./index.js"},"gitHead":"77166e3754e36e95c7ff7efb5a0ce5e0990b0ff7","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","test":"mocha","check":"npm run lint && npm run depcheck","pretest":"mongodb-runner install && mongodb-runner start --port=27018 && node ../../scripts/rebuild.js keytar","test-ci":"npm run test","depcheck":"depcheck","posttest":"mongodb-runner stop --port=27018","posttest-ci":"node ../../scripts/killall-mongo.js","test-check-ci":"npm run check && npm test"},"_npmUser":{"name":"alena.khineika","email":"alena.khineika@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.17.5+x64 (darwin)","description":"MongoDB connection model.","directories":{},"_nodeVersion":"14.17.5","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","debug":"4.3.0","lodash":"^4.17.15","mongodb3":"npm:mongodb@^3.6.3","storage-mixin":"^4.9.0","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.1","@mongodb-js/ssh-tunnel":"^1.2.1","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.3.2"},"_hasShrinkwrap":false,"devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"^4.2.1","depcheck":"^1.4.1","electron":"^13.5.1","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.8.3","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^4.2.2"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_21.10.0_1640096107933_0.40206222494279786","host":"s3://npm-registry-packages"}},"21.11.0":{"name":"mongodb-connection-model","version":"21.11.0","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@21.11.0","maintainers":[{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"brookescarlett","email":"brooke.yalof@mongodb.com"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"team-compass@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"rosem","email":"michael_rose@gmx.de"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"48911c56036659671abe2560178d34d4698076f9","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-21.11.0.tgz","fileCount":20,"integrity":"sha512-VPME4r7EYwR84JvJFcc3yz1QRqoGFvfxmCgDFynN9SoNbiEDvKJ6wUyzOjRMUnbiAMYPMqW/f4PwgjDIQ9jrog==","signatures":[{"sig":"MEYCIQCuagxMm7NLXhVhHvJtUAy/rFnISjULCJIs16+hddY9+wIhAIO/5mQQWEKKP5LiKAntsUQk3SXZ6h7MMj6vcrTVYL2c","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":108080,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh2IMkCRA9TVsSAnZWagAAcE4QAJWHFZFPOyL6Kyd44wUo\nuKHCye8i/IuTWFxar1ia+NKCMzC9LWIOuwrxZmPUIhr5VRTGzGUesXdwwC68\nIh3RQ+r9Ga4iiUbZk2sw6piFSDAPrtKuNjEqNFaY5EvMtrRqRFvnZ/grUDe6\ncVoVv2Mkar0fV1gUChk2pfMf47reUPKtggRk8bh+wUp9FCRc8090hN9Wc2ow\njKBoOERPP8lc7Obj1+Kjhpu1tw198dWH9h6t2EEQQA9/ewIIu4Q1rKDQFXqF\n866txR+IzLTcJKwkWOgsonwQdxn4xGFt3ZWmcFzD32SxlzKN8kIxHdOj4Vu1\nKK579SAKqb/dfNtqIeCtH6fmk6TnN0f4qXdbp75MUUwqonvCzag//cTFzwRs\npIhNMWXJrZDUJFlk9yw9KvBBd/Pj/zodrHR6FVXrku/PJnaNERH/stg5l4JN\nKKGBrx7pmNeJH547NGbj+ckIPZT71Bz/aVfzboeJjNTfFMnYxEbdFpW3BM+4\nztGUlx1zSa6nYKWUcUGarJS4jwR5gHpszFpANwwNmzlIZnU64WkIIW8rVFEW\nPzDf9IJUMrrd904l9zFbLJwf4tsU1YNDfygoXEHd+pXFFC1RdcgyYZ1SRqLF\ncZfPK+Og7BqbQTDvST4tlW1PS67Jk2GUOyw0/9ZEIZ8b/61tuwHn6T5vacKd\nrnUr\r\n=49L3\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","exports":{"require":"./index.js","webpack":"./index.js"},"gitHead":"542e3fa07d48435b1a7acc21c96de20562b843b3","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","test":"mocha","check":"npm run lint && npm run depcheck","pretest":"mongodb-runner install && mongodb-runner start --port=27018 && node ../../scripts/rebuild.js keytar","test-ci":"npm run test","depcheck":"depcheck","posttest":"mongodb-runner stop --port=27018","posttest-ci":"node ../../scripts/killall-mongo.js","test-check-ci":"npm run check && npm test"},"_npmUser":{"name":"alena.khineika","email":"alena.khineika@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.17.5+x64 (darwin)","description":"MongoDB connection model.","directories":{},"_nodeVersion":"14.17.5","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","debug":"4.3.0","lodash":"^4.17.15","mongodb3":"npm:mongodb@^3.6.3","storage-mixin":"^4.9.0","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.1","@mongodb-js/ssh-tunnel":"^1.2.1","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.4.1"},"_hasShrinkwrap":false,"devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"^4.2.1","depcheck":"^1.4.1","electron":"^13.5.1","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.8.3","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^4.2.2"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_21.11.0_1641579300778_0.05646594503344571","host":"s3://npm-registry-packages"}},"21.11.1":{"name":"mongodb-connection-model","version":"21.11.1","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@21.11.1","maintainers":[{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"brookescarlett","email":"brooke.yalof@mongodb.com"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"team-compass@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"rosem","email":"michael_rose@gmx.de"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"a5905bbe8278c2f9896f3e4d20d87fd32baec2ac","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-21.11.1.tgz","fileCount":20,"integrity":"sha512-157Xzu+nOF3b6Qohto07uSCedwhbvVp7S+q6icQaJpvD13OZu9vqK78vVmEYx3szqrIfU51/6UWspXSr0u+jMQ==","signatures":[{"sig":"MEUCIQDmCKPOuCqSEEIGn+rtVnu02srV+FoSUwSAXuLEatPt9gIgNufuL7xDJZB7IpxAxkxzeAreu+qcZF9YIEO6jDr+8KY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":108080,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh3fE4CRA9TVsSAnZWagAAKsoP/Rtt7oueCXzKxHa3qPez\nyCiXk0kKP7ceWlkEpgY61gmxL/XzpfcV+mwb9oAipvLaZ+I3XwqjWD4CPr+L\n+If7fHv62qNc8WysDoeqhgurH78p80LwOsOCblAZdjgEU67GcqggpANwzID/\nIMZNqdDyjVdPkjeI8exU/zAC8ubL/ddvnNveSK/bGMH1/nALvTFv+eh9s9Uw\ng4wG7w8JPJ/7gUKvq7+qayUIJ665LdZ1AWcfHI9+HfF62S27bdn92nurDI9A\n7yfcBmDWIe0wBOMUMZAGaErfVBMXXLzk0LECOIsvBptEUwcmFPHFsjgz/Ff0\nn0/PsOwedio4u33YJaBoIohkAqlzVNlYmG2L/RtIQkih+JroiZwzRErn9OF1\nKsz5QVkz82e/tJc/cPcpMrwWqVLSu157JrvSYeD4EV6hynzpsK6Ox5P9zvRW\nuf98wTjeDtf095Hi5RhCo9+/7h0Vf8thYZHxD58mG/Q0yrpbebPziMPMbggb\ndE9Wn1mmvDzh10q7WzAy2WSb1p8Q2y0nQvdnYtKHYutHWv6pGEn3h0pdv+0Q\nIoInmVtWtrA9OrE7kxsF6JT+3Z1Xj1ayES14O8VuNmzyzq43G9dsCcaM7PrU\naNgknlIEPDyeZOaaVCweki0M9mj6dl95tsF0YlAFz2qL/z6mlhe6wIKGVZH0\nxUMU\r\n=AgG/\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","exports":{"require":"./index.js","webpack":"./index.js"},"gitHead":"75710b287ad6e3ea08bc36b15e0be5ebb8f62050","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","test":"mocha","check":"npm run lint && npm run depcheck","pretest":"mongodb-runner install && mongodb-runner start --port=27018 && node ../../scripts/rebuild.js keytar","test-ci":"npm run test","depcheck":"depcheck","posttest":"mongodb-runner stop --port=27018","posttest-ci":"node ../../scripts/killall-mongo.js","test-check-ci":"npm run check && npm test"},"_npmUser":{"name":"rhysm","email":"rhys.howell@10gen.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.17.5+x64 (darwin)","description":"MongoDB connection model.","directories":{},"_nodeVersion":"14.17.5","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","debug":"4.3.0","lodash":"^4.17.15","mongodb3":"npm:mongodb@^3.6.3","storage-mixin":"^4.9.0","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.1","@mongodb-js/ssh-tunnel":"^1.2.3","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.4.1"},"_hasShrinkwrap":false,"devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"^4.2.1","depcheck":"^1.4.1","electron":"^13.5.1","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.8.3","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^4.2.2"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_21.11.1_1641935159919_0.9159478251316462","host":"s3://npm-registry-packages"}},"21.12.0":{"name":"mongodb-connection-model","version":"21.12.0","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@21.12.0","maintainers":[{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"team-compass@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"rosem","email":"michael_rose@gmx.de"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"0690d1d05da38b100acf7bc9a4c0b7acd636ff9a","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-21.12.0.tgz","fileCount":20,"integrity":"sha512-gWRM/jfJGpklG5VHw1lJWJ0RYbqbK3AdCBzyy6ygnaaGsykBs2Nji6jkPFw8fcxwZXtC60GOQmzxUeXVM/4pzA==","signatures":[{"sig":"MEUCIQDjKhCmYKIAbmN6H7fIJYCt+LhVdD9OI8N4GzDH/jA12QIgGfy/kONB1FZo+6Xp0Q9+VoX611511lAYfLM0lwvFOZI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":108191,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh+9ncCRA9TVsSAnZWagAArPAP/jlreGG/V8tLNbQtAKqY\nMTdGy0lsrYmE0+B+nmo7qnjmQ6Gv+kqiQXAB/zVYeEtIlIEL9iPKY8sfTUVa\n6ksAnI09tEGyAwFsjcmgrATHjoqmPm6KbEs6bFdhkl4srN/KN5zM4HW18lyr\neoSdCtES3Sgsu3lUTyw4M/JTojlP3BoZuLFh+noA/NjKWUiTyVoRt3yWqNup\nu8kCld2LZ02Oph71xTsovylzVXnv6cVjzdBm+qxVl+ns2GGS3/yrtlZfYugw\neP/gr3JOHrn2PY4V07sEfT+K/dqrzA1QwHv+7afQVV4xIDnk1RGHKEKYGkns\ncsnQl4R6QpxR9TlVViPtSixeXeNY+S/m+Ag3fR9rFnuM1WKRmXwpUvK1Td0l\nVrIlyVKH+46ESpECEiEykoInGzxbGmWXO1mkvDKAiFGMMrmpkiSI41zi7S9d\nDeAY9hpLzDN6UP9Z8zCXW4DjGntCPwiQaIzAnH2QdvX2dThu+AdjL2xiq9O0\n5ci2Pn/wXU+F3gmRMg/H5Ku5xSuY8qjoESs+GKqN8pEhP5gjfBVX8iusvmHF\nHbZvWd6Cpzgs2EvoBnRbPBi16ZKZuN6697zuw1Dk94y1OSLBiXVQFb7PCap0\nzvANUbHgDVzuEnaGsKpFA3WAaZv4y4jX+Y77pVKnxQ9Gheg9a619y2S1mEw9\nFXmF\r\n=lR7J\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","exports":{"require":"./index.js","webpack":"./index.js"},"gitHead":"6563679c816fa44691a53b7e27fa0cb5539e0854","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","test":"mocha","check":"npm run lint && npm run depcheck","pretest":"mongodb-runner install && mongodb-runner start --port=27018 && node ../../scripts/rebuild.js keytar","test-ci":"npm run test","depcheck":"depcheck","posttest":"mongodb-runner stop --port=27018","posttest-ci":"node ../../scripts/killall-mongo.js","test-check-ci":"npm run check && npm test"},"_npmUser":{"name":"alena.khineika","email":"alena.khineika@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.17.5+x64 (darwin)","description":"MongoDB connection model.","directories":{},"_nodeVersion":"14.17.5","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","debug":"4.3.0","lodash":"^4.17.15","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.1.2","storage-mixin":"^4.10.0","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.1","@mongodb-js/ssh-tunnel":"^1.3.0","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.4.2"},"_hasShrinkwrap":false,"devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"^4.3.0","depcheck":"^1.4.1","electron":"^13.5.1","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.8.3","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^4.3.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_21.12.0_1643895260103_0.41285790529146715","host":"s3://npm-registry-packages"}},"21.12.1":{"name":"mongodb-connection-model","version":"21.12.1","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@21.12.1","maintainers":[{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"team-compass@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"rosem","email":"michael_rose@gmx.de"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"da56394008801d49de2cb71a7327b39ff7089364","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-21.12.1.tgz","fileCount":20,"integrity":"sha512-E+x69Hxip9JTWkKTzEWP7T3GrHfg6nPclk+X5I1OUSMqFOeN487qwChzIYU5fssEpQLn0BU5LstUKYvZm/DKcQ==","signatures":[{"sig":"MEUCIH7SSnieP97iatNXSkVdyP+vTAkGWHNgSdr2ffSFZu+rAiEA5NijW7FN6JFbHNGCApEfczPwJqH+vGXaErmjGH19CvQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":108287,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh/CTmCRA9TVsSAnZWagAAPxsP/28xRRBm1lU+n/hc7Yd2\n/HN1Bf+PeRX8IUbXw2IIRb5gDFd4Z6ItRhy6BFhhO6Ix1ns/00AMkdKCt9ta\ncVi6ZRMjgW+DYocsYWb4PkzKnAmrY2d9MHY2gDHtln4/KVKk+FsMrfPKrMcA\nNbirSxgjMM3w/k7kRIq0AxVcsVBmsRSiBhYE+RvASAMZO5W4eTWIjjMHDl11\nDh1Vx4gxbi+1enKFZnFw0+Epd9dkBBMfaqyn2pUWY8wFGzHYSZsDmxnoDGQK\nPwowxeNchysauVAPQmB4nbnNwMAQzyT6gFgb5wdldmwsFXvY4ydVKoiquEFf\neW8hSFNt6tXjoP5Hnt2ksRLShYhslQ0z5To8FpLdlRUKynG+CmdjmzE+ydWl\nKgvHD4bfBtqD6FctN1blz8ugcDT6JGWnxSDal2Hnu5lHXkrP99XyQAV5Jop+\ndypizUXSlhvLkuNAelWD1fUO0J4nLLt4/LBBa1o3omRQokGhKa8HOH3j/Db7\nY1ZS0cGshN7AbkoKxqe6xEMv7JA+XmX226NPw0VIIi09Th7X3dom1h/fT2l1\n7unR9HgySCO8oc0OofUvLlvLRkWLvxIv20IyMHIC4t9sfP5RDHw0B1KxZlWI\nwdUnexX4vyJha5YKuWupkRKG27NPQfwYCUTvIVbIjw4072HD3UtM76kcSda1\napIp\r\n=RePe\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","exports":{"require":"./index.js","webpack":"./index.js"},"gitHead":"38680b2f9463d22a71105b6a7721883feecd54c9","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","test":"mocha","check":"npm run lint && npm run depcheck","pretest":"mongodb-runner install && mongodb-runner start --port=27018 && node ../../scripts/rebuild.js keytar","test-ci":"npm run test","depcheck":"depcheck","posttest":"mongodb-runner stop --port=27018","posttest-ci":"node ../../scripts/killall-mongo.js","test-check-ci":"npm run check && npm test"},"_npmUser":{"name":"alena.khineika","email":"alena.khineika@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.17.5+x64 (darwin)","description":"MongoDB connection model.","directories":{},"_nodeVersion":"14.17.5","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","debug":"4.3.0","lodash":"^4.17.15","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.1.2","storage-mixin":"^4.10.0","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.1","@mongodb-js/ssh-tunnel":"^1.3.0","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.4.2"},"_hasShrinkwrap":false,"devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"^4.3.0","depcheck":"^1.4.1","electron":"^13.5.1","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.8.3","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^4.3.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_21.12.1_1643914470265_0.9885690885110456","host":"s3://npm-registry-packages"}},"21.12.2":{"name":"mongodb-connection-model","version":"21.12.2","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@21.12.2","maintainers":[{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"team-compass@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"ce6399124345f472223070f5f69d3adf54c9deb2","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-21.12.2.tgz","fileCount":20,"integrity":"sha512-KIcB76Lu754tcUM/5wSsb1L1FQUHdZjag99cT/scj2ZeuYUrcz5Y0OiJtSeU1ebV+n0EY8plazXAjLhxJg5T3g==","signatures":[{"sig":"MEUCIQDsyJSoLwfvDfeZMB+CY2BMlrBZ4DQOK5SxNizUpnzO+wIgXoUuhguYQbCBNS3wx6kMT9YM4VsvmCnrg1cWah86AJc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":108300,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiGNwRACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmopYw//RJosxFsj0e1oEelBW+aW3nvLkyfgbC/WqBYmU36dTpp4NeFN\r\nZRyJ3hmDg+EzCFwwFpAGE32HZF0zP3D2lnvJIV+7xiqq9sALbNUckn80Ld5v\r\nI6RTHjumKxxH3+7whn/ZQQrJ8DxEnRzrh0J1/E+tcQRzKX3RCJvJztAm9SES\r\n1D1JFmQqU4g3A90piNQQDGvWfHt4p6ONnAGve81XWT83B9JOxrFYD5qbPPXx\r\nBy9xmlUsa5fSDlHmzXug1igCN09MqAOWeuxXtCr4J2CPjLIAW5VzDtE+aTQU\r\nM3GJEOAU3JeJmxNnC5DQGIvq/2ChkvyHHBjELZpxR+ZoXH9PO4sKw5sbvMS3\r\n0P+EyDGIReiHuNiHaxt+Xb0jz9JmHewiOMRy7g+D+sQxRy4HrGddhnYEMOgG\r\nwL616xHhXd1btME5YNHkfZWoNNEqvDJTgi4F7dLISlcdeXgA3pSxjhaTztHr\r\np+O0DVpNw8C0SmKbSjClAsX79yx2/mXfUn6RSSu6UqzvSdFnQwKn3V9s/+Ev\r\nbGba4EzcVX1iCmjwH7/f1tFGr/orBBubqr4EIQIvfstSqp8bccDpak83XNPI\r\nKBeD1SOuB5qeffpsytY4FOIjdLnLUgRytMc05VHvseZMnNf6V8WyEfcIzaUg\r\n2xBHRGtEOOJt+ye88voyrBhOtAolAJ2ricM=\r\n=UPMm\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","exports":{"require":"./index.js","webpack":"./index.js"},"gitHead":"d51426c38f3ad0be209769e18365824c710dbc2d","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","test":"mocha","check":"npm run lint && npm run depcheck","pretest":"mongodb-runner install && mongodb-runner start --port=27018 && node ../../scripts/rebuild.js keytar","test-ci":"npm run test","depcheck":"depcheck","posttest":"mongodb-runner stop --port=27018","posttest-ci":"node ../../scripts/killall-mongo.js","test-check-ci":"npm run check && npm test"},"_npmUser":{"name":"mabaasit","email":"baasit121@yahoo.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.0+x64 (darwin)","description":"MongoDB connection model.","directories":{},"_nodeVersion":"14.18.0","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","debug":"4.3.0","lodash":"^4.17.15","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.1.2","storage-mixin":"^4.10.0","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.1","@mongodb-js/ssh-tunnel":"^1.3.1","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.4.2"},"_hasShrinkwrap":false,"devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"^4.4.0","depcheck":"^1.4.1","electron":"^13.5.1","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.8.3","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^4.4.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_21.12.2_1645796369731_0.6816557836410679","host":"s3://npm-registry-packages"}},"21.13.0":{"name":"mongodb-connection-model","version":"21.13.0","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@21.13.0","maintainers":[{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"team-compass@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"dfa807f26a10c9957110807ef2c934f66e0b823d","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-21.13.0.tgz","fileCount":20,"integrity":"sha512-zvq0ds1DS0AKTaf/6O4LqRko9TCHnBWrRFXLSIVi1vFF+sSaPaL9VV/4JMQbtX5IQxKgxL8R40tWnelgfQPg4Q==","signatures":[{"sig":"MEQCIC2NTDdwurZ9BzmB69eiAFTSqumSKR0hsb/5s/pxU/jCAiAYyRV7ZL8mBaVPb4xFcAe8hsvtrE7rVm/2/H9ij1gccA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":108300,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiGOMmACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqV7RAAoUJ+Ak5U8ne9tC+klG2/RLKnxOPevQpznVURS0qxy5P4BCK2\r\nsydI0Laqz3hdNGvaif/4IXB7U/JX8/rM3dJ64FQ9Uho8xMwYnZpRv6k1qeBz\r\nWQAmjJXZZmFR9PyO4f7qsXAqVA2ORkAQlqs+RHV0opf//rRoST0kBadqL8aX\r\nWIxl95f23xXVubV8VwG+/tE7Rl25XCD5t28qHByhtLXMnsWMKeDZy+mrD6LL\r\nah667JDi93jAfKUwYe6jOQEDTnbtTDGp5qC6KZQQJTsk1Po3dPCSuSJLzsJ2\r\nU6m36XbRds5n8BOMfVstqqYpLdMnXHAL4L01MixRpNs4N7lN2Ly+z8vVCV9r\r\neCt9su9hu6tBADhEi8S51HSLr8PObG0zECHPuMKBvIF3/EpS2aYkmJLRhPFs\r\n4iGdXCuR255Z7RvMEHgnJPqmO++IqUOrWvP5eain7/zRHwTH5F3xv1J26lqG\r\nNgdjgxo1b+/bYe8zIirMSin4S1cWu0+1TaijUNW3xTtNcGuDevHzTTBMbk3N\r\nIsxT6FqrMUdOTdrzCZWAHOQ+8wmhax0/ZlvGTj4kM9B0S2B4mz4zEME8wQ1g\r\nrTJL1Y8TPxCwBxch/Vrsg+uIMJLuSMTyIpi5Amy5IGTmlCXz2uRRr4GN7YXv\r\nJXqULs/OAUfu9BCoYm8IAkhB023AeoP2dKg=\r\n=6yRg\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","exports":{"require":"./index.js","webpack":"./index.js"},"gitHead":"2bb63cdb1d4e825f280c0d2af14b7298c5769490","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","test":"mocha","check":"npm run lint && npm run depcheck","pretest":"mongodb-runner install && mongodb-runner start --port=27018 && node ../../scripts/rebuild.js keytar","test-ci":"npm run test","depcheck":"depcheck","posttest":"mongodb-runner stop --port=27018","posttest-ci":"node ../../scripts/killall-mongo.js","test-check-ci":"npm run check && npm test"},"_npmUser":{"name":"mabaasit","email":"baasit121@yahoo.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.0+x64 (darwin)","description":"MongoDB connection model.","directories":{},"_nodeVersion":"14.18.0","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","debug":"4.3.0","lodash":"^4.17.15","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.1.2","storage-mixin":"^4.11.0","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.1","@mongodb-js/ssh-tunnel":"^1.4.0","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.4.2"},"_hasShrinkwrap":false,"devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"^4.4.0","depcheck":"^1.4.1","electron":"^13.5.1","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.8.3","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^4.4.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_21.13.0_1645798182749_0.3316592286929769","host":"s3://npm-registry-packages"}},"21.14.0":{"name":"mongodb-connection-model","version":"21.14.0","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@21.14.0","maintainers":[{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"team-compass@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"6c01ba334d12b8d0d4b8e274b5ef8837c26490ee","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-21.14.0.tgz","fileCount":20,"integrity":"sha512-A4teHOSPTrPe4s2IxTtRTCrFleZyrw+CJ0x53UG3Myk2n+VO4FtdXpKdVyZFhjHUNhYCruhV95Yc711nkqZg2w==","signatures":[{"sig":"MEQCID9wQp65J6dQBZRF/piCuDuNEP0S+KoI8V1lLzvUaBNYAiBdautzox2u41QWFxEC8cSz9MZOTmMmWWeMlrrkueBEgQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":108260,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiINKCACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmox9g//Vb7WGn75jqpSafHyepw291M/px8y0/EB2Rpk1ZXsXmlkLzUW\r\ny/089ge37tCcVIsEJiOufnKtLA3dUoc6cnIghbvssFkrdBdDTG65EAFBCuD5\r\nJNFuJjLCpXXEEnkusnu2Xq8eDY5CN7xT3dYKRYmXsbZIZsPDkRboYaR2Q8w6\r\nMcPvL7AxmZVvXENSp2mrKK2+Yj1AC3Ch7EOxjkXBmrTxdI4AAArtuojgUKQJ\r\n+44tmh44x8PKsfbX0dAXBuYIjVr9qQCzffRySyAhm6kHqAXK/oN+wcl8QI7E\r\nk7Ih1chqunzf8wIlpwTqLZyq0AfOk7zazd5QL+9po/x0tmNweE6dioJzQkB3\r\nnFqUT63kIsUT9PuyhQY8BWKakKkiKS90nxdIyIf2Mv8k9IaEIdqCikpvIyIF\r\n3rF51PHW3IJ47e1aeP3MXQ/3umdv0mpeD5nBjQDJKNjWSOGDZMq4zk8th/wd\r\nYTYC+am9I1cOG0CUsdx7xnpyAbVJSd+BKivZH4TaC+M48udnzr8TRfUX8JLu\r\nrGRlxx0Mm+Z997VFeto1yd6EkPAN0I7ms9eo7fnLsjwennDRdPTzhv3zcT8T\r\nds5jl1Db7JPWIjZWmOlVzy3j0ttKtoydq+EtzZtRzDPXV8+whia3qOOJuIx+\r\nST546eYxwMfM1mbXdNX4xTabe53lzXK5WYw=\r\n=/mgo\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","exports":{"require":"./index.js","webpack":"./index.js"},"gitHead":"c125a379bd769b3305e494b68a4fc9bdfdc7d1bb","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","test":"mocha","check":"npm run lint && npm run depcheck","pretest":"mongodb-runner install && mongodb-runner start --port=27018","test-ci":"npm run test","depcheck":"depcheck","posttest":"mongodb-runner stop --port=27018","posttest-ci":"node ../../scripts/killall-mongo.js","test-check-ci":"npm run check && npm test"},"_npmUser":{"name":"lerouxb","email":"lerouxb@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (darwin)","description":"MongoDB connection model.","directories":{},"_nodeVersion":"14.18.1","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","debug":"4.3.0","lodash":"^4.17.15","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.2.0","storage-mixin":"^4.12.0","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.1","@mongodb-js/ssh-tunnel":"^1.4.0","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.5.2"},"_hasShrinkwrap":false,"devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"^4.4.0","depcheck":"^1.4.1","electron":"^13.5.1","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.8.3","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^4.4.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_21.14.0_1646318210217_0.37368589815626607","host":"s3://npm-registry-packages"}},"21.15.0":{"name":"mongodb-connection-model","version":"21.15.0","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@21.15.0","maintainers":[{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"team-compass@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"885463d363d5848d6abd60aa50deecfe6c33e9cf","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-21.15.0.tgz","fileCount":20,"integrity":"sha512-ClIuL1J0rJf7EdXt6zkRfWbqoeEibqns0UEDm8RO8bJ8iu/YoLTZX+NqTLYvMOUr5Wd8caYkMxXlz6835lsgQg==","signatures":[{"sig":"MEUCIBlyZvVU0XY/6uNELJGQOh2oxC9IuVpsNZ5zWjh2q83vAiEA7hKHJkuQ6yaNoIDoiFk3neKkLFHfjah/J0gDnlgZ6tQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":108351,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRI/gACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqYfw/+KMZgLCC9l9N8jqiBAyg848ScGluPVNnZCYTR1le0fa23cF/r\r\n4lbr8+KDZhwrzEokjiopb/0hI8AIgwJACxj7MdCS7cBgIjnQx/HWHhtjXmJg\r\nKHi0nNWuZ/c+Bu3pAZlok6w8DzAP8psSGFHYIaBwdrdtTZY3NJcic4ck44kd\r\njsiVWfLkxGfLE/9duK9B8NtODbJeM1m+VZvMb9aOSm0ndLqAJM401ZeTEmFk\r\n2c3Gqyxlrdcg/1z+icjEV0Byf9VOi7rhaJKe3MYIaIRrHSoo5rxnusp6p0Js\r\nK5eip99Ma/8akN/nNFDHuwPKYn7ArVbMRyXtSTf1/lTU6YKYcA4mk2cbPcK1\r\nPPvYyHA68dp7sNJcN1hj7E11TuLJVIAee/d2w98l9zoDPKehBV9jArMr75J4\r\nGjFa5hVnnkUlLSUWbVDFWBnP01rNOyfYL7AeCfLm2eAarkaQ/oCURvHkUd4i\r\nt9VXJyzzGsO08EPutvvTcf0jewS5FWW2a7ul98ucLSz3AmY03Da/FIihjbw5\r\nFOe7Azl+4znKuPJuaUlwqug9yxlHo8FD72AAH0DUUNfJdUYRQF3wLtguPfzg\r\n0Se+8jdiOyVmYQ2H0sBuexAMmhKebyz9Ule0J6Z+pCYfDwU2h8v8RVXBBzRc\r\nDR3rgt9ZxZuczT7Ef2uqyfBxERhUcT41lx0=\r\n=2o11\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","exports":{"require":"./index.js","webpack":"./index.js"},"gitHead":"a1283df32eb52881cc00eb73f8d435f772cdbfde","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","test":"mocha","check":"npm run lint && npm run depcheck","pretest":"mongodb-runner install && mongodb-runner start --port=27018","test-ci":"npm run test","depcheck":"depcheck","posttest":"mongodb-runner stop --port=27018","posttest-ci":"node ../../scripts/killall-mongo.js","test-check-ci":"npm run check && npm test"},"_npmUser":{"name":"rhysm","email":"rhys.howell@10gen.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (darwin)","description":"MongoDB connection model.","directories":{},"_nodeVersion":"14.19.0","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","debug":"4.3.0","lodash":"^4.17.15","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.2.0","storage-mixin":"^4.13.0","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.1","@mongodb-js/ssh-tunnel":"^1.5.0","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.5.2"},"_hasShrinkwrap":false,"devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"^4.4.0","depcheck":"^1.4.1","electron":"^13.5.1","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.8.3","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^4.4.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_21.15.0_1648660448266_0.5244542433039243","host":"s3://npm-registry-packages"}},"21.16.0":{"name":"mongodb-connection-model","version":"21.16.0","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@21.16.0","maintainers":[{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"team-compass@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"a63a1ef03803431aed1d73ccffef6b8337a9940f","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-21.16.0.tgz","fileCount":20,"integrity":"sha512-nVl5sWrJauTnMtSyfNugc8eY09klhpKByJAe6k1g4CpyXhXgqiCy7tIt4l6aDUeiBRvAJyQi0D3jJoXKetygSQ==","signatures":[{"sig":"MEYCIQCIFB+MMbC4hHX/bIw1l8YNqYlZfMvcS5nijcwsH80KuAIhAJe8GZmlKFACtexekitGN41P1h/drM6R0672xj+HVchN","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":108304,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiaW+1ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpCUA//dGBFIEqcTrNt7oJeilO+w/7VazFyVRYxSx38Lfyz65hT8yAJ\r\n5rHevlBIJTeVk4BGPDnEmZJTRQzGGLB983oXIIAvTOGXiisKxIgeoLK08sqQ\r\nNnxc5zTp3gqBrdPgChi5Spsawr2/9vCHaqPLFs6+crHdDW70JZHivTBsEJko\r\nmo1O/sUhb/5SVPpByuouZhmjQfE3ODfzeg+EJFqzC7dfr2Ar6CsLEQfRwlUZ\r\ngZh74JTjos0cpOYRaIZMGgt8STxXM+HK0hGC/+lcYzDA4dFMP84Csp3mffCd\r\nQp3rNsefPxMEMX7QXbRYqIeQG2LmL+phGaTD4unK55J6Dxu/lEftzBjAUwsf\r\n7Q0mDqMTlej6GgZRUWMjNnjB+Ls1xxlyqvah5QturCtp0Q4zVPGlXyrcHxgG\r\nhFuE8B3d5uzy7Y2A83DbOKCr/3XOF81MaFCq89WjbzoulgtYbF/fB26eb18D\r\n1l1pH6bx6NGaJ7K2JhkkxWoBbQSa2vo4tMojhCUAgjPp9PJDQKBBCcu2QlQ1\r\nXe9aoSxf5dAFd83w5vaXulzlBhaMxMwHQjwhXCvIf+71Ltef0C9RH2iZMR4t\r\n7UzdLNE0f8aT5FzqciFS4A2KF62y8Lz7CoYrjDPjCRemov2PgMFTSUO0fwDi\r\nm++T/hdjkz5awW0iq3IHjKOdbDVHRcbbq+U=\r\n=Gb06\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","gitHead":"2c4149184e87b8340851590663287b914d7ee63e","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","test":"mocha","check":"npm run lint && npm run depcheck","pretest":"mongodb-runner install && mongodb-runner start --port=27018","test-ci":"npm run test","depcheck":"depcheck","posttest":"mongodb-runner stop --port=27018","posttest-ci":"node ../../scripts/killall-mongo.js","test-check-ci":"npm run check && npm test"},"_npmUser":{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.3+x64 (darwin)","description":"MongoDB connection model.","directories":{},"_nodeVersion":"14.18.3","compass:main":"index.js","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","debug":"4.3.0","lodash":"^4.17.15","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.2.0","storage-mixin":"^4.14.0","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.1","@mongodb-js/ssh-tunnel":"^1.6.0","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.5.2"},"_hasShrinkwrap":false,"devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"^4.4.0","depcheck":"^1.4.1","electron":"^13.5.1","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.9.0","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^4.4.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_21.16.0_1651077044874_0.9439962687000079","host":"s3://npm-registry-packages"}},"21.17.0":{"name":"mongodb-connection-model","version":"21.17.0","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@21.17.0","maintainers":[{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"team-compass@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"0e4672db7ce082020eb6b4bc7a214b2ebd4c984f","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-21.17.0.tgz","fileCount":20,"integrity":"sha512-4c9SvQDxGTAbg90iIOpNSkSGik4kFBAxkYDm/eEaLBGeEpoV0ecCAa36NGgiv5a1aCtdQ1BQspLo+wTQ6bvkMw==","signatures":[{"sig":"MEUCIFK4IgB2YfJhdN0oN9oUE4Y3GHEbPh+hNE9IHJm4gfU7AiEAsV2foSRYbr6ZSz38WhSZ83J1Nh08i/tguML1Xlqv8x4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":108304,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJifM2+ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo4vg/9FXwQDv4B+jMjZVglyJ/QIBnexVHqy7PaQtAP8QMm4ap3Wsxa\r\nyG17OiMJBH/wJ3qFjBERf1dktpr5CqreFMr3w1/yCnhnWRgzZai2XDK0bV1o\r\nHoKTwMCRYWH7PrlQTpOJNJ2qV0vA6vNSscQ7+26difEJiHUBoSAwquumMlh2\r\nrGzlUX6/TcAp/Hij4cNZFJGLtM7QcCO/yTLYKq6UEHcjFYOkA3bTR4wxekZm\r\nMpUxlvRTIm8/9JiAevhkA3BIwTE+al5vFoGHxNQ3bkNJjFSJtqxWWUk3qqRo\r\nreewkKARnAGNfxwOjHh0u4pPKlKlZFNCdcKoWpA8eTf35tmegYdklDQRtUaO\r\nwRAVcIS2VhKfjhmZGESLJ+MMJY3ztem5v2wgJpk66c6S4+uYERNZ9eHdRZbI\r\niAvsHkO2TS5GO/8B4GEeLHPyvyid7SNaQ27gAh9ekw5UO9ntkMCwyEY2lIoY\r\nRGTfOAyxcMJWqb2AfyDjx4Hg2G5ziB4SCAtTOAwJCgrqs+jbxcHVw6uFeOqt\r\nugxrcJDe22fZBnmBhSc2XJINMkDSz9ISTvf1yYbnzr8lGxZayrj33Ca9tC/P\r\nG9ZPbpwnNdLIlXt9pbKbtgYBVZz9ZbJS5QZnArqBziYrWxEMxFiXvUP0fZ2p\r\n1Ih4iF47ZlMyR0AlTAiZyEWzfufGQtNioTk=\r\n=bj6n\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","gitHead":"63c32b940f523e4c3e45b86a5aecaeadef93253f","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","test":"mocha","check":"npm run lint && npm run depcheck","pretest":"mongodb-runner install && mongodb-runner start --port=27018","test-ci":"npm run test","depcheck":"depcheck","posttest":"mongodb-runner stop --port=27018","posttest-ci":"node ../../scripts/killall-mongo.js","test-check-ci":"npm run check && npm test"},"_npmUser":{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.3+x64 (darwin)","description":"MongoDB connection model.","directories":{},"_nodeVersion":"14.18.3","compass:main":"index.js","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","debug":"4.3.0","lodash":"^4.17.15","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.2.0","storage-mixin":"^4.14.0","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.1","@mongodb-js/ssh-tunnel":"^1.7.0","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.5.2"},"_hasShrinkwrap":false,"devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"^4.4.0","depcheck":"^1.4.1","electron":"^13.5.1","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.9.0","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^4.4.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_21.17.0_1652346302311_0.7119010784858288","host":"s3://npm-registry-packages"}},"21.18.0":{"name":"mongodb-connection-model","version":"21.18.0","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@21.18.0","maintainers":[{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"team-compass@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"4c57896d5145f98e52d3a60ec5a8f3ea6089a8c2","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-21.18.0.tgz","fileCount":20,"integrity":"sha512-2PM+L7uLx950Y5HOmOQmcnsYPRf/Y1MTZy3UQlFVn5N4M3KQjYXucceTqOLHJxbf3hexS7t8k/DEEaOM+hg5Gw==","signatures":[{"sig":"MEUCIQCVwdA8PmQ3/+9jhdWzume6p4jKI8Vd3Ua4WcUTyYO+SAIgK6qfE7SihLAolNkCdJ5fs6W/lrOHDzZoLKSW/XDHTh4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":108304,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiuWCqACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmom0A//UcgSGekaX0xtzRf8qH05U/Jwf8hiTnIml2o3xPKrHspX7Lgb\r\nZHM7Dmz7b5WJMhk4kVULxC5ftDn/hM3BKUYlGt3Kn7jYXecfAfiaWrS4XKst\r\nd5R8k9Zx+CJTaz0E1aLbr5ZOktSAv7xI48K7zlVv/f2pbSJ/XRYAq3uaYbog\r\nVz5Y/7goZX0Avk2mDe6I3mGsrPSB/75QTj8vBOibHayN3zAfkHDkKvrbzs4n\r\nFSpAxgOhSmEqIaiI/y1Mf4Y/nVUUGpREtDnz69/0w39yKlUUT0wp8Rl9Ro5m\r\nE2dKie2hpBoS4aTck/ZZpOfZiey/iVQgwQo3u75Y7uaET8uvL6/T5LdNQFBP\r\ntmX1ZACGi59S56mWKP72Go9/oVaxsLHZ2/jXQgCZclwa07/NHuu4SoQH2m0I\r\nluunEmyJ0gzC41iMobVHqbHSS7PtnwxqcuesNTzjwwV5ZEGw2oKCas+krq75\r\nzVK3Z2zo24ik82Dpf0gsM2W6d3qRZbyPFc7JixBlBucZW5WG5pkYzBRvPXCt\r\nojsz1umJP7KpzhbBjfU/EN4ESoh4b12PS5oNuzjNL6Z7ONKcQPS/gntXfBYO\r\nprrQpNDzB7lFvUgNjKK1USoMoBTn54fsjCT9Q55tMaIM096qCwA2sA+6wa2s\r\nl53rztvyO0HBI9i51mciCmj2gzNNw35jXJ8=\r\n=qCMz\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","gitHead":"a4e705ec6d13393d2e14e906838bb67548e7ae35","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","test":"mocha","check":"npm run lint && npm run depcheck","pretest":"mongodb-runner install && mongodb-runner start --port=27018","test-ci":"npm run test","depcheck":"depcheck","posttest":"mongodb-runner stop --port=27018","posttest-ci":"node ../../scripts/killall-mongo.js","test-check-ci":"npm run check && npm test"},"_npmUser":{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.3+x64 (darwin)","description":"MongoDB connection model.","directories":{},"_nodeVersion":"14.18.3","compass:main":"index.js","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","debug":"4.3.0","lodash":"^4.17.15","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.2.0","storage-mixin":"^4.14.0","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.1","@mongodb-js/ssh-tunnel":"^1.8.0","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.5.2"},"_hasShrinkwrap":false,"devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"^4.6.0","depcheck":"^1.4.1","electron":"^13.5.1","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.9.0","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^4.6.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_21.18.0_1656316073959_0.015468505994593373","host":"s3://npm-registry-packages"}},"21.19.0":{"name":"mongodb-connection-model","version":"21.19.0","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@21.19.0","maintainers":[{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"iteng@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"7dd61543264ef2203e68f11aa62daa9169449c3c","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-21.19.0.tgz","fileCount":20,"integrity":"sha512-aOiYyezHXxuDYrZWNHW+/jE/l6pK9zrkFZ50sxLUae+e/POUQAkba4ql1Urr9K1ZeDJM8rYXvHm7T6NCqQuk+w==","signatures":[{"sig":"MEYCIQD2pV3ZKEbPqV7yDoKps+JZNd0i6VS24ufhaZIH6yd5EwIhANzlM6F0pXvVDchrLDjldYbXr/VhHS+Q71+GrZeg36Mb","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":108304,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJizbouACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmptqA/+MieUst9S1KtK24a5rdQ6cKMXvt2XEtF9+VbDPyilZaE0Z19I\r\nYTO37Y76DAU+mJy/TzxsW7Gw0NFZlh6vAzTCoNLcPWVR3HtmvINxTV4CXSvq\r\n3IdQSCafyMcsSdBKgAA04ZIbQjg1sHWaEgj0gN4cApogPp1Aq5EmddY+pGlb\r\nqTr/LLGJraxJwEE8iOmPlS5zMa+1cvmZfSWSnADn3sMT1wjvJsRJ40fqVRXt\r\nkd/h11uW1fQ91XX6wvCyJ1VasQ3KE2TfrgJPXcLHs8na3VJb/2bNw7IvzY/j\r\nh9GkXWqG79UYcEvPickG3NYNPgF53wKY+kYzKNWtnlbL+N4931DtRV9Ucdpz\r\n//0NWm8FT7+0XJgFKTyrgoM5wih0NoY9WrkyU5cVAWhmsCJbjndYYjAy1LOq\r\nQDIEqTThHGf+Vc6FBW8IBkptLOvJoSmCyLWyrNdGJ4+5LBLbcF5juC1x6wQF\r\n9+m4hnDAjhbSA3xrzFVPrjU86j5pzJAzJeMBhPlaAoXTzG2MlDPkdjBhzsyv\r\nq4DFwHNbnNg+mBENjDSFrEZEOm1Iho87IHN8eALOLjG32MOFA6kRYNg49/lq\r\nSCH9jkn6noscpSFSH9STHTKQIQGr6UKqjaJnHxW6Hfi9QWrf+k3y6/odNWzN\r\nFB09lCjAlZBB4OGNkRBZIqd0pLtYqX6CkvY=\r\n=JOuN\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","gitHead":"9f5498524c3e50d351f6f36fb015ff14163a39cf","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","test":"mocha","check":"npm run lint && npm run depcheck","pretest":"mongodb-runner install && mongodb-runner start --port=27018","test-ci":"npm run test","depcheck":"depcheck","posttest":"mongodb-runner stop --port=27018","posttest-ci":"node ../../scripts/killall-mongo.js","test-check-ci":"npm run check && npm test"},"_npmUser":{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.3+x64 (darwin)","description":"MongoDB connection model.","directories":{},"_nodeVersion":"14.18.3","compass:main":"index.js","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","debug":"4.3.0","lodash":"^4.17.15","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.2.0","storage-mixin":"^4.14.0","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.1","@mongodb-js/ssh-tunnel":"^1.9.0","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.5.2"},"_hasShrinkwrap":false,"devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"^4.6.0","depcheck":"^1.4.1","electron":"^13.5.1","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.9.0","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^4.6.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_21.19.0_1657649710106_0.7297678858721637","host":"s3://npm-registry-packages"}},"21.19.1":{"name":"mongodb-connection-model","version":"21.19.1","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@21.19.1","maintainers":[{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"iteng@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"635e71814658481209b620c5469ac1e8f218be4f","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-21.19.1.tgz","fileCount":20,"integrity":"sha512-/KZCI1fnZsGj2VPhsJyoxFQQVFJc7ZeH5uIoKi0GlBvarDeUW9DFDs6W6/8DZMiiX57lM5AG5m12ZDV5Wp3NLQ==","signatures":[{"sig":"MEUCIH6YswlWeb6+10ESJ6jSPhOfe2RZUsWuMOg4RLpd7jKfAiEAi6k7g7EH6CAPszz1Ff3v5GruLIFF2M2qbVBKPhqq144=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":108304,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJizoadACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq64g//fGi0g4sotj5x96xxmkdQMr00H1mkF7NkJQazfY2KleR0oPG4\r\nKkcz7eu0Kw3FESixKMwCZ+Zocy26oFmKqBEqtM7R1IzWA4CnVSAKmznH1pUw\r\nDmd8puyTeT7em4xpHSlnIZjuIzRQmbpGomoNCsjgnBzTrLWhsuD5Ox/OdRkp\r\niv7QpUwMkSAw+BlEyccGd3KwjdPgJVXBAN2QzsXPgJZHhqSgfHZeQUFIw1aU\r\nsJEWcmRqeBae/HTUZX+c1TARVpJ8Q3v4oKSfb3OzzxRiBaHHthBKomDku7LD\r\ny8GRfNpb0l6Pvi5XanhdiP7blwwoJQfsW7yck9Z+ojM4Cbaz+f+hVQFM5AtH\r\n6Y5qHKui4PeMGb87OdQoNr83a809H5BR0s2AG87mtp8T4dT+q+ujDx7RkzEE\r\nPNLkEkSd0CNiXvPClaLn1ht43I3JtAw2OsU/ot2SZFKSk1nHgcwJ0SbzctG3\r\nyodJUFcWbsHvONxNYNN72xysmRpHBtcEqu3r3UbWlS6i9B+OJJKb/m2R+B3t\r\nLCLLqJIf18PJxTnm5sqjiZMkBQPrxP9TktlFbY8WH7RJXg5c/kcM6yPWzw+r\r\npqtPrkcj8t6aLnbidUjXcf40ZYrbA1W1Xn93AQR/pdWfJDpn14zy2WRCr3xv\r\nHgz4kwSxClkzVU5dReFjFaT8mTnvvoF/rmg=\r\n=eSFM\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","gitHead":"94eb44eba276874d7a3bfa44e394d87a8d9b88be","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","test":"mocha","check":"npm run lint && npm run depcheck","pretest":"mongodb-runner install && mongodb-runner start --port=27018","test-ci":"npm run test","depcheck":"depcheck","posttest":"mongodb-runner stop --port=27018","posttest-ci":"node ../../scripts/killall-mongo.js","test-check-ci":"npm run check && npm test"},"_npmUser":{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.3+x64 (darwin)","description":"MongoDB connection model.","directories":{},"_nodeVersion":"14.18.3","compass:main":"index.js","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","debug":"4.3.0","lodash":"^4.17.15","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.2.0","storage-mixin":"^4.14.0","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.1","@mongodb-js/ssh-tunnel":"^1.9.1","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.5.2"},"_hasShrinkwrap":false,"devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"^4.6.0","depcheck":"^1.4.1","electron":"^13.5.1","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.9.0","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^4.6.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_21.19.1_1657702044703_0.42743616469516943","host":"s3://npm-registry-packages"}},"22.0.0":{"name":"mongodb-connection-model","version":"22.0.0","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@22.0.0","maintainers":[{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"iteng@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"ae4537cb6fbc8925657243767bf6af53bf61b1b2","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-22.0.0.tgz","fileCount":20,"integrity":"sha512-s0d1/sIt567AMg8qaIjieyKhhsG59MawBanxBSQmWiWTC4eJAX5kNOhsGUQsQnWwUJyuLK6pR2E7fs4KZcvbBA==","signatures":[{"sig":"MEUCIQDCvoBGztFEVmmysr2qs3fomLRMpdxljRlKC6ExZWfl8AIgOrJyLjp8xEBt/buxO2kiszVlKX/r/+m45AUge6oMr2E=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":108284,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi8mBPACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqdbBAAhzrRQZvi6ylt6rEWFBYX0XObt+BJLIkekOMB3/9A/NkvBB/F\r\nlRUCt8g7+ELa4iZNHnT0DhDca7ho8vhPq5xnHqLJBS5fCgOs3PybBfOz+11B\r\n7wM5IEMDZ0voibd0PVgyoDaBqi6kzymvoBpXeAUKhXd7pJPahsdt4vouVvka\r\n3B1pBOgdxiZLRkZHDqJUuagb8jeoAl4a2f9/KNFBhQyrUAQZK/68G5/Vt2ZE\r\n39H9A2DJTOPhMycSggi6dvnfA1wuKAsEIBAQY+GKH4wiMIv3UmNWJAv9d/wy\r\nP1iqnA+MM4LvBsSq7PExR+HiJEP5riKTK7WZzwGfEfdWjm0I/wOIBUZh9z6r\r\nDjQ2iz/rnZ1IDkYSWt1PURyIdM9a49K1FFoDkouBaQFix+TMUF82einMMa65\r\nDX524jVJYJJYhwwVMY//Jti6O4vAlSaZ3kFK1NQixwki/3GwWtiBDy0UfrS9\r\n3IUL+0AjsXK24bmuFdIphpEnQvAfYFvunVU8kiC7CAznRfJooohsAolW2JJ6\r\n3kKd8vvkUzUwF4p2B4Y6KnwAQ9PpvYUcoAIPVUKXbwx9qPkz1rKYtHXffFWG\r\n+bFVIm7Iv1Up2O7HJ8SBb/hTCjYlffm+czva8KDFJkNJYSN7MsR07W3kudv1\r\nuPYXSixAvPKr+p86uLYTbM+8DA6qTdkXTMk=\r\n=8Ine\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","gitHead":"a30734888ab496a07d58e26870e5e33b374e98f7","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","test":"mocha","check":"npm run lint && npm run depcheck","pretest":"mongodb-runner install && mongodb-runner start --port=27018","test-ci":"npm run test","depcheck":"depcheck","posttest":"mongodb-runner stop --port=27018","posttest-ci":"node ../../scripts/killall-mongo.js","test-check-ci":"npm run check && npm test"},"_npmUser":{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.15.1+x64 (darwin)","description":"MongoDB connection model.","directories":{},"_nodeVersion":"16.15.1","compass:main":"index.js","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","debug":"^4.2.0","lodash":"^4.17.15","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.2.0","storage-mixin":"^5.0.0","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.2","@mongodb-js/ssh-tunnel":"^2.0.0","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.5.3"},"_hasShrinkwrap":false,"devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"^4.8.1","depcheck":"^1.4.1","electron":"^15.5.7","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.9.0","@electron/remote":"^2.0.8","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^4.8.1"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_22.0.0_1660051534852_0.6346486344138627","host":"s3://npm-registry-packages"}},"22.1.1":{"name":"mongodb-connection-model","version":"22.1.1","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@22.1.1","maintainers":[{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"iteng@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"26d3630f81d0a92e30da8e0186d8a90a3c3e7244","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-22.1.1.tgz","fileCount":20,"integrity":"sha512-JLPxOaosOAdamcyftvcYAXjqMsHYBIyxG6hHYyKPbhMzwJpKUWNvlpc9wQE4k6iru6tjsVm94mynb/Hh5Ny+VA==","signatures":[{"sig":"MEYCIQD5KnGn+3WvPuxf3UCARnbbQXKpHSKPs7CZpSzld5UEjwIhANPhZ0FgbyV2+3WojCI+S9ScfgXF7t6oU3lvfgJgR5vn","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":107972,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjLHvFACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpf0w//R8BVT6CpEu2lY+Ioy6e+fhdANjzmMSAXz1qmVM3Hc98vvFlT\r\nYqbUFvkfDYEnlh4LLvHC/LnQxZR3DHrJXGDP6sU1jQzrFEly5PJZAqPeO09v\r\n9VSxncpPakKSFUIUWmmXi7Rwpzd49AAmpEOtewkBXjwDVGW2kajnangoegoh\r\nc35stM5O9feucwXdh8uDLRreYdDxmNnIOjYgx0sC58h8GERuot9cyethIO2d\r\n+KKgGULo/ZiRXuh5cmwUlm5FL/CBB3g8gLDTLQD4eXywnoNmheaJToDgsUdo\r\nstwwkrQyqaOo5F9NW5V0fGRcsDu2+CV7JK24+GA9sgf5zK3a9hOeQb9DtWMw\r\n/qYHDSAsBOc4S0TdxnmsViYfDmr14+P2eqXVhKr6nHtoDTmaSOd/1dLVfzp7\r\nPk0SR2gJuAHd/zlb8UA5R1lvtV5M8hFo7tKRSvIdlqMm95Oy/RoztpMyqVTN\r\nEy6uPBL+JE67rclT1JCn+ukdGn93kJaoA7UataDDC9KvUYjUYAtrIDUEmlbx\r\nYSfuhqgRKxReCcBJKibR/WzsQ97A5Zru6TX2AxoNdvRq6ERMajDkBuvpt+K6\r\ngAwRm5PBPXkqJsP40uR5D68pqO2fX8adCh6MXvF27ui6PoUiVTzAjQot6xpT\r\nXEKo62SRsIFtukjtB0qEJiK7OBDoYULlAHw=\r\n=yFnG\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","gitHead":"51f04a0ac45c3b51a3ffb98af390c811d1404380","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","test":"mocha","check":"npm run lint && npm run depcheck","pretest":"mongodb-runner install && mongodb-runner start --port=27018","test-ci":"npm run test","depcheck":"depcheck","posttest":"mongodb-runner stop --port=27018","posttest-ci":"node ../../scripts/killall-mongo.js","test-check-ci":"npm run check && npm test"},"_npmUser":{"name":"alena.khineika","email":"alena.khineika@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.16.0+arm64 (darwin)","description":"MongoDB connection model.","directories":{},"_nodeVersion":"16.16.0","compass:main":"index.js","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","debug":"^4.2.0","lodash":"^4.17.15","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.2.0","storage-mixin":"^5.1.0","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.2","@mongodb-js/ssh-tunnel":"^2.0.1","@mongodb-js/compass-utils":"^0.1.1","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.5.3"},"_hasShrinkwrap":false,"devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"^4.10.0","depcheck":"^1.4.1","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.9.0","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^4.10.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_22.1.1_1663859653632_0.06397838616172491","host":"s3://npm-registry-packages"}},"0.0.0-experimental-1c53312ce4905234885618d41ae95fde9c21aa18":{"name":"mongodb-connection-model","version":"0.0.0-experimental-1c53312ce4905234885618d41ae95fde9c21aa18","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@0.0.0-experimental-1c53312ce4905234885618d41ae95fde9c21aa18","maintainers":[{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"iteng@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"e1de307fe76d51484dffd6973cfda0e8a4303ef8","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-0.0.0-experimental-1c53312ce4905234885618d41ae95fde9c21aa18.tgz","fileCount":20,"integrity":"sha512-GxUy0oq3iBAEqJjIVbVnGcatU2l3FhHLDUSbytIitzDZMGt6QoxNv6R6VPpQa9QzZMfLBw6qg5OCGaVXyogMHQ==","signatures":[{"sig":"MEUCIQDKxMyY/ew0tGYeL6qXxaP0GCnd33fr2j6XknR1xjEIWgIgZhSJMsC98xTOmf7pS5i3aUGTxDEdprAVXszY2H73Q6g=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":108184,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjMah2ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmrz6g//QtW9wgEJNVk4jckj7ZxNKQ1/8zuS3hfn9+ppOaL2+T4zRreQ\r\nk5knvZE5o8SPYJHfaGpHWjTjXDQ630uaOtZrDfJ+Vnttti2upGnWjYVQ9ztN\r\nEdZSQZWSTXD5pgq1c7E0nj17i+P5DCoh8LB15o8I9lNN9B+98SStiN8MvC6r\r\nYTuN7a/7ReDhCf+1xgsZrbv0R5LX5aoLsgMSot+kHVGmK9XcsI0hSQItqzm+\r\n2VaX3SLK42mpLw1y+L5b9Q7BNspsP4T1SEZ9/x6sMLJ/WcG5V8TrOXhg7RKA\r\npCMPKYMRcN6HQUrNJP3jaeZolrrM6kDPVP1ne5JDaME8Afx6MeefrcRNpYQo\r\n4eXWV5dbTDfNpnWZ6OjuR7Fe77sbXM05aY6t5Ji1ySlbRfbfhrkx973wKJU+\r\ncc7Q1f5X8cIdgxiHXAcivtsX9iOl4swFpjQo+IlacEItGoM0lheBBCyHE1Ba\r\n9/b10EGPB7csnxgA2QfJNYZQylW9RTPSh9BMHV6jXo5f2eoai+P5psEb0vMq\r\nCoQ9I1Tf543bMGj4xzQxDq0+zc48AELkZpbIfYYhPPIVx7sxq55h6MdXoVzD\r\n7GM4GmvlEOu/Y/tk4FyFvcCBTJGCWxwZ0HlPWPnoCPjInF56U3suAg2VXH79\r\n5aFzAfMw9RHH8X7OUjGTZKdffA6uMNeFTtA=\r\n=TMMz\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","readme":"# mongodb-connection-model [![][workflow_img]][workflow_url] [![][npm_img]][npm_url]\n\n> MongoDB connection model\n\nThe main purpose of the MongoDB connection model is to be a domain model around a MongoDB connection. It encapsulates generating a [Connection String URI](https://docs.mongodb.com/manual/reference/connection-string/) from a group of attributes and parses URI using the [MongoDB Node.JS Driver URI Parser](https://github.com/mongodb-js/mongodb-core/blob/master/lib/uri_parser.js).\n\n## Installation\n\n```\nnpm install --save mongodb-connection-model\n```\n\n## Usage\n\n### Building URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\nconst c = new Connection({ appname: 'My App Name' });\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://localhost:27017/?readPreference=primary&appname=My%20App&ssl=false'\n```\n\n### Parsing URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\n\nConnection.from(\n  'mongodb://someUsername:testPassword@localhost',\n  (error, result) => {\n    console.log(result);\n    >>> `{\n      hosts: [{ host: 'localhost', port: 27017 }],\n      hostname: 'localhost',\n      port: 27017,\n      auth: {\n        username: 'someUsername',\n        password: 'testPassword',\n        db: 'admin'\n      },\n      isSrvRecord: false,\n      authStrategy: 'MONGODB',\n      mongodbUsername: 'someUsername',\n      mongodbPassword: 'testPassword',\n      mongodbDatabaseName: 'admin',\n      extraOptions: {},\n      connectionType: 'NODE_DRIVER',\n      readPreference: 'primary',\n      kerberosCanonicalizeHostname: false,\n      sslMethod: 'NONE',\n      sshTunnel: 'NONE',\n      sshTunnelPort: 22\n    }`\n  }\n);\n```\n\n## Properties\n\nMongoDB connection model is based on Ampersand.js framework and consist of [props](https://ampersandjs.com/docs/#ampersand-state-props) and [derived props](https://ampersandjs.com/docs/#ampersand-state-derived). The props object describes the observable properties that MongoDB connection model gets from the Node.js Driver API.\n\n```javascript\nconst с = new Connection();\nconst props = с.getAttributes({ props: true });\n```\n\n#### See Also\n\n- [URI Generic Syntax](https://tools.ietf.org/html/rfc3986)\n- [URI Options Specification](https://github.com/mongodb/specifications/blob/master/source/uri-options/uri-options.rst)\n\n### General Properties\n\n```javascript\nconst c = new Connection({ isSrvRecord: true });\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ns` | String | A valid [ns][ns] the user can read from | `undefined` |\n| `isSrvRecord` | Boolean | Indicates SRV record | `false` |\n| `auth` | Object | Authentication from driver (username, user, db, password) | `undefined` |\n| `hostname` | String | Hostname of a MongoDB Instance. In case of the replica set the first host and port will be taken | `localhost` |\n| `port` | Number | TCP port of a MongoDB Instance | `27017` |\n| `hosts` | Array | Contains all hosts and ports for replica set | `[{ host: 'localhost', port: 27017 }]` |\n| `extraOptions` | Object | Extra options passed to the node driver as part of `driverOptions` | `{}` |\n| `connectionType` | String | The desired connection type. Possible values: `NODE_DRIVER`, `STITCH_ON_PREM`, `STITCH_ATLAS` | `NODE_DRIVER` |\n| `authStrategy` | String | The desired authentication strategy. Possible values: `NONE`, `MONGODB`, `X509`, `KERBEROS`, `LDAP`, `SCRAM-SHA-256` | `NONE` |\n\n### Connection string options\n\n```javascript\nconst c = new Connection({ appname: 'My App', replicaSet: 'testing' });\n```\n\n#### General connection string options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `replicaSet` | String | Specifies the name of the replica set, if the mongod is a member of a replica set | `undefined` |\n| `connectTimeoutMS` | Number | The time in milliseconds to attempt a connection before timing out | `undefined` |\n| `socketTimeoutMS` | Number | The time in milliseconds to attempt a send or receive on a socket before the attempt times out | `undefined` |\n| `compression` | Object | Object includes compressors and a compression level. The following compressors can be specified: `snappy`, `zlib` (Available in MongoDB 3.6 or greater) | `undefined` |\n\n#### Connection Pool Option\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `maxPoolSize` | Number | The maximum number of connections in the connection pool | `undefined` |\n| `minPoolSize` | Number | The minimum number of connections in the connection pool | `undefined` |\n| `maxIdleTimeMS` | Number | The maximum number of milliseconds that a connection can remain idle in the pool before being removed and closed | `undefined` |\n| `waitQueueMultiple` | Number | A number that the driver multiples the maxPoolSize value to, to provide the maximum number of threads allowed to wait for a connection to become available from the pool | `undefined` |\n| `waitQueueTimeoutMS` | Number | The maximum time in milliseconds that a thread can wait for a connection to become available | `undefined` |\n\n#### Write Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `w` | Number/String | Corresponds to the write concern [w Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-w) | `undefined` |\n| `wTimeoutMS` | Number | Corresponds to the write concern [wtimeout](https://docs.mongodb.com/manual/reference/write-concern/#wc-wtimeout) | `undefined` |\n| `journal` | Boolean | Corresponds to the write concern [j Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-j) | `undefined` |\n\n#### Read Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readConcernLevel` | String | The level of isolation | `undefined` |\n\n#### Read Preference Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readPreference` | String | Specifies the read preferences for this connection. Possible values: `PRIMARY`, `PRIMARY_PREFERRED`, `SECONDARY`, `SECONDARY_PREFERRED`, `NEAREST` | `PRIMARY` |\n| `maxStalenessSeconds` | Number | Specifies, in seconds, how stale a secondary can be before the client stops using it for read operations | `undefined` |\n| `readPreferenceTags` | Object | Default read preference tags for the client | `undefined` |\n\n#### Authentication Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `authSource` | String | Specify the database name associated with the user’s credentials | `undefined` |\n| `authMechanism` | String | Specifies the authentication mechanism that MongoDB will use to authenticate the connection. Possible values: `DEFAULT`, `GSSAPI`, `MONGODB-X509`, `PLAIN`, `SCRAM-SHA-256` | `undefined` |\n| `authMechanismProperties` | Object | Additional options provided for authentication (e.g. to enable hostname canonicalization for GSSAPI) | `undefined` |\n| `gssapiServiceName` | String | Set the Kerberos service name when connecting to Kerberized MongoDB instances | `undefined` |\n| `gssapiServiceRealm` | String | Set the Realm service name | `undefined` |\n| `gssapiCanonicalizeHostName` | Boolean | Whether canonicalized hostname | `undefined` |\n\n#### Server Selection and Discovery Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `localThresholdMS` | Number | The size (in milliseconds) of the latency window for selecting among multiple suitable MongoDB instances | `undefined` |\n| `serverSelectionTimeoutMS` | Number | Specifies how long (in milliseconds) to block for server selection before throwing an exception | `undefined` |\n| `serverSelectionTryOnce` | Boolean | Instructs the driver to scan the MongoDB deployment exactly once after server selection fails and then either select a server or raise an error | `undefined` |\n| `heartbeatFrequencyMS` | Number | Controls when the driver checks the state of the MongoDB deployment | `undefined` |\n\n#### Miscellaneous Configuration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `appname` | String | An application name passed to server as client metadata | `undefined` |\n| `retryWrites` | Boolean | Enable retryable writes | `undefined` |\n| `uuidRepresentation` | String | The legacy representation of UUID. Possible values: `standard`, `csharpLegacy`, `javaLegacy`, `pythonLegacy` | `undefined` |\n| `loadBalanced` | Boolean | Whether or not the server is running in load balanced mode | `undefined` |\n\n### Stitch attributes\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `stitchServiceName` | String | Stitch service name | `undefined` |\n| `stitchClientAppId` | String | Stitch сlient app ID | `undefined` |\n| `stitchGroupId` | String | Stitch group ID | `undefined` |\n| `stitchBaseUrl` | String | Stitch base Url | `undefined` |\n\n### MONGODB authentication\n\n```javascript\nconst c = new Connection({\n  mongodbUsername: 'arlo',\n  mongodbPassword: 'w@of'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/?slaveOk=true&authSource=admin'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `mongodbUsername` | String | MongoDB username | `undefined` |\n| `mongodbPassword` | String | MongoDB password | `undefined` |\n| `mongodbDatabaseName` | String | The database name associated with the user's credentials | `undefined` |\n| `promoteValues` | Boolean | Whether BSON values should be promoted to their JS type counterparts | `undefined` |\n\n### KERBEROS authentication\n\n```javascript\nconst c = new Connection({\n  kerberosServiceName: 'mongodb',\n  kerberosPrincipal: 'arlo/dog@krb5.mongodb.parts',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo%252Fdog%2540krb5.mongodb.parts@localhost:27017/toys?authMechanism=GSSAPI'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n> @note (imlucas): Kerberos on Windows is broken out as it's own state for UX consideration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `kerberosServiceName` | String | Any program or computer you access over a network | `undefined` |\n| `kerberosPrincipal` | String | The format of a typical Kerberos V5 principal is `primary/instance@REALM` | `undefined` |\n| `kerberosCanonicalizeHostname` | Boolean | Whether canonicalized kerberos hostname | `undefined` |\n\n#### See Also\n\n- [node.js driver Kerberos reference](http://bit.ly/mongodb-node-driver-kerberos)\n- [node.js driver Kerberos functional test][kerberos-functional]\n\n### LDAP authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  ldapUsername: 'arlo',\n  ldapPassword: 'w@of',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/toys?slaveOk=true&authMechanism=PLAIN'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ldapUsername` | String | LDAP username | `undefined` |\n| `ldapPassword` | String | LDAP password | `undefined` |\n\n#### See Also\n\n- [node.js driver LDAP reference](http://bit.ly/mongodb-node-driver-ldap)\n- [node.js driver X509 functional test][ldap-functional]\n\n### X509 authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  x509Username: 'CN=client,OU=arlo,O=MongoDB,L=Philadelphia,ST=Pennsylvania,C=US'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://CN%253Dclient%252COU%253Darlo%252CO%253DMongoDB%252CL%253DPhiladelphia%252CST%253DPennsylvania%252CC%253DUS@localhost:27017?slaveOk=true&authMechanism=MONGODB-X509'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `x509Username` | String | The x.509 certificate derived user name, e.g. `CN=user,OU=OrgUnit,O=myOrg,...` | `undefined` |\n\n#### See Also\n\n- [node.js driver X509 reference](http://bit.ly/mongodb-node-driver-x509)\n- [node.js driver X509 functional test][x509-functional]\n\n### SSL\n\n> **Note**: Not to be confused with `authentication=X509`\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ssl` | Number/String | A boolean to enable or disables TLS/SSL for the connection | `undefined` |\n| `sslMethod` | String | The desired ssl method. Possible values: `NONE`, `SYSTEMCA`, `IFAVAILABLE`, `UNVALIDATED`, `SERVER`, `ALL` | `NONE` |\n| `sslCA` | Buffer/String | Array of valid certificates | `undefined` |\n| `sslCert` | Buffer/String | The certificate | `undefined` |\n| `sslKey` | Buffer/String | The certificate private key | `undefined` |\n| `sslPass` | Buffer/String | The certificate password | `undefined` |\n\nDescription of `sslMethod` values:\n\n- `SYSTEMCA` - SSL required, validate using System CA, with host verification.\n- `IFAVAILABLE` - The driver should try SSL first, fall back to no SSL if unavailable, and use the system's Certificate Authority.\n- `SERVER` - The driver should validate the server certificate and fail to connect if validation fails. See also [node.js driver \"Validate Server Certificate\" docs][driver-ssl-server].\n- `ALL` - The driver must present a valid certificate and validate the server certificate. See also [node.js driver \"Validate Server Certificate and Present Valid Certificate\" docs][driver-ssl-all].\n- `NONE` - No SSL (Not recommended).\n- `UNVALIDATED` - Use SSL but do not perform any validation of the certificate chain. See also [node.js driver \"No Certificate Validation\" docs][driver-ssl-none]. **Very** not recommended and likely to be deprecated in future releases because it exposes potential Man-In-The-Middle attack vectors.\n\n#### See also\n\n- [node.js driver SSL implementation][driver-ssl-impl]\n- [node.js driver SSL tutorial][driver-ssl-tutorial]\n\n### SSH TUNNEL\n\n> New in mongodb-connection-model@5.0.0\n\nBecause [authentication](#authentication) is quite difficult for operators to migrate to, the most common method of securing a MongoDB deployment is to use an [SSH tunnel][sf-ssh-tunnel].  This allows operators to leverage their existing SSH security infrastructure to also provide secure access to MongoDB.  For a standard deployment of MongoDB on AWS, this is almost always to strategy.  Because of this, we now support creating SSH tunnels automatically when connecting to MongoDB.\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options, (connectionError, client) => {\n  if (connectionError) {\n    return console.log(connectionError);\n  }\n\n  client.db('mongodb').collection('fanclub').count((countingError, count) => {\n    console.log('counted:', countingError, count);\n    client.close();\n  });\n});\n```\n\nThe above provides the same functionality as creating the tunnel using the bash\ncommand below and connecting to MongoDB via another terminal. Notice that\nconnection-model uses a random local port each time it creates a tunnel.\nUsing the command line, you'd have to replace `<random port>` with an actual\nport number.\n\n```bash\nssh -i ~/.ssh/my-key-aws-pair.pem -L <random port>:localhost:27017 ubuntu@ec2-11-111-111-111.compute-1.amazonaws.com\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `sshTunnel` | String | The desired SSH tunnel strategy. Possible values: `NONE`, `USER_PASSWORD`, `IDENTITY_FILE` | `undefined` |\n| `sshTunnelHostname` | String | The hostname of the SSH remote host | `undefined` |\n| `sshTunnelPort` | Port | The SSH port of the remote host | `22` |\n| `sshTunnelBindToLocalPort` | Port | Bind the localhost endpoint of the SSH Tunnel to this port | `undefined` |\n| `sshTunnelUsername` | String | The optional SSH username for the remote host | `undefined` |\n| `sshTunnelPassword` | String | The optional SSH password for the remote host | `undefined` |\n| `sshTunnelIdentityFile` | String/Array | The optional path to the SSH identity file for the remote host | `undefined` |\n| `sshTunnelPassphrase` | String | The optional passphrase for `sshTunnelIdentityFile` | `undefined` |\n\nDescription of `sshTunnel` values:\n\n- `NONE` - Do not use SSH tunneling.\n- `USER_PASSWORD` - The tunnel is created with SSH username and password only.\n- `IDENTITY_FILE` - The tunnel is created using an identity file.\n\n## Derived Properties\n\nDerived properties (also known as computed properties) are properties of the state object that depend on other properties to determine their value.\n\n```javascript\nconst c = new Connection();\nconst derivedProps = c.getAttributes({ derived: true });\n```\n\n| Derived Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `instanceId` | String | The mongoscope | `localhost:27017` |\n| `driverAuthMechanism` | String | Converts the value of `authStrategy` for humans into the `authMechanism` value for the driver | `undefined` |\n| `safeUrl` | String | The URL where a password is replaced with stars | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrl` | String | Use this URL in order to connect via DataService | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrlWithSsh` | String | Use this URL in order to connect via connection model itself | `mongodb://localhost:29201/?readPreference=primary&ssl=false` |\n| `driverOptions` | String | The second argument `mongoscope-server` passes to `mongodb.connect` | `{}` |\n\n## Events\n\n> New in mongodb-connection-model@5.0.0\n\n#### Example: SSH Tunnel\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', skipped: true,\n  reason: 'The selected SSL mode does not need to load any files.' }\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', complete: true}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n#### Example: SSL\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  ssl: 'ALL',\n  sslCA: '~/.ssl/my-ca.pem',\n  sslCert: '~/.ssl/my-server.pem',\n  sslKey: '~/.ssl/my-server.pem'\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', complete: true}\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', skipped: true,\n  reason: 'The selected SSH Tunnel mode is NONE.'}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n[workflow_img]: https://github.com/mongodb-js/connection-model/workflows/Check%20and%20Test/badge.svg?event=push\n[workflow_url]: https://github.com/mongodb-js/connection-model/actions?query=workflow%3A%22Check+and+Test%22\n[npm_img]: https://img.shields.io/npm/v/mongodb-connection-model.svg?style=flat-square\n[npm_url]: https://www.npmjs.org/package/mongodb-connection-model\n[gitter_img]: https://badges.gitter.im/Join%20Chat.svg\n[gitter_url]: http://gitter.im/mongodb-js/mongodb-js\n[enterprise_img]: https://img.shields.io/badge/MongoDB-Enterprise-blue.svg?style=flat-square\n[coming_soon_img]: https://img.shields.io/badge/-Coming%20Soon-ff69b4.svg?style=flat-square\n[kerberos-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/kerberos_tests.js\n[ldap-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ldap_tests.js\n[x509-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ssl_x509_tests.js\n[ns]: https://github.com/mongodb-js/ns\n[sf-ssh-tunnel]: http://serverfault.com/questions/597765/how-to-connect-to-mongodb-server-via-ssh-tunnel\n[ec2-key-pairs]: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html\n[driver-ssl-impl]: https://github.com/christkv/mongodb-core/blob/c3d21cb636d74d7a68134ecd3b9f6af536311279/lib/connection/connection.js#L365-L407\n[driver-ssl-tutorial]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/\n[driver-ssl-none]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#no-certificate-validation\n[driver-ssl-server]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate\n[driver-ssl-all]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate-and-present-valid-certificate\n","gitHead":"85bec9e9b95acd9ace066254edfc492578f4f8b2","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","test":"mocha","check":"npm run lint && npm run depcheck","pretest":"mongodb-runner install && mongodb-runner start --port=27018","test-ci":"npm run test","depcheck":"depcheck","posttest":"mongodb-runner stop --port=27018","posttest-ci":"node ../../scripts/killall-mongo.js","test-check-ci":"npm run check && npm test"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.17.0+x64 (darwin)","description":"MongoDB connection model.","directories":{},"_nodeVersion":"16.17.0","compass:main":"index.js","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","debug":"^4.2.0","lodash":"^4.17.15","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.2.0","storage-mixin":"0.0.0-experimental-1c53312ce4905234885618d41ae95fde9c21aa18","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.2","@mongodb-js/ssh-tunnel":"0.0.0-experimental-1c53312ce4905234885618d41ae95fde9c21aa18","@mongodb-js/compass-utils":"0.0.0-experimental-1c53312ce4905234885618d41ae95fde9c21aa18","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.5.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"^4.10.0","depcheck":"^1.4.1","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.9.0","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^4.10.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_0.0.0-experimental-1c53312ce4905234885618d41ae95fde9c21aa18_1664198773774_0.41787926950832355","host":"s3://npm-registry-packages"}},"0.0.0-next-e30a9e850a8a66b70770fbf6658a3e35cf1ff8b8":{"name":"mongodb-connection-model","version":"0.0.0-next-e30a9e850a8a66b70770fbf6658a3e35cf1ff8b8","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@0.0.0-next-e30a9e850a8a66b70770fbf6658a3e35cf1ff8b8","maintainers":[{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"iteng@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"521f05d94aa384d0318952cced6dab690dd6aec5","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-0.0.0-next-e30a9e850a8a66b70770fbf6658a3e35cf1ff8b8.tgz","fileCount":20,"integrity":"sha512-8OIhw4UwNiea0dO6qBIe/dPD6Iz2+yv2JsGKlTYfHbZk65tVFQMsbymHcdhMWied0q/4co/2O+GV+SkjDBXZwA==","signatures":[{"sig":"MEYCIQCpsPCE78IMB9e3WYZZMfXDeObc/4mrEELjSbR10n0xSAIhAPFETtlFqx7JLUouwhIme4iCj3KkYi0XsV8/wWiaYcpc","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":108152,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjMbIfACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrsuA/+M+twzb17z63iv3baxFJJXKS7hD0P8as8lw8rhNAaRMvKbTog\r\nvVLH+WsbuTCXPyzgU58bhB/XM1tqvQdGFwZP58FihF/2l9Q1ABD1k9DmmGTy\r\nbOGfNcxc2vD93D5Mu4/cSmSQSiKr23MrmVYpkaFvw8BcVRVh6+JxzH0Kb+yJ\r\niq93tvi85ix30cZFL8NeabEA3GUT/jxQGjw3TvHs3jvl4IO5gIS9m/nsPC7V\r\nt+Ebo5KFtknzcKhjhA+wgDAdg6CKCm0oW+VQ3qH07zMf7CrR5g4PBsnlifwa\r\nS9zOFUtxcPr+PgoM2aEemY/5JkXvnXPgwdUHC48i86kAYBgfiLERgMhzMsO3\r\nEEDV/Nuest0kj2gGb7F9FRxscFAe6YUKCS6JPrTSwYGsvnoWqqklUqw8IMWV\r\nHsJ9Dv0ppfccXshxE4m1r11J/QulKfiqodbDDI9PbR7NP/TI+a3Tn2Q6Vx8Q\r\nvWfYyq++Fokz3dMiDRLqYXh7Mu25govuQ7UVmx819Vst9Z1ShK3Ekyju6CK1\r\nVoOvjUplrGyq40AumAVOclYwTRCn+JXVrsunZEAFLG7/JrNK1FWYj7hTIJyF\r\n+myl/ficT5D3ILLJrf/xe5cit1t9KYiye08XrmtNajrdivzqn3NTjPQsK/Y5\r\n1Qy661HrLTuhfmvIlpjueFKZcnoz2PKSeXo=\r\n=KzwA\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","readme":"# mongodb-connection-model [![][workflow_img]][workflow_url] [![][npm_img]][npm_url]\n\n> MongoDB connection model\n\nThe main purpose of the MongoDB connection model is to be a domain model around a MongoDB connection. It encapsulates generating a [Connection String URI](https://docs.mongodb.com/manual/reference/connection-string/) from a group of attributes and parses URI using the [MongoDB Node.JS Driver URI Parser](https://github.com/mongodb-js/mongodb-core/blob/master/lib/uri_parser.js).\n\n## Installation\n\n```\nnpm install --save mongodb-connection-model\n```\n\n## Usage\n\n### Building URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\nconst c = new Connection({ appname: 'My App Name' });\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://localhost:27017/?readPreference=primary&appname=My%20App&ssl=false'\n```\n\n### Parsing URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\n\nConnection.from(\n  'mongodb://someUsername:testPassword@localhost',\n  (error, result) => {\n    console.log(result);\n    >>> `{\n      hosts: [{ host: 'localhost', port: 27017 }],\n      hostname: 'localhost',\n      port: 27017,\n      auth: {\n        username: 'someUsername',\n        password: 'testPassword',\n        db: 'admin'\n      },\n      isSrvRecord: false,\n      authStrategy: 'MONGODB',\n      mongodbUsername: 'someUsername',\n      mongodbPassword: 'testPassword',\n      mongodbDatabaseName: 'admin',\n      extraOptions: {},\n      connectionType: 'NODE_DRIVER',\n      readPreference: 'primary',\n      kerberosCanonicalizeHostname: false,\n      sslMethod: 'NONE',\n      sshTunnel: 'NONE',\n      sshTunnelPort: 22\n    }`\n  }\n);\n```\n\n## Properties\n\nMongoDB connection model is based on Ampersand.js framework and consist of [props](https://ampersandjs.com/docs/#ampersand-state-props) and [derived props](https://ampersandjs.com/docs/#ampersand-state-derived). The props object describes the observable properties that MongoDB connection model gets from the Node.js Driver API.\n\n```javascript\nconst с = new Connection();\nconst props = с.getAttributes({ props: true });\n```\n\n#### See Also\n\n- [URI Generic Syntax](https://tools.ietf.org/html/rfc3986)\n- [URI Options Specification](https://github.com/mongodb/specifications/blob/master/source/uri-options/uri-options.rst)\n\n### General Properties\n\n```javascript\nconst c = new Connection({ isSrvRecord: true });\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ns` | String | A valid [ns][ns] the user can read from | `undefined` |\n| `isSrvRecord` | Boolean | Indicates SRV record | `false` |\n| `auth` | Object | Authentication from driver (username, user, db, password) | `undefined` |\n| `hostname` | String | Hostname of a MongoDB Instance. In case of the replica set the first host and port will be taken | `localhost` |\n| `port` | Number | TCP port of a MongoDB Instance | `27017` |\n| `hosts` | Array | Contains all hosts and ports for replica set | `[{ host: 'localhost', port: 27017 }]` |\n| `extraOptions` | Object | Extra options passed to the node driver as part of `driverOptions` | `{}` |\n| `connectionType` | String | The desired connection type. Possible values: `NODE_DRIVER`, `STITCH_ON_PREM`, `STITCH_ATLAS` | `NODE_DRIVER` |\n| `authStrategy` | String | The desired authentication strategy. Possible values: `NONE`, `MONGODB`, `X509`, `KERBEROS`, `LDAP`, `SCRAM-SHA-256` | `NONE` |\n\n### Connection string options\n\n```javascript\nconst c = new Connection({ appname: 'My App', replicaSet: 'testing' });\n```\n\n#### General connection string options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `replicaSet` | String | Specifies the name of the replica set, if the mongod is a member of a replica set | `undefined` |\n| `connectTimeoutMS` | Number | The time in milliseconds to attempt a connection before timing out | `undefined` |\n| `socketTimeoutMS` | Number | The time in milliseconds to attempt a send or receive on a socket before the attempt times out | `undefined` |\n| `compression` | Object | Object includes compressors and a compression level. The following compressors can be specified: `snappy`, `zlib` (Available in MongoDB 3.6 or greater) | `undefined` |\n\n#### Connection Pool Option\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `maxPoolSize` | Number | The maximum number of connections in the connection pool | `undefined` |\n| `minPoolSize` | Number | The minimum number of connections in the connection pool | `undefined` |\n| `maxIdleTimeMS` | Number | The maximum number of milliseconds that a connection can remain idle in the pool before being removed and closed | `undefined` |\n| `waitQueueMultiple` | Number | A number that the driver multiples the maxPoolSize value to, to provide the maximum number of threads allowed to wait for a connection to become available from the pool | `undefined` |\n| `waitQueueTimeoutMS` | Number | The maximum time in milliseconds that a thread can wait for a connection to become available | `undefined` |\n\n#### Write Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `w` | Number/String | Corresponds to the write concern [w Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-w) | `undefined` |\n| `wTimeoutMS` | Number | Corresponds to the write concern [wtimeout](https://docs.mongodb.com/manual/reference/write-concern/#wc-wtimeout) | `undefined` |\n| `journal` | Boolean | Corresponds to the write concern [j Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-j) | `undefined` |\n\n#### Read Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readConcernLevel` | String | The level of isolation | `undefined` |\n\n#### Read Preference Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readPreference` | String | Specifies the read preferences for this connection. Possible values: `PRIMARY`, `PRIMARY_PREFERRED`, `SECONDARY`, `SECONDARY_PREFERRED`, `NEAREST` | `PRIMARY` |\n| `maxStalenessSeconds` | Number | Specifies, in seconds, how stale a secondary can be before the client stops using it for read operations | `undefined` |\n| `readPreferenceTags` | Object | Default read preference tags for the client | `undefined` |\n\n#### Authentication Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `authSource` | String | Specify the database name associated with the user’s credentials | `undefined` |\n| `authMechanism` | String | Specifies the authentication mechanism that MongoDB will use to authenticate the connection. Possible values: `DEFAULT`, `GSSAPI`, `MONGODB-X509`, `PLAIN`, `SCRAM-SHA-256` | `undefined` |\n| `authMechanismProperties` | Object | Additional options provided for authentication (e.g. to enable hostname canonicalization for GSSAPI) | `undefined` |\n| `gssapiServiceName` | String | Set the Kerberos service name when connecting to Kerberized MongoDB instances | `undefined` |\n| `gssapiServiceRealm` | String | Set the Realm service name | `undefined` |\n| `gssapiCanonicalizeHostName` | Boolean | Whether canonicalized hostname | `undefined` |\n\n#### Server Selection and Discovery Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `localThresholdMS` | Number | The size (in milliseconds) of the latency window for selecting among multiple suitable MongoDB instances | `undefined` |\n| `serverSelectionTimeoutMS` | Number | Specifies how long (in milliseconds) to block for server selection before throwing an exception | `undefined` |\n| `serverSelectionTryOnce` | Boolean | Instructs the driver to scan the MongoDB deployment exactly once after server selection fails and then either select a server or raise an error | `undefined` |\n| `heartbeatFrequencyMS` | Number | Controls when the driver checks the state of the MongoDB deployment | `undefined` |\n\n#### Miscellaneous Configuration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `appname` | String | An application name passed to server as client metadata | `undefined` |\n| `retryWrites` | Boolean | Enable retryable writes | `undefined` |\n| `uuidRepresentation` | String | The legacy representation of UUID. Possible values: `standard`, `csharpLegacy`, `javaLegacy`, `pythonLegacy` | `undefined` |\n| `loadBalanced` | Boolean | Whether or not the server is running in load balanced mode | `undefined` |\n\n### Stitch attributes\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `stitchServiceName` | String | Stitch service name | `undefined` |\n| `stitchClientAppId` | String | Stitch сlient app ID | `undefined` |\n| `stitchGroupId` | String | Stitch group ID | `undefined` |\n| `stitchBaseUrl` | String | Stitch base Url | `undefined` |\n\n### MONGODB authentication\n\n```javascript\nconst c = new Connection({\n  mongodbUsername: 'arlo',\n  mongodbPassword: 'w@of'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/?slaveOk=true&authSource=admin'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `mongodbUsername` | String | MongoDB username | `undefined` |\n| `mongodbPassword` | String | MongoDB password | `undefined` |\n| `mongodbDatabaseName` | String | The database name associated with the user's credentials | `undefined` |\n| `promoteValues` | Boolean | Whether BSON values should be promoted to their JS type counterparts | `undefined` |\n\n### KERBEROS authentication\n\n```javascript\nconst c = new Connection({\n  kerberosServiceName: 'mongodb',\n  kerberosPrincipal: 'arlo/dog@krb5.mongodb.parts',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo%252Fdog%2540krb5.mongodb.parts@localhost:27017/toys?authMechanism=GSSAPI'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n> @note (imlucas): Kerberos on Windows is broken out as it's own state for UX consideration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `kerberosServiceName` | String | Any program or computer you access over a network | `undefined` |\n| `kerberosPrincipal` | String | The format of a typical Kerberos V5 principal is `primary/instance@REALM` | `undefined` |\n| `kerberosCanonicalizeHostname` | Boolean | Whether canonicalized kerberos hostname | `undefined` |\n\n#### See Also\n\n- [node.js driver Kerberos reference](http://bit.ly/mongodb-node-driver-kerberos)\n- [node.js driver Kerberos functional test][kerberos-functional]\n\n### LDAP authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  ldapUsername: 'arlo',\n  ldapPassword: 'w@of',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/toys?slaveOk=true&authMechanism=PLAIN'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ldapUsername` | String | LDAP username | `undefined` |\n| `ldapPassword` | String | LDAP password | `undefined` |\n\n#### See Also\n\n- [node.js driver LDAP reference](http://bit.ly/mongodb-node-driver-ldap)\n- [node.js driver X509 functional test][ldap-functional]\n\n### X509 authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  x509Username: 'CN=client,OU=arlo,O=MongoDB,L=Philadelphia,ST=Pennsylvania,C=US'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://CN%253Dclient%252COU%253Darlo%252CO%253DMongoDB%252CL%253DPhiladelphia%252CST%253DPennsylvania%252CC%253DUS@localhost:27017?slaveOk=true&authMechanism=MONGODB-X509'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `x509Username` | String | The x.509 certificate derived user name, e.g. `CN=user,OU=OrgUnit,O=myOrg,...` | `undefined` |\n\n#### See Also\n\n- [node.js driver X509 reference](http://bit.ly/mongodb-node-driver-x509)\n- [node.js driver X509 functional test][x509-functional]\n\n### SSL\n\n> **Note**: Not to be confused with `authentication=X509`\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ssl` | Number/String | A boolean to enable or disables TLS/SSL for the connection | `undefined` |\n| `sslMethod` | String | The desired ssl method. Possible values: `NONE`, `SYSTEMCA`, `IFAVAILABLE`, `UNVALIDATED`, `SERVER`, `ALL` | `NONE` |\n| `sslCA` | Buffer/String | Array of valid certificates | `undefined` |\n| `sslCert` | Buffer/String | The certificate | `undefined` |\n| `sslKey` | Buffer/String | The certificate private key | `undefined` |\n| `sslPass` | Buffer/String | The certificate password | `undefined` |\n\nDescription of `sslMethod` values:\n\n- `SYSTEMCA` - SSL required, validate using System CA, with host verification.\n- `IFAVAILABLE` - The driver should try SSL first, fall back to no SSL if unavailable, and use the system's Certificate Authority.\n- `SERVER` - The driver should validate the server certificate and fail to connect if validation fails. See also [node.js driver \"Validate Server Certificate\" docs][driver-ssl-server].\n- `ALL` - The driver must present a valid certificate and validate the server certificate. See also [node.js driver \"Validate Server Certificate and Present Valid Certificate\" docs][driver-ssl-all].\n- `NONE` - No SSL (Not recommended).\n- `UNVALIDATED` - Use SSL but do not perform any validation of the certificate chain. See also [node.js driver \"No Certificate Validation\" docs][driver-ssl-none]. **Very** not recommended and likely to be deprecated in future releases because it exposes potential Man-In-The-Middle attack vectors.\n\n#### See also\n\n- [node.js driver SSL implementation][driver-ssl-impl]\n- [node.js driver SSL tutorial][driver-ssl-tutorial]\n\n### SSH TUNNEL\n\n> New in mongodb-connection-model@5.0.0\n\nBecause [authentication](#authentication) is quite difficult for operators to migrate to, the most common method of securing a MongoDB deployment is to use an [SSH tunnel][sf-ssh-tunnel].  This allows operators to leverage their existing SSH security infrastructure to also provide secure access to MongoDB.  For a standard deployment of MongoDB on AWS, this is almost always to strategy.  Because of this, we now support creating SSH tunnels automatically when connecting to MongoDB.\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options, (connectionError, client) => {\n  if (connectionError) {\n    return console.log(connectionError);\n  }\n\n  client.db('mongodb').collection('fanclub').count((countingError, count) => {\n    console.log('counted:', countingError, count);\n    client.close();\n  });\n});\n```\n\nThe above provides the same functionality as creating the tunnel using the bash\ncommand below and connecting to MongoDB via another terminal. Notice that\nconnection-model uses a random local port each time it creates a tunnel.\nUsing the command line, you'd have to replace `<random port>` with an actual\nport number.\n\n```bash\nssh -i ~/.ssh/my-key-aws-pair.pem -L <random port>:localhost:27017 ubuntu@ec2-11-111-111-111.compute-1.amazonaws.com\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `sshTunnel` | String | The desired SSH tunnel strategy. Possible values: `NONE`, `USER_PASSWORD`, `IDENTITY_FILE` | `undefined` |\n| `sshTunnelHostname` | String | The hostname of the SSH remote host | `undefined` |\n| `sshTunnelPort` | Port | The SSH port of the remote host | `22` |\n| `sshTunnelBindToLocalPort` | Port | Bind the localhost endpoint of the SSH Tunnel to this port | `undefined` |\n| `sshTunnelUsername` | String | The optional SSH username for the remote host | `undefined` |\n| `sshTunnelPassword` | String | The optional SSH password for the remote host | `undefined` |\n| `sshTunnelIdentityFile` | String/Array | The optional path to the SSH identity file for the remote host | `undefined` |\n| `sshTunnelPassphrase` | String | The optional passphrase for `sshTunnelIdentityFile` | `undefined` |\n\nDescription of `sshTunnel` values:\n\n- `NONE` - Do not use SSH tunneling.\n- `USER_PASSWORD` - The tunnel is created with SSH username and password only.\n- `IDENTITY_FILE` - The tunnel is created using an identity file.\n\n## Derived Properties\n\nDerived properties (also known as computed properties) are properties of the state object that depend on other properties to determine their value.\n\n```javascript\nconst c = new Connection();\nconst derivedProps = c.getAttributes({ derived: true });\n```\n\n| Derived Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `instanceId` | String | The mongoscope | `localhost:27017` |\n| `driverAuthMechanism` | String | Converts the value of `authStrategy` for humans into the `authMechanism` value for the driver | `undefined` |\n| `safeUrl` | String | The URL where a password is replaced with stars | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrl` | String | Use this URL in order to connect via DataService | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrlWithSsh` | String | Use this URL in order to connect via connection model itself | `mongodb://localhost:29201/?readPreference=primary&ssl=false` |\n| `driverOptions` | String | The second argument `mongoscope-server` passes to `mongodb.connect` | `{}` |\n\n## Events\n\n> New in mongodb-connection-model@5.0.0\n\n#### Example: SSH Tunnel\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', skipped: true,\n  reason: 'The selected SSL mode does not need to load any files.' }\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', complete: true}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n#### Example: SSL\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  ssl: 'ALL',\n  sslCA: '~/.ssl/my-ca.pem',\n  sslCert: '~/.ssl/my-server.pem',\n  sslKey: '~/.ssl/my-server.pem'\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', complete: true}\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', skipped: true,\n  reason: 'The selected SSH Tunnel mode is NONE.'}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n[workflow_img]: https://github.com/mongodb-js/connection-model/workflows/Check%20and%20Test/badge.svg?event=push\n[workflow_url]: https://github.com/mongodb-js/connection-model/actions?query=workflow%3A%22Check+and+Test%22\n[npm_img]: https://img.shields.io/npm/v/mongodb-connection-model.svg?style=flat-square\n[npm_url]: https://www.npmjs.org/package/mongodb-connection-model\n[gitter_img]: https://badges.gitter.im/Join%20Chat.svg\n[gitter_url]: http://gitter.im/mongodb-js/mongodb-js\n[enterprise_img]: https://img.shields.io/badge/MongoDB-Enterprise-blue.svg?style=flat-square\n[coming_soon_img]: https://img.shields.io/badge/-Coming%20Soon-ff69b4.svg?style=flat-square\n[kerberos-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/kerberos_tests.js\n[ldap-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ldap_tests.js\n[x509-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ssl_x509_tests.js\n[ns]: https://github.com/mongodb-js/ns\n[sf-ssh-tunnel]: http://serverfault.com/questions/597765/how-to-connect-to-mongodb-server-via-ssh-tunnel\n[ec2-key-pairs]: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html\n[driver-ssl-impl]: https://github.com/christkv/mongodb-core/blob/c3d21cb636d74d7a68134ecd3b9f6af536311279/lib/connection/connection.js#L365-L407\n[driver-ssl-tutorial]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/\n[driver-ssl-none]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#no-certificate-validation\n[driver-ssl-server]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate\n[driver-ssl-all]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate-and-present-valid-certificate\n","gitHead":"e30a9e850a8a66b70770fbf6658a3e35cf1ff8b8","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","test":"mocha","check":"npm run lint && npm run depcheck","pretest":"mongodb-runner install && mongodb-runner start --port=27018","test-ci":"npm run test","depcheck":"depcheck","posttest":"mongodb-runner stop --port=27018","posttest-ci":"node ../../scripts/killall-mongo.js","test-check-ci":"npm run check && npm test"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.17.0+x64 (darwin)","description":"MongoDB connection model.","directories":{},"_nodeVersion":"16.17.0","compass:main":"index.js","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","debug":"^4.2.0","lodash":"^4.17.15","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.2.0","storage-mixin":"0.0.0-next-e30a9e850a8a66b70770fbf6658a3e35cf1ff8b8","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.2","@mongodb-js/ssh-tunnel":"0.0.0-next-e30a9e850a8a66b70770fbf6658a3e35cf1ff8b8","@mongodb-js/compass-utils":"0.0.0-next-e30a9e850a8a66b70770fbf6658a3e35cf1ff8b8","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.5.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"^4.10.0","depcheck":"^1.4.1","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.9.0","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^4.10.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_0.0.0-next-e30a9e850a8a66b70770fbf6658a3e35cf1ff8b8_1664201247536_0.3063876025617356","host":"s3://npm-registry-packages"}},"0.0.0-next-25b11de63d51aa4ca7fda0f3eae67999e3418ca5":{"name":"mongodb-connection-model","version":"0.0.0-next-25b11de63d51aa4ca7fda0f3eae67999e3418ca5","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@0.0.0-next-25b11de63d51aa4ca7fda0f3eae67999e3418ca5","maintainers":[{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"iteng@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"110257c76e78c2d115d051a918d786e4baa81543","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-0.0.0-next-25b11de63d51aa4ca7fda0f3eae67999e3418ca5.tgz","fileCount":20,"integrity":"sha512-ij2ICNI7Ze7djHaF0XTm2AV8Tqwp36HbjLBZ2aR1Inyw7cBr2pPnMTFg1PCu/AcRI07qmtHK9u3qIMMkYhTIpQ==","signatures":[{"sig":"MEUCIQDBDNRInruuyZnjnnlZ1X3ydIxX7xI/FimaR3KPbOW5oAIgDLlB7I7HWURkI3v9cBVkiGHL06Yc2nJ712CZu7oFppE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":108152,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjNHwlACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrUhhAAoNgO6tjAPVWgIdZqdfWWM86epL4rBFmAGyHio/edhyScRWxr\r\nTzhihHV4QSez1d3KtYskMLgN4YB1MUZYOmoHmStrXHKGDEoO0OUhdL1jSJqu\r\n6gEsfTHYmqV+A6I7RTz3sEUqpNyRCvWGprfHqSG2dVn5UxsYa+w1U0w/ZN3i\r\nHVOiQ71u4ln8GCmP7v5lFNQkAYtYryh+QoVPmweyunBgFfJrOTeW5TSN2RLr\r\n03MPouYav6Qn4GlVrUsGjXsiLt/+LppKLlmK9NlXWqZMSCUNneLP6rvGGubV\r\nimMBLlwsj9iX4lZbiSc7nZVMmrMMM9oMLt8d2FAiean7LYy57JLkJR1nptBo\r\nzJflHNLHSZ79uYz2/aAODWqodso0WMkAlxFVqNOHOImLhk2nui5MtZ18raaX\r\nGrX0ftUIm/r678auRvTovaHYuQgyOd8TJD6klmhpwbGJpp5hOlK4WIrWk3Qs\r\nrwu31XVOth3sYH78FxGLf0Hb9re7nAwca+R4Jv7AHD3AChHHeEkDVqrsobRj\r\nq2IZo8YzJKyEfXEOXaCEUafvCQlxUdAk2YgNWnAF6Vb47cyQWInWFsphdfTc\r\n90XnTn/4QzvQFlzrtnV2FnRm6EzHRCIBdXszhQIdvJVO9AtG2hkWOsPE4x7P\r\n0bfv/XABZVETk2ttM+d96SqoJto1DnmXUoI=\r\n=iRlI\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","readme":"# mongodb-connection-model [![][workflow_img]][workflow_url] [![][npm_img]][npm_url]\n\n> MongoDB connection model\n\nThe main purpose of the MongoDB connection model is to be a domain model around a MongoDB connection. It encapsulates generating a [Connection String URI](https://docs.mongodb.com/manual/reference/connection-string/) from a group of attributes and parses URI using the [MongoDB Node.JS Driver URI Parser](https://github.com/mongodb-js/mongodb-core/blob/master/lib/uri_parser.js).\n\n## Installation\n\n```\nnpm install --save mongodb-connection-model\n```\n\n## Usage\n\n### Building URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\nconst c = new Connection({ appname: 'My App Name' });\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://localhost:27017/?readPreference=primary&appname=My%20App&ssl=false'\n```\n\n### Parsing URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\n\nConnection.from(\n  'mongodb://someUsername:testPassword@localhost',\n  (error, result) => {\n    console.log(result);\n    >>> `{\n      hosts: [{ host: 'localhost', port: 27017 }],\n      hostname: 'localhost',\n      port: 27017,\n      auth: {\n        username: 'someUsername',\n        password: 'testPassword',\n        db: 'admin'\n      },\n      isSrvRecord: false,\n      authStrategy: 'MONGODB',\n      mongodbUsername: 'someUsername',\n      mongodbPassword: 'testPassword',\n      mongodbDatabaseName: 'admin',\n      extraOptions: {},\n      connectionType: 'NODE_DRIVER',\n      readPreference: 'primary',\n      kerberosCanonicalizeHostname: false,\n      sslMethod: 'NONE',\n      sshTunnel: 'NONE',\n      sshTunnelPort: 22\n    }`\n  }\n);\n```\n\n## Properties\n\nMongoDB connection model is based on Ampersand.js framework and consist of [props](https://ampersandjs.com/docs/#ampersand-state-props) and [derived props](https://ampersandjs.com/docs/#ampersand-state-derived). The props object describes the observable properties that MongoDB connection model gets from the Node.js Driver API.\n\n```javascript\nconst с = new Connection();\nconst props = с.getAttributes({ props: true });\n```\n\n#### See Also\n\n- [URI Generic Syntax](https://tools.ietf.org/html/rfc3986)\n- [URI Options Specification](https://github.com/mongodb/specifications/blob/master/source/uri-options/uri-options.rst)\n\n### General Properties\n\n```javascript\nconst c = new Connection({ isSrvRecord: true });\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ns` | String | A valid [ns][ns] the user can read from | `undefined` |\n| `isSrvRecord` | Boolean | Indicates SRV record | `false` |\n| `auth` | Object | Authentication from driver (username, user, db, password) | `undefined` |\n| `hostname` | String | Hostname of a MongoDB Instance. In case of the replica set the first host and port will be taken | `localhost` |\n| `port` | Number | TCP port of a MongoDB Instance | `27017` |\n| `hosts` | Array | Contains all hosts and ports for replica set | `[{ host: 'localhost', port: 27017 }]` |\n| `extraOptions` | Object | Extra options passed to the node driver as part of `driverOptions` | `{}` |\n| `connectionType` | String | The desired connection type. Possible values: `NODE_DRIVER`, `STITCH_ON_PREM`, `STITCH_ATLAS` | `NODE_DRIVER` |\n| `authStrategy` | String | The desired authentication strategy. Possible values: `NONE`, `MONGODB`, `X509`, `KERBEROS`, `LDAP`, `SCRAM-SHA-256` | `NONE` |\n\n### Connection string options\n\n```javascript\nconst c = new Connection({ appname: 'My App', replicaSet: 'testing' });\n```\n\n#### General connection string options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `replicaSet` | String | Specifies the name of the replica set, if the mongod is a member of a replica set | `undefined` |\n| `connectTimeoutMS` | Number | The time in milliseconds to attempt a connection before timing out | `undefined` |\n| `socketTimeoutMS` | Number | The time in milliseconds to attempt a send or receive on a socket before the attempt times out | `undefined` |\n| `compression` | Object | Object includes compressors and a compression level. The following compressors can be specified: `snappy`, `zlib` (Available in MongoDB 3.6 or greater) | `undefined` |\n\n#### Connection Pool Option\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `maxPoolSize` | Number | The maximum number of connections in the connection pool | `undefined` |\n| `minPoolSize` | Number | The minimum number of connections in the connection pool | `undefined` |\n| `maxIdleTimeMS` | Number | The maximum number of milliseconds that a connection can remain idle in the pool before being removed and closed | `undefined` |\n| `waitQueueMultiple` | Number | A number that the driver multiples the maxPoolSize value to, to provide the maximum number of threads allowed to wait for a connection to become available from the pool | `undefined` |\n| `waitQueueTimeoutMS` | Number | The maximum time in milliseconds that a thread can wait for a connection to become available | `undefined` |\n\n#### Write Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `w` | Number/String | Corresponds to the write concern [w Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-w) | `undefined` |\n| `wTimeoutMS` | Number | Corresponds to the write concern [wtimeout](https://docs.mongodb.com/manual/reference/write-concern/#wc-wtimeout) | `undefined` |\n| `journal` | Boolean | Corresponds to the write concern [j Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-j) | `undefined` |\n\n#### Read Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readConcernLevel` | String | The level of isolation | `undefined` |\n\n#### Read Preference Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readPreference` | String | Specifies the read preferences for this connection. Possible values: `PRIMARY`, `PRIMARY_PREFERRED`, `SECONDARY`, `SECONDARY_PREFERRED`, `NEAREST` | `PRIMARY` |\n| `maxStalenessSeconds` | Number | Specifies, in seconds, how stale a secondary can be before the client stops using it for read operations | `undefined` |\n| `readPreferenceTags` | Object | Default read preference tags for the client | `undefined` |\n\n#### Authentication Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `authSource` | String | Specify the database name associated with the user’s credentials | `undefined` |\n| `authMechanism` | String | Specifies the authentication mechanism that MongoDB will use to authenticate the connection. Possible values: `DEFAULT`, `GSSAPI`, `MONGODB-X509`, `PLAIN`, `SCRAM-SHA-256` | `undefined` |\n| `authMechanismProperties` | Object | Additional options provided for authentication (e.g. to enable hostname canonicalization for GSSAPI) | `undefined` |\n| `gssapiServiceName` | String | Set the Kerberos service name when connecting to Kerberized MongoDB instances | `undefined` |\n| `gssapiServiceRealm` | String | Set the Realm service name | `undefined` |\n| `gssapiCanonicalizeHostName` | Boolean | Whether canonicalized hostname | `undefined` |\n\n#### Server Selection and Discovery Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `localThresholdMS` | Number | The size (in milliseconds) of the latency window for selecting among multiple suitable MongoDB instances | `undefined` |\n| `serverSelectionTimeoutMS` | Number | Specifies how long (in milliseconds) to block for server selection before throwing an exception | `undefined` |\n| `serverSelectionTryOnce` | Boolean | Instructs the driver to scan the MongoDB deployment exactly once after server selection fails and then either select a server or raise an error | `undefined` |\n| `heartbeatFrequencyMS` | Number | Controls when the driver checks the state of the MongoDB deployment | `undefined` |\n\n#### Miscellaneous Configuration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `appname` | String | An application name passed to server as client metadata | `undefined` |\n| `retryWrites` | Boolean | Enable retryable writes | `undefined` |\n| `uuidRepresentation` | String | The legacy representation of UUID. Possible values: `standard`, `csharpLegacy`, `javaLegacy`, `pythonLegacy` | `undefined` |\n| `loadBalanced` | Boolean | Whether or not the server is running in load balanced mode | `undefined` |\n\n### Stitch attributes\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `stitchServiceName` | String | Stitch service name | `undefined` |\n| `stitchClientAppId` | String | Stitch сlient app ID | `undefined` |\n| `stitchGroupId` | String | Stitch group ID | `undefined` |\n| `stitchBaseUrl` | String | Stitch base Url | `undefined` |\n\n### MONGODB authentication\n\n```javascript\nconst c = new Connection({\n  mongodbUsername: 'arlo',\n  mongodbPassword: 'w@of'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/?slaveOk=true&authSource=admin'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `mongodbUsername` | String | MongoDB username | `undefined` |\n| `mongodbPassword` | String | MongoDB password | `undefined` |\n| `mongodbDatabaseName` | String | The database name associated with the user's credentials | `undefined` |\n| `promoteValues` | Boolean | Whether BSON values should be promoted to their JS type counterparts | `undefined` |\n\n### KERBEROS authentication\n\n```javascript\nconst c = new Connection({\n  kerberosServiceName: 'mongodb',\n  kerberosPrincipal: 'arlo/dog@krb5.mongodb.parts',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo%252Fdog%2540krb5.mongodb.parts@localhost:27017/toys?authMechanism=GSSAPI'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n> @note (imlucas): Kerberos on Windows is broken out as it's own state for UX consideration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `kerberosServiceName` | String | Any program or computer you access over a network | `undefined` |\n| `kerberosPrincipal` | String | The format of a typical Kerberos V5 principal is `primary/instance@REALM` | `undefined` |\n| `kerberosCanonicalizeHostname` | Boolean | Whether canonicalized kerberos hostname | `undefined` |\n\n#### See Also\n\n- [node.js driver Kerberos reference](http://bit.ly/mongodb-node-driver-kerberos)\n- [node.js driver Kerberos functional test][kerberos-functional]\n\n### LDAP authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  ldapUsername: 'arlo',\n  ldapPassword: 'w@of',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/toys?slaveOk=true&authMechanism=PLAIN'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ldapUsername` | String | LDAP username | `undefined` |\n| `ldapPassword` | String | LDAP password | `undefined` |\n\n#### See Also\n\n- [node.js driver LDAP reference](http://bit.ly/mongodb-node-driver-ldap)\n- [node.js driver X509 functional test][ldap-functional]\n\n### X509 authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  x509Username: 'CN=client,OU=arlo,O=MongoDB,L=Philadelphia,ST=Pennsylvania,C=US'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://CN%253Dclient%252COU%253Darlo%252CO%253DMongoDB%252CL%253DPhiladelphia%252CST%253DPennsylvania%252CC%253DUS@localhost:27017?slaveOk=true&authMechanism=MONGODB-X509'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `x509Username` | String | The x.509 certificate derived user name, e.g. `CN=user,OU=OrgUnit,O=myOrg,...` | `undefined` |\n\n#### See Also\n\n- [node.js driver X509 reference](http://bit.ly/mongodb-node-driver-x509)\n- [node.js driver X509 functional test][x509-functional]\n\n### SSL\n\n> **Note**: Not to be confused with `authentication=X509`\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ssl` | Number/String | A boolean to enable or disables TLS/SSL for the connection | `undefined` |\n| `sslMethod` | String | The desired ssl method. Possible values: `NONE`, `SYSTEMCA`, `IFAVAILABLE`, `UNVALIDATED`, `SERVER`, `ALL` | `NONE` |\n| `sslCA` | Buffer/String | Array of valid certificates | `undefined` |\n| `sslCert` | Buffer/String | The certificate | `undefined` |\n| `sslKey` | Buffer/String | The certificate private key | `undefined` |\n| `sslPass` | Buffer/String | The certificate password | `undefined` |\n\nDescription of `sslMethod` values:\n\n- `SYSTEMCA` - SSL required, validate using System CA, with host verification.\n- `IFAVAILABLE` - The driver should try SSL first, fall back to no SSL if unavailable, and use the system's Certificate Authority.\n- `SERVER` - The driver should validate the server certificate and fail to connect if validation fails. See also [node.js driver \"Validate Server Certificate\" docs][driver-ssl-server].\n- `ALL` - The driver must present a valid certificate and validate the server certificate. See also [node.js driver \"Validate Server Certificate and Present Valid Certificate\" docs][driver-ssl-all].\n- `NONE` - No SSL (Not recommended).\n- `UNVALIDATED` - Use SSL but do not perform any validation of the certificate chain. See also [node.js driver \"No Certificate Validation\" docs][driver-ssl-none]. **Very** not recommended and likely to be deprecated in future releases because it exposes potential Man-In-The-Middle attack vectors.\n\n#### See also\n\n- [node.js driver SSL implementation][driver-ssl-impl]\n- [node.js driver SSL tutorial][driver-ssl-tutorial]\n\n### SSH TUNNEL\n\n> New in mongodb-connection-model@5.0.0\n\nBecause [authentication](#authentication) is quite difficult for operators to migrate to, the most common method of securing a MongoDB deployment is to use an [SSH tunnel][sf-ssh-tunnel].  This allows operators to leverage their existing SSH security infrastructure to also provide secure access to MongoDB.  For a standard deployment of MongoDB on AWS, this is almost always to strategy.  Because of this, we now support creating SSH tunnels automatically when connecting to MongoDB.\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options, (connectionError, client) => {\n  if (connectionError) {\n    return console.log(connectionError);\n  }\n\n  client.db('mongodb').collection('fanclub').count((countingError, count) => {\n    console.log('counted:', countingError, count);\n    client.close();\n  });\n});\n```\n\nThe above provides the same functionality as creating the tunnel using the bash\ncommand below and connecting to MongoDB via another terminal. Notice that\nconnection-model uses a random local port each time it creates a tunnel.\nUsing the command line, you'd have to replace `<random port>` with an actual\nport number.\n\n```bash\nssh -i ~/.ssh/my-key-aws-pair.pem -L <random port>:localhost:27017 ubuntu@ec2-11-111-111-111.compute-1.amazonaws.com\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `sshTunnel` | String | The desired SSH tunnel strategy. Possible values: `NONE`, `USER_PASSWORD`, `IDENTITY_FILE` | `undefined` |\n| `sshTunnelHostname` | String | The hostname of the SSH remote host | `undefined` |\n| `sshTunnelPort` | Port | The SSH port of the remote host | `22` |\n| `sshTunnelBindToLocalPort` | Port | Bind the localhost endpoint of the SSH Tunnel to this port | `undefined` |\n| `sshTunnelUsername` | String | The optional SSH username for the remote host | `undefined` |\n| `sshTunnelPassword` | String | The optional SSH password for the remote host | `undefined` |\n| `sshTunnelIdentityFile` | String/Array | The optional path to the SSH identity file for the remote host | `undefined` |\n| `sshTunnelPassphrase` | String | The optional passphrase for `sshTunnelIdentityFile` | `undefined` |\n\nDescription of `sshTunnel` values:\n\n- `NONE` - Do not use SSH tunneling.\n- `USER_PASSWORD` - The tunnel is created with SSH username and password only.\n- `IDENTITY_FILE` - The tunnel is created using an identity file.\n\n## Derived Properties\n\nDerived properties (also known as computed properties) are properties of the state object that depend on other properties to determine their value.\n\n```javascript\nconst c = new Connection();\nconst derivedProps = c.getAttributes({ derived: true });\n```\n\n| Derived Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `instanceId` | String | The mongoscope | `localhost:27017` |\n| `driverAuthMechanism` | String | Converts the value of `authStrategy` for humans into the `authMechanism` value for the driver | `undefined` |\n| `safeUrl` | String | The URL where a password is replaced with stars | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrl` | String | Use this URL in order to connect via DataService | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrlWithSsh` | String | Use this URL in order to connect via connection model itself | `mongodb://localhost:29201/?readPreference=primary&ssl=false` |\n| `driverOptions` | String | The second argument `mongoscope-server` passes to `mongodb.connect` | `{}` |\n\n## Events\n\n> New in mongodb-connection-model@5.0.0\n\n#### Example: SSH Tunnel\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', skipped: true,\n  reason: 'The selected SSL mode does not need to load any files.' }\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', complete: true}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n#### Example: SSL\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  ssl: 'ALL',\n  sslCA: '~/.ssl/my-ca.pem',\n  sslCert: '~/.ssl/my-server.pem',\n  sslKey: '~/.ssl/my-server.pem'\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', complete: true}\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', skipped: true,\n  reason: 'The selected SSH Tunnel mode is NONE.'}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n[workflow_img]: https://github.com/mongodb-js/connection-model/workflows/Check%20and%20Test/badge.svg?event=push\n[workflow_url]: https://github.com/mongodb-js/connection-model/actions?query=workflow%3A%22Check+and+Test%22\n[npm_img]: https://img.shields.io/npm/v/mongodb-connection-model.svg?style=flat-square\n[npm_url]: https://www.npmjs.org/package/mongodb-connection-model\n[gitter_img]: https://badges.gitter.im/Join%20Chat.svg\n[gitter_url]: http://gitter.im/mongodb-js/mongodb-js\n[enterprise_img]: https://img.shields.io/badge/MongoDB-Enterprise-blue.svg?style=flat-square\n[coming_soon_img]: https://img.shields.io/badge/-Coming%20Soon-ff69b4.svg?style=flat-square\n[kerberos-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/kerberos_tests.js\n[ldap-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ldap_tests.js\n[x509-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ssl_x509_tests.js\n[ns]: https://github.com/mongodb-js/ns\n[sf-ssh-tunnel]: http://serverfault.com/questions/597765/how-to-connect-to-mongodb-server-via-ssh-tunnel\n[ec2-key-pairs]: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html\n[driver-ssl-impl]: https://github.com/christkv/mongodb-core/blob/c3d21cb636d74d7a68134ecd3b9f6af536311279/lib/connection/connection.js#L365-L407\n[driver-ssl-tutorial]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/\n[driver-ssl-none]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#no-certificate-validation\n[driver-ssl-server]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate\n[driver-ssl-all]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate-and-present-valid-certificate\n","gitHead":"25b11de63d51aa4ca7fda0f3eae67999e3418ca5","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","test":"mocha","check":"npm run lint && npm run depcheck","pretest":"mongodb-runner install && mongodb-runner start --port=27018","test-ci":"npm run test","depcheck":"depcheck","posttest":"mongodb-runner stop --port=27018","posttest-ci":"node ../../scripts/killall-mongo.js","test-check-ci":"npm run check && npm test"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.17.0+x64 (linux)","description":"MongoDB connection model.","directories":{},"_nodeVersion":"16.17.0","compass:main":"index.js","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","debug":"^4.2.0","lodash":"^4.17.15","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.2.0","storage-mixin":"0.0.0-next-25b11de63d51aa4ca7fda0f3eae67999e3418ca5","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.2","@mongodb-js/ssh-tunnel":"0.0.0-next-25b11de63d51aa4ca7fda0f3eae67999e3418ca5","@mongodb-js/compass-utils":"0.0.0-next-25b11de63d51aa4ca7fda0f3eae67999e3418ca5","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.5.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"^4.10.0","depcheck":"^1.4.1","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.9.0","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^4.10.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_0.0.0-next-25b11de63d51aa4ca7fda0f3eae67999e3418ca5_1664384037193_0.8789735801134808","host":"s3://npm-registry-packages"}},"0.0.0-next-dfa464112f63969f158bde32322e393fa2b77940":{"name":"mongodb-connection-model","version":"0.0.0-next-dfa464112f63969f158bde32322e393fa2b77940","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@0.0.0-next-dfa464112f63969f158bde32322e393fa2b77940","maintainers":[{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"iteng@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"59ec736f2bf983d0e1463c28eceda6ad7def579c","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-0.0.0-next-dfa464112f63969f158bde32322e393fa2b77940.tgz","fileCount":20,"integrity":"sha512-UvJ8MlUX3cGrYqR1/OIySpXtNqQZkejTWcBSlBFQe25SUa+cYZdnThHXCAi5Y9xtfOf6YgIQAaca+Z7uGJztSQ==","signatures":[{"sig":"MEUCIDz4P4EGqYeU3ywQSxrnC+bsgeNnCZDkqPC/V8Gkwi6BAiEA1Vl6eNPxaUuzHAozJfZsIJb2rfF26gv6uwAEGI5lCoU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":108152,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjNMUlACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqnUBAAj4H19rF2G55V3MYKn9SA1DutKx0ZJx2WDXHK7DWGpM6p9EV2\r\n+PkljCZ6vjksAkxOjr6e1+3VcnUdobW1BxNn77PmRjzhmpQncm+vCj8u3ZXG\r\n46DA1O3NjzOr0Xn+SYbdz5vqHR0Pgn4VmR9B8R12yoftv9Auy9P8GR3eXDe7\r\nYb3EC6ip26JIU7juW98oneWJSI9ob3EfDwLC6MMKANoM9GGp3pEASxPW3yQB\r\nB40h/YAcFa0FghFglUEW9cLjGy4wIcrt8Rh9N1sAqL6JeHp/82ijhCfK72Ji\r\nLc93MCvT4xx053mbfpPinjAtDu/5+v292V2liLEzN3O4o5a/im212jJVTuLp\r\n6IB+CFGukAtDa9N+US2yhvDw8jctdIr35qsbCmi8ZzJQi4FhIVzkKPAf9PRr\r\na4acKNVjfSjG1xZRM8oA7zh9JeNW2KzjrOwWn1/WjitwMpmoDFI1DuVWGpBw\r\n/i826AK83ikFldw0TE7AOgtJtCD8Z1o2W1Ri3Y8QzD/UMa2vzWjahD42Cnnq\r\noGrMKk5vU66X+vel/uky+dNb6yUCVsuBRjP7DmJo0Z1KpYvaGSdfYRGfbRIj\r\nezalzbjqO7GIOjvsAi+KaPozPTTA8LWwGFh/0xrpdTyqY0IR88m1RVVoVcDw\r\nU2X3opL1DvxrV3DXSdjjMSPYG3aaXSoP/5k=\r\n=CHFf\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","readme":"# mongodb-connection-model [![][workflow_img]][workflow_url] [![][npm_img]][npm_url]\n\n> MongoDB connection model\n\nThe main purpose of the MongoDB connection model is to be a domain model around a MongoDB connection. It encapsulates generating a [Connection String URI](https://docs.mongodb.com/manual/reference/connection-string/) from a group of attributes and parses URI using the [MongoDB Node.JS Driver URI Parser](https://github.com/mongodb-js/mongodb-core/blob/master/lib/uri_parser.js).\n\n## Installation\n\n```\nnpm install --save mongodb-connection-model\n```\n\n## Usage\n\n### Building URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\nconst c = new Connection({ appname: 'My App Name' });\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://localhost:27017/?readPreference=primary&appname=My%20App&ssl=false'\n```\n\n### Parsing URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\n\nConnection.from(\n  'mongodb://someUsername:testPassword@localhost',\n  (error, result) => {\n    console.log(result);\n    >>> `{\n      hosts: [{ host: 'localhost', port: 27017 }],\n      hostname: 'localhost',\n      port: 27017,\n      auth: {\n        username: 'someUsername',\n        password: 'testPassword',\n        db: 'admin'\n      },\n      isSrvRecord: false,\n      authStrategy: 'MONGODB',\n      mongodbUsername: 'someUsername',\n      mongodbPassword: 'testPassword',\n      mongodbDatabaseName: 'admin',\n      extraOptions: {},\n      connectionType: 'NODE_DRIVER',\n      readPreference: 'primary',\n      kerberosCanonicalizeHostname: false,\n      sslMethod: 'NONE',\n      sshTunnel: 'NONE',\n      sshTunnelPort: 22\n    }`\n  }\n);\n```\n\n## Properties\n\nMongoDB connection model is based on Ampersand.js framework and consist of [props](https://ampersandjs.com/docs/#ampersand-state-props) and [derived props](https://ampersandjs.com/docs/#ampersand-state-derived). The props object describes the observable properties that MongoDB connection model gets from the Node.js Driver API.\n\n```javascript\nconst с = new Connection();\nconst props = с.getAttributes({ props: true });\n```\n\n#### See Also\n\n- [URI Generic Syntax](https://tools.ietf.org/html/rfc3986)\n- [URI Options Specification](https://github.com/mongodb/specifications/blob/master/source/uri-options/uri-options.rst)\n\n### General Properties\n\n```javascript\nconst c = new Connection({ isSrvRecord: true });\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ns` | String | A valid [ns][ns] the user can read from | `undefined` |\n| `isSrvRecord` | Boolean | Indicates SRV record | `false` |\n| `auth` | Object | Authentication from driver (username, user, db, password) | `undefined` |\n| `hostname` | String | Hostname of a MongoDB Instance. In case of the replica set the first host and port will be taken | `localhost` |\n| `port` | Number | TCP port of a MongoDB Instance | `27017` |\n| `hosts` | Array | Contains all hosts and ports for replica set | `[{ host: 'localhost', port: 27017 }]` |\n| `extraOptions` | Object | Extra options passed to the node driver as part of `driverOptions` | `{}` |\n| `connectionType` | String | The desired connection type. Possible values: `NODE_DRIVER`, `STITCH_ON_PREM`, `STITCH_ATLAS` | `NODE_DRIVER` |\n| `authStrategy` | String | The desired authentication strategy. Possible values: `NONE`, `MONGODB`, `X509`, `KERBEROS`, `LDAP`, `SCRAM-SHA-256` | `NONE` |\n\n### Connection string options\n\n```javascript\nconst c = new Connection({ appname: 'My App', replicaSet: 'testing' });\n```\n\n#### General connection string options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `replicaSet` | String | Specifies the name of the replica set, if the mongod is a member of a replica set | `undefined` |\n| `connectTimeoutMS` | Number | The time in milliseconds to attempt a connection before timing out | `undefined` |\n| `socketTimeoutMS` | Number | The time in milliseconds to attempt a send or receive on a socket before the attempt times out | `undefined` |\n| `compression` | Object | Object includes compressors and a compression level. The following compressors can be specified: `snappy`, `zlib` (Available in MongoDB 3.6 or greater) | `undefined` |\n\n#### Connection Pool Option\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `maxPoolSize` | Number | The maximum number of connections in the connection pool | `undefined` |\n| `minPoolSize` | Number | The minimum number of connections in the connection pool | `undefined` |\n| `maxIdleTimeMS` | Number | The maximum number of milliseconds that a connection can remain idle in the pool before being removed and closed | `undefined` |\n| `waitQueueMultiple` | Number | A number that the driver multiples the maxPoolSize value to, to provide the maximum number of threads allowed to wait for a connection to become available from the pool | `undefined` |\n| `waitQueueTimeoutMS` | Number | The maximum time in milliseconds that a thread can wait for a connection to become available | `undefined` |\n\n#### Write Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `w` | Number/String | Corresponds to the write concern [w Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-w) | `undefined` |\n| `wTimeoutMS` | Number | Corresponds to the write concern [wtimeout](https://docs.mongodb.com/manual/reference/write-concern/#wc-wtimeout) | `undefined` |\n| `journal` | Boolean | Corresponds to the write concern [j Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-j) | `undefined` |\n\n#### Read Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readConcernLevel` | String | The level of isolation | `undefined` |\n\n#### Read Preference Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readPreference` | String | Specifies the read preferences for this connection. Possible values: `PRIMARY`, `PRIMARY_PREFERRED`, `SECONDARY`, `SECONDARY_PREFERRED`, `NEAREST` | `PRIMARY` |\n| `maxStalenessSeconds` | Number | Specifies, in seconds, how stale a secondary can be before the client stops using it for read operations | `undefined` |\n| `readPreferenceTags` | Object | Default read preference tags for the client | `undefined` |\n\n#### Authentication Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `authSource` | String | Specify the database name associated with the user’s credentials | `undefined` |\n| `authMechanism` | String | Specifies the authentication mechanism that MongoDB will use to authenticate the connection. Possible values: `DEFAULT`, `GSSAPI`, `MONGODB-X509`, `PLAIN`, `SCRAM-SHA-256` | `undefined` |\n| `authMechanismProperties` | Object | Additional options provided for authentication (e.g. to enable hostname canonicalization for GSSAPI) | `undefined` |\n| `gssapiServiceName` | String | Set the Kerberos service name when connecting to Kerberized MongoDB instances | `undefined` |\n| `gssapiServiceRealm` | String | Set the Realm service name | `undefined` |\n| `gssapiCanonicalizeHostName` | Boolean | Whether canonicalized hostname | `undefined` |\n\n#### Server Selection and Discovery Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `localThresholdMS` | Number | The size (in milliseconds) of the latency window for selecting among multiple suitable MongoDB instances | `undefined` |\n| `serverSelectionTimeoutMS` | Number | Specifies how long (in milliseconds) to block for server selection before throwing an exception | `undefined` |\n| `serverSelectionTryOnce` | Boolean | Instructs the driver to scan the MongoDB deployment exactly once after server selection fails and then either select a server or raise an error | `undefined` |\n| `heartbeatFrequencyMS` | Number | Controls when the driver checks the state of the MongoDB deployment | `undefined` |\n\n#### Miscellaneous Configuration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `appname` | String | An application name passed to server as client metadata | `undefined` |\n| `retryWrites` | Boolean | Enable retryable writes | `undefined` |\n| `uuidRepresentation` | String | The legacy representation of UUID. Possible values: `standard`, `csharpLegacy`, `javaLegacy`, `pythonLegacy` | `undefined` |\n| `loadBalanced` | Boolean | Whether or not the server is running in load balanced mode | `undefined` |\n\n### Stitch attributes\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `stitchServiceName` | String | Stitch service name | `undefined` |\n| `stitchClientAppId` | String | Stitch сlient app ID | `undefined` |\n| `stitchGroupId` | String | Stitch group ID | `undefined` |\n| `stitchBaseUrl` | String | Stitch base Url | `undefined` |\n\n### MONGODB authentication\n\n```javascript\nconst c = new Connection({\n  mongodbUsername: 'arlo',\n  mongodbPassword: 'w@of'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/?slaveOk=true&authSource=admin'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `mongodbUsername` | String | MongoDB username | `undefined` |\n| `mongodbPassword` | String | MongoDB password | `undefined` |\n| `mongodbDatabaseName` | String | The database name associated with the user's credentials | `undefined` |\n| `promoteValues` | Boolean | Whether BSON values should be promoted to their JS type counterparts | `undefined` |\n\n### KERBEROS authentication\n\n```javascript\nconst c = new Connection({\n  kerberosServiceName: 'mongodb',\n  kerberosPrincipal: 'arlo/dog@krb5.mongodb.parts',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo%252Fdog%2540krb5.mongodb.parts@localhost:27017/toys?authMechanism=GSSAPI'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n> @note (imlucas): Kerberos on Windows is broken out as it's own state for UX consideration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `kerberosServiceName` | String | Any program or computer you access over a network | `undefined` |\n| `kerberosPrincipal` | String | The format of a typical Kerberos V5 principal is `primary/instance@REALM` | `undefined` |\n| `kerberosCanonicalizeHostname` | Boolean | Whether canonicalized kerberos hostname | `undefined` |\n\n#### See Also\n\n- [node.js driver Kerberos reference](http://bit.ly/mongodb-node-driver-kerberos)\n- [node.js driver Kerberos functional test][kerberos-functional]\n\n### LDAP authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  ldapUsername: 'arlo',\n  ldapPassword: 'w@of',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/toys?slaveOk=true&authMechanism=PLAIN'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ldapUsername` | String | LDAP username | `undefined` |\n| `ldapPassword` | String | LDAP password | `undefined` |\n\n#### See Also\n\n- [node.js driver LDAP reference](http://bit.ly/mongodb-node-driver-ldap)\n- [node.js driver X509 functional test][ldap-functional]\n\n### X509 authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  x509Username: 'CN=client,OU=arlo,O=MongoDB,L=Philadelphia,ST=Pennsylvania,C=US'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://CN%253Dclient%252COU%253Darlo%252CO%253DMongoDB%252CL%253DPhiladelphia%252CST%253DPennsylvania%252CC%253DUS@localhost:27017?slaveOk=true&authMechanism=MONGODB-X509'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `x509Username` | String | The x.509 certificate derived user name, e.g. `CN=user,OU=OrgUnit,O=myOrg,...` | `undefined` |\n\n#### See Also\n\n- [node.js driver X509 reference](http://bit.ly/mongodb-node-driver-x509)\n- [node.js driver X509 functional test][x509-functional]\n\n### SSL\n\n> **Note**: Not to be confused with `authentication=X509`\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ssl` | Number/String | A boolean to enable or disables TLS/SSL for the connection | `undefined` |\n| `sslMethod` | String | The desired ssl method. Possible values: `NONE`, `SYSTEMCA`, `IFAVAILABLE`, `UNVALIDATED`, `SERVER`, `ALL` | `NONE` |\n| `sslCA` | Buffer/String | Array of valid certificates | `undefined` |\n| `sslCert` | Buffer/String | The certificate | `undefined` |\n| `sslKey` | Buffer/String | The certificate private key | `undefined` |\n| `sslPass` | Buffer/String | The certificate password | `undefined` |\n\nDescription of `sslMethod` values:\n\n- `SYSTEMCA` - SSL required, validate using System CA, with host verification.\n- `IFAVAILABLE` - The driver should try SSL first, fall back to no SSL if unavailable, and use the system's Certificate Authority.\n- `SERVER` - The driver should validate the server certificate and fail to connect if validation fails. See also [node.js driver \"Validate Server Certificate\" docs][driver-ssl-server].\n- `ALL` - The driver must present a valid certificate and validate the server certificate. See also [node.js driver \"Validate Server Certificate and Present Valid Certificate\" docs][driver-ssl-all].\n- `NONE` - No SSL (Not recommended).\n- `UNVALIDATED` - Use SSL but do not perform any validation of the certificate chain. See also [node.js driver \"No Certificate Validation\" docs][driver-ssl-none]. **Very** not recommended and likely to be deprecated in future releases because it exposes potential Man-In-The-Middle attack vectors.\n\n#### See also\n\n- [node.js driver SSL implementation][driver-ssl-impl]\n- [node.js driver SSL tutorial][driver-ssl-tutorial]\n\n### SSH TUNNEL\n\n> New in mongodb-connection-model@5.0.0\n\nBecause [authentication](#authentication) is quite difficult for operators to migrate to, the most common method of securing a MongoDB deployment is to use an [SSH tunnel][sf-ssh-tunnel].  This allows operators to leverage their existing SSH security infrastructure to also provide secure access to MongoDB.  For a standard deployment of MongoDB on AWS, this is almost always to strategy.  Because of this, we now support creating SSH tunnels automatically when connecting to MongoDB.\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options, (connectionError, client) => {\n  if (connectionError) {\n    return console.log(connectionError);\n  }\n\n  client.db('mongodb').collection('fanclub').count((countingError, count) => {\n    console.log('counted:', countingError, count);\n    client.close();\n  });\n});\n```\n\nThe above provides the same functionality as creating the tunnel using the bash\ncommand below and connecting to MongoDB via another terminal. Notice that\nconnection-model uses a random local port each time it creates a tunnel.\nUsing the command line, you'd have to replace `<random port>` with an actual\nport number.\n\n```bash\nssh -i ~/.ssh/my-key-aws-pair.pem -L <random port>:localhost:27017 ubuntu@ec2-11-111-111-111.compute-1.amazonaws.com\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `sshTunnel` | String | The desired SSH tunnel strategy. Possible values: `NONE`, `USER_PASSWORD`, `IDENTITY_FILE` | `undefined` |\n| `sshTunnelHostname` | String | The hostname of the SSH remote host | `undefined` |\n| `sshTunnelPort` | Port | The SSH port of the remote host | `22` |\n| `sshTunnelBindToLocalPort` | Port | Bind the localhost endpoint of the SSH Tunnel to this port | `undefined` |\n| `sshTunnelUsername` | String | The optional SSH username for the remote host | `undefined` |\n| `sshTunnelPassword` | String | The optional SSH password for the remote host | `undefined` |\n| `sshTunnelIdentityFile` | String/Array | The optional path to the SSH identity file for the remote host | `undefined` |\n| `sshTunnelPassphrase` | String | The optional passphrase for `sshTunnelIdentityFile` | `undefined` |\n\nDescription of `sshTunnel` values:\n\n- `NONE` - Do not use SSH tunneling.\n- `USER_PASSWORD` - The tunnel is created with SSH username and password only.\n- `IDENTITY_FILE` - The tunnel is created using an identity file.\n\n## Derived Properties\n\nDerived properties (also known as computed properties) are properties of the state object that depend on other properties to determine their value.\n\n```javascript\nconst c = new Connection();\nconst derivedProps = c.getAttributes({ derived: true });\n```\n\n| Derived Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `instanceId` | String | The mongoscope | `localhost:27017` |\n| `driverAuthMechanism` | String | Converts the value of `authStrategy` for humans into the `authMechanism` value for the driver | `undefined` |\n| `safeUrl` | String | The URL where a password is replaced with stars | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrl` | String | Use this URL in order to connect via DataService | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrlWithSsh` | String | Use this URL in order to connect via connection model itself | `mongodb://localhost:29201/?readPreference=primary&ssl=false` |\n| `driverOptions` | String | The second argument `mongoscope-server` passes to `mongodb.connect` | `{}` |\n\n## Events\n\n> New in mongodb-connection-model@5.0.0\n\n#### Example: SSH Tunnel\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', skipped: true,\n  reason: 'The selected SSL mode does not need to load any files.' }\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', complete: true}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n#### Example: SSL\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  ssl: 'ALL',\n  sslCA: '~/.ssl/my-ca.pem',\n  sslCert: '~/.ssl/my-server.pem',\n  sslKey: '~/.ssl/my-server.pem'\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', complete: true}\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', skipped: true,\n  reason: 'The selected SSH Tunnel mode is NONE.'}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n[workflow_img]: https://github.com/mongodb-js/connection-model/workflows/Check%20and%20Test/badge.svg?event=push\n[workflow_url]: https://github.com/mongodb-js/connection-model/actions?query=workflow%3A%22Check+and+Test%22\n[npm_img]: https://img.shields.io/npm/v/mongodb-connection-model.svg?style=flat-square\n[npm_url]: https://www.npmjs.org/package/mongodb-connection-model\n[gitter_img]: https://badges.gitter.im/Join%20Chat.svg\n[gitter_url]: http://gitter.im/mongodb-js/mongodb-js\n[enterprise_img]: https://img.shields.io/badge/MongoDB-Enterprise-blue.svg?style=flat-square\n[coming_soon_img]: https://img.shields.io/badge/-Coming%20Soon-ff69b4.svg?style=flat-square\n[kerberos-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/kerberos_tests.js\n[ldap-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ldap_tests.js\n[x509-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ssl_x509_tests.js\n[ns]: https://github.com/mongodb-js/ns\n[sf-ssh-tunnel]: http://serverfault.com/questions/597765/how-to-connect-to-mongodb-server-via-ssh-tunnel\n[ec2-key-pairs]: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html\n[driver-ssl-impl]: https://github.com/christkv/mongodb-core/blob/c3d21cb636d74d7a68134ecd3b9f6af536311279/lib/connection/connection.js#L365-L407\n[driver-ssl-tutorial]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/\n[driver-ssl-none]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#no-certificate-validation\n[driver-ssl-server]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate\n[driver-ssl-all]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate-and-present-valid-certificate\n","gitHead":"dfa464112f63969f158bde32322e393fa2b77940","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","test":"mocha","check":"npm run lint && npm run depcheck","pretest":"mongodb-runner install && mongodb-runner start --port=27018","test-ci":"npm run test","depcheck":"depcheck","posttest":"mongodb-runner stop --port=27018","posttest-ci":"node ../../scripts/killall-mongo.js","test-check-ci":"npm run check && npm test"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.17.0+x64 (linux)","description":"MongoDB connection model.","directories":{},"_nodeVersion":"16.17.0","compass:main":"index.js","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","debug":"^4.2.0","lodash":"^4.17.15","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.2.0","storage-mixin":"0.0.0-next-dfa464112f63969f158bde32322e393fa2b77940","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.2","@mongodb-js/ssh-tunnel":"0.0.0-next-dfa464112f63969f158bde32322e393fa2b77940","@mongodb-js/compass-utils":"0.0.0-next-dfa464112f63969f158bde32322e393fa2b77940","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.5.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"^4.10.0","depcheck":"^1.4.1","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.9.0","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^4.10.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_0.0.0-next-dfa464112f63969f158bde32322e393fa2b77940_1664402724912_0.7429648724076405","host":"s3://npm-registry-packages"}},"0.0.0-next-e42d58083be39ce9f112e6ec7f9fd1fdcb666e3e":{"name":"mongodb-connection-model","version":"0.0.0-next-e42d58083be39ce9f112e6ec7f9fd1fdcb666e3e","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@0.0.0-next-e42d58083be39ce9f112e6ec7f9fd1fdcb666e3e","maintainers":[{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"iteng@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"1b7fdb803e57962458f53de8916aa0ac58f43a2f","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-0.0.0-next-e42d58083be39ce9f112e6ec7f9fd1fdcb666e3e.tgz","fileCount":20,"integrity":"sha512-7aBxSTg27rf0vhDfeiAz2nso7FZy85xMpKlLf1INtp29ORXoFNXOwhDyerlPeeZkij2gtN43ePYdI/VHCE/6Kg==","signatures":[{"sig":"MEUCIQCXQ/ZpPdnvHfgXz9B1h5jckZL2HRu9IDAKGDByQpJOSQIgd9TnuTQguthP1DAP10Nlhbz8qFOPR8LQw1f1XvUCXGw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":108152,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjNcLFACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqUJw//QnyoLi48xmSGS1XKhPVTxCxIO7m4ny4AYvPSjowffM3Vqtu1\r\nde6HMJLbVmtxFQjICpNsKX2C+eqXTZVGVqhAhwOxNVdlY2muv0bWnLlMk92M\r\nd9j322kz6SUoyDHLCMZ2GRNSn/hZX9ioJNlhmzSwwA5NGY/kWuUMVUuo89B8\r\nEoe9OZOsIuFJG26ZzXchR4KMVRqOL7QmfLajD+vs6lfPwsQu9Mhd1QnzE6re\r\nvCF3zP39elZtXMDD3RAB1/cYH2ngwjGgYj6EshBQDoP+6n0z/t0Ycj2ImSvT\r\nqA5IwZpQZzxbAUhg8u3ZV8KfHrlR+R923sRJ+mCJAYnOSVrzSArQiIx03r5i\r\nqVWTb2J52XX5J/RokNK6c7Nzy2k0ksTaKDCqcv/ask3lvNaZVhUbpFzIvXtb\r\n/F8MHsxGO3Dd/+skPzJ8klm6LiNnLQNCc22NXne0uNINM92jxBeOmk2Qr3xA\r\nRm/FPxqCLK6EftdyB43MHElqkBNQRyz3yZpdjX0nDumeuvLofAcGur9PsLjV\r\npzljti6Y0214oQo4sEkk4q2aVSFvH2mL2Q1ndw1RDN9B12v2pwvIYzKfsq+J\r\npNpdKlheluSXfth/04mQnuDuVfsCqDp1/xOnfaf9TXs4rYZqb41kuZebHiD+\r\njZRK4bLoiGhyvUkRSXDZ7xUxp+8k/0GHTCs=\r\n=MINZ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","readme":"# mongodb-connection-model [![][workflow_img]][workflow_url] [![][npm_img]][npm_url]\n\n> MongoDB connection model\n\nThe main purpose of the MongoDB connection model is to be a domain model around a MongoDB connection. It encapsulates generating a [Connection String URI](https://docs.mongodb.com/manual/reference/connection-string/) from a group of attributes and parses URI using the [MongoDB Node.JS Driver URI Parser](https://github.com/mongodb-js/mongodb-core/blob/master/lib/uri_parser.js).\n\n## Installation\n\n```\nnpm install --save mongodb-connection-model\n```\n\n## Usage\n\n### Building URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\nconst c = new Connection({ appname: 'My App Name' });\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://localhost:27017/?readPreference=primary&appname=My%20App&ssl=false'\n```\n\n### Parsing URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\n\nConnection.from(\n  'mongodb://someUsername:testPassword@localhost',\n  (error, result) => {\n    console.log(result);\n    >>> `{\n      hosts: [{ host: 'localhost', port: 27017 }],\n      hostname: 'localhost',\n      port: 27017,\n      auth: {\n        username: 'someUsername',\n        password: 'testPassword',\n        db: 'admin'\n      },\n      isSrvRecord: false,\n      authStrategy: 'MONGODB',\n      mongodbUsername: 'someUsername',\n      mongodbPassword: 'testPassword',\n      mongodbDatabaseName: 'admin',\n      extraOptions: {},\n      connectionType: 'NODE_DRIVER',\n      readPreference: 'primary',\n      kerberosCanonicalizeHostname: false,\n      sslMethod: 'NONE',\n      sshTunnel: 'NONE',\n      sshTunnelPort: 22\n    }`\n  }\n);\n```\n\n## Properties\n\nMongoDB connection model is based on Ampersand.js framework and consist of [props](https://ampersandjs.com/docs/#ampersand-state-props) and [derived props](https://ampersandjs.com/docs/#ampersand-state-derived). The props object describes the observable properties that MongoDB connection model gets from the Node.js Driver API.\n\n```javascript\nconst с = new Connection();\nconst props = с.getAttributes({ props: true });\n```\n\n#### See Also\n\n- [URI Generic Syntax](https://tools.ietf.org/html/rfc3986)\n- [URI Options Specification](https://github.com/mongodb/specifications/blob/master/source/uri-options/uri-options.rst)\n\n### General Properties\n\n```javascript\nconst c = new Connection({ isSrvRecord: true });\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ns` | String | A valid [ns][ns] the user can read from | `undefined` |\n| `isSrvRecord` | Boolean | Indicates SRV record | `false` |\n| `auth` | Object | Authentication from driver (username, user, db, password) | `undefined` |\n| `hostname` | String | Hostname of a MongoDB Instance. In case of the replica set the first host and port will be taken | `localhost` |\n| `port` | Number | TCP port of a MongoDB Instance | `27017` |\n| `hosts` | Array | Contains all hosts and ports for replica set | `[{ host: 'localhost', port: 27017 }]` |\n| `extraOptions` | Object | Extra options passed to the node driver as part of `driverOptions` | `{}` |\n| `connectionType` | String | The desired connection type. Possible values: `NODE_DRIVER`, `STITCH_ON_PREM`, `STITCH_ATLAS` | `NODE_DRIVER` |\n| `authStrategy` | String | The desired authentication strategy. Possible values: `NONE`, `MONGODB`, `X509`, `KERBEROS`, `LDAP`, `SCRAM-SHA-256` | `NONE` |\n\n### Connection string options\n\n```javascript\nconst c = new Connection({ appname: 'My App', replicaSet: 'testing' });\n```\n\n#### General connection string options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `replicaSet` | String | Specifies the name of the replica set, if the mongod is a member of a replica set | `undefined` |\n| `connectTimeoutMS` | Number | The time in milliseconds to attempt a connection before timing out | `undefined` |\n| `socketTimeoutMS` | Number | The time in milliseconds to attempt a send or receive on a socket before the attempt times out | `undefined` |\n| `compression` | Object | Object includes compressors and a compression level. The following compressors can be specified: `snappy`, `zlib` (Available in MongoDB 3.6 or greater) | `undefined` |\n\n#### Connection Pool Option\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `maxPoolSize` | Number | The maximum number of connections in the connection pool | `undefined` |\n| `minPoolSize` | Number | The minimum number of connections in the connection pool | `undefined` |\n| `maxIdleTimeMS` | Number | The maximum number of milliseconds that a connection can remain idle in the pool before being removed and closed | `undefined` |\n| `waitQueueMultiple` | Number | A number that the driver multiples the maxPoolSize value to, to provide the maximum number of threads allowed to wait for a connection to become available from the pool | `undefined` |\n| `waitQueueTimeoutMS` | Number | The maximum time in milliseconds that a thread can wait for a connection to become available | `undefined` |\n\n#### Write Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `w` | Number/String | Corresponds to the write concern [w Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-w) | `undefined` |\n| `wTimeoutMS` | Number | Corresponds to the write concern [wtimeout](https://docs.mongodb.com/manual/reference/write-concern/#wc-wtimeout) | `undefined` |\n| `journal` | Boolean | Corresponds to the write concern [j Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-j) | `undefined` |\n\n#### Read Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readConcernLevel` | String | The level of isolation | `undefined` |\n\n#### Read Preference Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readPreference` | String | Specifies the read preferences for this connection. Possible values: `PRIMARY`, `PRIMARY_PREFERRED`, `SECONDARY`, `SECONDARY_PREFERRED`, `NEAREST` | `PRIMARY` |\n| `maxStalenessSeconds` | Number | Specifies, in seconds, how stale a secondary can be before the client stops using it for read operations | `undefined` |\n| `readPreferenceTags` | Object | Default read preference tags for the client | `undefined` |\n\n#### Authentication Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `authSource` | String | Specify the database name associated with the user’s credentials | `undefined` |\n| `authMechanism` | String | Specifies the authentication mechanism that MongoDB will use to authenticate the connection. Possible values: `DEFAULT`, `GSSAPI`, `MONGODB-X509`, `PLAIN`, `SCRAM-SHA-256` | `undefined` |\n| `authMechanismProperties` | Object | Additional options provided for authentication (e.g. to enable hostname canonicalization for GSSAPI) | `undefined` |\n| `gssapiServiceName` | String | Set the Kerberos service name when connecting to Kerberized MongoDB instances | `undefined` |\n| `gssapiServiceRealm` | String | Set the Realm service name | `undefined` |\n| `gssapiCanonicalizeHostName` | Boolean | Whether canonicalized hostname | `undefined` |\n\n#### Server Selection and Discovery Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `localThresholdMS` | Number | The size (in milliseconds) of the latency window for selecting among multiple suitable MongoDB instances | `undefined` |\n| `serverSelectionTimeoutMS` | Number | Specifies how long (in milliseconds) to block for server selection before throwing an exception | `undefined` |\n| `serverSelectionTryOnce` | Boolean | Instructs the driver to scan the MongoDB deployment exactly once after server selection fails and then either select a server or raise an error | `undefined` |\n| `heartbeatFrequencyMS` | Number | Controls when the driver checks the state of the MongoDB deployment | `undefined` |\n\n#### Miscellaneous Configuration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `appname` | String | An application name passed to server as client metadata | `undefined` |\n| `retryWrites` | Boolean | Enable retryable writes | `undefined` |\n| `uuidRepresentation` | String | The legacy representation of UUID. Possible values: `standard`, `csharpLegacy`, `javaLegacy`, `pythonLegacy` | `undefined` |\n| `loadBalanced` | Boolean | Whether or not the server is running in load balanced mode | `undefined` |\n\n### Stitch attributes\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `stitchServiceName` | String | Stitch service name | `undefined` |\n| `stitchClientAppId` | String | Stitch сlient app ID | `undefined` |\n| `stitchGroupId` | String | Stitch group ID | `undefined` |\n| `stitchBaseUrl` | String | Stitch base Url | `undefined` |\n\n### MONGODB authentication\n\n```javascript\nconst c = new Connection({\n  mongodbUsername: 'arlo',\n  mongodbPassword: 'w@of'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/?slaveOk=true&authSource=admin'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `mongodbUsername` | String | MongoDB username | `undefined` |\n| `mongodbPassword` | String | MongoDB password | `undefined` |\n| `mongodbDatabaseName` | String | The database name associated with the user's credentials | `undefined` |\n| `promoteValues` | Boolean | Whether BSON values should be promoted to their JS type counterparts | `undefined` |\n\n### KERBEROS authentication\n\n```javascript\nconst c = new Connection({\n  kerberosServiceName: 'mongodb',\n  kerberosPrincipal: 'arlo/dog@krb5.mongodb.parts',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo%252Fdog%2540krb5.mongodb.parts@localhost:27017/toys?authMechanism=GSSAPI'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n> @note (imlucas): Kerberos on Windows is broken out as it's own state for UX consideration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `kerberosServiceName` | String | Any program or computer you access over a network | `undefined` |\n| `kerberosPrincipal` | String | The format of a typical Kerberos V5 principal is `primary/instance@REALM` | `undefined` |\n| `kerberosCanonicalizeHostname` | Boolean | Whether canonicalized kerberos hostname | `undefined` |\n\n#### See Also\n\n- [node.js driver Kerberos reference](http://bit.ly/mongodb-node-driver-kerberos)\n- [node.js driver Kerberos functional test][kerberos-functional]\n\n### LDAP authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  ldapUsername: 'arlo',\n  ldapPassword: 'w@of',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/toys?slaveOk=true&authMechanism=PLAIN'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ldapUsername` | String | LDAP username | `undefined` |\n| `ldapPassword` | String | LDAP password | `undefined` |\n\n#### See Also\n\n- [node.js driver LDAP reference](http://bit.ly/mongodb-node-driver-ldap)\n- [node.js driver X509 functional test][ldap-functional]\n\n### X509 authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  x509Username: 'CN=client,OU=arlo,O=MongoDB,L=Philadelphia,ST=Pennsylvania,C=US'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://CN%253Dclient%252COU%253Darlo%252CO%253DMongoDB%252CL%253DPhiladelphia%252CST%253DPennsylvania%252CC%253DUS@localhost:27017?slaveOk=true&authMechanism=MONGODB-X509'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `x509Username` | String | The x.509 certificate derived user name, e.g. `CN=user,OU=OrgUnit,O=myOrg,...` | `undefined` |\n\n#### See Also\n\n- [node.js driver X509 reference](http://bit.ly/mongodb-node-driver-x509)\n- [node.js driver X509 functional test][x509-functional]\n\n### SSL\n\n> **Note**: Not to be confused with `authentication=X509`\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ssl` | Number/String | A boolean to enable or disables TLS/SSL for the connection | `undefined` |\n| `sslMethod` | String | The desired ssl method. Possible values: `NONE`, `SYSTEMCA`, `IFAVAILABLE`, `UNVALIDATED`, `SERVER`, `ALL` | `NONE` |\n| `sslCA` | Buffer/String | Array of valid certificates | `undefined` |\n| `sslCert` | Buffer/String | The certificate | `undefined` |\n| `sslKey` | Buffer/String | The certificate private key | `undefined` |\n| `sslPass` | Buffer/String | The certificate password | `undefined` |\n\nDescription of `sslMethod` values:\n\n- `SYSTEMCA` - SSL required, validate using System CA, with host verification.\n- `IFAVAILABLE` - The driver should try SSL first, fall back to no SSL if unavailable, and use the system's Certificate Authority.\n- `SERVER` - The driver should validate the server certificate and fail to connect if validation fails. See also [node.js driver \"Validate Server Certificate\" docs][driver-ssl-server].\n- `ALL` - The driver must present a valid certificate and validate the server certificate. See also [node.js driver \"Validate Server Certificate and Present Valid Certificate\" docs][driver-ssl-all].\n- `NONE` - No SSL (Not recommended).\n- `UNVALIDATED` - Use SSL but do not perform any validation of the certificate chain. See also [node.js driver \"No Certificate Validation\" docs][driver-ssl-none]. **Very** not recommended and likely to be deprecated in future releases because it exposes potential Man-In-The-Middle attack vectors.\n\n#### See also\n\n- [node.js driver SSL implementation][driver-ssl-impl]\n- [node.js driver SSL tutorial][driver-ssl-tutorial]\n\n### SSH TUNNEL\n\n> New in mongodb-connection-model@5.0.0\n\nBecause [authentication](#authentication) is quite difficult for operators to migrate to, the most common method of securing a MongoDB deployment is to use an [SSH tunnel][sf-ssh-tunnel].  This allows operators to leverage their existing SSH security infrastructure to also provide secure access to MongoDB.  For a standard deployment of MongoDB on AWS, this is almost always to strategy.  Because of this, we now support creating SSH tunnels automatically when connecting to MongoDB.\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options, (connectionError, client) => {\n  if (connectionError) {\n    return console.log(connectionError);\n  }\n\n  client.db('mongodb').collection('fanclub').count((countingError, count) => {\n    console.log('counted:', countingError, count);\n    client.close();\n  });\n});\n```\n\nThe above provides the same functionality as creating the tunnel using the bash\ncommand below and connecting to MongoDB via another terminal. Notice that\nconnection-model uses a random local port each time it creates a tunnel.\nUsing the command line, you'd have to replace `<random port>` with an actual\nport number.\n\n```bash\nssh -i ~/.ssh/my-key-aws-pair.pem -L <random port>:localhost:27017 ubuntu@ec2-11-111-111-111.compute-1.amazonaws.com\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `sshTunnel` | String | The desired SSH tunnel strategy. Possible values: `NONE`, `USER_PASSWORD`, `IDENTITY_FILE` | `undefined` |\n| `sshTunnelHostname` | String | The hostname of the SSH remote host | `undefined` |\n| `sshTunnelPort` | Port | The SSH port of the remote host | `22` |\n| `sshTunnelBindToLocalPort` | Port | Bind the localhost endpoint of the SSH Tunnel to this port | `undefined` |\n| `sshTunnelUsername` | String | The optional SSH username for the remote host | `undefined` |\n| `sshTunnelPassword` | String | The optional SSH password for the remote host | `undefined` |\n| `sshTunnelIdentityFile` | String/Array | The optional path to the SSH identity file for the remote host | `undefined` |\n| `sshTunnelPassphrase` | String | The optional passphrase for `sshTunnelIdentityFile` | `undefined` |\n\nDescription of `sshTunnel` values:\n\n- `NONE` - Do not use SSH tunneling.\n- `USER_PASSWORD` - The tunnel is created with SSH username and password only.\n- `IDENTITY_FILE` - The tunnel is created using an identity file.\n\n## Derived Properties\n\nDerived properties (also known as computed properties) are properties of the state object that depend on other properties to determine their value.\n\n```javascript\nconst c = new Connection();\nconst derivedProps = c.getAttributes({ derived: true });\n```\n\n| Derived Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `instanceId` | String | The mongoscope | `localhost:27017` |\n| `driverAuthMechanism` | String | Converts the value of `authStrategy` for humans into the `authMechanism` value for the driver | `undefined` |\n| `safeUrl` | String | The URL where a password is replaced with stars | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrl` | String | Use this URL in order to connect via DataService | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrlWithSsh` | String | Use this URL in order to connect via connection model itself | `mongodb://localhost:29201/?readPreference=primary&ssl=false` |\n| `driverOptions` | String | The second argument `mongoscope-server` passes to `mongodb.connect` | `{}` |\n\n## Events\n\n> New in mongodb-connection-model@5.0.0\n\n#### Example: SSH Tunnel\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', skipped: true,\n  reason: 'The selected SSL mode does not need to load any files.' }\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', complete: true}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n#### Example: SSL\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  ssl: 'ALL',\n  sslCA: '~/.ssl/my-ca.pem',\n  sslCert: '~/.ssl/my-server.pem',\n  sslKey: '~/.ssl/my-server.pem'\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', complete: true}\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', skipped: true,\n  reason: 'The selected SSH Tunnel mode is NONE.'}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n[workflow_img]: https://github.com/mongodb-js/connection-model/workflows/Check%20and%20Test/badge.svg?event=push\n[workflow_url]: https://github.com/mongodb-js/connection-model/actions?query=workflow%3A%22Check+and+Test%22\n[npm_img]: https://img.shields.io/npm/v/mongodb-connection-model.svg?style=flat-square\n[npm_url]: https://www.npmjs.org/package/mongodb-connection-model\n[gitter_img]: https://badges.gitter.im/Join%20Chat.svg\n[gitter_url]: http://gitter.im/mongodb-js/mongodb-js\n[enterprise_img]: https://img.shields.io/badge/MongoDB-Enterprise-blue.svg?style=flat-square\n[coming_soon_img]: https://img.shields.io/badge/-Coming%20Soon-ff69b4.svg?style=flat-square\n[kerberos-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/kerberos_tests.js\n[ldap-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ldap_tests.js\n[x509-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ssl_x509_tests.js\n[ns]: https://github.com/mongodb-js/ns\n[sf-ssh-tunnel]: http://serverfault.com/questions/597765/how-to-connect-to-mongodb-server-via-ssh-tunnel\n[ec2-key-pairs]: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html\n[driver-ssl-impl]: https://github.com/christkv/mongodb-core/blob/c3d21cb636d74d7a68134ecd3b9f6af536311279/lib/connection/connection.js#L365-L407\n[driver-ssl-tutorial]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/\n[driver-ssl-none]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#no-certificate-validation\n[driver-ssl-server]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate\n[driver-ssl-all]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate-and-present-valid-certificate\n","gitHead":"e42d58083be39ce9f112e6ec7f9fd1fdcb666e3e","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","test":"mocha","check":"npm run lint && npm run depcheck","pretest":"mongodb-runner install && mongodb-runner start --port=27018","test-ci":"npm run test","depcheck":"depcheck","posttest":"mongodb-runner stop --port=27018","posttest-ci":"node ../../scripts/killall-mongo.js","test-check-ci":"npm run check && npm test"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.17.0+x64 (linux)","description":"MongoDB connection model.","directories":{},"_nodeVersion":"16.17.0","compass:main":"index.js","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","debug":"^4.2.0","lodash":"^4.17.15","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.2.0","storage-mixin":"0.0.0-next-e42d58083be39ce9f112e6ec7f9fd1fdcb666e3e","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.2","@mongodb-js/ssh-tunnel":"0.0.0-next-e42d58083be39ce9f112e6ec7f9fd1fdcb666e3e","@mongodb-js/compass-utils":"0.0.0-next-e42d58083be39ce9f112e6ec7f9fd1fdcb666e3e","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.5.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"^4.10.0","depcheck":"^1.4.1","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.9.0","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^4.10.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_0.0.0-next-e42d58083be39ce9f112e6ec7f9fd1fdcb666e3e_1664467652804_0.6104033726046694","host":"s3://npm-registry-packages"}},"0.0.0-next-5f69e8129e0242b4e507fee055188a8a83e1f1c1":{"name":"mongodb-connection-model","version":"0.0.0-next-5f69e8129e0242b4e507fee055188a8a83e1f1c1","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@0.0.0-next-5f69e8129e0242b4e507fee055188a8a83e1f1c1","maintainers":[{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"iteng@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"8d43358f52926ece77360846dcf977a843adbd72","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-0.0.0-next-5f69e8129e0242b4e507fee055188a8a83e1f1c1.tgz","fileCount":20,"integrity":"sha512-bRpUw15IWGc3LZwVfz3/HPMqbbR/XBtX+jzXV15HEnhq+QLIjngwE7fCvGjMcMglk9xC8O4PbPxDM+Ov7LLr8g==","signatures":[{"sig":"MEYCIQCf+4J74ywZwu33h8TjfffeRtuiPyeLfK4N3Av9wyUqfwIhAMjHW39dnw7TGNxkFLLCeet1XHUTDUvGlwSu/ykwC+LO","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":108152,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjPWY5ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmod0xAAj+6mz0hPBh/IqwJbyMElWp7mSA8jkBs4JYANRBTjug7iyV0W\r\nKnGemrCu1fbNxJ0oT/0AiJb8u3ZB3nKNn/Us3FJDR7fTqo5TiSN1a+4XKJ3o\r\n+ocdZuQaHkWYnLFRlTEafq335gfFoDYQ31aW71naEA4+npLVGBC91tpsB0WY\r\n0wJL2eL4pByDu/TGWkHwLHjtJZutBEo6ChXjlElSqxGUqMgwzA0b/mjWJNJs\r\ndgiKvdTLQyMyBTNrTkGnO3BzaF+pANGhb9nAfKD34sZtx3psSz2N1Uc1eOdg\r\n/AkNoX4OwbfVDjhKrK8kIB8aPKoacgMaKTFWCkaANoW5fDZOcyuw+oFAZfxl\r\nihIWH42E8XoQ25HIP1efykkSqdhBX2zBVTm36kM7VK7sbK9ulMCllbzzf42v\r\ne+5wyM2qBJinSB0hzBU2rJiwqOsluskoDDK9ZpMcJ6HwLHJmFQi0GBcL46oJ\r\n8eWfSqF21d3urrL2YGjAtZPX7S3TM9NCTmfzVAhV+BmvHTcP+ofCL+xoT2qz\r\nB/T2ZG1GwLa6XCyQIcnAkUYyeUb5HmxHtE88xbi+8dp4fYFhtX54V/mX4NLi\r\nJOZMePZ3rdeh4BeG3jQ2KtXXOM28krL00s8bgb6B53Yy2g91CkIGRuFwfyXu\r\nLn78mM1hU1hfqMIOanAGv2z/6KRMU9oibz0=\r\n=+U/M\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","readme":"# mongodb-connection-model [![][workflow_img]][workflow_url] [![][npm_img]][npm_url]\n\n> MongoDB connection model\n\nThe main purpose of the MongoDB connection model is to be a domain model around a MongoDB connection. It encapsulates generating a [Connection String URI](https://docs.mongodb.com/manual/reference/connection-string/) from a group of attributes and parses URI using the [MongoDB Node.JS Driver URI Parser](https://github.com/mongodb-js/mongodb-core/blob/master/lib/uri_parser.js).\n\n## Installation\n\n```\nnpm install --save mongodb-connection-model\n```\n\n## Usage\n\n### Building URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\nconst c = new Connection({ appname: 'My App Name' });\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://localhost:27017/?readPreference=primary&appname=My%20App&ssl=false'\n```\n\n### Parsing URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\n\nConnection.from(\n  'mongodb://someUsername:testPassword@localhost',\n  (error, result) => {\n    console.log(result);\n    >>> `{\n      hosts: [{ host: 'localhost', port: 27017 }],\n      hostname: 'localhost',\n      port: 27017,\n      auth: {\n        username: 'someUsername',\n        password: 'testPassword',\n        db: 'admin'\n      },\n      isSrvRecord: false,\n      authStrategy: 'MONGODB',\n      mongodbUsername: 'someUsername',\n      mongodbPassword: 'testPassword',\n      mongodbDatabaseName: 'admin',\n      extraOptions: {},\n      connectionType: 'NODE_DRIVER',\n      readPreference: 'primary',\n      kerberosCanonicalizeHostname: false,\n      sslMethod: 'NONE',\n      sshTunnel: 'NONE',\n      sshTunnelPort: 22\n    }`\n  }\n);\n```\n\n## Properties\n\nMongoDB connection model is based on Ampersand.js framework and consist of [props](https://ampersandjs.com/docs/#ampersand-state-props) and [derived props](https://ampersandjs.com/docs/#ampersand-state-derived). The props object describes the observable properties that MongoDB connection model gets from the Node.js Driver API.\n\n```javascript\nconst с = new Connection();\nconst props = с.getAttributes({ props: true });\n```\n\n#### See Also\n\n- [URI Generic Syntax](https://tools.ietf.org/html/rfc3986)\n- [URI Options Specification](https://github.com/mongodb/specifications/blob/master/source/uri-options/uri-options.rst)\n\n### General Properties\n\n```javascript\nconst c = new Connection({ isSrvRecord: true });\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ns` | String | A valid [ns][ns] the user can read from | `undefined` |\n| `isSrvRecord` | Boolean | Indicates SRV record | `false` |\n| `auth` | Object | Authentication from driver (username, user, db, password) | `undefined` |\n| `hostname` | String | Hostname of a MongoDB Instance. In case of the replica set the first host and port will be taken | `localhost` |\n| `port` | Number | TCP port of a MongoDB Instance | `27017` |\n| `hosts` | Array | Contains all hosts and ports for replica set | `[{ host: 'localhost', port: 27017 }]` |\n| `extraOptions` | Object | Extra options passed to the node driver as part of `driverOptions` | `{}` |\n| `connectionType` | String | The desired connection type. Possible values: `NODE_DRIVER`, `STITCH_ON_PREM`, `STITCH_ATLAS` | `NODE_DRIVER` |\n| `authStrategy` | String | The desired authentication strategy. Possible values: `NONE`, `MONGODB`, `X509`, `KERBEROS`, `LDAP`, `SCRAM-SHA-256` | `NONE` |\n\n### Connection string options\n\n```javascript\nconst c = new Connection({ appname: 'My App', replicaSet: 'testing' });\n```\n\n#### General connection string options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `replicaSet` | String | Specifies the name of the replica set, if the mongod is a member of a replica set | `undefined` |\n| `connectTimeoutMS` | Number | The time in milliseconds to attempt a connection before timing out | `undefined` |\n| `socketTimeoutMS` | Number | The time in milliseconds to attempt a send or receive on a socket before the attempt times out | `undefined` |\n| `compression` | Object | Object includes compressors and a compression level. The following compressors can be specified: `snappy`, `zlib` (Available in MongoDB 3.6 or greater) | `undefined` |\n\n#### Connection Pool Option\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `maxPoolSize` | Number | The maximum number of connections in the connection pool | `undefined` |\n| `minPoolSize` | Number | The minimum number of connections in the connection pool | `undefined` |\n| `maxIdleTimeMS` | Number | The maximum number of milliseconds that a connection can remain idle in the pool before being removed and closed | `undefined` |\n| `waitQueueMultiple` | Number | A number that the driver multiples the maxPoolSize value to, to provide the maximum number of threads allowed to wait for a connection to become available from the pool | `undefined` |\n| `waitQueueTimeoutMS` | Number | The maximum time in milliseconds that a thread can wait for a connection to become available | `undefined` |\n\n#### Write Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `w` | Number/String | Corresponds to the write concern [w Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-w) | `undefined` |\n| `wTimeoutMS` | Number | Corresponds to the write concern [wtimeout](https://docs.mongodb.com/manual/reference/write-concern/#wc-wtimeout) | `undefined` |\n| `journal` | Boolean | Corresponds to the write concern [j Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-j) | `undefined` |\n\n#### Read Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readConcernLevel` | String | The level of isolation | `undefined` |\n\n#### Read Preference Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readPreference` | String | Specifies the read preferences for this connection. Possible values: `PRIMARY`, `PRIMARY_PREFERRED`, `SECONDARY`, `SECONDARY_PREFERRED`, `NEAREST` | `PRIMARY` |\n| `maxStalenessSeconds` | Number | Specifies, in seconds, how stale a secondary can be before the client stops using it for read operations | `undefined` |\n| `readPreferenceTags` | Object | Default read preference tags for the client | `undefined` |\n\n#### Authentication Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `authSource` | String | Specify the database name associated with the user’s credentials | `undefined` |\n| `authMechanism` | String | Specifies the authentication mechanism that MongoDB will use to authenticate the connection. Possible values: `DEFAULT`, `GSSAPI`, `MONGODB-X509`, `PLAIN`, `SCRAM-SHA-256` | `undefined` |\n| `authMechanismProperties` | Object | Additional options provided for authentication (e.g. to enable hostname canonicalization for GSSAPI) | `undefined` |\n| `gssapiServiceName` | String | Set the Kerberos service name when connecting to Kerberized MongoDB instances | `undefined` |\n| `gssapiServiceRealm` | String | Set the Realm service name | `undefined` |\n| `gssapiCanonicalizeHostName` | Boolean | Whether canonicalized hostname | `undefined` |\n\n#### Server Selection and Discovery Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `localThresholdMS` | Number | The size (in milliseconds) of the latency window for selecting among multiple suitable MongoDB instances | `undefined` |\n| `serverSelectionTimeoutMS` | Number | Specifies how long (in milliseconds) to block for server selection before throwing an exception | `undefined` |\n| `serverSelectionTryOnce` | Boolean | Instructs the driver to scan the MongoDB deployment exactly once after server selection fails and then either select a server or raise an error | `undefined` |\n| `heartbeatFrequencyMS` | Number | Controls when the driver checks the state of the MongoDB deployment | `undefined` |\n\n#### Miscellaneous Configuration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `appname` | String | An application name passed to server as client metadata | `undefined` |\n| `retryWrites` | Boolean | Enable retryable writes | `undefined` |\n| `uuidRepresentation` | String | The legacy representation of UUID. Possible values: `standard`, `csharpLegacy`, `javaLegacy`, `pythonLegacy` | `undefined` |\n| `loadBalanced` | Boolean | Whether or not the server is running in load balanced mode | `undefined` |\n\n### Stitch attributes\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `stitchServiceName` | String | Stitch service name | `undefined` |\n| `stitchClientAppId` | String | Stitch сlient app ID | `undefined` |\n| `stitchGroupId` | String | Stitch group ID | `undefined` |\n| `stitchBaseUrl` | String | Stitch base Url | `undefined` |\n\n### MONGODB authentication\n\n```javascript\nconst c = new Connection({\n  mongodbUsername: 'arlo',\n  mongodbPassword: 'w@of'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/?slaveOk=true&authSource=admin'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `mongodbUsername` | String | MongoDB username | `undefined` |\n| `mongodbPassword` | String | MongoDB password | `undefined` |\n| `mongodbDatabaseName` | String | The database name associated with the user's credentials | `undefined` |\n| `promoteValues` | Boolean | Whether BSON values should be promoted to their JS type counterparts | `undefined` |\n\n### KERBEROS authentication\n\n```javascript\nconst c = new Connection({\n  kerberosServiceName: 'mongodb',\n  kerberosPrincipal: 'arlo/dog@krb5.mongodb.parts',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo%252Fdog%2540krb5.mongodb.parts@localhost:27017/toys?authMechanism=GSSAPI'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n> @note (imlucas): Kerberos on Windows is broken out as it's own state for UX consideration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `kerberosServiceName` | String | Any program or computer you access over a network | `undefined` |\n| `kerberosPrincipal` | String | The format of a typical Kerberos V5 principal is `primary/instance@REALM` | `undefined` |\n| `kerberosCanonicalizeHostname` | Boolean | Whether canonicalized kerberos hostname | `undefined` |\n\n#### See Also\n\n- [node.js driver Kerberos reference](http://bit.ly/mongodb-node-driver-kerberos)\n- [node.js driver Kerberos functional test][kerberos-functional]\n\n### LDAP authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  ldapUsername: 'arlo',\n  ldapPassword: 'w@of',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/toys?slaveOk=true&authMechanism=PLAIN'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ldapUsername` | String | LDAP username | `undefined` |\n| `ldapPassword` | String | LDAP password | `undefined` |\n\n#### See Also\n\n- [node.js driver LDAP reference](http://bit.ly/mongodb-node-driver-ldap)\n- [node.js driver X509 functional test][ldap-functional]\n\n### X509 authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  x509Username: 'CN=client,OU=arlo,O=MongoDB,L=Philadelphia,ST=Pennsylvania,C=US'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://CN%253Dclient%252COU%253Darlo%252CO%253DMongoDB%252CL%253DPhiladelphia%252CST%253DPennsylvania%252CC%253DUS@localhost:27017?slaveOk=true&authMechanism=MONGODB-X509'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `x509Username` | String | The x.509 certificate derived user name, e.g. `CN=user,OU=OrgUnit,O=myOrg,...` | `undefined` |\n\n#### See Also\n\n- [node.js driver X509 reference](http://bit.ly/mongodb-node-driver-x509)\n- [node.js driver X509 functional test][x509-functional]\n\n### SSL\n\n> **Note**: Not to be confused with `authentication=X509`\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ssl` | Number/String | A boolean to enable or disables TLS/SSL for the connection | `undefined` |\n| `sslMethod` | String | The desired ssl method. Possible values: `NONE`, `SYSTEMCA`, `IFAVAILABLE`, `UNVALIDATED`, `SERVER`, `ALL` | `NONE` |\n| `sslCA` | Buffer/String | Array of valid certificates | `undefined` |\n| `sslCert` | Buffer/String | The certificate | `undefined` |\n| `sslKey` | Buffer/String | The certificate private key | `undefined` |\n| `sslPass` | Buffer/String | The certificate password | `undefined` |\n\nDescription of `sslMethod` values:\n\n- `SYSTEMCA` - SSL required, validate using System CA, with host verification.\n- `IFAVAILABLE` - The driver should try SSL first, fall back to no SSL if unavailable, and use the system's Certificate Authority.\n- `SERVER` - The driver should validate the server certificate and fail to connect if validation fails. See also [node.js driver \"Validate Server Certificate\" docs][driver-ssl-server].\n- `ALL` - The driver must present a valid certificate and validate the server certificate. See also [node.js driver \"Validate Server Certificate and Present Valid Certificate\" docs][driver-ssl-all].\n- `NONE` - No SSL (Not recommended).\n- `UNVALIDATED` - Use SSL but do not perform any validation of the certificate chain. See also [node.js driver \"No Certificate Validation\" docs][driver-ssl-none]. **Very** not recommended and likely to be deprecated in future releases because it exposes potential Man-In-The-Middle attack vectors.\n\n#### See also\n\n- [node.js driver SSL implementation][driver-ssl-impl]\n- [node.js driver SSL tutorial][driver-ssl-tutorial]\n\n### SSH TUNNEL\n\n> New in mongodb-connection-model@5.0.0\n\nBecause [authentication](#authentication) is quite difficult for operators to migrate to, the most common method of securing a MongoDB deployment is to use an [SSH tunnel][sf-ssh-tunnel].  This allows operators to leverage their existing SSH security infrastructure to also provide secure access to MongoDB.  For a standard deployment of MongoDB on AWS, this is almost always to strategy.  Because of this, we now support creating SSH tunnels automatically when connecting to MongoDB.\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options, (connectionError, client) => {\n  if (connectionError) {\n    return console.log(connectionError);\n  }\n\n  client.db('mongodb').collection('fanclub').count((countingError, count) => {\n    console.log('counted:', countingError, count);\n    client.close();\n  });\n});\n```\n\nThe above provides the same functionality as creating the tunnel using the bash\ncommand below and connecting to MongoDB via another terminal. Notice that\nconnection-model uses a random local port each time it creates a tunnel.\nUsing the command line, you'd have to replace `<random port>` with an actual\nport number.\n\n```bash\nssh -i ~/.ssh/my-key-aws-pair.pem -L <random port>:localhost:27017 ubuntu@ec2-11-111-111-111.compute-1.amazonaws.com\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `sshTunnel` | String | The desired SSH tunnel strategy. Possible values: `NONE`, `USER_PASSWORD`, `IDENTITY_FILE` | `undefined` |\n| `sshTunnelHostname` | String | The hostname of the SSH remote host | `undefined` |\n| `sshTunnelPort` | Port | The SSH port of the remote host | `22` |\n| `sshTunnelBindToLocalPort` | Port | Bind the localhost endpoint of the SSH Tunnel to this port | `undefined` |\n| `sshTunnelUsername` | String | The optional SSH username for the remote host | `undefined` |\n| `sshTunnelPassword` | String | The optional SSH password for the remote host | `undefined` |\n| `sshTunnelIdentityFile` | String/Array | The optional path to the SSH identity file for the remote host | `undefined` |\n| `sshTunnelPassphrase` | String | The optional passphrase for `sshTunnelIdentityFile` | `undefined` |\n\nDescription of `sshTunnel` values:\n\n- `NONE` - Do not use SSH tunneling.\n- `USER_PASSWORD` - The tunnel is created with SSH username and password only.\n- `IDENTITY_FILE` - The tunnel is created using an identity file.\n\n## Derived Properties\n\nDerived properties (also known as computed properties) are properties of the state object that depend on other properties to determine their value.\n\n```javascript\nconst c = new Connection();\nconst derivedProps = c.getAttributes({ derived: true });\n```\n\n| Derived Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `instanceId` | String | The mongoscope | `localhost:27017` |\n| `driverAuthMechanism` | String | Converts the value of `authStrategy` for humans into the `authMechanism` value for the driver | `undefined` |\n| `safeUrl` | String | The URL where a password is replaced with stars | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrl` | String | Use this URL in order to connect via DataService | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrlWithSsh` | String | Use this URL in order to connect via connection model itself | `mongodb://localhost:29201/?readPreference=primary&ssl=false` |\n| `driverOptions` | String | The second argument `mongoscope-server` passes to `mongodb.connect` | `{}` |\n\n## Events\n\n> New in mongodb-connection-model@5.0.0\n\n#### Example: SSH Tunnel\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', skipped: true,\n  reason: 'The selected SSL mode does not need to load any files.' }\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', complete: true}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n#### Example: SSL\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  ssl: 'ALL',\n  sslCA: '~/.ssl/my-ca.pem',\n  sslCert: '~/.ssl/my-server.pem',\n  sslKey: '~/.ssl/my-server.pem'\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', complete: true}\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', skipped: true,\n  reason: 'The selected SSH Tunnel mode is NONE.'}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n[workflow_img]: https://github.com/mongodb-js/connection-model/workflows/Check%20and%20Test/badge.svg?event=push\n[workflow_url]: https://github.com/mongodb-js/connection-model/actions?query=workflow%3A%22Check+and+Test%22\n[npm_img]: https://img.shields.io/npm/v/mongodb-connection-model.svg?style=flat-square\n[npm_url]: https://www.npmjs.org/package/mongodb-connection-model\n[gitter_img]: https://badges.gitter.im/Join%20Chat.svg\n[gitter_url]: http://gitter.im/mongodb-js/mongodb-js\n[enterprise_img]: https://img.shields.io/badge/MongoDB-Enterprise-blue.svg?style=flat-square\n[coming_soon_img]: https://img.shields.io/badge/-Coming%20Soon-ff69b4.svg?style=flat-square\n[kerberos-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/kerberos_tests.js\n[ldap-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ldap_tests.js\n[x509-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ssl_x509_tests.js\n[ns]: https://github.com/mongodb-js/ns\n[sf-ssh-tunnel]: http://serverfault.com/questions/597765/how-to-connect-to-mongodb-server-via-ssh-tunnel\n[ec2-key-pairs]: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html\n[driver-ssl-impl]: https://github.com/christkv/mongodb-core/blob/c3d21cb636d74d7a68134ecd3b9f6af536311279/lib/connection/connection.js#L365-L407\n[driver-ssl-tutorial]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/\n[driver-ssl-none]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#no-certificate-validation\n[driver-ssl-server]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate\n[driver-ssl-all]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate-and-present-valid-certificate\n","gitHead":"5f69e8129e0242b4e507fee055188a8a83e1f1c1","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","test":"mocha","check":"npm run lint && npm run depcheck","pretest":"mongodb-runner install && mongodb-runner start --port=27018","test-ci":"npm run test","depcheck":"depcheck","posttest":"mongodb-runner stop --port=27018","posttest-ci":"node ../../scripts/killall-mongo.js","test-check-ci":"npm run check && npm test"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.17.0+x64 (linux)","description":"MongoDB connection model.","directories":{},"_nodeVersion":"16.17.0","compass:main":"index.js","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","debug":"^4.2.0","lodash":"^4.17.15","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.2.0","storage-mixin":"0.0.0-next-5f69e8129e0242b4e507fee055188a8a83e1f1c1","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.2","@mongodb-js/ssh-tunnel":"0.0.0-next-5f69e8129e0242b4e507fee055188a8a83e1f1c1","@mongodb-js/compass-utils":"0.0.0-next-5f69e8129e0242b4e507fee055188a8a83e1f1c1","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.5.4"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"^4.10.0","depcheck":"^1.4.1","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.9.0","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^4.10.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_0.0.0-next-5f69e8129e0242b4e507fee055188a8a83e1f1c1_1664968249020_0.2962012650771009","host":"s3://npm-registry-packages"}},"0.0.0-next-823f55a862f13d28437b87fb594450b2208c0d4f":{"name":"mongodb-connection-model","version":"0.0.0-next-823f55a862f13d28437b87fb594450b2208c0d4f","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@0.0.0-next-823f55a862f13d28437b87fb594450b2208c0d4f","maintainers":[{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"iteng@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"838c6e965740ae394b8b53f51cf4a10547e542b8","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-0.0.0-next-823f55a862f13d28437b87fb594450b2208c0d4f.tgz","fileCount":20,"integrity":"sha512-VcilClrrcxRfwgGOBgg7N5fwKqXlRrjjMX4Q9FtZnTHGjEXUKUuROfFK6YqNVpFktgSjIRIkqFYiSySAhp27jA==","signatures":[{"sig":"MEYCIQD/LL+kTbSqtcTOjd4OwKtxBrkcL7t7YKJ/fIXVPIrZvQIhAPQn4mz8zImOZmlOxqoFY51IO/QVnMWRt1voDsYDvGTB","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":108152,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjPa2AACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpY0Q//fDNd0Ue5Hy/0UdGKskUe90VB1yiSSwM/nxchSIBvJiRlReot\r\nXSKxCnEFKsCA8ttlE49XAEbdhgvQy7IylfjTFQXRTb5tjJ/fZ12lmcvuObt0\r\npdkrnVwSQEYoDSjvcQWBmn55sSYEc5uMSD9wLBINV3fiuGaBW/HkcQqLBAol\r\noaQZ8Kq2kZFJRKVn2WEvlUNLV9SCQgQ37t3HqUy5OxRSLbPheA7/uoTn26e0\r\ncr3yZejVaR5cXFFtII9OJk464nvWhsLmj2XawQISCQknrEenSjzwUGSaAEDI\r\nOJffOzZJKMWPbzoCY7Q6bj/AoYoAl0jNaudBa4N93vTBFL1adOMhqbhI55kv\r\n34nXnMwyazUztCm/VC1a+ET1OCvafX6dLhN7ok7ORwojdMmmCXeEBrgMxCpr\r\nD1yGhrKksPbKfdQ0BCSxibgoJ75R5XtHe5JT9q13xMQVLhsh5d5eNrlSLb9y\r\nUKT4OFP/VPJwKgN7a6y/NJYMh3mn00EaYmlYtF+WkFYB+E9TOjVnAiuWQ8I0\r\nRI1JzDzOaSHR99xfBkdBTJWUttGm8CMqKAhhrCtAaEUOxUYjZsXg9Y3Yu4TX\r\nLgBp1aiLybPamH4Bi/EnqAM0c14HtqJY0zprMIs07a2K0v2uhdxnh4gGZwma\r\nlDrgO1BKCx6ZMvTaKNO8F1dUYFf29HMsZjg=\r\n=f++X\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","readme":"# mongodb-connection-model [![][workflow_img]][workflow_url] [![][npm_img]][npm_url]\n\n> MongoDB connection model\n\nThe main purpose of the MongoDB connection model is to be a domain model around a MongoDB connection. It encapsulates generating a [Connection String URI](https://docs.mongodb.com/manual/reference/connection-string/) from a group of attributes and parses URI using the [MongoDB Node.JS Driver URI Parser](https://github.com/mongodb-js/mongodb-core/blob/master/lib/uri_parser.js).\n\n## Installation\n\n```\nnpm install --save mongodb-connection-model\n```\n\n## Usage\n\n### Building URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\nconst c = new Connection({ appname: 'My App Name' });\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://localhost:27017/?readPreference=primary&appname=My%20App&ssl=false'\n```\n\n### Parsing URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\n\nConnection.from(\n  'mongodb://someUsername:testPassword@localhost',\n  (error, result) => {\n    console.log(result);\n    >>> `{\n      hosts: [{ host: 'localhost', port: 27017 }],\n      hostname: 'localhost',\n      port: 27017,\n      auth: {\n        username: 'someUsername',\n        password: 'testPassword',\n        db: 'admin'\n      },\n      isSrvRecord: false,\n      authStrategy: 'MONGODB',\n      mongodbUsername: 'someUsername',\n      mongodbPassword: 'testPassword',\n      mongodbDatabaseName: 'admin',\n      extraOptions: {},\n      connectionType: 'NODE_DRIVER',\n      readPreference: 'primary',\n      kerberosCanonicalizeHostname: false,\n      sslMethod: 'NONE',\n      sshTunnel: 'NONE',\n      sshTunnelPort: 22\n    }`\n  }\n);\n```\n\n## Properties\n\nMongoDB connection model is based on Ampersand.js framework and consist of [props](https://ampersandjs.com/docs/#ampersand-state-props) and [derived props](https://ampersandjs.com/docs/#ampersand-state-derived). The props object describes the observable properties that MongoDB connection model gets from the Node.js Driver API.\n\n```javascript\nconst с = new Connection();\nconst props = с.getAttributes({ props: true });\n```\n\n#### See Also\n\n- [URI Generic Syntax](https://tools.ietf.org/html/rfc3986)\n- [URI Options Specification](https://github.com/mongodb/specifications/blob/master/source/uri-options/uri-options.rst)\n\n### General Properties\n\n```javascript\nconst c = new Connection({ isSrvRecord: true });\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ns` | String | A valid [ns][ns] the user can read from | `undefined` |\n| `isSrvRecord` | Boolean | Indicates SRV record | `false` |\n| `auth` | Object | Authentication from driver (username, user, db, password) | `undefined` |\n| `hostname` | String | Hostname of a MongoDB Instance. In case of the replica set the first host and port will be taken | `localhost` |\n| `port` | Number | TCP port of a MongoDB Instance | `27017` |\n| `hosts` | Array | Contains all hosts and ports for replica set | `[{ host: 'localhost', port: 27017 }]` |\n| `extraOptions` | Object | Extra options passed to the node driver as part of `driverOptions` | `{}` |\n| `connectionType` | String | The desired connection type. Possible values: `NODE_DRIVER`, `STITCH_ON_PREM`, `STITCH_ATLAS` | `NODE_DRIVER` |\n| `authStrategy` | String | The desired authentication strategy. Possible values: `NONE`, `MONGODB`, `X509`, `KERBEROS`, `LDAP`, `SCRAM-SHA-256` | `NONE` |\n\n### Connection string options\n\n```javascript\nconst c = new Connection({ appname: 'My App', replicaSet: 'testing' });\n```\n\n#### General connection string options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `replicaSet` | String | Specifies the name of the replica set, if the mongod is a member of a replica set | `undefined` |\n| `connectTimeoutMS` | Number | The time in milliseconds to attempt a connection before timing out | `undefined` |\n| `socketTimeoutMS` | Number | The time in milliseconds to attempt a send or receive on a socket before the attempt times out | `undefined` |\n| `compression` | Object | Object includes compressors and a compression level. The following compressors can be specified: `snappy`, `zlib` (Available in MongoDB 3.6 or greater) | `undefined` |\n\n#### Connection Pool Option\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `maxPoolSize` | Number | The maximum number of connections in the connection pool | `undefined` |\n| `minPoolSize` | Number | The minimum number of connections in the connection pool | `undefined` |\n| `maxIdleTimeMS` | Number | The maximum number of milliseconds that a connection can remain idle in the pool before being removed and closed | `undefined` |\n| `waitQueueMultiple` | Number | A number that the driver multiples the maxPoolSize value to, to provide the maximum number of threads allowed to wait for a connection to become available from the pool | `undefined` |\n| `waitQueueTimeoutMS` | Number | The maximum time in milliseconds that a thread can wait for a connection to become available | `undefined` |\n\n#### Write Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `w` | Number/String | Corresponds to the write concern [w Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-w) | `undefined` |\n| `wTimeoutMS` | Number | Corresponds to the write concern [wtimeout](https://docs.mongodb.com/manual/reference/write-concern/#wc-wtimeout) | `undefined` |\n| `journal` | Boolean | Corresponds to the write concern [j Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-j) | `undefined` |\n\n#### Read Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readConcernLevel` | String | The level of isolation | `undefined` |\n\n#### Read Preference Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readPreference` | String | Specifies the read preferences for this connection. Possible values: `PRIMARY`, `PRIMARY_PREFERRED`, `SECONDARY`, `SECONDARY_PREFERRED`, `NEAREST` | `PRIMARY` |\n| `maxStalenessSeconds` | Number | Specifies, in seconds, how stale a secondary can be before the client stops using it for read operations | `undefined` |\n| `readPreferenceTags` | Object | Default read preference tags for the client | `undefined` |\n\n#### Authentication Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `authSource` | String | Specify the database name associated with the user’s credentials | `undefined` |\n| `authMechanism` | String | Specifies the authentication mechanism that MongoDB will use to authenticate the connection. Possible values: `DEFAULT`, `GSSAPI`, `MONGODB-X509`, `PLAIN`, `SCRAM-SHA-256` | `undefined` |\n| `authMechanismProperties` | Object | Additional options provided for authentication (e.g. to enable hostname canonicalization for GSSAPI) | `undefined` |\n| `gssapiServiceName` | String | Set the Kerberos service name when connecting to Kerberized MongoDB instances | `undefined` |\n| `gssapiServiceRealm` | String | Set the Realm service name | `undefined` |\n| `gssapiCanonicalizeHostName` | Boolean | Whether canonicalized hostname | `undefined` |\n\n#### Server Selection and Discovery Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `localThresholdMS` | Number | The size (in milliseconds) of the latency window for selecting among multiple suitable MongoDB instances | `undefined` |\n| `serverSelectionTimeoutMS` | Number | Specifies how long (in milliseconds) to block for server selection before throwing an exception | `undefined` |\n| `serverSelectionTryOnce` | Boolean | Instructs the driver to scan the MongoDB deployment exactly once after server selection fails and then either select a server or raise an error | `undefined` |\n| `heartbeatFrequencyMS` | Number | Controls when the driver checks the state of the MongoDB deployment | `undefined` |\n\n#### Miscellaneous Configuration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `appname` | String | An application name passed to server as client metadata | `undefined` |\n| `retryWrites` | Boolean | Enable retryable writes | `undefined` |\n| `uuidRepresentation` | String | The legacy representation of UUID. Possible values: `standard`, `csharpLegacy`, `javaLegacy`, `pythonLegacy` | `undefined` |\n| `loadBalanced` | Boolean | Whether or not the server is running in load balanced mode | `undefined` |\n\n### Stitch attributes\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `stitchServiceName` | String | Stitch service name | `undefined` |\n| `stitchClientAppId` | String | Stitch сlient app ID | `undefined` |\n| `stitchGroupId` | String | Stitch group ID | `undefined` |\n| `stitchBaseUrl` | String | Stitch base Url | `undefined` |\n\n### MONGODB authentication\n\n```javascript\nconst c = new Connection({\n  mongodbUsername: 'arlo',\n  mongodbPassword: 'w@of'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/?slaveOk=true&authSource=admin'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `mongodbUsername` | String | MongoDB username | `undefined` |\n| `mongodbPassword` | String | MongoDB password | `undefined` |\n| `mongodbDatabaseName` | String | The database name associated with the user's credentials | `undefined` |\n| `promoteValues` | Boolean | Whether BSON values should be promoted to their JS type counterparts | `undefined` |\n\n### KERBEROS authentication\n\n```javascript\nconst c = new Connection({\n  kerberosServiceName: 'mongodb',\n  kerberosPrincipal: 'arlo/dog@krb5.mongodb.parts',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo%252Fdog%2540krb5.mongodb.parts@localhost:27017/toys?authMechanism=GSSAPI'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n> @note (imlucas): Kerberos on Windows is broken out as it's own state for UX consideration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `kerberosServiceName` | String | Any program or computer you access over a network | `undefined` |\n| `kerberosPrincipal` | String | The format of a typical Kerberos V5 principal is `primary/instance@REALM` | `undefined` |\n| `kerberosCanonicalizeHostname` | Boolean | Whether canonicalized kerberos hostname | `undefined` |\n\n#### See Also\n\n- [node.js driver Kerberos reference](http://bit.ly/mongodb-node-driver-kerberos)\n- [node.js driver Kerberos functional test][kerberos-functional]\n\n### LDAP authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  ldapUsername: 'arlo',\n  ldapPassword: 'w@of',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/toys?slaveOk=true&authMechanism=PLAIN'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ldapUsername` | String | LDAP username | `undefined` |\n| `ldapPassword` | String | LDAP password | `undefined` |\n\n#### See Also\n\n- [node.js driver LDAP reference](http://bit.ly/mongodb-node-driver-ldap)\n- [node.js driver X509 functional test][ldap-functional]\n\n### X509 authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  x509Username: 'CN=client,OU=arlo,O=MongoDB,L=Philadelphia,ST=Pennsylvania,C=US'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://CN%253Dclient%252COU%253Darlo%252CO%253DMongoDB%252CL%253DPhiladelphia%252CST%253DPennsylvania%252CC%253DUS@localhost:27017?slaveOk=true&authMechanism=MONGODB-X509'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `x509Username` | String | The x.509 certificate derived user name, e.g. `CN=user,OU=OrgUnit,O=myOrg,...` | `undefined` |\n\n#### See Also\n\n- [node.js driver X509 reference](http://bit.ly/mongodb-node-driver-x509)\n- [node.js driver X509 functional test][x509-functional]\n\n### SSL\n\n> **Note**: Not to be confused with `authentication=X509`\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ssl` | Number/String | A boolean to enable or disables TLS/SSL for the connection | `undefined` |\n| `sslMethod` | String | The desired ssl method. Possible values: `NONE`, `SYSTEMCA`, `IFAVAILABLE`, `UNVALIDATED`, `SERVER`, `ALL` | `NONE` |\n| `sslCA` | Buffer/String | Array of valid certificates | `undefined` |\n| `sslCert` | Buffer/String | The certificate | `undefined` |\n| `sslKey` | Buffer/String | The certificate private key | `undefined` |\n| `sslPass` | Buffer/String | The certificate password | `undefined` |\n\nDescription of `sslMethod` values:\n\n- `SYSTEMCA` - SSL required, validate using System CA, with host verification.\n- `IFAVAILABLE` - The driver should try SSL first, fall back to no SSL if unavailable, and use the system's Certificate Authority.\n- `SERVER` - The driver should validate the server certificate and fail to connect if validation fails. See also [node.js driver \"Validate Server Certificate\" docs][driver-ssl-server].\n- `ALL` - The driver must present a valid certificate and validate the server certificate. See also [node.js driver \"Validate Server Certificate and Present Valid Certificate\" docs][driver-ssl-all].\n- `NONE` - No SSL (Not recommended).\n- `UNVALIDATED` - Use SSL but do not perform any validation of the certificate chain. See also [node.js driver \"No Certificate Validation\" docs][driver-ssl-none]. **Very** not recommended and likely to be deprecated in future releases because it exposes potential Man-In-The-Middle attack vectors.\n\n#### See also\n\n- [node.js driver SSL implementation][driver-ssl-impl]\n- [node.js driver SSL tutorial][driver-ssl-tutorial]\n\n### SSH TUNNEL\n\n> New in mongodb-connection-model@5.0.0\n\nBecause [authentication](#authentication) is quite difficult for operators to migrate to, the most common method of securing a MongoDB deployment is to use an [SSH tunnel][sf-ssh-tunnel].  This allows operators to leverage their existing SSH security infrastructure to also provide secure access to MongoDB.  For a standard deployment of MongoDB on AWS, this is almost always to strategy.  Because of this, we now support creating SSH tunnels automatically when connecting to MongoDB.\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options, (connectionError, client) => {\n  if (connectionError) {\n    return console.log(connectionError);\n  }\n\n  client.db('mongodb').collection('fanclub').count((countingError, count) => {\n    console.log('counted:', countingError, count);\n    client.close();\n  });\n});\n```\n\nThe above provides the same functionality as creating the tunnel using the bash\ncommand below and connecting to MongoDB via another terminal. Notice that\nconnection-model uses a random local port each time it creates a tunnel.\nUsing the command line, you'd have to replace `<random port>` with an actual\nport number.\n\n```bash\nssh -i ~/.ssh/my-key-aws-pair.pem -L <random port>:localhost:27017 ubuntu@ec2-11-111-111-111.compute-1.amazonaws.com\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `sshTunnel` | String | The desired SSH tunnel strategy. Possible values: `NONE`, `USER_PASSWORD`, `IDENTITY_FILE` | `undefined` |\n| `sshTunnelHostname` | String | The hostname of the SSH remote host | `undefined` |\n| `sshTunnelPort` | Port | The SSH port of the remote host | `22` |\n| `sshTunnelBindToLocalPort` | Port | Bind the localhost endpoint of the SSH Tunnel to this port | `undefined` |\n| `sshTunnelUsername` | String | The optional SSH username for the remote host | `undefined` |\n| `sshTunnelPassword` | String | The optional SSH password for the remote host | `undefined` |\n| `sshTunnelIdentityFile` | String/Array | The optional path to the SSH identity file for the remote host | `undefined` |\n| `sshTunnelPassphrase` | String | The optional passphrase for `sshTunnelIdentityFile` | `undefined` |\n\nDescription of `sshTunnel` values:\n\n- `NONE` - Do not use SSH tunneling.\n- `USER_PASSWORD` - The tunnel is created with SSH username and password only.\n- `IDENTITY_FILE` - The tunnel is created using an identity file.\n\n## Derived Properties\n\nDerived properties (also known as computed properties) are properties of the state object that depend on other properties to determine their value.\n\n```javascript\nconst c = new Connection();\nconst derivedProps = c.getAttributes({ derived: true });\n```\n\n| Derived Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `instanceId` | String | The mongoscope | `localhost:27017` |\n| `driverAuthMechanism` | String | Converts the value of `authStrategy` for humans into the `authMechanism` value for the driver | `undefined` |\n| `safeUrl` | String | The URL where a password is replaced with stars | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrl` | String | Use this URL in order to connect via DataService | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrlWithSsh` | String | Use this URL in order to connect via connection model itself | `mongodb://localhost:29201/?readPreference=primary&ssl=false` |\n| `driverOptions` | String | The second argument `mongoscope-server` passes to `mongodb.connect` | `{}` |\n\n## Events\n\n> New in mongodb-connection-model@5.0.0\n\n#### Example: SSH Tunnel\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', skipped: true,\n  reason: 'The selected SSL mode does not need to load any files.' }\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', complete: true}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n#### Example: SSL\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  ssl: 'ALL',\n  sslCA: '~/.ssl/my-ca.pem',\n  sslCert: '~/.ssl/my-server.pem',\n  sslKey: '~/.ssl/my-server.pem'\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', complete: true}\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', skipped: true,\n  reason: 'The selected SSH Tunnel mode is NONE.'}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n[workflow_img]: https://github.com/mongodb-js/connection-model/workflows/Check%20and%20Test/badge.svg?event=push\n[workflow_url]: https://github.com/mongodb-js/connection-model/actions?query=workflow%3A%22Check+and+Test%22\n[npm_img]: https://img.shields.io/npm/v/mongodb-connection-model.svg?style=flat-square\n[npm_url]: https://www.npmjs.org/package/mongodb-connection-model\n[gitter_img]: https://badges.gitter.im/Join%20Chat.svg\n[gitter_url]: http://gitter.im/mongodb-js/mongodb-js\n[enterprise_img]: https://img.shields.io/badge/MongoDB-Enterprise-blue.svg?style=flat-square\n[coming_soon_img]: https://img.shields.io/badge/-Coming%20Soon-ff69b4.svg?style=flat-square\n[kerberos-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/kerberos_tests.js\n[ldap-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ldap_tests.js\n[x509-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ssl_x509_tests.js\n[ns]: https://github.com/mongodb-js/ns\n[sf-ssh-tunnel]: http://serverfault.com/questions/597765/how-to-connect-to-mongodb-server-via-ssh-tunnel\n[ec2-key-pairs]: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html\n[driver-ssl-impl]: https://github.com/christkv/mongodb-core/blob/c3d21cb636d74d7a68134ecd3b9f6af536311279/lib/connection/connection.js#L365-L407\n[driver-ssl-tutorial]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/\n[driver-ssl-none]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#no-certificate-validation\n[driver-ssl-server]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate\n[driver-ssl-all]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate-and-present-valid-certificate\n","gitHead":"823f55a862f13d28437b87fb594450b2208c0d4f","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","test":"mocha","check":"npm run lint && npm run depcheck","pretest":"mongodb-runner install && mongodb-runner start --port=27018","test-ci":"npm run test","depcheck":"depcheck","posttest":"mongodb-runner stop --port=27018","posttest-ci":"node ../../scripts/killall-mongo.js","test-check-ci":"npm run check && npm test"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.17.0+x64 (linux)","description":"MongoDB connection model.","directories":{},"_nodeVersion":"16.17.0","compass:main":"index.js","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","debug":"^4.2.0","lodash":"^4.17.15","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.2.0","storage-mixin":"0.0.0-next-823f55a862f13d28437b87fb594450b2208c0d4f","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.2","@mongodb-js/ssh-tunnel":"0.0.0-next-823f55a862f13d28437b87fb594450b2208c0d4f","@mongodb-js/compass-utils":"0.0.0-next-823f55a862f13d28437b87fb594450b2208c0d4f","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.5.4"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"^4.10.0","depcheck":"^1.4.1","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.9.0","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^4.10.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_0.0.0-next-823f55a862f13d28437b87fb594450b2208c0d4f_1664986496628_0.15579420363085927","host":"s3://npm-registry-packages"}},"0.0.0-next-01a3ac56d52443bc859ccdcf7ed301ffbdea7a47":{"name":"mongodb-connection-model","version":"0.0.0-next-01a3ac56d52443bc859ccdcf7ed301ffbdea7a47","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@0.0.0-next-01a3ac56d52443bc859ccdcf7ed301ffbdea7a47","maintainers":[{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"iteng@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"5cab49baf44bb5b0d7da865b971b3bee70e6e9e5","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-0.0.0-next-01a3ac56d52443bc859ccdcf7ed301ffbdea7a47.tgz","fileCount":20,"integrity":"sha512-cOJ0LkXnCN2gVuuUtfFc9wcdGHinMEbN3mVQGZAroHHo+oEzxKokLFHu52pN1fhWd4KzhG5DRJg6iqNr2yLN5Q==","signatures":[{"sig":"MEUCIQCbyjHd7GCFS4EgQjgWBNuikRzEWDBU4AO8KZ5ZM0NJSwIgbcoD/4QGI68sOWT3c1yrTxBhg01j2sdZXl/xGiL/jD4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":108152,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjPqQIACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmptYA/9Ferqkgt6PcucRsPAaHOhfuOJ4oyU9RysxEnTABDX1I3hyISM\r\nMISj+IBhvtyj3MQFR5QhrpdM+EoqlJCbFHcUrFJh6C+FP2/29zXbpQzMVnps\r\naEEQg48STVEhTauIi09K48kwCFc2Ox1B5ovxdlIBFm1HGR8Gu2uKABu6nTFO\r\nYjzwlekQ1Xt3D2Ys3EvamLMBZHo7nlQoRaTxbS8hBD7hfiqo/5S7iEySkHXN\r\naFV6F/GSi3a9h0UXYuCmlsOPyREwDW0CvCvJWTJtJVmo6U6xe4HCTYsSa2SB\r\nhsqP8aSo/troiYanYCjddUkK3qvFhp1KezjgqUJ23/uIRDQpZ7l8Fh45Qd7k\r\naQgOApjBm2bd8CLhdKxStGuhamGIgbzAe9LGHpW4Dn1Tv4H2a8fMTi+SJlKH\r\nOOUJ0g21BiI2MYiImCv/YYjzikMaAdXQCEkxEWBGGG7vzF38CSX0bie5gox3\r\nxkklRO0Tkgja/MMmYnRPz97a25Yg5UqyM3Ou9C7oD/GECkfC8wFphyauq/Bu\r\nkaVoItZLAQPvFE4898rQjfkFORU0pcxeF5eYa+Kniodc2JgT2WwIq1ZBLtFE\r\ny7lHtnfJUhYEAYauA5XVo/meusKOjcff/biRqY4dBlva5XOMEv0QZKMvpw6C\r\ne7w10zXDSs4JpVulGj2cYvzI+TBSmIXCtA0=\r\n=oxg8\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","readme":"# mongodb-connection-model [![][workflow_img]][workflow_url] [![][npm_img]][npm_url]\n\n> MongoDB connection model\n\nThe main purpose of the MongoDB connection model is to be a domain model around a MongoDB connection. It encapsulates generating a [Connection String URI](https://docs.mongodb.com/manual/reference/connection-string/) from a group of attributes and parses URI using the [MongoDB Node.JS Driver URI Parser](https://github.com/mongodb-js/mongodb-core/blob/master/lib/uri_parser.js).\n\n## Installation\n\n```\nnpm install --save mongodb-connection-model\n```\n\n## Usage\n\n### Building URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\nconst c = new Connection({ appname: 'My App Name' });\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://localhost:27017/?readPreference=primary&appname=My%20App&ssl=false'\n```\n\n### Parsing URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\n\nConnection.from(\n  'mongodb://someUsername:testPassword@localhost',\n  (error, result) => {\n    console.log(result);\n    >>> `{\n      hosts: [{ host: 'localhost', port: 27017 }],\n      hostname: 'localhost',\n      port: 27017,\n      auth: {\n        username: 'someUsername',\n        password: 'testPassword',\n        db: 'admin'\n      },\n      isSrvRecord: false,\n      authStrategy: 'MONGODB',\n      mongodbUsername: 'someUsername',\n      mongodbPassword: 'testPassword',\n      mongodbDatabaseName: 'admin',\n      extraOptions: {},\n      connectionType: 'NODE_DRIVER',\n      readPreference: 'primary',\n      kerberosCanonicalizeHostname: false,\n      sslMethod: 'NONE',\n      sshTunnel: 'NONE',\n      sshTunnelPort: 22\n    }`\n  }\n);\n```\n\n## Properties\n\nMongoDB connection model is based on Ampersand.js framework and consist of [props](https://ampersandjs.com/docs/#ampersand-state-props) and [derived props](https://ampersandjs.com/docs/#ampersand-state-derived). The props object describes the observable properties that MongoDB connection model gets from the Node.js Driver API.\n\n```javascript\nconst с = new Connection();\nconst props = с.getAttributes({ props: true });\n```\n\n#### See Also\n\n- [URI Generic Syntax](https://tools.ietf.org/html/rfc3986)\n- [URI Options Specification](https://github.com/mongodb/specifications/blob/master/source/uri-options/uri-options.rst)\n\n### General Properties\n\n```javascript\nconst c = new Connection({ isSrvRecord: true });\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ns` | String | A valid [ns][ns] the user can read from | `undefined` |\n| `isSrvRecord` | Boolean | Indicates SRV record | `false` |\n| `auth` | Object | Authentication from driver (username, user, db, password) | `undefined` |\n| `hostname` | String | Hostname of a MongoDB Instance. In case of the replica set the first host and port will be taken | `localhost` |\n| `port` | Number | TCP port of a MongoDB Instance | `27017` |\n| `hosts` | Array | Contains all hosts and ports for replica set | `[{ host: 'localhost', port: 27017 }]` |\n| `extraOptions` | Object | Extra options passed to the node driver as part of `driverOptions` | `{}` |\n| `connectionType` | String | The desired connection type. Possible values: `NODE_DRIVER`, `STITCH_ON_PREM`, `STITCH_ATLAS` | `NODE_DRIVER` |\n| `authStrategy` | String | The desired authentication strategy. Possible values: `NONE`, `MONGODB`, `X509`, `KERBEROS`, `LDAP`, `SCRAM-SHA-256` | `NONE` |\n\n### Connection string options\n\n```javascript\nconst c = new Connection({ appname: 'My App', replicaSet: 'testing' });\n```\n\n#### General connection string options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `replicaSet` | String | Specifies the name of the replica set, if the mongod is a member of a replica set | `undefined` |\n| `connectTimeoutMS` | Number | The time in milliseconds to attempt a connection before timing out | `undefined` |\n| `socketTimeoutMS` | Number | The time in milliseconds to attempt a send or receive on a socket before the attempt times out | `undefined` |\n| `compression` | Object | Object includes compressors and a compression level. The following compressors can be specified: `snappy`, `zlib` (Available in MongoDB 3.6 or greater) | `undefined` |\n\n#### Connection Pool Option\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `maxPoolSize` | Number | The maximum number of connections in the connection pool | `undefined` |\n| `minPoolSize` | Number | The minimum number of connections in the connection pool | `undefined` |\n| `maxIdleTimeMS` | Number | The maximum number of milliseconds that a connection can remain idle in the pool before being removed and closed | `undefined` |\n| `waitQueueMultiple` | Number | A number that the driver multiples the maxPoolSize value to, to provide the maximum number of threads allowed to wait for a connection to become available from the pool | `undefined` |\n| `waitQueueTimeoutMS` | Number | The maximum time in milliseconds that a thread can wait for a connection to become available | `undefined` |\n\n#### Write Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `w` | Number/String | Corresponds to the write concern [w Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-w) | `undefined` |\n| `wTimeoutMS` | Number | Corresponds to the write concern [wtimeout](https://docs.mongodb.com/manual/reference/write-concern/#wc-wtimeout) | `undefined` |\n| `journal` | Boolean | Corresponds to the write concern [j Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-j) | `undefined` |\n\n#### Read Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readConcernLevel` | String | The level of isolation | `undefined` |\n\n#### Read Preference Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readPreference` | String | Specifies the read preferences for this connection. Possible values: `PRIMARY`, `PRIMARY_PREFERRED`, `SECONDARY`, `SECONDARY_PREFERRED`, `NEAREST` | `PRIMARY` |\n| `maxStalenessSeconds` | Number | Specifies, in seconds, how stale a secondary can be before the client stops using it for read operations | `undefined` |\n| `readPreferenceTags` | Object | Default read preference tags for the client | `undefined` |\n\n#### Authentication Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `authSource` | String | Specify the database name associated with the user’s credentials | `undefined` |\n| `authMechanism` | String | Specifies the authentication mechanism that MongoDB will use to authenticate the connection. Possible values: `DEFAULT`, `GSSAPI`, `MONGODB-X509`, `PLAIN`, `SCRAM-SHA-256` | `undefined` |\n| `authMechanismProperties` | Object | Additional options provided for authentication (e.g. to enable hostname canonicalization for GSSAPI) | `undefined` |\n| `gssapiServiceName` | String | Set the Kerberos service name when connecting to Kerberized MongoDB instances | `undefined` |\n| `gssapiServiceRealm` | String | Set the Realm service name | `undefined` |\n| `gssapiCanonicalizeHostName` | Boolean | Whether canonicalized hostname | `undefined` |\n\n#### Server Selection and Discovery Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `localThresholdMS` | Number | The size (in milliseconds) of the latency window for selecting among multiple suitable MongoDB instances | `undefined` |\n| `serverSelectionTimeoutMS` | Number | Specifies how long (in milliseconds) to block for server selection before throwing an exception | `undefined` |\n| `serverSelectionTryOnce` | Boolean | Instructs the driver to scan the MongoDB deployment exactly once after server selection fails and then either select a server or raise an error | `undefined` |\n| `heartbeatFrequencyMS` | Number | Controls when the driver checks the state of the MongoDB deployment | `undefined` |\n\n#### Miscellaneous Configuration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `appname` | String | An application name passed to server as client metadata | `undefined` |\n| `retryWrites` | Boolean | Enable retryable writes | `undefined` |\n| `uuidRepresentation` | String | The legacy representation of UUID. Possible values: `standard`, `csharpLegacy`, `javaLegacy`, `pythonLegacy` | `undefined` |\n| `loadBalanced` | Boolean | Whether or not the server is running in load balanced mode | `undefined` |\n\n### Stitch attributes\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `stitchServiceName` | String | Stitch service name | `undefined` |\n| `stitchClientAppId` | String | Stitch сlient app ID | `undefined` |\n| `stitchGroupId` | String | Stitch group ID | `undefined` |\n| `stitchBaseUrl` | String | Stitch base Url | `undefined` |\n\n### MONGODB authentication\n\n```javascript\nconst c = new Connection({\n  mongodbUsername: 'arlo',\n  mongodbPassword: 'w@of'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/?slaveOk=true&authSource=admin'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `mongodbUsername` | String | MongoDB username | `undefined` |\n| `mongodbPassword` | String | MongoDB password | `undefined` |\n| `mongodbDatabaseName` | String | The database name associated with the user's credentials | `undefined` |\n| `promoteValues` | Boolean | Whether BSON values should be promoted to their JS type counterparts | `undefined` |\n\n### KERBEROS authentication\n\n```javascript\nconst c = new Connection({\n  kerberosServiceName: 'mongodb',\n  kerberosPrincipal: 'arlo/dog@krb5.mongodb.parts',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo%252Fdog%2540krb5.mongodb.parts@localhost:27017/toys?authMechanism=GSSAPI'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n> @note (imlucas): Kerberos on Windows is broken out as it's own state for UX consideration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `kerberosServiceName` | String | Any program or computer you access over a network | `undefined` |\n| `kerberosPrincipal` | String | The format of a typical Kerberos V5 principal is `primary/instance@REALM` | `undefined` |\n| `kerberosCanonicalizeHostname` | Boolean | Whether canonicalized kerberos hostname | `undefined` |\n\n#### See Also\n\n- [node.js driver Kerberos reference](http://bit.ly/mongodb-node-driver-kerberos)\n- [node.js driver Kerberos functional test][kerberos-functional]\n\n### LDAP authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  ldapUsername: 'arlo',\n  ldapPassword: 'w@of',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/toys?slaveOk=true&authMechanism=PLAIN'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ldapUsername` | String | LDAP username | `undefined` |\n| `ldapPassword` | String | LDAP password | `undefined` |\n\n#### See Also\n\n- [node.js driver LDAP reference](http://bit.ly/mongodb-node-driver-ldap)\n- [node.js driver X509 functional test][ldap-functional]\n\n### X509 authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  x509Username: 'CN=client,OU=arlo,O=MongoDB,L=Philadelphia,ST=Pennsylvania,C=US'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://CN%253Dclient%252COU%253Darlo%252CO%253DMongoDB%252CL%253DPhiladelphia%252CST%253DPennsylvania%252CC%253DUS@localhost:27017?slaveOk=true&authMechanism=MONGODB-X509'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `x509Username` | String | The x.509 certificate derived user name, e.g. `CN=user,OU=OrgUnit,O=myOrg,...` | `undefined` |\n\n#### See Also\n\n- [node.js driver X509 reference](http://bit.ly/mongodb-node-driver-x509)\n- [node.js driver X509 functional test][x509-functional]\n\n### SSL\n\n> **Note**: Not to be confused with `authentication=X509`\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ssl` | Number/String | A boolean to enable or disables TLS/SSL for the connection | `undefined` |\n| `sslMethod` | String | The desired ssl method. Possible values: `NONE`, `SYSTEMCA`, `IFAVAILABLE`, `UNVALIDATED`, `SERVER`, `ALL` | `NONE` |\n| `sslCA` | Buffer/String | Array of valid certificates | `undefined` |\n| `sslCert` | Buffer/String | The certificate | `undefined` |\n| `sslKey` | Buffer/String | The certificate private key | `undefined` |\n| `sslPass` | Buffer/String | The certificate password | `undefined` |\n\nDescription of `sslMethod` values:\n\n- `SYSTEMCA` - SSL required, validate using System CA, with host verification.\n- `IFAVAILABLE` - The driver should try SSL first, fall back to no SSL if unavailable, and use the system's Certificate Authority.\n- `SERVER` - The driver should validate the server certificate and fail to connect if validation fails. See also [node.js driver \"Validate Server Certificate\" docs][driver-ssl-server].\n- `ALL` - The driver must present a valid certificate and validate the server certificate. See also [node.js driver \"Validate Server Certificate and Present Valid Certificate\" docs][driver-ssl-all].\n- `NONE` - No SSL (Not recommended).\n- `UNVALIDATED` - Use SSL but do not perform any validation of the certificate chain. See also [node.js driver \"No Certificate Validation\" docs][driver-ssl-none]. **Very** not recommended and likely to be deprecated in future releases because it exposes potential Man-In-The-Middle attack vectors.\n\n#### See also\n\n- [node.js driver SSL implementation][driver-ssl-impl]\n- [node.js driver SSL tutorial][driver-ssl-tutorial]\n\n### SSH TUNNEL\n\n> New in mongodb-connection-model@5.0.0\n\nBecause [authentication](#authentication) is quite difficult for operators to migrate to, the most common method of securing a MongoDB deployment is to use an [SSH tunnel][sf-ssh-tunnel].  This allows operators to leverage their existing SSH security infrastructure to also provide secure access to MongoDB.  For a standard deployment of MongoDB on AWS, this is almost always to strategy.  Because of this, we now support creating SSH tunnels automatically when connecting to MongoDB.\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options, (connectionError, client) => {\n  if (connectionError) {\n    return console.log(connectionError);\n  }\n\n  client.db('mongodb').collection('fanclub').count((countingError, count) => {\n    console.log('counted:', countingError, count);\n    client.close();\n  });\n});\n```\n\nThe above provides the same functionality as creating the tunnel using the bash\ncommand below and connecting to MongoDB via another terminal. Notice that\nconnection-model uses a random local port each time it creates a tunnel.\nUsing the command line, you'd have to replace `<random port>` with an actual\nport number.\n\n```bash\nssh -i ~/.ssh/my-key-aws-pair.pem -L <random port>:localhost:27017 ubuntu@ec2-11-111-111-111.compute-1.amazonaws.com\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `sshTunnel` | String | The desired SSH tunnel strategy. Possible values: `NONE`, `USER_PASSWORD`, `IDENTITY_FILE` | `undefined` |\n| `sshTunnelHostname` | String | The hostname of the SSH remote host | `undefined` |\n| `sshTunnelPort` | Port | The SSH port of the remote host | `22` |\n| `sshTunnelBindToLocalPort` | Port | Bind the localhost endpoint of the SSH Tunnel to this port | `undefined` |\n| `sshTunnelUsername` | String | The optional SSH username for the remote host | `undefined` |\n| `sshTunnelPassword` | String | The optional SSH password for the remote host | `undefined` |\n| `sshTunnelIdentityFile` | String/Array | The optional path to the SSH identity file for the remote host | `undefined` |\n| `sshTunnelPassphrase` | String | The optional passphrase for `sshTunnelIdentityFile` | `undefined` |\n\nDescription of `sshTunnel` values:\n\n- `NONE` - Do not use SSH tunneling.\n- `USER_PASSWORD` - The tunnel is created with SSH username and password only.\n- `IDENTITY_FILE` - The tunnel is created using an identity file.\n\n## Derived Properties\n\nDerived properties (also known as computed properties) are properties of the state object that depend on other properties to determine their value.\n\n```javascript\nconst c = new Connection();\nconst derivedProps = c.getAttributes({ derived: true });\n```\n\n| Derived Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `instanceId` | String | The mongoscope | `localhost:27017` |\n| `driverAuthMechanism` | String | Converts the value of `authStrategy` for humans into the `authMechanism` value for the driver | `undefined` |\n| `safeUrl` | String | The URL where a password is replaced with stars | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrl` | String | Use this URL in order to connect via DataService | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrlWithSsh` | String | Use this URL in order to connect via connection model itself | `mongodb://localhost:29201/?readPreference=primary&ssl=false` |\n| `driverOptions` | String | The second argument `mongoscope-server` passes to `mongodb.connect` | `{}` |\n\n## Events\n\n> New in mongodb-connection-model@5.0.0\n\n#### Example: SSH Tunnel\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', skipped: true,\n  reason: 'The selected SSL mode does not need to load any files.' }\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', complete: true}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n#### Example: SSL\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  ssl: 'ALL',\n  sslCA: '~/.ssl/my-ca.pem',\n  sslCert: '~/.ssl/my-server.pem',\n  sslKey: '~/.ssl/my-server.pem'\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', complete: true}\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', skipped: true,\n  reason: 'The selected SSH Tunnel mode is NONE.'}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n[workflow_img]: https://github.com/mongodb-js/connection-model/workflows/Check%20and%20Test/badge.svg?event=push\n[workflow_url]: https://github.com/mongodb-js/connection-model/actions?query=workflow%3A%22Check+and+Test%22\n[npm_img]: https://img.shields.io/npm/v/mongodb-connection-model.svg?style=flat-square\n[npm_url]: https://www.npmjs.org/package/mongodb-connection-model\n[gitter_img]: https://badges.gitter.im/Join%20Chat.svg\n[gitter_url]: http://gitter.im/mongodb-js/mongodb-js\n[enterprise_img]: https://img.shields.io/badge/MongoDB-Enterprise-blue.svg?style=flat-square\n[coming_soon_img]: https://img.shields.io/badge/-Coming%20Soon-ff69b4.svg?style=flat-square\n[kerberos-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/kerberos_tests.js\n[ldap-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ldap_tests.js\n[x509-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ssl_x509_tests.js\n[ns]: https://github.com/mongodb-js/ns\n[sf-ssh-tunnel]: http://serverfault.com/questions/597765/how-to-connect-to-mongodb-server-via-ssh-tunnel\n[ec2-key-pairs]: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html\n[driver-ssl-impl]: https://github.com/christkv/mongodb-core/blob/c3d21cb636d74d7a68134ecd3b9f6af536311279/lib/connection/connection.js#L365-L407\n[driver-ssl-tutorial]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/\n[driver-ssl-none]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#no-certificate-validation\n[driver-ssl-server]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate\n[driver-ssl-all]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate-and-present-valid-certificate\n","gitHead":"01a3ac56d52443bc859ccdcf7ed301ffbdea7a47","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","test":"mocha","check":"npm run lint && npm run depcheck","pretest":"mongodb-runner install && mongodb-runner start --port=27018","test-ci":"npm run test","depcheck":"depcheck","posttest":"mongodb-runner stop --port=27018","posttest-ci":"node ../../scripts/killall-mongo.js","test-check-ci":"npm run check && npm test"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.17.0+x64 (linux)","description":"MongoDB connection model.","directories":{},"_nodeVersion":"16.17.0","compass:main":"index.js","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","debug":"^4.2.0","lodash":"^4.17.15","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.2.0","storage-mixin":"0.0.0-next-01a3ac56d52443bc859ccdcf7ed301ffbdea7a47","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.2","@mongodb-js/ssh-tunnel":"0.0.0-next-01a3ac56d52443bc859ccdcf7ed301ffbdea7a47","@mongodb-js/compass-utils":"0.0.0-next-01a3ac56d52443bc859ccdcf7ed301ffbdea7a47","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.5.4"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"^4.10.0","depcheck":"^1.4.1","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.9.0","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^4.10.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_0.0.0-next-01a3ac56d52443bc859ccdcf7ed301ffbdea7a47_1665049608593_0.6830089571958458","host":"s3://npm-registry-packages"}},"0.0.0-next-cd3c5c1303c464ef7900dc08adb8154d15c7f3a9":{"name":"mongodb-connection-model","version":"0.0.0-next-cd3c5c1303c464ef7900dc08adb8154d15c7f3a9","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@0.0.0-next-cd3c5c1303c464ef7900dc08adb8154d15c7f3a9","maintainers":[{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"iteng@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"1182bdbecc5ee3e6e3e7080193b510582713fd88","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-0.0.0-next-cd3c5c1303c464ef7900dc08adb8154d15c7f3a9.tgz","fileCount":20,"integrity":"sha512-7KXviCtE+17IPVLBlJC0GTpge+jNdvyQXbmurKipe1Eyk6kqur1p/XQUYhc8lgB3Lp07vCZXkgBgsdxjIVXnkg==","signatures":[{"sig":"MEUCIDd68YnAONMlgkNkVznkiMKiZR9XDWOPWqjDY3D63YjYAiEAtrhg+sUHKhSjl7/fM55meyokcLuUbGAxBzNwPIx4IIU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":108152,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjPumzACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrZMBAAj4LXeZasGz1B5Y9Fzt1p5zMiVLNI8wzLosuibriTOw+K2av1\r\nUlRsDlfZn6cwakDZ7LRo7DdiYJVoG09tQWs1DR8gaflMkgHU8vUajevReMiZ\r\nTXr37KmSe+MXXR6HpREZXDRttj168zhK5d3b6FE4AhozPcdNpH7xJXdQ82EJ\r\n0i7DvmUeChauha35a8WhaGDt6ux5SRpRjIaYo3+tS1KIk8oZyc+sQrr6xi8M\r\nmtT9AKzXMv10nHoc0KUvphVH6mBmfAsmmpQnsYvWfara874EsfdmeZIjrlLK\r\nZzZc+IrssyVU+zsXais49lzgZwpJISSN1T8iggeGr363kGwgdPeeZnpQAuhQ\r\nsmVA3dvkmn8eKuU7U0dk7P2XN22Sb+C3Z/rlI3brzefhNXb2Cz4s8uxgl8gJ\r\nAzNmwb/0PUfhfNa/Az2RRwi7zagXHFxIqeY2XzwCY+DvFVB3FwXgJdh37XT+\r\n4UucOsEsIc5ITl+CvZGNTzKc3qdi4PhfEVhh+1PTKE10QmmZK94kY1whm9lJ\r\nnvBgMBI+7LK+3anfuAJlPDkM6zjiWnyAo4V9h7ayibltDbZaiUwWRT0Z8ali\r\n7+HWVW3QcP7EQPOhK0WuEkggJLpktWyfotAXWH3snKFPV+JD04EAjgo8JAp7\r\npBvz6GmZb2jo99jCD1dZYc6GQtMz/47l6HM=\r\n=cXgD\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","readme":"# mongodb-connection-model [![][workflow_img]][workflow_url] [![][npm_img]][npm_url]\n\n> MongoDB connection model\n\nThe main purpose of the MongoDB connection model is to be a domain model around a MongoDB connection. It encapsulates generating a [Connection String URI](https://docs.mongodb.com/manual/reference/connection-string/) from a group of attributes and parses URI using the [MongoDB Node.JS Driver URI Parser](https://github.com/mongodb-js/mongodb-core/blob/master/lib/uri_parser.js).\n\n## Installation\n\n```\nnpm install --save mongodb-connection-model\n```\n\n## Usage\n\n### Building URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\nconst c = new Connection({ appname: 'My App Name' });\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://localhost:27017/?readPreference=primary&appname=My%20App&ssl=false'\n```\n\n### Parsing URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\n\nConnection.from(\n  'mongodb://someUsername:testPassword@localhost',\n  (error, result) => {\n    console.log(result);\n    >>> `{\n      hosts: [{ host: 'localhost', port: 27017 }],\n      hostname: 'localhost',\n      port: 27017,\n      auth: {\n        username: 'someUsername',\n        password: 'testPassword',\n        db: 'admin'\n      },\n      isSrvRecord: false,\n      authStrategy: 'MONGODB',\n      mongodbUsername: 'someUsername',\n      mongodbPassword: 'testPassword',\n      mongodbDatabaseName: 'admin',\n      extraOptions: {},\n      connectionType: 'NODE_DRIVER',\n      readPreference: 'primary',\n      kerberosCanonicalizeHostname: false,\n      sslMethod: 'NONE',\n      sshTunnel: 'NONE',\n      sshTunnelPort: 22\n    }`\n  }\n);\n```\n\n## Properties\n\nMongoDB connection model is based on Ampersand.js framework and consist of [props](https://ampersandjs.com/docs/#ampersand-state-props) and [derived props](https://ampersandjs.com/docs/#ampersand-state-derived). The props object describes the observable properties that MongoDB connection model gets from the Node.js Driver API.\n\n```javascript\nconst с = new Connection();\nconst props = с.getAttributes({ props: true });\n```\n\n#### See Also\n\n- [URI Generic Syntax](https://tools.ietf.org/html/rfc3986)\n- [URI Options Specification](https://github.com/mongodb/specifications/blob/master/source/uri-options/uri-options.rst)\n\n### General Properties\n\n```javascript\nconst c = new Connection({ isSrvRecord: true });\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ns` | String | A valid [ns][ns] the user can read from | `undefined` |\n| `isSrvRecord` | Boolean | Indicates SRV record | `false` |\n| `auth` | Object | Authentication from driver (username, user, db, password) | `undefined` |\n| `hostname` | String | Hostname of a MongoDB Instance. In case of the replica set the first host and port will be taken | `localhost` |\n| `port` | Number | TCP port of a MongoDB Instance | `27017` |\n| `hosts` | Array | Contains all hosts and ports for replica set | `[{ host: 'localhost', port: 27017 }]` |\n| `extraOptions` | Object | Extra options passed to the node driver as part of `driverOptions` | `{}` |\n| `connectionType` | String | The desired connection type. Possible values: `NODE_DRIVER`, `STITCH_ON_PREM`, `STITCH_ATLAS` | `NODE_DRIVER` |\n| `authStrategy` | String | The desired authentication strategy. Possible values: `NONE`, `MONGODB`, `X509`, `KERBEROS`, `LDAP`, `SCRAM-SHA-256` | `NONE` |\n\n### Connection string options\n\n```javascript\nconst c = new Connection({ appname: 'My App', replicaSet: 'testing' });\n```\n\n#### General connection string options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `replicaSet` | String | Specifies the name of the replica set, if the mongod is a member of a replica set | `undefined` |\n| `connectTimeoutMS` | Number | The time in milliseconds to attempt a connection before timing out | `undefined` |\n| `socketTimeoutMS` | Number | The time in milliseconds to attempt a send or receive on a socket before the attempt times out | `undefined` |\n| `compression` | Object | Object includes compressors and a compression level. The following compressors can be specified: `snappy`, `zlib` (Available in MongoDB 3.6 or greater) | `undefined` |\n\n#### Connection Pool Option\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `maxPoolSize` | Number | The maximum number of connections in the connection pool | `undefined` |\n| `minPoolSize` | Number | The minimum number of connections in the connection pool | `undefined` |\n| `maxIdleTimeMS` | Number | The maximum number of milliseconds that a connection can remain idle in the pool before being removed and closed | `undefined` |\n| `waitQueueMultiple` | Number | A number that the driver multiples the maxPoolSize value to, to provide the maximum number of threads allowed to wait for a connection to become available from the pool | `undefined` |\n| `waitQueueTimeoutMS` | Number | The maximum time in milliseconds that a thread can wait for a connection to become available | `undefined` |\n\n#### Write Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `w` | Number/String | Corresponds to the write concern [w Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-w) | `undefined` |\n| `wTimeoutMS` | Number | Corresponds to the write concern [wtimeout](https://docs.mongodb.com/manual/reference/write-concern/#wc-wtimeout) | `undefined` |\n| `journal` | Boolean | Corresponds to the write concern [j Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-j) | `undefined` |\n\n#### Read Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readConcernLevel` | String | The level of isolation | `undefined` |\n\n#### Read Preference Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readPreference` | String | Specifies the read preferences for this connection. Possible values: `PRIMARY`, `PRIMARY_PREFERRED`, `SECONDARY`, `SECONDARY_PREFERRED`, `NEAREST` | `PRIMARY` |\n| `maxStalenessSeconds` | Number | Specifies, in seconds, how stale a secondary can be before the client stops using it for read operations | `undefined` |\n| `readPreferenceTags` | Object | Default read preference tags for the client | `undefined` |\n\n#### Authentication Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `authSource` | String | Specify the database name associated with the user’s credentials | `undefined` |\n| `authMechanism` | String | Specifies the authentication mechanism that MongoDB will use to authenticate the connection. Possible values: `DEFAULT`, `GSSAPI`, `MONGODB-X509`, `PLAIN`, `SCRAM-SHA-256` | `undefined` |\n| `authMechanismProperties` | Object | Additional options provided for authentication (e.g. to enable hostname canonicalization for GSSAPI) | `undefined` |\n| `gssapiServiceName` | String | Set the Kerberos service name when connecting to Kerberized MongoDB instances | `undefined` |\n| `gssapiServiceRealm` | String | Set the Realm service name | `undefined` |\n| `gssapiCanonicalizeHostName` | Boolean | Whether canonicalized hostname | `undefined` |\n\n#### Server Selection and Discovery Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `localThresholdMS` | Number | The size (in milliseconds) of the latency window for selecting among multiple suitable MongoDB instances | `undefined` |\n| `serverSelectionTimeoutMS` | Number | Specifies how long (in milliseconds) to block for server selection before throwing an exception | `undefined` |\n| `serverSelectionTryOnce` | Boolean | Instructs the driver to scan the MongoDB deployment exactly once after server selection fails and then either select a server or raise an error | `undefined` |\n| `heartbeatFrequencyMS` | Number | Controls when the driver checks the state of the MongoDB deployment | `undefined` |\n\n#### Miscellaneous Configuration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `appname` | String | An application name passed to server as client metadata | `undefined` |\n| `retryWrites` | Boolean | Enable retryable writes | `undefined` |\n| `uuidRepresentation` | String | The legacy representation of UUID. Possible values: `standard`, `csharpLegacy`, `javaLegacy`, `pythonLegacy` | `undefined` |\n| `loadBalanced` | Boolean | Whether or not the server is running in load balanced mode | `undefined` |\n\n### Stitch attributes\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `stitchServiceName` | String | Stitch service name | `undefined` |\n| `stitchClientAppId` | String | Stitch сlient app ID | `undefined` |\n| `stitchGroupId` | String | Stitch group ID | `undefined` |\n| `stitchBaseUrl` | String | Stitch base Url | `undefined` |\n\n### MONGODB authentication\n\n```javascript\nconst c = new Connection({\n  mongodbUsername: 'arlo',\n  mongodbPassword: 'w@of'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/?slaveOk=true&authSource=admin'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `mongodbUsername` | String | MongoDB username | `undefined` |\n| `mongodbPassword` | String | MongoDB password | `undefined` |\n| `mongodbDatabaseName` | String | The database name associated with the user's credentials | `undefined` |\n| `promoteValues` | Boolean | Whether BSON values should be promoted to their JS type counterparts | `undefined` |\n\n### KERBEROS authentication\n\n```javascript\nconst c = new Connection({\n  kerberosServiceName: 'mongodb',\n  kerberosPrincipal: 'arlo/dog@krb5.mongodb.parts',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo%252Fdog%2540krb5.mongodb.parts@localhost:27017/toys?authMechanism=GSSAPI'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n> @note (imlucas): Kerberos on Windows is broken out as it's own state for UX consideration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `kerberosServiceName` | String | Any program or computer you access over a network | `undefined` |\n| `kerberosPrincipal` | String | The format of a typical Kerberos V5 principal is `primary/instance@REALM` | `undefined` |\n| `kerberosCanonicalizeHostname` | Boolean | Whether canonicalized kerberos hostname | `undefined` |\n\n#### See Also\n\n- [node.js driver Kerberos reference](http://bit.ly/mongodb-node-driver-kerberos)\n- [node.js driver Kerberos functional test][kerberos-functional]\n\n### LDAP authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  ldapUsername: 'arlo',\n  ldapPassword: 'w@of',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/toys?slaveOk=true&authMechanism=PLAIN'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ldapUsername` | String | LDAP username | `undefined` |\n| `ldapPassword` | String | LDAP password | `undefined` |\n\n#### See Also\n\n- [node.js driver LDAP reference](http://bit.ly/mongodb-node-driver-ldap)\n- [node.js driver X509 functional test][ldap-functional]\n\n### X509 authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  x509Username: 'CN=client,OU=arlo,O=MongoDB,L=Philadelphia,ST=Pennsylvania,C=US'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://CN%253Dclient%252COU%253Darlo%252CO%253DMongoDB%252CL%253DPhiladelphia%252CST%253DPennsylvania%252CC%253DUS@localhost:27017?slaveOk=true&authMechanism=MONGODB-X509'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `x509Username` | String | The x.509 certificate derived user name, e.g. `CN=user,OU=OrgUnit,O=myOrg,...` | `undefined` |\n\n#### See Also\n\n- [node.js driver X509 reference](http://bit.ly/mongodb-node-driver-x509)\n- [node.js driver X509 functional test][x509-functional]\n\n### SSL\n\n> **Note**: Not to be confused with `authentication=X509`\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ssl` | Number/String | A boolean to enable or disables TLS/SSL for the connection | `undefined` |\n| `sslMethod` | String | The desired ssl method. Possible values: `NONE`, `SYSTEMCA`, `IFAVAILABLE`, `UNVALIDATED`, `SERVER`, `ALL` | `NONE` |\n| `sslCA` | Buffer/String | Array of valid certificates | `undefined` |\n| `sslCert` | Buffer/String | The certificate | `undefined` |\n| `sslKey` | Buffer/String | The certificate private key | `undefined` |\n| `sslPass` | Buffer/String | The certificate password | `undefined` |\n\nDescription of `sslMethod` values:\n\n- `SYSTEMCA` - SSL required, validate using System CA, with host verification.\n- `IFAVAILABLE` - The driver should try SSL first, fall back to no SSL if unavailable, and use the system's Certificate Authority.\n- `SERVER` - The driver should validate the server certificate and fail to connect if validation fails. See also [node.js driver \"Validate Server Certificate\" docs][driver-ssl-server].\n- `ALL` - The driver must present a valid certificate and validate the server certificate. See also [node.js driver \"Validate Server Certificate and Present Valid Certificate\" docs][driver-ssl-all].\n- `NONE` - No SSL (Not recommended).\n- `UNVALIDATED` - Use SSL but do not perform any validation of the certificate chain. See also [node.js driver \"No Certificate Validation\" docs][driver-ssl-none]. **Very** not recommended and likely to be deprecated in future releases because it exposes potential Man-In-The-Middle attack vectors.\n\n#### See also\n\n- [node.js driver SSL implementation][driver-ssl-impl]\n- [node.js driver SSL tutorial][driver-ssl-tutorial]\n\n### SSH TUNNEL\n\n> New in mongodb-connection-model@5.0.0\n\nBecause [authentication](#authentication) is quite difficult for operators to migrate to, the most common method of securing a MongoDB deployment is to use an [SSH tunnel][sf-ssh-tunnel].  This allows operators to leverage their existing SSH security infrastructure to also provide secure access to MongoDB.  For a standard deployment of MongoDB on AWS, this is almost always to strategy.  Because of this, we now support creating SSH tunnels automatically when connecting to MongoDB.\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options, (connectionError, client) => {\n  if (connectionError) {\n    return console.log(connectionError);\n  }\n\n  client.db('mongodb').collection('fanclub').count((countingError, count) => {\n    console.log('counted:', countingError, count);\n    client.close();\n  });\n});\n```\n\nThe above provides the same functionality as creating the tunnel using the bash\ncommand below and connecting to MongoDB via another terminal. Notice that\nconnection-model uses a random local port each time it creates a tunnel.\nUsing the command line, you'd have to replace `<random port>` with an actual\nport number.\n\n```bash\nssh -i ~/.ssh/my-key-aws-pair.pem -L <random port>:localhost:27017 ubuntu@ec2-11-111-111-111.compute-1.amazonaws.com\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `sshTunnel` | String | The desired SSH tunnel strategy. Possible values: `NONE`, `USER_PASSWORD`, `IDENTITY_FILE` | `undefined` |\n| `sshTunnelHostname` | String | The hostname of the SSH remote host | `undefined` |\n| `sshTunnelPort` | Port | The SSH port of the remote host | `22` |\n| `sshTunnelBindToLocalPort` | Port | Bind the localhost endpoint of the SSH Tunnel to this port | `undefined` |\n| `sshTunnelUsername` | String | The optional SSH username for the remote host | `undefined` |\n| `sshTunnelPassword` | String | The optional SSH password for the remote host | `undefined` |\n| `sshTunnelIdentityFile` | String/Array | The optional path to the SSH identity file for the remote host | `undefined` |\n| `sshTunnelPassphrase` | String | The optional passphrase for `sshTunnelIdentityFile` | `undefined` |\n\nDescription of `sshTunnel` values:\n\n- `NONE` - Do not use SSH tunneling.\n- `USER_PASSWORD` - The tunnel is created with SSH username and password only.\n- `IDENTITY_FILE` - The tunnel is created using an identity file.\n\n## Derived Properties\n\nDerived properties (also known as computed properties) are properties of the state object that depend on other properties to determine their value.\n\n```javascript\nconst c = new Connection();\nconst derivedProps = c.getAttributes({ derived: true });\n```\n\n| Derived Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `instanceId` | String | The mongoscope | `localhost:27017` |\n| `driverAuthMechanism` | String | Converts the value of `authStrategy` for humans into the `authMechanism` value for the driver | `undefined` |\n| `safeUrl` | String | The URL where a password is replaced with stars | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrl` | String | Use this URL in order to connect via DataService | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrlWithSsh` | String | Use this URL in order to connect via connection model itself | `mongodb://localhost:29201/?readPreference=primary&ssl=false` |\n| `driverOptions` | String | The second argument `mongoscope-server` passes to `mongodb.connect` | `{}` |\n\n## Events\n\n> New in mongodb-connection-model@5.0.0\n\n#### Example: SSH Tunnel\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', skipped: true,\n  reason: 'The selected SSL mode does not need to load any files.' }\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', complete: true}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n#### Example: SSL\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  ssl: 'ALL',\n  sslCA: '~/.ssl/my-ca.pem',\n  sslCert: '~/.ssl/my-server.pem',\n  sslKey: '~/.ssl/my-server.pem'\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', complete: true}\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', skipped: true,\n  reason: 'The selected SSH Tunnel mode is NONE.'}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n[workflow_img]: https://github.com/mongodb-js/connection-model/workflows/Check%20and%20Test/badge.svg?event=push\n[workflow_url]: https://github.com/mongodb-js/connection-model/actions?query=workflow%3A%22Check+and+Test%22\n[npm_img]: https://img.shields.io/npm/v/mongodb-connection-model.svg?style=flat-square\n[npm_url]: https://www.npmjs.org/package/mongodb-connection-model\n[gitter_img]: https://badges.gitter.im/Join%20Chat.svg\n[gitter_url]: http://gitter.im/mongodb-js/mongodb-js\n[enterprise_img]: https://img.shields.io/badge/MongoDB-Enterprise-blue.svg?style=flat-square\n[coming_soon_img]: https://img.shields.io/badge/-Coming%20Soon-ff69b4.svg?style=flat-square\n[kerberos-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/kerberos_tests.js\n[ldap-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ldap_tests.js\n[x509-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ssl_x509_tests.js\n[ns]: https://github.com/mongodb-js/ns\n[sf-ssh-tunnel]: http://serverfault.com/questions/597765/how-to-connect-to-mongodb-server-via-ssh-tunnel\n[ec2-key-pairs]: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html\n[driver-ssl-impl]: https://github.com/christkv/mongodb-core/blob/c3d21cb636d74d7a68134ecd3b9f6af536311279/lib/connection/connection.js#L365-L407\n[driver-ssl-tutorial]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/\n[driver-ssl-none]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#no-certificate-validation\n[driver-ssl-server]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate\n[driver-ssl-all]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate-and-present-valid-certificate\n","gitHead":"cd3c5c1303c464ef7900dc08adb8154d15c7f3a9","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","test":"mocha","check":"npm run lint && npm run depcheck","pretest":"mongodb-runner install && mongodb-runner start --port=27018","test-ci":"npm run test","depcheck":"depcheck","posttest":"mongodb-runner stop --port=27018","posttest-ci":"node ../../scripts/killall-mongo.js","test-check-ci":"npm run check && npm test"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.17.0+x64 (linux)","description":"MongoDB connection model.","directories":{},"_nodeVersion":"16.17.0","compass:main":"index.js","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","debug":"^4.2.0","lodash":"^4.17.15","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.2.0","storage-mixin":"0.0.0-next-cd3c5c1303c464ef7900dc08adb8154d15c7f3a9","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.2","@mongodb-js/ssh-tunnel":"0.0.0-next-cd3c5c1303c464ef7900dc08adb8154d15c7f3a9","@mongodb-js/compass-utils":"0.0.0-next-cd3c5c1303c464ef7900dc08adb8154d15c7f3a9","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.5.4"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"^4.10.0","depcheck":"^1.4.1","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.9.0","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^4.10.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_0.0.0-next-cd3c5c1303c464ef7900dc08adb8154d15c7f3a9_1665067443176_0.8468924743713182","host":"s3://npm-registry-packages"}},"0.0.0-next-d9691f3c8230e21aeb2817ac2c984aba0d79f09c":{"name":"mongodb-connection-model","version":"0.0.0-next-d9691f3c8230e21aeb2817ac2c984aba0d79f09c","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@0.0.0-next-d9691f3c8230e21aeb2817ac2c984aba0d79f09c","maintainers":[{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"iteng@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"bd1f53b67158ac5ee3fed9aebc37ffa22ee1535c","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-0.0.0-next-d9691f3c8230e21aeb2817ac2c984aba0d79f09c.tgz","fileCount":20,"integrity":"sha512-CXPzuPmN2WdjKqGkGAoJ5oPvh0qTIKhnF+WZqmoWy6EGefJypVJ05ifdgJhgjTunXoCc6fj1g4XslJEMeiuweA==","signatures":[{"sig":"MEUCIG+KuXIpYJDejGsgu5X3xeTxnW3/kbZRf5qdSJNqMHxpAiEA6I0K329ZFJCV7fpIzS9brTUAWt9Or6PSSN+fhERZR5c=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":108152,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjQIGnACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqppBAAjZ+K5jWX9pSgJrKaOo1EOAR6pYkWGQ4O1FDBggyEebXbq5F4\r\nnsg5SPaZSR9djnIHBuu1bPzuNT4nRuZZmr1QkY1kwJzu7MfdqifSaJYkRazC\r\n8PCGVaflZ2jviNXRRjOUxqhF0FueQKH0Zcp3JwjFeLb8ypY5Qy6w8AwKij96\r\nwoDurCUd4IYk/3bQIagdR4zNK3f7Sq6NtBWSvkolevNtXqsJcI19RTprRZQE\r\nZd136ApdZT0mtgnWxvyoGk2VVHaWykwIBfYZd/ejOroUxtdTfCqmtN9t58+8\r\nxKA56CiMoJClzl8ItOh8pLlqBnCoSLNcgMQLciQ/ddlRZeZwy4hNCKmLII3v\r\nsvT1aLZJwciI+OVti6hq0KDMKqtGvGPPlD0xiQCloXs1KD7gluxuZCPXX5bl\r\nYLVUpBn4EZRSNHZC+YSvPJXNvl1E9gtpwt+6QoUKoM1LrcojNA5d0+g1Tn0M\r\nF7ZQsColWR1g+HCj9x/Kk59psMGTHUn0of4c3XQzy+fnfVMrSSifC9hiJGcj\r\npdtFAG8/Jax2y9RLndOKlLSN2+jtpMJtnYtRv9PlV+sBsB9u91L638srH98s\r\nYV1XW2g7vLBpPkW7aIUrgoUtoe6k8NQyn7+DfFw0jAG5uwbUzkZq4jaAdHKs\r\nE/aPKXH5AOOeWD0QIhUJhL1N56Qcj1C3cJE=\r\n=tydy\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","readme":"# mongodb-connection-model [![][workflow_img]][workflow_url] [![][npm_img]][npm_url]\n\n> MongoDB connection model\n\nThe main purpose of the MongoDB connection model is to be a domain model around a MongoDB connection. It encapsulates generating a [Connection String URI](https://docs.mongodb.com/manual/reference/connection-string/) from a group of attributes and parses URI using the [MongoDB Node.JS Driver URI Parser](https://github.com/mongodb-js/mongodb-core/blob/master/lib/uri_parser.js).\n\n## Installation\n\n```\nnpm install --save mongodb-connection-model\n```\n\n## Usage\n\n### Building URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\nconst c = new Connection({ appname: 'My App Name' });\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://localhost:27017/?readPreference=primary&appname=My%20App&ssl=false'\n```\n\n### Parsing URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\n\nConnection.from(\n  'mongodb://someUsername:testPassword@localhost',\n  (error, result) => {\n    console.log(result);\n    >>> `{\n      hosts: [{ host: 'localhost', port: 27017 }],\n      hostname: 'localhost',\n      port: 27017,\n      auth: {\n        username: 'someUsername',\n        password: 'testPassword',\n        db: 'admin'\n      },\n      isSrvRecord: false,\n      authStrategy: 'MONGODB',\n      mongodbUsername: 'someUsername',\n      mongodbPassword: 'testPassword',\n      mongodbDatabaseName: 'admin',\n      extraOptions: {},\n      connectionType: 'NODE_DRIVER',\n      readPreference: 'primary',\n      kerberosCanonicalizeHostname: false,\n      sslMethod: 'NONE',\n      sshTunnel: 'NONE',\n      sshTunnelPort: 22\n    }`\n  }\n);\n```\n\n## Properties\n\nMongoDB connection model is based on Ampersand.js framework and consist of [props](https://ampersandjs.com/docs/#ampersand-state-props) and [derived props](https://ampersandjs.com/docs/#ampersand-state-derived). The props object describes the observable properties that MongoDB connection model gets from the Node.js Driver API.\n\n```javascript\nconst с = new Connection();\nconst props = с.getAttributes({ props: true });\n```\n\n#### See Also\n\n- [URI Generic Syntax](https://tools.ietf.org/html/rfc3986)\n- [URI Options Specification](https://github.com/mongodb/specifications/blob/master/source/uri-options/uri-options.rst)\n\n### General Properties\n\n```javascript\nconst c = new Connection({ isSrvRecord: true });\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ns` | String | A valid [ns][ns] the user can read from | `undefined` |\n| `isSrvRecord` | Boolean | Indicates SRV record | `false` |\n| `auth` | Object | Authentication from driver (username, user, db, password) | `undefined` |\n| `hostname` | String | Hostname of a MongoDB Instance. In case of the replica set the first host and port will be taken | `localhost` |\n| `port` | Number | TCP port of a MongoDB Instance | `27017` |\n| `hosts` | Array | Contains all hosts and ports for replica set | `[{ host: 'localhost', port: 27017 }]` |\n| `extraOptions` | Object | Extra options passed to the node driver as part of `driverOptions` | `{}` |\n| `connectionType` | String | The desired connection type. Possible values: `NODE_DRIVER`, `STITCH_ON_PREM`, `STITCH_ATLAS` | `NODE_DRIVER` |\n| `authStrategy` | String | The desired authentication strategy. Possible values: `NONE`, `MONGODB`, `X509`, `KERBEROS`, `LDAP`, `SCRAM-SHA-256` | `NONE` |\n\n### Connection string options\n\n```javascript\nconst c = new Connection({ appname: 'My App', replicaSet: 'testing' });\n```\n\n#### General connection string options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `replicaSet` | String | Specifies the name of the replica set, if the mongod is a member of a replica set | `undefined` |\n| `connectTimeoutMS` | Number | The time in milliseconds to attempt a connection before timing out | `undefined` |\n| `socketTimeoutMS` | Number | The time in milliseconds to attempt a send or receive on a socket before the attempt times out | `undefined` |\n| `compression` | Object | Object includes compressors and a compression level. The following compressors can be specified: `snappy`, `zlib` (Available in MongoDB 3.6 or greater) | `undefined` |\n\n#### Connection Pool Option\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `maxPoolSize` | Number | The maximum number of connections in the connection pool | `undefined` |\n| `minPoolSize` | Number | The minimum number of connections in the connection pool | `undefined` |\n| `maxIdleTimeMS` | Number | The maximum number of milliseconds that a connection can remain idle in the pool before being removed and closed | `undefined` |\n| `waitQueueMultiple` | Number | A number that the driver multiples the maxPoolSize value to, to provide the maximum number of threads allowed to wait for a connection to become available from the pool | `undefined` |\n| `waitQueueTimeoutMS` | Number | The maximum time in milliseconds that a thread can wait for a connection to become available | `undefined` |\n\n#### Write Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `w` | Number/String | Corresponds to the write concern [w Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-w) | `undefined` |\n| `wTimeoutMS` | Number | Corresponds to the write concern [wtimeout](https://docs.mongodb.com/manual/reference/write-concern/#wc-wtimeout) | `undefined` |\n| `journal` | Boolean | Corresponds to the write concern [j Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-j) | `undefined` |\n\n#### Read Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readConcernLevel` | String | The level of isolation | `undefined` |\n\n#### Read Preference Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readPreference` | String | Specifies the read preferences for this connection. Possible values: `PRIMARY`, `PRIMARY_PREFERRED`, `SECONDARY`, `SECONDARY_PREFERRED`, `NEAREST` | `PRIMARY` |\n| `maxStalenessSeconds` | Number | Specifies, in seconds, how stale a secondary can be before the client stops using it for read operations | `undefined` |\n| `readPreferenceTags` | Object | Default read preference tags for the client | `undefined` |\n\n#### Authentication Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `authSource` | String | Specify the database name associated with the user’s credentials | `undefined` |\n| `authMechanism` | String | Specifies the authentication mechanism that MongoDB will use to authenticate the connection. Possible values: `DEFAULT`, `GSSAPI`, `MONGODB-X509`, `PLAIN`, `SCRAM-SHA-256` | `undefined` |\n| `authMechanismProperties` | Object | Additional options provided for authentication (e.g. to enable hostname canonicalization for GSSAPI) | `undefined` |\n| `gssapiServiceName` | String | Set the Kerberos service name when connecting to Kerberized MongoDB instances | `undefined` |\n| `gssapiServiceRealm` | String | Set the Realm service name | `undefined` |\n| `gssapiCanonicalizeHostName` | Boolean | Whether canonicalized hostname | `undefined` |\n\n#### Server Selection and Discovery Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `localThresholdMS` | Number | The size (in milliseconds) of the latency window for selecting among multiple suitable MongoDB instances | `undefined` |\n| `serverSelectionTimeoutMS` | Number | Specifies how long (in milliseconds) to block for server selection before throwing an exception | `undefined` |\n| `serverSelectionTryOnce` | Boolean | Instructs the driver to scan the MongoDB deployment exactly once after server selection fails and then either select a server or raise an error | `undefined` |\n| `heartbeatFrequencyMS` | Number | Controls when the driver checks the state of the MongoDB deployment | `undefined` |\n\n#### Miscellaneous Configuration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `appname` | String | An application name passed to server as client metadata | `undefined` |\n| `retryWrites` | Boolean | Enable retryable writes | `undefined` |\n| `uuidRepresentation` | String | The legacy representation of UUID. Possible values: `standard`, `csharpLegacy`, `javaLegacy`, `pythonLegacy` | `undefined` |\n| `loadBalanced` | Boolean | Whether or not the server is running in load balanced mode | `undefined` |\n\n### Stitch attributes\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `stitchServiceName` | String | Stitch service name | `undefined` |\n| `stitchClientAppId` | String | Stitch сlient app ID | `undefined` |\n| `stitchGroupId` | String | Stitch group ID | `undefined` |\n| `stitchBaseUrl` | String | Stitch base Url | `undefined` |\n\n### MONGODB authentication\n\n```javascript\nconst c = new Connection({\n  mongodbUsername: 'arlo',\n  mongodbPassword: 'w@of'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/?slaveOk=true&authSource=admin'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `mongodbUsername` | String | MongoDB username | `undefined` |\n| `mongodbPassword` | String | MongoDB password | `undefined` |\n| `mongodbDatabaseName` | String | The database name associated with the user's credentials | `undefined` |\n| `promoteValues` | Boolean | Whether BSON values should be promoted to their JS type counterparts | `undefined` |\n\n### KERBEROS authentication\n\n```javascript\nconst c = new Connection({\n  kerberosServiceName: 'mongodb',\n  kerberosPrincipal: 'arlo/dog@krb5.mongodb.parts',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo%252Fdog%2540krb5.mongodb.parts@localhost:27017/toys?authMechanism=GSSAPI'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n> @note (imlucas): Kerberos on Windows is broken out as it's own state for UX consideration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `kerberosServiceName` | String | Any program or computer you access over a network | `undefined` |\n| `kerberosPrincipal` | String | The format of a typical Kerberos V5 principal is `primary/instance@REALM` | `undefined` |\n| `kerberosCanonicalizeHostname` | Boolean | Whether canonicalized kerberos hostname | `undefined` |\n\n#### See Also\n\n- [node.js driver Kerberos reference](http://bit.ly/mongodb-node-driver-kerberos)\n- [node.js driver Kerberos functional test][kerberos-functional]\n\n### LDAP authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  ldapUsername: 'arlo',\n  ldapPassword: 'w@of',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/toys?slaveOk=true&authMechanism=PLAIN'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ldapUsername` | String | LDAP username | `undefined` |\n| `ldapPassword` | String | LDAP password | `undefined` |\n\n#### See Also\n\n- [node.js driver LDAP reference](http://bit.ly/mongodb-node-driver-ldap)\n- [node.js driver X509 functional test][ldap-functional]\n\n### X509 authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  x509Username: 'CN=client,OU=arlo,O=MongoDB,L=Philadelphia,ST=Pennsylvania,C=US'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://CN%253Dclient%252COU%253Darlo%252CO%253DMongoDB%252CL%253DPhiladelphia%252CST%253DPennsylvania%252CC%253DUS@localhost:27017?slaveOk=true&authMechanism=MONGODB-X509'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `x509Username` | String | The x.509 certificate derived user name, e.g. `CN=user,OU=OrgUnit,O=myOrg,...` | `undefined` |\n\n#### See Also\n\n- [node.js driver X509 reference](http://bit.ly/mongodb-node-driver-x509)\n- [node.js driver X509 functional test][x509-functional]\n\n### SSL\n\n> **Note**: Not to be confused with `authentication=X509`\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ssl` | Number/String | A boolean to enable or disables TLS/SSL for the connection | `undefined` |\n| `sslMethod` | String | The desired ssl method. Possible values: `NONE`, `SYSTEMCA`, `IFAVAILABLE`, `UNVALIDATED`, `SERVER`, `ALL` | `NONE` |\n| `sslCA` | Buffer/String | Array of valid certificates | `undefined` |\n| `sslCert` | Buffer/String | The certificate | `undefined` |\n| `sslKey` | Buffer/String | The certificate private key | `undefined` |\n| `sslPass` | Buffer/String | The certificate password | `undefined` |\n\nDescription of `sslMethod` values:\n\n- `SYSTEMCA` - SSL required, validate using System CA, with host verification.\n- `IFAVAILABLE` - The driver should try SSL first, fall back to no SSL if unavailable, and use the system's Certificate Authority.\n- `SERVER` - The driver should validate the server certificate and fail to connect if validation fails. See also [node.js driver \"Validate Server Certificate\" docs][driver-ssl-server].\n- `ALL` - The driver must present a valid certificate and validate the server certificate. See also [node.js driver \"Validate Server Certificate and Present Valid Certificate\" docs][driver-ssl-all].\n- `NONE` - No SSL (Not recommended).\n- `UNVALIDATED` - Use SSL but do not perform any validation of the certificate chain. See also [node.js driver \"No Certificate Validation\" docs][driver-ssl-none]. **Very** not recommended and likely to be deprecated in future releases because it exposes potential Man-In-The-Middle attack vectors.\n\n#### See also\n\n- [node.js driver SSL implementation][driver-ssl-impl]\n- [node.js driver SSL tutorial][driver-ssl-tutorial]\n\n### SSH TUNNEL\n\n> New in mongodb-connection-model@5.0.0\n\nBecause [authentication](#authentication) is quite difficult for operators to migrate to, the most common method of securing a MongoDB deployment is to use an [SSH tunnel][sf-ssh-tunnel].  This allows operators to leverage their existing SSH security infrastructure to also provide secure access to MongoDB.  For a standard deployment of MongoDB on AWS, this is almost always to strategy.  Because of this, we now support creating SSH tunnels automatically when connecting to MongoDB.\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options, (connectionError, client) => {\n  if (connectionError) {\n    return console.log(connectionError);\n  }\n\n  client.db('mongodb').collection('fanclub').count((countingError, count) => {\n    console.log('counted:', countingError, count);\n    client.close();\n  });\n});\n```\n\nThe above provides the same functionality as creating the tunnel using the bash\ncommand below and connecting to MongoDB via another terminal. Notice that\nconnection-model uses a random local port each time it creates a tunnel.\nUsing the command line, you'd have to replace `<random port>` with an actual\nport number.\n\n```bash\nssh -i ~/.ssh/my-key-aws-pair.pem -L <random port>:localhost:27017 ubuntu@ec2-11-111-111-111.compute-1.amazonaws.com\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `sshTunnel` | String | The desired SSH tunnel strategy. Possible values: `NONE`, `USER_PASSWORD`, `IDENTITY_FILE` | `undefined` |\n| `sshTunnelHostname` | String | The hostname of the SSH remote host | `undefined` |\n| `sshTunnelPort` | Port | The SSH port of the remote host | `22` |\n| `sshTunnelBindToLocalPort` | Port | Bind the localhost endpoint of the SSH Tunnel to this port | `undefined` |\n| `sshTunnelUsername` | String | The optional SSH username for the remote host | `undefined` |\n| `sshTunnelPassword` | String | The optional SSH password for the remote host | `undefined` |\n| `sshTunnelIdentityFile` | String/Array | The optional path to the SSH identity file for the remote host | `undefined` |\n| `sshTunnelPassphrase` | String | The optional passphrase for `sshTunnelIdentityFile` | `undefined` |\n\nDescription of `sshTunnel` values:\n\n- `NONE` - Do not use SSH tunneling.\n- `USER_PASSWORD` - The tunnel is created with SSH username and password only.\n- `IDENTITY_FILE` - The tunnel is created using an identity file.\n\n## Derived Properties\n\nDerived properties (also known as computed properties) are properties of the state object that depend on other properties to determine their value.\n\n```javascript\nconst c = new Connection();\nconst derivedProps = c.getAttributes({ derived: true });\n```\n\n| Derived Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `instanceId` | String | The mongoscope | `localhost:27017` |\n| `driverAuthMechanism` | String | Converts the value of `authStrategy` for humans into the `authMechanism` value for the driver | `undefined` |\n| `safeUrl` | String | The URL where a password is replaced with stars | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrl` | String | Use this URL in order to connect via DataService | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrlWithSsh` | String | Use this URL in order to connect via connection model itself | `mongodb://localhost:29201/?readPreference=primary&ssl=false` |\n| `driverOptions` | String | The second argument `mongoscope-server` passes to `mongodb.connect` | `{}` |\n\n## Events\n\n> New in mongodb-connection-model@5.0.0\n\n#### Example: SSH Tunnel\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', skipped: true,\n  reason: 'The selected SSL mode does not need to load any files.' }\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', complete: true}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n#### Example: SSL\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  ssl: 'ALL',\n  sslCA: '~/.ssl/my-ca.pem',\n  sslCert: '~/.ssl/my-server.pem',\n  sslKey: '~/.ssl/my-server.pem'\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', complete: true}\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', skipped: true,\n  reason: 'The selected SSH Tunnel mode is NONE.'}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n[workflow_img]: https://github.com/mongodb-js/connection-model/workflows/Check%20and%20Test/badge.svg?event=push\n[workflow_url]: https://github.com/mongodb-js/connection-model/actions?query=workflow%3A%22Check+and+Test%22\n[npm_img]: https://img.shields.io/npm/v/mongodb-connection-model.svg?style=flat-square\n[npm_url]: https://www.npmjs.org/package/mongodb-connection-model\n[gitter_img]: https://badges.gitter.im/Join%20Chat.svg\n[gitter_url]: http://gitter.im/mongodb-js/mongodb-js\n[enterprise_img]: https://img.shields.io/badge/MongoDB-Enterprise-blue.svg?style=flat-square\n[coming_soon_img]: https://img.shields.io/badge/-Coming%20Soon-ff69b4.svg?style=flat-square\n[kerberos-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/kerberos_tests.js\n[ldap-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ldap_tests.js\n[x509-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ssl_x509_tests.js\n[ns]: https://github.com/mongodb-js/ns\n[sf-ssh-tunnel]: http://serverfault.com/questions/597765/how-to-connect-to-mongodb-server-via-ssh-tunnel\n[ec2-key-pairs]: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html\n[driver-ssl-impl]: https://github.com/christkv/mongodb-core/blob/c3d21cb636d74d7a68134ecd3b9f6af536311279/lib/connection/connection.js#L365-L407\n[driver-ssl-tutorial]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/\n[driver-ssl-none]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#no-certificate-validation\n[driver-ssl-server]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate\n[driver-ssl-all]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate-and-present-valid-certificate\n","gitHead":"d9691f3c8230e21aeb2817ac2c984aba0d79f09c","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","test":"mocha","check":"npm run lint && npm run depcheck","pretest":"mongodb-runner install && mongodb-runner start --port=27018","test-ci":"npm run test","depcheck":"depcheck","posttest":"mongodb-runner stop --port=27018","posttest-ci":"node ../../scripts/killall-mongo.js","test-check-ci":"npm run check && npm test"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.17.0+x64 (linux)","description":"MongoDB connection model.","directories":{},"_nodeVersion":"16.17.0","compass:main":"index.js","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","debug":"^4.2.0","lodash":"^4.17.15","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.2.0","storage-mixin":"0.0.0-next-d9691f3c8230e21aeb2817ac2c984aba0d79f09c","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.2","@mongodb-js/ssh-tunnel":"0.0.0-next-d9691f3c8230e21aeb2817ac2c984aba0d79f09c","@mongodb-js/compass-utils":"0.0.0-next-d9691f3c8230e21aeb2817ac2c984aba0d79f09c","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.5.4"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"^4.10.0","depcheck":"^1.4.1","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.9.0","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^4.10.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_0.0.0-next-d9691f3c8230e21aeb2817ac2c984aba0d79f09c_1665171878287_0.12237372223929088","host":"s3://npm-registry-packages"}},"0.0.0-next-1cb9ea1724d90e58422b33fe089df5b774e0be10":{"name":"mongodb-connection-model","version":"0.0.0-next-1cb9ea1724d90e58422b33fe089df5b774e0be10","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@0.0.0-next-1cb9ea1724d90e58422b33fe089df5b774e0be10","maintainers":[{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"iteng@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"465d3a11132f416739cc4af467b1462baecda7d6","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-0.0.0-next-1cb9ea1724d90e58422b33fe089df5b774e0be10.tgz","fileCount":20,"integrity":"sha512-Ku3RRBhbsqOIKZO6v0niamqNXiacBpSdsecYQLC2Eu6Ux2wDKdfPGR8yBPwUnYLSe/h46nKoBgcV0aGp8hejdg==","signatures":[{"sig":"MEUCIQDf8EG13BZyus5WgUI1bhf/FBaqGrVvgxLjpgV7WXK/oAIgIeD1XdJ3XCbM0FSYQ4kg/aOJrOrdChfqQSIOQeVYvIo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":108152,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjQILIACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr/Lg/+KB1XEancgJLsEew7HQ8pOo/UrwDVJMhlux2k/B23WG/eDcDD\r\nAm242UJvgw746a1zREtYvHGSdg9TG8Rftg/mUlDPw8tjrCUXWxH/6GBK1z9l\r\nDQjfZL6lNV7umFpOTsG7qmKUu1VlO8NLP1CXtHBXNs6eUeNaRyNDQA4UZ6i4\r\nmnymGBKB2/FMsmjBH5S++U8ZDDL5mkG4eLXNvk2on6qw4Ujd7tdhHCZZz8Oh\r\n0BfLH80GBLA6jTDIf3D675rIokb2rUsiau2HpWJ7S1fzD9Lf9dqxauU3CjTB\r\n0t3oWF672MBPzdtcO79g9SUwx0gr8ON6FT8xLPQCXTfddOCkMwcZ08FbkRhw\r\n2NX/2BXV1lOdxuNUs85GvEDfJvCTYxf0DPqaxOw6uMeHKFxYcTmxnlLNx2JT\r\nFP+RynUHXzKlr8Hv15O3t+fNOgPenuK1CDZ28aAvgb50DjqNOddSxS3N4XZQ\r\n6uEC0bdLWL+AzY444ZMRIknF9+v5fG50a5WMMk6Sexkvnn/fVZiIbmobbrHF\r\ngLqRGLhPKm3zIC5u/M92+1GwNoH3ajc5lg5qAylO+lFbiTpHZ4RU/qdzsgun\r\nG2Oz5OxhzIQ7sZ5YIQmlcTPriF0UlYicbETOmLyjJoPPdBHLSNFJukcyMOGW\r\nsYrLx82SElepeH5g49vj7q8VdOPMDH5IsN4=\r\n=p+Bi\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","readme":"# mongodb-connection-model [![][workflow_img]][workflow_url] [![][npm_img]][npm_url]\n\n> MongoDB connection model\n\nThe main purpose of the MongoDB connection model is to be a domain model around a MongoDB connection. It encapsulates generating a [Connection String URI](https://docs.mongodb.com/manual/reference/connection-string/) from a group of attributes and parses URI using the [MongoDB Node.JS Driver URI Parser](https://github.com/mongodb-js/mongodb-core/blob/master/lib/uri_parser.js).\n\n## Installation\n\n```\nnpm install --save mongodb-connection-model\n```\n\n## Usage\n\n### Building URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\nconst c = new Connection({ appname: 'My App Name' });\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://localhost:27017/?readPreference=primary&appname=My%20App&ssl=false'\n```\n\n### Parsing URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\n\nConnection.from(\n  'mongodb://someUsername:testPassword@localhost',\n  (error, result) => {\n    console.log(result);\n    >>> `{\n      hosts: [{ host: 'localhost', port: 27017 }],\n      hostname: 'localhost',\n      port: 27017,\n      auth: {\n        username: 'someUsername',\n        password: 'testPassword',\n        db: 'admin'\n      },\n      isSrvRecord: false,\n      authStrategy: 'MONGODB',\n      mongodbUsername: 'someUsername',\n      mongodbPassword: 'testPassword',\n      mongodbDatabaseName: 'admin',\n      extraOptions: {},\n      connectionType: 'NODE_DRIVER',\n      readPreference: 'primary',\n      kerberosCanonicalizeHostname: false,\n      sslMethod: 'NONE',\n      sshTunnel: 'NONE',\n      sshTunnelPort: 22\n    }`\n  }\n);\n```\n\n## Properties\n\nMongoDB connection model is based on Ampersand.js framework and consist of [props](https://ampersandjs.com/docs/#ampersand-state-props) and [derived props](https://ampersandjs.com/docs/#ampersand-state-derived). The props object describes the observable properties that MongoDB connection model gets from the Node.js Driver API.\n\n```javascript\nconst с = new Connection();\nconst props = с.getAttributes({ props: true });\n```\n\n#### See Also\n\n- [URI Generic Syntax](https://tools.ietf.org/html/rfc3986)\n- [URI Options Specification](https://github.com/mongodb/specifications/blob/master/source/uri-options/uri-options.rst)\n\n### General Properties\n\n```javascript\nconst c = new Connection({ isSrvRecord: true });\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ns` | String | A valid [ns][ns] the user can read from | `undefined` |\n| `isSrvRecord` | Boolean | Indicates SRV record | `false` |\n| `auth` | Object | Authentication from driver (username, user, db, password) | `undefined` |\n| `hostname` | String | Hostname of a MongoDB Instance. In case of the replica set the first host and port will be taken | `localhost` |\n| `port` | Number | TCP port of a MongoDB Instance | `27017` |\n| `hosts` | Array | Contains all hosts and ports for replica set | `[{ host: 'localhost', port: 27017 }]` |\n| `extraOptions` | Object | Extra options passed to the node driver as part of `driverOptions` | `{}` |\n| `connectionType` | String | The desired connection type. Possible values: `NODE_DRIVER`, `STITCH_ON_PREM`, `STITCH_ATLAS` | `NODE_DRIVER` |\n| `authStrategy` | String | The desired authentication strategy. Possible values: `NONE`, `MONGODB`, `X509`, `KERBEROS`, `LDAP`, `SCRAM-SHA-256` | `NONE` |\n\n### Connection string options\n\n```javascript\nconst c = new Connection({ appname: 'My App', replicaSet: 'testing' });\n```\n\n#### General connection string options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `replicaSet` | String | Specifies the name of the replica set, if the mongod is a member of a replica set | `undefined` |\n| `connectTimeoutMS` | Number | The time in milliseconds to attempt a connection before timing out | `undefined` |\n| `socketTimeoutMS` | Number | The time in milliseconds to attempt a send or receive on a socket before the attempt times out | `undefined` |\n| `compression` | Object | Object includes compressors and a compression level. The following compressors can be specified: `snappy`, `zlib` (Available in MongoDB 3.6 or greater) | `undefined` |\n\n#### Connection Pool Option\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `maxPoolSize` | Number | The maximum number of connections in the connection pool | `undefined` |\n| `minPoolSize` | Number | The minimum number of connections in the connection pool | `undefined` |\n| `maxIdleTimeMS` | Number | The maximum number of milliseconds that a connection can remain idle in the pool before being removed and closed | `undefined` |\n| `waitQueueMultiple` | Number | A number that the driver multiples the maxPoolSize value to, to provide the maximum number of threads allowed to wait for a connection to become available from the pool | `undefined` |\n| `waitQueueTimeoutMS` | Number | The maximum time in milliseconds that a thread can wait for a connection to become available | `undefined` |\n\n#### Write Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `w` | Number/String | Corresponds to the write concern [w Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-w) | `undefined` |\n| `wTimeoutMS` | Number | Corresponds to the write concern [wtimeout](https://docs.mongodb.com/manual/reference/write-concern/#wc-wtimeout) | `undefined` |\n| `journal` | Boolean | Corresponds to the write concern [j Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-j) | `undefined` |\n\n#### Read Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readConcernLevel` | String | The level of isolation | `undefined` |\n\n#### Read Preference Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readPreference` | String | Specifies the read preferences for this connection. Possible values: `PRIMARY`, `PRIMARY_PREFERRED`, `SECONDARY`, `SECONDARY_PREFERRED`, `NEAREST` | `PRIMARY` |\n| `maxStalenessSeconds` | Number | Specifies, in seconds, how stale a secondary can be before the client stops using it for read operations | `undefined` |\n| `readPreferenceTags` | Object | Default read preference tags for the client | `undefined` |\n\n#### Authentication Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `authSource` | String | Specify the database name associated with the user’s credentials | `undefined` |\n| `authMechanism` | String | Specifies the authentication mechanism that MongoDB will use to authenticate the connection. Possible values: `DEFAULT`, `GSSAPI`, `MONGODB-X509`, `PLAIN`, `SCRAM-SHA-256` | `undefined` |\n| `authMechanismProperties` | Object | Additional options provided for authentication (e.g. to enable hostname canonicalization for GSSAPI) | `undefined` |\n| `gssapiServiceName` | String | Set the Kerberos service name when connecting to Kerberized MongoDB instances | `undefined` |\n| `gssapiServiceRealm` | String | Set the Realm service name | `undefined` |\n| `gssapiCanonicalizeHostName` | Boolean | Whether canonicalized hostname | `undefined` |\n\n#### Server Selection and Discovery Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `localThresholdMS` | Number | The size (in milliseconds) of the latency window for selecting among multiple suitable MongoDB instances | `undefined` |\n| `serverSelectionTimeoutMS` | Number | Specifies how long (in milliseconds) to block for server selection before throwing an exception | `undefined` |\n| `serverSelectionTryOnce` | Boolean | Instructs the driver to scan the MongoDB deployment exactly once after server selection fails and then either select a server or raise an error | `undefined` |\n| `heartbeatFrequencyMS` | Number | Controls when the driver checks the state of the MongoDB deployment | `undefined` |\n\n#### Miscellaneous Configuration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `appname` | String | An application name passed to server as client metadata | `undefined` |\n| `retryWrites` | Boolean | Enable retryable writes | `undefined` |\n| `uuidRepresentation` | String | The legacy representation of UUID. Possible values: `standard`, `csharpLegacy`, `javaLegacy`, `pythonLegacy` | `undefined` |\n| `loadBalanced` | Boolean | Whether or not the server is running in load balanced mode | `undefined` |\n\n### Stitch attributes\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `stitchServiceName` | String | Stitch service name | `undefined` |\n| `stitchClientAppId` | String | Stitch сlient app ID | `undefined` |\n| `stitchGroupId` | String | Stitch group ID | `undefined` |\n| `stitchBaseUrl` | String | Stitch base Url | `undefined` |\n\n### MONGODB authentication\n\n```javascript\nconst c = new Connection({\n  mongodbUsername: 'arlo',\n  mongodbPassword: 'w@of'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/?slaveOk=true&authSource=admin'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `mongodbUsername` | String | MongoDB username | `undefined` |\n| `mongodbPassword` | String | MongoDB password | `undefined` |\n| `mongodbDatabaseName` | String | The database name associated with the user's credentials | `undefined` |\n| `promoteValues` | Boolean | Whether BSON values should be promoted to their JS type counterparts | `undefined` |\n\n### KERBEROS authentication\n\n```javascript\nconst c = new Connection({\n  kerberosServiceName: 'mongodb',\n  kerberosPrincipal: 'arlo/dog@krb5.mongodb.parts',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo%252Fdog%2540krb5.mongodb.parts@localhost:27017/toys?authMechanism=GSSAPI'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n> @note (imlucas): Kerberos on Windows is broken out as it's own state for UX consideration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `kerberosServiceName` | String | Any program or computer you access over a network | `undefined` |\n| `kerberosPrincipal` | String | The format of a typical Kerberos V5 principal is `primary/instance@REALM` | `undefined` |\n| `kerberosCanonicalizeHostname` | Boolean | Whether canonicalized kerberos hostname | `undefined` |\n\n#### See Also\n\n- [node.js driver Kerberos reference](http://bit.ly/mongodb-node-driver-kerberos)\n- [node.js driver Kerberos functional test][kerberos-functional]\n\n### LDAP authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  ldapUsername: 'arlo',\n  ldapPassword: 'w@of',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/toys?slaveOk=true&authMechanism=PLAIN'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ldapUsername` | String | LDAP username | `undefined` |\n| `ldapPassword` | String | LDAP password | `undefined` |\n\n#### See Also\n\n- [node.js driver LDAP reference](http://bit.ly/mongodb-node-driver-ldap)\n- [node.js driver X509 functional test][ldap-functional]\n\n### X509 authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  x509Username: 'CN=client,OU=arlo,O=MongoDB,L=Philadelphia,ST=Pennsylvania,C=US'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://CN%253Dclient%252COU%253Darlo%252CO%253DMongoDB%252CL%253DPhiladelphia%252CST%253DPennsylvania%252CC%253DUS@localhost:27017?slaveOk=true&authMechanism=MONGODB-X509'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `x509Username` | String | The x.509 certificate derived user name, e.g. `CN=user,OU=OrgUnit,O=myOrg,...` | `undefined` |\n\n#### See Also\n\n- [node.js driver X509 reference](http://bit.ly/mongodb-node-driver-x509)\n- [node.js driver X509 functional test][x509-functional]\n\n### SSL\n\n> **Note**: Not to be confused with `authentication=X509`\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ssl` | Number/String | A boolean to enable or disables TLS/SSL for the connection | `undefined` |\n| `sslMethod` | String | The desired ssl method. Possible values: `NONE`, `SYSTEMCA`, `IFAVAILABLE`, `UNVALIDATED`, `SERVER`, `ALL` | `NONE` |\n| `sslCA` | Buffer/String | Array of valid certificates | `undefined` |\n| `sslCert` | Buffer/String | The certificate | `undefined` |\n| `sslKey` | Buffer/String | The certificate private key | `undefined` |\n| `sslPass` | Buffer/String | The certificate password | `undefined` |\n\nDescription of `sslMethod` values:\n\n- `SYSTEMCA` - SSL required, validate using System CA, with host verification.\n- `IFAVAILABLE` - The driver should try SSL first, fall back to no SSL if unavailable, and use the system's Certificate Authority.\n- `SERVER` - The driver should validate the server certificate and fail to connect if validation fails. See also [node.js driver \"Validate Server Certificate\" docs][driver-ssl-server].\n- `ALL` - The driver must present a valid certificate and validate the server certificate. See also [node.js driver \"Validate Server Certificate and Present Valid Certificate\" docs][driver-ssl-all].\n- `NONE` - No SSL (Not recommended).\n- `UNVALIDATED` - Use SSL but do not perform any validation of the certificate chain. See also [node.js driver \"No Certificate Validation\" docs][driver-ssl-none]. **Very** not recommended and likely to be deprecated in future releases because it exposes potential Man-In-The-Middle attack vectors.\n\n#### See also\n\n- [node.js driver SSL implementation][driver-ssl-impl]\n- [node.js driver SSL tutorial][driver-ssl-tutorial]\n\n### SSH TUNNEL\n\n> New in mongodb-connection-model@5.0.0\n\nBecause [authentication](#authentication) is quite difficult for operators to migrate to, the most common method of securing a MongoDB deployment is to use an [SSH tunnel][sf-ssh-tunnel].  This allows operators to leverage their existing SSH security infrastructure to also provide secure access to MongoDB.  For a standard deployment of MongoDB on AWS, this is almost always to strategy.  Because of this, we now support creating SSH tunnels automatically when connecting to MongoDB.\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options, (connectionError, client) => {\n  if (connectionError) {\n    return console.log(connectionError);\n  }\n\n  client.db('mongodb').collection('fanclub').count((countingError, count) => {\n    console.log('counted:', countingError, count);\n    client.close();\n  });\n});\n```\n\nThe above provides the same functionality as creating the tunnel using the bash\ncommand below and connecting to MongoDB via another terminal. Notice that\nconnection-model uses a random local port each time it creates a tunnel.\nUsing the command line, you'd have to replace `<random port>` with an actual\nport number.\n\n```bash\nssh -i ~/.ssh/my-key-aws-pair.pem -L <random port>:localhost:27017 ubuntu@ec2-11-111-111-111.compute-1.amazonaws.com\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `sshTunnel` | String | The desired SSH tunnel strategy. Possible values: `NONE`, `USER_PASSWORD`, `IDENTITY_FILE` | `undefined` |\n| `sshTunnelHostname` | String | The hostname of the SSH remote host | `undefined` |\n| `sshTunnelPort` | Port | The SSH port of the remote host | `22` |\n| `sshTunnelBindToLocalPort` | Port | Bind the localhost endpoint of the SSH Tunnel to this port | `undefined` |\n| `sshTunnelUsername` | String | The optional SSH username for the remote host | `undefined` |\n| `sshTunnelPassword` | String | The optional SSH password for the remote host | `undefined` |\n| `sshTunnelIdentityFile` | String/Array | The optional path to the SSH identity file for the remote host | `undefined` |\n| `sshTunnelPassphrase` | String | The optional passphrase for `sshTunnelIdentityFile` | `undefined` |\n\nDescription of `sshTunnel` values:\n\n- `NONE` - Do not use SSH tunneling.\n- `USER_PASSWORD` - The tunnel is created with SSH username and password only.\n- `IDENTITY_FILE` - The tunnel is created using an identity file.\n\n## Derived Properties\n\nDerived properties (also known as computed properties) are properties of the state object that depend on other properties to determine their value.\n\n```javascript\nconst c = new Connection();\nconst derivedProps = c.getAttributes({ derived: true });\n```\n\n| Derived Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `instanceId` | String | The mongoscope | `localhost:27017` |\n| `driverAuthMechanism` | String | Converts the value of `authStrategy` for humans into the `authMechanism` value for the driver | `undefined` |\n| `safeUrl` | String | The URL where a password is replaced with stars | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrl` | String | Use this URL in order to connect via DataService | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrlWithSsh` | String | Use this URL in order to connect via connection model itself | `mongodb://localhost:29201/?readPreference=primary&ssl=false` |\n| `driverOptions` | String | The second argument `mongoscope-server` passes to `mongodb.connect` | `{}` |\n\n## Events\n\n> New in mongodb-connection-model@5.0.0\n\n#### Example: SSH Tunnel\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', skipped: true,\n  reason: 'The selected SSL mode does not need to load any files.' }\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', complete: true}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n#### Example: SSL\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  ssl: 'ALL',\n  sslCA: '~/.ssl/my-ca.pem',\n  sslCert: '~/.ssl/my-server.pem',\n  sslKey: '~/.ssl/my-server.pem'\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', complete: true}\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', skipped: true,\n  reason: 'The selected SSH Tunnel mode is NONE.'}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n[workflow_img]: https://github.com/mongodb-js/connection-model/workflows/Check%20and%20Test/badge.svg?event=push\n[workflow_url]: https://github.com/mongodb-js/connection-model/actions?query=workflow%3A%22Check+and+Test%22\n[npm_img]: https://img.shields.io/npm/v/mongodb-connection-model.svg?style=flat-square\n[npm_url]: https://www.npmjs.org/package/mongodb-connection-model\n[gitter_img]: https://badges.gitter.im/Join%20Chat.svg\n[gitter_url]: http://gitter.im/mongodb-js/mongodb-js\n[enterprise_img]: https://img.shields.io/badge/MongoDB-Enterprise-blue.svg?style=flat-square\n[coming_soon_img]: https://img.shields.io/badge/-Coming%20Soon-ff69b4.svg?style=flat-square\n[kerberos-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/kerberos_tests.js\n[ldap-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ldap_tests.js\n[x509-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ssl_x509_tests.js\n[ns]: https://github.com/mongodb-js/ns\n[sf-ssh-tunnel]: http://serverfault.com/questions/597765/how-to-connect-to-mongodb-server-via-ssh-tunnel\n[ec2-key-pairs]: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html\n[driver-ssl-impl]: https://github.com/christkv/mongodb-core/blob/c3d21cb636d74d7a68134ecd3b9f6af536311279/lib/connection/connection.js#L365-L407\n[driver-ssl-tutorial]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/\n[driver-ssl-none]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#no-certificate-validation\n[driver-ssl-server]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate\n[driver-ssl-all]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate-and-present-valid-certificate\n","gitHead":"1cb9ea1724d90e58422b33fe089df5b774e0be10","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","test":"mocha","check":"npm run lint && npm run depcheck","pretest":"mongodb-runner install && mongodb-runner start --port=27018","test-ci":"npm run test","depcheck":"depcheck","posttest":"mongodb-runner stop --port=27018","posttest-ci":"node ../../scripts/killall-mongo.js","test-check-ci":"npm run check && npm test"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.17.0+x64 (linux)","description":"MongoDB connection model.","directories":{},"_nodeVersion":"16.17.0","compass:main":"index.js","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","debug":"^4.2.0","lodash":"^4.17.15","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.2.0","storage-mixin":"0.0.0-next-1cb9ea1724d90e58422b33fe089df5b774e0be10","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.2","@mongodb-js/ssh-tunnel":"0.0.0-next-1cb9ea1724d90e58422b33fe089df5b774e0be10","@mongodb-js/compass-utils":"0.0.0-next-1cb9ea1724d90e58422b33fe089df5b774e0be10","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.5.4"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"^4.10.0","depcheck":"^1.4.1","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.9.0","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^4.10.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_0.0.0-next-1cb9ea1724d90e58422b33fe089df5b774e0be10_1665172168619_0.5318456355291232","host":"s3://npm-registry-packages"}},"0.0.0-next-4216a27cdf41425fff35938bb42040bb93c2d246":{"name":"mongodb-connection-model","version":"0.0.0-next-4216a27cdf41425fff35938bb42040bb93c2d246","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@0.0.0-next-4216a27cdf41425fff35938bb42040bb93c2d246","maintainers":[{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"iteng@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"8b34b73404cf7fd0a0a7b0c8c93ddf6a03979930","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-0.0.0-next-4216a27cdf41425fff35938bb42040bb93c2d246.tgz","fileCount":20,"integrity":"sha512-E2RnDnC2jA1yA/DJLwDM9cJ7XJM6fwXmp+TVjGV/WWD6YJHPtHSAr79NVY45Iwm6t5ZNtV9lw/VMijGprBRqsg==","signatures":[{"sig":"MEUCIQDxsTRH3GLbaZOw8klzwOkEJlF4llQL6lxlH9qE3k0maQIgerhZiSDeghy3t4bxDRrkZOuAf5g5Lq7pNltkLa6xrtk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":108152,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjQIVOACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpyVA/8C4EcmHY3+WIqI1xIj7IMc//JhU+SAG9KMOXf/MXvrFOjyz3I\r\nIg/ydmS7hq+8uQ6fQUBBvdMv1VRGVSFahJR7d9lJid6KMgtg8jCgi4QFmpiE\r\n6+7lEu/sCOEiD3taPdFqeV4ffvr8e0AIdymRVKgt11pFSMl9Bg1MuiWzjRpm\r\n3dqeMLBP7E8Nffhnty2EtLYKGjn8yVYHXwXO19Dm6rBqrrsDt1kcpd6r6XtV\r\nfAVf6zPD3bCBvaFGjKLeg67BC2E6JQYzZmmNJHpIsPSXiqO1AYftudUEIK+I\r\nimlWOHiD/JLAwDWe6GmKUnL6YVqdHL5oix1XvRYB88HSO5572gYx0w+PHJ9D\r\nLdr9Vjxjy4+X5Kk0g0qWyE4izIFASKxx8Gprhe//kfUQ20FUOkG4bDqT/+re\r\nsSADKBp8WPSwHKQz2koqrSiimsxP5QhHdLPJUQRroUCjq2xcWT6Qt75SvBpv\r\nV+dGXCB5WsJ2PTuc3S1yIAChESWJAn2qCtgQazPg3w1XrbQ2r12Phwcc26R/\r\nMgZ3fBuVOPnFUErdzy+NcOxPQeF/GSjjraFWTfYY6k5tQFInfkxhft95INak\r\nTaLxRIb8JSaku3Ry04xylAtSUo7z7GfbEBQlTNByUfY/kYolNT3uA4r/RJ1S\r\nVHjAzoXc9geDeVv9DXst2Iub6TKds+GdEfs=\r\n=LrHq\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","readme":"# mongodb-connection-model [![][workflow_img]][workflow_url] [![][npm_img]][npm_url]\n\n> MongoDB connection model\n\nThe main purpose of the MongoDB connection model is to be a domain model around a MongoDB connection. It encapsulates generating a [Connection String URI](https://docs.mongodb.com/manual/reference/connection-string/) from a group of attributes and parses URI using the [MongoDB Node.JS Driver URI Parser](https://github.com/mongodb-js/mongodb-core/blob/master/lib/uri_parser.js).\n\n## Installation\n\n```\nnpm install --save mongodb-connection-model\n```\n\n## Usage\n\n### Building URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\nconst c = new Connection({ appname: 'My App Name' });\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://localhost:27017/?readPreference=primary&appname=My%20App&ssl=false'\n```\n\n### Parsing URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\n\nConnection.from(\n  'mongodb://someUsername:testPassword@localhost',\n  (error, result) => {\n    console.log(result);\n    >>> `{\n      hosts: [{ host: 'localhost', port: 27017 }],\n      hostname: 'localhost',\n      port: 27017,\n      auth: {\n        username: 'someUsername',\n        password: 'testPassword',\n        db: 'admin'\n      },\n      isSrvRecord: false,\n      authStrategy: 'MONGODB',\n      mongodbUsername: 'someUsername',\n      mongodbPassword: 'testPassword',\n      mongodbDatabaseName: 'admin',\n      extraOptions: {},\n      connectionType: 'NODE_DRIVER',\n      readPreference: 'primary',\n      kerberosCanonicalizeHostname: false,\n      sslMethod: 'NONE',\n      sshTunnel: 'NONE',\n      sshTunnelPort: 22\n    }`\n  }\n);\n```\n\n## Properties\n\nMongoDB connection model is based on Ampersand.js framework and consist of [props](https://ampersandjs.com/docs/#ampersand-state-props) and [derived props](https://ampersandjs.com/docs/#ampersand-state-derived). The props object describes the observable properties that MongoDB connection model gets from the Node.js Driver API.\n\n```javascript\nconst с = new Connection();\nconst props = с.getAttributes({ props: true });\n```\n\n#### See Also\n\n- [URI Generic Syntax](https://tools.ietf.org/html/rfc3986)\n- [URI Options Specification](https://github.com/mongodb/specifications/blob/master/source/uri-options/uri-options.rst)\n\n### General Properties\n\n```javascript\nconst c = new Connection({ isSrvRecord: true });\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ns` | String | A valid [ns][ns] the user can read from | `undefined` |\n| `isSrvRecord` | Boolean | Indicates SRV record | `false` |\n| `auth` | Object | Authentication from driver (username, user, db, password) | `undefined` |\n| `hostname` | String | Hostname of a MongoDB Instance. In case of the replica set the first host and port will be taken | `localhost` |\n| `port` | Number | TCP port of a MongoDB Instance | `27017` |\n| `hosts` | Array | Contains all hosts and ports for replica set | `[{ host: 'localhost', port: 27017 }]` |\n| `extraOptions` | Object | Extra options passed to the node driver as part of `driverOptions` | `{}` |\n| `connectionType` | String | The desired connection type. Possible values: `NODE_DRIVER`, `STITCH_ON_PREM`, `STITCH_ATLAS` | `NODE_DRIVER` |\n| `authStrategy` | String | The desired authentication strategy. Possible values: `NONE`, `MONGODB`, `X509`, `KERBEROS`, `LDAP`, `SCRAM-SHA-256` | `NONE` |\n\n### Connection string options\n\n```javascript\nconst c = new Connection({ appname: 'My App', replicaSet: 'testing' });\n```\n\n#### General connection string options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `replicaSet` | String | Specifies the name of the replica set, if the mongod is a member of a replica set | `undefined` |\n| `connectTimeoutMS` | Number | The time in milliseconds to attempt a connection before timing out | `undefined` |\n| `socketTimeoutMS` | Number | The time in milliseconds to attempt a send or receive on a socket before the attempt times out | `undefined` |\n| `compression` | Object | Object includes compressors and a compression level. The following compressors can be specified: `snappy`, `zlib` (Available in MongoDB 3.6 or greater) | `undefined` |\n\n#### Connection Pool Option\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `maxPoolSize` | Number | The maximum number of connections in the connection pool | `undefined` |\n| `minPoolSize` | Number | The minimum number of connections in the connection pool | `undefined` |\n| `maxIdleTimeMS` | Number | The maximum number of milliseconds that a connection can remain idle in the pool before being removed and closed | `undefined` |\n| `waitQueueMultiple` | Number | A number that the driver multiples the maxPoolSize value to, to provide the maximum number of threads allowed to wait for a connection to become available from the pool | `undefined` |\n| `waitQueueTimeoutMS` | Number | The maximum time in milliseconds that a thread can wait for a connection to become available | `undefined` |\n\n#### Write Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `w` | Number/String | Corresponds to the write concern [w Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-w) | `undefined` |\n| `wTimeoutMS` | Number | Corresponds to the write concern [wtimeout](https://docs.mongodb.com/manual/reference/write-concern/#wc-wtimeout) | `undefined` |\n| `journal` | Boolean | Corresponds to the write concern [j Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-j) | `undefined` |\n\n#### Read Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readConcernLevel` | String | The level of isolation | `undefined` |\n\n#### Read Preference Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readPreference` | String | Specifies the read preferences for this connection. Possible values: `PRIMARY`, `PRIMARY_PREFERRED`, `SECONDARY`, `SECONDARY_PREFERRED`, `NEAREST` | `PRIMARY` |\n| `maxStalenessSeconds` | Number | Specifies, in seconds, how stale a secondary can be before the client stops using it for read operations | `undefined` |\n| `readPreferenceTags` | Object | Default read preference tags for the client | `undefined` |\n\n#### Authentication Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `authSource` | String | Specify the database name associated with the user’s credentials | `undefined` |\n| `authMechanism` | String | Specifies the authentication mechanism that MongoDB will use to authenticate the connection. Possible values: `DEFAULT`, `GSSAPI`, `MONGODB-X509`, `PLAIN`, `SCRAM-SHA-256` | `undefined` |\n| `authMechanismProperties` | Object | Additional options provided for authentication (e.g. to enable hostname canonicalization for GSSAPI) | `undefined` |\n| `gssapiServiceName` | String | Set the Kerberos service name when connecting to Kerberized MongoDB instances | `undefined` |\n| `gssapiServiceRealm` | String | Set the Realm service name | `undefined` |\n| `gssapiCanonicalizeHostName` | Boolean | Whether canonicalized hostname | `undefined` |\n\n#### Server Selection and Discovery Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `localThresholdMS` | Number | The size (in milliseconds) of the latency window for selecting among multiple suitable MongoDB instances | `undefined` |\n| `serverSelectionTimeoutMS` | Number | Specifies how long (in milliseconds) to block for server selection before throwing an exception | `undefined` |\n| `serverSelectionTryOnce` | Boolean | Instructs the driver to scan the MongoDB deployment exactly once after server selection fails and then either select a server or raise an error | `undefined` |\n| `heartbeatFrequencyMS` | Number | Controls when the driver checks the state of the MongoDB deployment | `undefined` |\n\n#### Miscellaneous Configuration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `appname` | String | An application name passed to server as client metadata | `undefined` |\n| `retryWrites` | Boolean | Enable retryable writes | `undefined` |\n| `uuidRepresentation` | String | The legacy representation of UUID. Possible values: `standard`, `csharpLegacy`, `javaLegacy`, `pythonLegacy` | `undefined` |\n| `loadBalanced` | Boolean | Whether or not the server is running in load balanced mode | `undefined` |\n\n### Stitch attributes\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `stitchServiceName` | String | Stitch service name | `undefined` |\n| `stitchClientAppId` | String | Stitch сlient app ID | `undefined` |\n| `stitchGroupId` | String | Stitch group ID | `undefined` |\n| `stitchBaseUrl` | String | Stitch base Url | `undefined` |\n\n### MONGODB authentication\n\n```javascript\nconst c = new Connection({\n  mongodbUsername: 'arlo',\n  mongodbPassword: 'w@of'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/?slaveOk=true&authSource=admin'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `mongodbUsername` | String | MongoDB username | `undefined` |\n| `mongodbPassword` | String | MongoDB password | `undefined` |\n| `mongodbDatabaseName` | String | The database name associated with the user's credentials | `undefined` |\n| `promoteValues` | Boolean | Whether BSON values should be promoted to their JS type counterparts | `undefined` |\n\n### KERBEROS authentication\n\n```javascript\nconst c = new Connection({\n  kerberosServiceName: 'mongodb',\n  kerberosPrincipal: 'arlo/dog@krb5.mongodb.parts',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo%252Fdog%2540krb5.mongodb.parts@localhost:27017/toys?authMechanism=GSSAPI'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n> @note (imlucas): Kerberos on Windows is broken out as it's own state for UX consideration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `kerberosServiceName` | String | Any program or computer you access over a network | `undefined` |\n| `kerberosPrincipal` | String | The format of a typical Kerberos V5 principal is `primary/instance@REALM` | `undefined` |\n| `kerberosCanonicalizeHostname` | Boolean | Whether canonicalized kerberos hostname | `undefined` |\n\n#### See Also\n\n- [node.js driver Kerberos reference](http://bit.ly/mongodb-node-driver-kerberos)\n- [node.js driver Kerberos functional test][kerberos-functional]\n\n### LDAP authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  ldapUsername: 'arlo',\n  ldapPassword: 'w@of',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/toys?slaveOk=true&authMechanism=PLAIN'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ldapUsername` | String | LDAP username | `undefined` |\n| `ldapPassword` | String | LDAP password | `undefined` |\n\n#### See Also\n\n- [node.js driver LDAP reference](http://bit.ly/mongodb-node-driver-ldap)\n- [node.js driver X509 functional test][ldap-functional]\n\n### X509 authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  x509Username: 'CN=client,OU=arlo,O=MongoDB,L=Philadelphia,ST=Pennsylvania,C=US'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://CN%253Dclient%252COU%253Darlo%252CO%253DMongoDB%252CL%253DPhiladelphia%252CST%253DPennsylvania%252CC%253DUS@localhost:27017?slaveOk=true&authMechanism=MONGODB-X509'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `x509Username` | String | The x.509 certificate derived user name, e.g. `CN=user,OU=OrgUnit,O=myOrg,...` | `undefined` |\n\n#### See Also\n\n- [node.js driver X509 reference](http://bit.ly/mongodb-node-driver-x509)\n- [node.js driver X509 functional test][x509-functional]\n\n### SSL\n\n> **Note**: Not to be confused with `authentication=X509`\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ssl` | Number/String | A boolean to enable or disables TLS/SSL for the connection | `undefined` |\n| `sslMethod` | String | The desired ssl method. Possible values: `NONE`, `SYSTEMCA`, `IFAVAILABLE`, `UNVALIDATED`, `SERVER`, `ALL` | `NONE` |\n| `sslCA` | Buffer/String | Array of valid certificates | `undefined` |\n| `sslCert` | Buffer/String | The certificate | `undefined` |\n| `sslKey` | Buffer/String | The certificate private key | `undefined` |\n| `sslPass` | Buffer/String | The certificate password | `undefined` |\n\nDescription of `sslMethod` values:\n\n- `SYSTEMCA` - SSL required, validate using System CA, with host verification.\n- `IFAVAILABLE` - The driver should try SSL first, fall back to no SSL if unavailable, and use the system's Certificate Authority.\n- `SERVER` - The driver should validate the server certificate and fail to connect if validation fails. See also [node.js driver \"Validate Server Certificate\" docs][driver-ssl-server].\n- `ALL` - The driver must present a valid certificate and validate the server certificate. See also [node.js driver \"Validate Server Certificate and Present Valid Certificate\" docs][driver-ssl-all].\n- `NONE` - No SSL (Not recommended).\n- `UNVALIDATED` - Use SSL but do not perform any validation of the certificate chain. See also [node.js driver \"No Certificate Validation\" docs][driver-ssl-none]. **Very** not recommended and likely to be deprecated in future releases because it exposes potential Man-In-The-Middle attack vectors.\n\n#### See also\n\n- [node.js driver SSL implementation][driver-ssl-impl]\n- [node.js driver SSL tutorial][driver-ssl-tutorial]\n\n### SSH TUNNEL\n\n> New in mongodb-connection-model@5.0.0\n\nBecause [authentication](#authentication) is quite difficult for operators to migrate to, the most common method of securing a MongoDB deployment is to use an [SSH tunnel][sf-ssh-tunnel].  This allows operators to leverage their existing SSH security infrastructure to also provide secure access to MongoDB.  For a standard deployment of MongoDB on AWS, this is almost always to strategy.  Because of this, we now support creating SSH tunnels automatically when connecting to MongoDB.\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options, (connectionError, client) => {\n  if (connectionError) {\n    return console.log(connectionError);\n  }\n\n  client.db('mongodb').collection('fanclub').count((countingError, count) => {\n    console.log('counted:', countingError, count);\n    client.close();\n  });\n});\n```\n\nThe above provides the same functionality as creating the tunnel using the bash\ncommand below and connecting to MongoDB via another terminal. Notice that\nconnection-model uses a random local port each time it creates a tunnel.\nUsing the command line, you'd have to replace `<random port>` with an actual\nport number.\n\n```bash\nssh -i ~/.ssh/my-key-aws-pair.pem -L <random port>:localhost:27017 ubuntu@ec2-11-111-111-111.compute-1.amazonaws.com\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `sshTunnel` | String | The desired SSH tunnel strategy. Possible values: `NONE`, `USER_PASSWORD`, `IDENTITY_FILE` | `undefined` |\n| `sshTunnelHostname` | String | The hostname of the SSH remote host | `undefined` |\n| `sshTunnelPort` | Port | The SSH port of the remote host | `22` |\n| `sshTunnelBindToLocalPort` | Port | Bind the localhost endpoint of the SSH Tunnel to this port | `undefined` |\n| `sshTunnelUsername` | String | The optional SSH username for the remote host | `undefined` |\n| `sshTunnelPassword` | String | The optional SSH password for the remote host | `undefined` |\n| `sshTunnelIdentityFile` | String/Array | The optional path to the SSH identity file for the remote host | `undefined` |\n| `sshTunnelPassphrase` | String | The optional passphrase for `sshTunnelIdentityFile` | `undefined` |\n\nDescription of `sshTunnel` values:\n\n- `NONE` - Do not use SSH tunneling.\n- `USER_PASSWORD` - The tunnel is created with SSH username and password only.\n- `IDENTITY_FILE` - The tunnel is created using an identity file.\n\n## Derived Properties\n\nDerived properties (also known as computed properties) are properties of the state object that depend on other properties to determine their value.\n\n```javascript\nconst c = new Connection();\nconst derivedProps = c.getAttributes({ derived: true });\n```\n\n| Derived Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `instanceId` | String | The mongoscope | `localhost:27017` |\n| `driverAuthMechanism` | String | Converts the value of `authStrategy` for humans into the `authMechanism` value for the driver | `undefined` |\n| `safeUrl` | String | The URL where a password is replaced with stars | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrl` | String | Use this URL in order to connect via DataService | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrlWithSsh` | String | Use this URL in order to connect via connection model itself | `mongodb://localhost:29201/?readPreference=primary&ssl=false` |\n| `driverOptions` | String | The second argument `mongoscope-server` passes to `mongodb.connect` | `{}` |\n\n## Events\n\n> New in mongodb-connection-model@5.0.0\n\n#### Example: SSH Tunnel\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', skipped: true,\n  reason: 'The selected SSL mode does not need to load any files.' }\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', complete: true}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n#### Example: SSL\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  ssl: 'ALL',\n  sslCA: '~/.ssl/my-ca.pem',\n  sslCert: '~/.ssl/my-server.pem',\n  sslKey: '~/.ssl/my-server.pem'\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', complete: true}\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', skipped: true,\n  reason: 'The selected SSH Tunnel mode is NONE.'}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n[workflow_img]: https://github.com/mongodb-js/connection-model/workflows/Check%20and%20Test/badge.svg?event=push\n[workflow_url]: https://github.com/mongodb-js/connection-model/actions?query=workflow%3A%22Check+and+Test%22\n[npm_img]: https://img.shields.io/npm/v/mongodb-connection-model.svg?style=flat-square\n[npm_url]: https://www.npmjs.org/package/mongodb-connection-model\n[gitter_img]: https://badges.gitter.im/Join%20Chat.svg\n[gitter_url]: http://gitter.im/mongodb-js/mongodb-js\n[enterprise_img]: https://img.shields.io/badge/MongoDB-Enterprise-blue.svg?style=flat-square\n[coming_soon_img]: https://img.shields.io/badge/-Coming%20Soon-ff69b4.svg?style=flat-square\n[kerberos-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/kerberos_tests.js\n[ldap-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ldap_tests.js\n[x509-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ssl_x509_tests.js\n[ns]: https://github.com/mongodb-js/ns\n[sf-ssh-tunnel]: http://serverfault.com/questions/597765/how-to-connect-to-mongodb-server-via-ssh-tunnel\n[ec2-key-pairs]: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html\n[driver-ssl-impl]: https://github.com/christkv/mongodb-core/blob/c3d21cb636d74d7a68134ecd3b9f6af536311279/lib/connection/connection.js#L365-L407\n[driver-ssl-tutorial]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/\n[driver-ssl-none]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#no-certificate-validation\n[driver-ssl-server]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate\n[driver-ssl-all]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate-and-present-valid-certificate\n","gitHead":"4216a27cdf41425fff35938bb42040bb93c2d246","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","test":"mocha","check":"npm run lint && npm run depcheck","pretest":"mongodb-runner install && mongodb-runner start --port=27018","test-ci":"npm run test","depcheck":"depcheck","posttest":"mongodb-runner stop --port=27018","posttest-ci":"node ../../scripts/killall-mongo.js","test-check-ci":"npm run check && npm test"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.17.0+x64 (linux)","description":"MongoDB connection model.","directories":{},"_nodeVersion":"16.17.0","compass:main":"index.js","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","debug":"^4.2.0","lodash":"^4.17.15","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.2.0","storage-mixin":"0.0.0-next-4216a27cdf41425fff35938bb42040bb93c2d246","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.2","@mongodb-js/ssh-tunnel":"0.0.0-next-4216a27cdf41425fff35938bb42040bb93c2d246","@mongodb-js/compass-utils":"0.0.0-next-4216a27cdf41425fff35938bb42040bb93c2d246","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.5.4"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"^4.10.0","depcheck":"^1.4.1","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.9.0","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^4.10.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_0.0.0-next-4216a27cdf41425fff35938bb42040bb93c2d246_1665172814215_0.16669097562265534","host":"s3://npm-registry-packages"}},"22.1.2":{"name":"mongodb-connection-model","version":"22.1.2","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@22.1.2","maintainers":[{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"iteng@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"0966e6ca23a56640d67b5986952ac11478dab401","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-22.1.2.tgz","fileCount":20,"integrity":"sha512-vjLFGeq3Tce/5axb00BoplDk4waQOm/wEmud4mzHNoGRp18/n7rF5gFFoJAaMgsWeqXqzi14vwUrgM/FTMytrg==","signatures":[{"sig":"MEUCIDlAyTzBhxDEQXfvEFTlM22oBPaKFTw51/2Yq/Nm0WRuAiEAqaWupqFmRrAd7qdn8fRAzMMV9c90C1DXgjq64C1XdMc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":107972,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjYj1SACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo4/BAAkRNAx5dd8R7Pkoq6xBp93fCn/5RlUXMUi7aIuY9zSq0Xh+gx\r\nHPESx8sggdm+0q3BKfm7NdQIClJ4CZ5a0Vu2b/azKmkpSKzvWJp+MwdINJa6\r\nPPZ79XaHEvKQ1GlMGgvReawBJHf3dnoCPKAYJRnHqMRkFHyCCERtgx206afj\r\nKZlIZ5d2OTli01QbXd1ZuyJwCrZlX8R6w1Z9CDvOGuNTEhvraRToartniJNs\r\nhltdVhbEPPzrI/7spLUmIET0hKtdFDkaXSN5rkpbRhfSV1gtn+z/gdhb+E6b\r\nNrIYsacE8DJcg10Ks5nB8eHaR74g+Av1XmvkNC5PLPOmzVdd4feNi4M3HrGd\r\nDabqVXHAVPywjfzHnkymR3WNYicqXwyOp4RZeq/xckzwTvNHOiCYm7pYkH4r\r\nkld6U6t5xjbBAfiv3CD2AUdwtyzqU1NSpIg3M8NETqCC8w3tLbEqdWTJVowh\r\noQpRvOVeqCcJ5hQ8gLAgeF8q/m3T+5ctsZnlXP2l/8Asmkv28856LmfjgyPl\r\nTMpu0/SU56ngOMsoTP3L27sVrlsjNIsTw03BmhOxSGw4ziXUc/W40noYqAnC\r\n9yMTevH9/rAUBoQyICln5hzL4z5JI7RNDHEuF2TuhDs8P39iFCoPFysgoDvY\r\nksFAsOiTyq54k5Wy1lAJ5SpMtoLvaitVXhY=\r\n=GIBP\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","gitHead":"10815be8fd57f3bfd89d061e1592eb7136d4a0fb","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","test":"mocha","check":"npm run lint && npm run depcheck","pretest":"mongodb-runner install && mongodb-runner start --port=27018","test-ci":"npm run test","depcheck":"depcheck","posttest":"mongodb-runner stop --port=27018","posttest-ci":"node ../../scripts/killall-mongo.js","test-check-ci":"npm run check && npm test"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.17.1+x64 (linux)","description":"MongoDB connection model.","directories":{},"_nodeVersion":"16.17.1","compass:main":"index.js","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","debug":"^4.2.0","lodash":"^4.17.15","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.2.0","storage-mixin":"^5.1.0","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.2","@mongodb-js/ssh-tunnel":"^2.0.1","@mongodb-js/compass-utils":"^0.1.1","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.5.4"},"_hasShrinkwrap":false,"devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"^4.10.0","depcheck":"^1.4.1","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.9.0","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^4.10.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_22.1.2_1667382609921_0.8638201153538201","host":"s3://npm-registry-packages"}},"0.0.0-next-10815be8fd57f3bfd89d061e1592eb7136d4a0fb":{"name":"mongodb-connection-model","version":"0.0.0-next-10815be8fd57f3bfd89d061e1592eb7136d4a0fb","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@0.0.0-next-10815be8fd57f3bfd89d061e1592eb7136d4a0fb","maintainers":[{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"iteng@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"134bb1bb7d37dc575622fc868ac1405ebf248eb8","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-0.0.0-next-10815be8fd57f3bfd89d061e1592eb7136d4a0fb.tgz","fileCount":20,"integrity":"sha512-L5/PCFixUcr8pgKGYQcZRSKx0BiQOAs/aWBno1qqdRXorGEE5fMsLqWQDd8CWXKtoKnvHYGoSt7aXnQDhITBVQ==","signatures":[{"sig":"MEQCIAFrei/JofU3bNn0abEJnoWDhHgwceBf5eSdGbMdpG+hAiBmfFyoxdaPL+lmOR88yZQcW5Fmz+99B0HNJ8EP8AMxpQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":108152,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjYlToACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrMjA//f7c8o0jqNE5moTvwbMPsWiW2a1u1X88MzyYJTsKYePQgIdyX\r\nr5a3+Y+p0/WiBTm56Nbfsfu8bEJRtfUmYJuUZoj5jmpccaGoajG1B4V6Bfr6\r\nQJUdIBMWYhV35SQQo8tfmpZLywI52Ha5EZRoY8PWfytuu6XCVZQv9QOMh7EW\r\nwsAUENc+1NqIetvtvjXwXoyScTG9epGLogEgmUzAw/cEiF2xQ3ysfVmp1J6u\r\nCSxFL0/FGLwgdpAvMZZCGgty8DH8uuybhP1qr2bNoSk3qF2JuEMNAZu7NUv6\r\nUv9zsz/nQhuzm6Ehu50IokTBoP34PlvS5LJhvX0BZjKBgXJ5uHNCs/8+w5Le\r\n/XMsuzdaEPmPlFjcFqis5JuYLnx7Ubx+r3JwZHdtOgrJ9LFpe01jjqiGbXS+\r\nbQXcqwOSM9BbO+oRUtIvA9uhmo5scrd9z0fVBdJj/nvSHH+Kr8qnUsHqt3gm\r\nzzZzjav/rJljod4GIpxxcE6bBucG0IoDJALCk2fXAumrngfVkZTb2lnNWiCi\r\n2CAPvBuIVtL3Lk+UWOzJoIZ1XJ0PNOUAD1B4QfXsdZzgedoXr5fD7Hq2xG/p\r\nb0/sSKYeYEPpJ6tBR9yQpjgUxFzv/ly5KKDMUYtJ510YYoQbKLCraqg1rfd5\r\n6S84DnHk/vvhQ7cvEJr3shvBReCpLfkn1Rc=\r\n=Qqn6\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","readme":"# mongodb-connection-model [![][workflow_img]][workflow_url] [![][npm_img]][npm_url]\n\n> MongoDB connection model\n\nThe main purpose of the MongoDB connection model is to be a domain model around a MongoDB connection. It encapsulates generating a [Connection String URI](https://docs.mongodb.com/manual/reference/connection-string/) from a group of attributes and parses URI using the [MongoDB Node.JS Driver URI Parser](https://github.com/mongodb-js/mongodb-core/blob/master/lib/uri_parser.js).\n\n## Installation\n\n```\nnpm install --save mongodb-connection-model\n```\n\n## Usage\n\n### Building URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\nconst c = new Connection({ appname: 'My App Name' });\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://localhost:27017/?readPreference=primary&appname=My%20App&ssl=false'\n```\n\n### Parsing URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\n\nConnection.from(\n  'mongodb://someUsername:testPassword@localhost',\n  (error, result) => {\n    console.log(result);\n    >>> `{\n      hosts: [{ host: 'localhost', port: 27017 }],\n      hostname: 'localhost',\n      port: 27017,\n      auth: {\n        username: 'someUsername',\n        password: 'testPassword',\n        db: 'admin'\n      },\n      isSrvRecord: false,\n      authStrategy: 'MONGODB',\n      mongodbUsername: 'someUsername',\n      mongodbPassword: 'testPassword',\n      mongodbDatabaseName: 'admin',\n      extraOptions: {},\n      connectionType: 'NODE_DRIVER',\n      readPreference: 'primary',\n      kerberosCanonicalizeHostname: false,\n      sslMethod: 'NONE',\n      sshTunnel: 'NONE',\n      sshTunnelPort: 22\n    }`\n  }\n);\n```\n\n## Properties\n\nMongoDB connection model is based on Ampersand.js framework and consist of [props](https://ampersandjs.com/docs/#ampersand-state-props) and [derived props](https://ampersandjs.com/docs/#ampersand-state-derived). The props object describes the observable properties that MongoDB connection model gets from the Node.js Driver API.\n\n```javascript\nconst с = new Connection();\nconst props = с.getAttributes({ props: true });\n```\n\n#### See Also\n\n- [URI Generic Syntax](https://tools.ietf.org/html/rfc3986)\n- [URI Options Specification](https://github.com/mongodb/specifications/blob/master/source/uri-options/uri-options.rst)\n\n### General Properties\n\n```javascript\nconst c = new Connection({ isSrvRecord: true });\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ns` | String | A valid [ns][ns] the user can read from | `undefined` |\n| `isSrvRecord` | Boolean | Indicates SRV record | `false` |\n| `auth` | Object | Authentication from driver (username, user, db, password) | `undefined` |\n| `hostname` | String | Hostname of a MongoDB Instance. In case of the replica set the first host and port will be taken | `localhost` |\n| `port` | Number | TCP port of a MongoDB Instance | `27017` |\n| `hosts` | Array | Contains all hosts and ports for replica set | `[{ host: 'localhost', port: 27017 }]` |\n| `extraOptions` | Object | Extra options passed to the node driver as part of `driverOptions` | `{}` |\n| `connectionType` | String | The desired connection type. Possible values: `NODE_DRIVER`, `STITCH_ON_PREM`, `STITCH_ATLAS` | `NODE_DRIVER` |\n| `authStrategy` | String | The desired authentication strategy. Possible values: `NONE`, `MONGODB`, `X509`, `KERBEROS`, `LDAP`, `SCRAM-SHA-256` | `NONE` |\n\n### Connection string options\n\n```javascript\nconst c = new Connection({ appname: 'My App', replicaSet: 'testing' });\n```\n\n#### General connection string options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `replicaSet` | String | Specifies the name of the replica set, if the mongod is a member of a replica set | `undefined` |\n| `connectTimeoutMS` | Number | The time in milliseconds to attempt a connection before timing out | `undefined` |\n| `socketTimeoutMS` | Number | The time in milliseconds to attempt a send or receive on a socket before the attempt times out | `undefined` |\n| `compression` | Object | Object includes compressors and a compression level. The following compressors can be specified: `snappy`, `zlib` (Available in MongoDB 3.6 or greater) | `undefined` |\n\n#### Connection Pool Option\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `maxPoolSize` | Number | The maximum number of connections in the connection pool | `undefined` |\n| `minPoolSize` | Number | The minimum number of connections in the connection pool | `undefined` |\n| `maxIdleTimeMS` | Number | The maximum number of milliseconds that a connection can remain idle in the pool before being removed and closed | `undefined` |\n| `waitQueueMultiple` | Number | A number that the driver multiples the maxPoolSize value to, to provide the maximum number of threads allowed to wait for a connection to become available from the pool | `undefined` |\n| `waitQueueTimeoutMS` | Number | The maximum time in milliseconds that a thread can wait for a connection to become available | `undefined` |\n\n#### Write Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `w` | Number/String | Corresponds to the write concern [w Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-w) | `undefined` |\n| `wTimeoutMS` | Number | Corresponds to the write concern [wtimeout](https://docs.mongodb.com/manual/reference/write-concern/#wc-wtimeout) | `undefined` |\n| `journal` | Boolean | Corresponds to the write concern [j Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-j) | `undefined` |\n\n#### Read Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readConcernLevel` | String | The level of isolation | `undefined` |\n\n#### Read Preference Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readPreference` | String | Specifies the read preferences for this connection. Possible values: `PRIMARY`, `PRIMARY_PREFERRED`, `SECONDARY`, `SECONDARY_PREFERRED`, `NEAREST` | `PRIMARY` |\n| `maxStalenessSeconds` | Number | Specifies, in seconds, how stale a secondary can be before the client stops using it for read operations | `undefined` |\n| `readPreferenceTags` | Object | Default read preference tags for the client | `undefined` |\n\n#### Authentication Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `authSource` | String | Specify the database name associated with the user’s credentials | `undefined` |\n| `authMechanism` | String | Specifies the authentication mechanism that MongoDB will use to authenticate the connection. Possible values: `DEFAULT`, `GSSAPI`, `MONGODB-X509`, `PLAIN`, `SCRAM-SHA-256` | `undefined` |\n| `authMechanismProperties` | Object | Additional options provided for authentication (e.g. to enable hostname canonicalization for GSSAPI) | `undefined` |\n| `gssapiServiceName` | String | Set the Kerberos service name when connecting to Kerberized MongoDB instances | `undefined` |\n| `gssapiServiceRealm` | String | Set the Realm service name | `undefined` |\n| `gssapiCanonicalizeHostName` | Boolean | Whether canonicalized hostname | `undefined` |\n\n#### Server Selection and Discovery Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `localThresholdMS` | Number | The size (in milliseconds) of the latency window for selecting among multiple suitable MongoDB instances | `undefined` |\n| `serverSelectionTimeoutMS` | Number | Specifies how long (in milliseconds) to block for server selection before throwing an exception | `undefined` |\n| `serverSelectionTryOnce` | Boolean | Instructs the driver to scan the MongoDB deployment exactly once after server selection fails and then either select a server or raise an error | `undefined` |\n| `heartbeatFrequencyMS` | Number | Controls when the driver checks the state of the MongoDB deployment | `undefined` |\n\n#### Miscellaneous Configuration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `appname` | String | An application name passed to server as client metadata | `undefined` |\n| `retryWrites` | Boolean | Enable retryable writes | `undefined` |\n| `uuidRepresentation` | String | The legacy representation of UUID. Possible values: `standard`, `csharpLegacy`, `javaLegacy`, `pythonLegacy` | `undefined` |\n| `loadBalanced` | Boolean | Whether or not the server is running in load balanced mode | `undefined` |\n\n### Stitch attributes\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `stitchServiceName` | String | Stitch service name | `undefined` |\n| `stitchClientAppId` | String | Stitch сlient app ID | `undefined` |\n| `stitchGroupId` | String | Stitch group ID | `undefined` |\n| `stitchBaseUrl` | String | Stitch base Url | `undefined` |\n\n### MONGODB authentication\n\n```javascript\nconst c = new Connection({\n  mongodbUsername: 'arlo',\n  mongodbPassword: 'w@of'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/?slaveOk=true&authSource=admin'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `mongodbUsername` | String | MongoDB username | `undefined` |\n| `mongodbPassword` | String | MongoDB password | `undefined` |\n| `mongodbDatabaseName` | String | The database name associated with the user's credentials | `undefined` |\n| `promoteValues` | Boolean | Whether BSON values should be promoted to their JS type counterparts | `undefined` |\n\n### KERBEROS authentication\n\n```javascript\nconst c = new Connection({\n  kerberosServiceName: 'mongodb',\n  kerberosPrincipal: 'arlo/dog@krb5.mongodb.parts',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo%252Fdog%2540krb5.mongodb.parts@localhost:27017/toys?authMechanism=GSSAPI'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n> @note (imlucas): Kerberos on Windows is broken out as it's own state for UX consideration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `kerberosServiceName` | String | Any program or computer you access over a network | `undefined` |\n| `kerberosPrincipal` | String | The format of a typical Kerberos V5 principal is `primary/instance@REALM` | `undefined` |\n| `kerberosCanonicalizeHostname` | Boolean | Whether canonicalized kerberos hostname | `undefined` |\n\n#### See Also\n\n- [node.js driver Kerberos reference](http://bit.ly/mongodb-node-driver-kerberos)\n- [node.js driver Kerberos functional test][kerberos-functional]\n\n### LDAP authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  ldapUsername: 'arlo',\n  ldapPassword: 'w@of',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/toys?slaveOk=true&authMechanism=PLAIN'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ldapUsername` | String | LDAP username | `undefined` |\n| `ldapPassword` | String | LDAP password | `undefined` |\n\n#### See Also\n\n- [node.js driver LDAP reference](http://bit.ly/mongodb-node-driver-ldap)\n- [node.js driver X509 functional test][ldap-functional]\n\n### X509 authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  x509Username: 'CN=client,OU=arlo,O=MongoDB,L=Philadelphia,ST=Pennsylvania,C=US'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://CN%253Dclient%252COU%253Darlo%252CO%253DMongoDB%252CL%253DPhiladelphia%252CST%253DPennsylvania%252CC%253DUS@localhost:27017?slaveOk=true&authMechanism=MONGODB-X509'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `x509Username` | String | The x.509 certificate derived user name, e.g. `CN=user,OU=OrgUnit,O=myOrg,...` | `undefined` |\n\n#### See Also\n\n- [node.js driver X509 reference](http://bit.ly/mongodb-node-driver-x509)\n- [node.js driver X509 functional test][x509-functional]\n\n### SSL\n\n> **Note**: Not to be confused with `authentication=X509`\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ssl` | Number/String | A boolean to enable or disables TLS/SSL for the connection | `undefined` |\n| `sslMethod` | String | The desired ssl method. Possible values: `NONE`, `SYSTEMCA`, `IFAVAILABLE`, `UNVALIDATED`, `SERVER`, `ALL` | `NONE` |\n| `sslCA` | Buffer/String | Array of valid certificates | `undefined` |\n| `sslCert` | Buffer/String | The certificate | `undefined` |\n| `sslKey` | Buffer/String | The certificate private key | `undefined` |\n| `sslPass` | Buffer/String | The certificate password | `undefined` |\n\nDescription of `sslMethod` values:\n\n- `SYSTEMCA` - SSL required, validate using System CA, with host verification.\n- `IFAVAILABLE` - The driver should try SSL first, fall back to no SSL if unavailable, and use the system's Certificate Authority.\n- `SERVER` - The driver should validate the server certificate and fail to connect if validation fails. See also [node.js driver \"Validate Server Certificate\" docs][driver-ssl-server].\n- `ALL` - The driver must present a valid certificate and validate the server certificate. See also [node.js driver \"Validate Server Certificate and Present Valid Certificate\" docs][driver-ssl-all].\n- `NONE` - No SSL (Not recommended).\n- `UNVALIDATED` - Use SSL but do not perform any validation of the certificate chain. See also [node.js driver \"No Certificate Validation\" docs][driver-ssl-none]. **Very** not recommended and likely to be deprecated in future releases because it exposes potential Man-In-The-Middle attack vectors.\n\n#### See also\n\n- [node.js driver SSL implementation][driver-ssl-impl]\n- [node.js driver SSL tutorial][driver-ssl-tutorial]\n\n### SSH TUNNEL\n\n> New in mongodb-connection-model@5.0.0\n\nBecause [authentication](#authentication) is quite difficult for operators to migrate to, the most common method of securing a MongoDB deployment is to use an [SSH tunnel][sf-ssh-tunnel].  This allows operators to leverage their existing SSH security infrastructure to also provide secure access to MongoDB.  For a standard deployment of MongoDB on AWS, this is almost always to strategy.  Because of this, we now support creating SSH tunnels automatically when connecting to MongoDB.\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options, (connectionError, client) => {\n  if (connectionError) {\n    return console.log(connectionError);\n  }\n\n  client.db('mongodb').collection('fanclub').count((countingError, count) => {\n    console.log('counted:', countingError, count);\n    client.close();\n  });\n});\n```\n\nThe above provides the same functionality as creating the tunnel using the bash\ncommand below and connecting to MongoDB via another terminal. Notice that\nconnection-model uses a random local port each time it creates a tunnel.\nUsing the command line, you'd have to replace `<random port>` with an actual\nport number.\n\n```bash\nssh -i ~/.ssh/my-key-aws-pair.pem -L <random port>:localhost:27017 ubuntu@ec2-11-111-111-111.compute-1.amazonaws.com\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `sshTunnel` | String | The desired SSH tunnel strategy. Possible values: `NONE`, `USER_PASSWORD`, `IDENTITY_FILE` | `undefined` |\n| `sshTunnelHostname` | String | The hostname of the SSH remote host | `undefined` |\n| `sshTunnelPort` | Port | The SSH port of the remote host | `22` |\n| `sshTunnelBindToLocalPort` | Port | Bind the localhost endpoint of the SSH Tunnel to this port | `undefined` |\n| `sshTunnelUsername` | String | The optional SSH username for the remote host | `undefined` |\n| `sshTunnelPassword` | String | The optional SSH password for the remote host | `undefined` |\n| `sshTunnelIdentityFile` | String/Array | The optional path to the SSH identity file for the remote host | `undefined` |\n| `sshTunnelPassphrase` | String | The optional passphrase for `sshTunnelIdentityFile` | `undefined` |\n\nDescription of `sshTunnel` values:\n\n- `NONE` - Do not use SSH tunneling.\n- `USER_PASSWORD` - The tunnel is created with SSH username and password only.\n- `IDENTITY_FILE` - The tunnel is created using an identity file.\n\n## Derived Properties\n\nDerived properties (also known as computed properties) are properties of the state object that depend on other properties to determine their value.\n\n```javascript\nconst c = new Connection();\nconst derivedProps = c.getAttributes({ derived: true });\n```\n\n| Derived Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `instanceId` | String | The mongoscope | `localhost:27017` |\n| `driverAuthMechanism` | String | Converts the value of `authStrategy` for humans into the `authMechanism` value for the driver | `undefined` |\n| `safeUrl` | String | The URL where a password is replaced with stars | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrl` | String | Use this URL in order to connect via DataService | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrlWithSsh` | String | Use this URL in order to connect via connection model itself | `mongodb://localhost:29201/?readPreference=primary&ssl=false` |\n| `driverOptions` | String | The second argument `mongoscope-server` passes to `mongodb.connect` | `{}` |\n\n## Events\n\n> New in mongodb-connection-model@5.0.0\n\n#### Example: SSH Tunnel\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', skipped: true,\n  reason: 'The selected SSL mode does not need to load any files.' }\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', complete: true}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n#### Example: SSL\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  ssl: 'ALL',\n  sslCA: '~/.ssl/my-ca.pem',\n  sslCert: '~/.ssl/my-server.pem',\n  sslKey: '~/.ssl/my-server.pem'\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', complete: true}\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', skipped: true,\n  reason: 'The selected SSH Tunnel mode is NONE.'}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n[workflow_img]: https://github.com/mongodb-js/connection-model/workflows/Check%20and%20Test/badge.svg?event=push\n[workflow_url]: https://github.com/mongodb-js/connection-model/actions?query=workflow%3A%22Check+and+Test%22\n[npm_img]: https://img.shields.io/npm/v/mongodb-connection-model.svg?style=flat-square\n[npm_url]: https://www.npmjs.org/package/mongodb-connection-model\n[gitter_img]: https://badges.gitter.im/Join%20Chat.svg\n[gitter_url]: http://gitter.im/mongodb-js/mongodb-js\n[enterprise_img]: https://img.shields.io/badge/MongoDB-Enterprise-blue.svg?style=flat-square\n[coming_soon_img]: https://img.shields.io/badge/-Coming%20Soon-ff69b4.svg?style=flat-square\n[kerberos-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/kerberos_tests.js\n[ldap-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ldap_tests.js\n[x509-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ssl_x509_tests.js\n[ns]: https://github.com/mongodb-js/ns\n[sf-ssh-tunnel]: http://serverfault.com/questions/597765/how-to-connect-to-mongodb-server-via-ssh-tunnel\n[ec2-key-pairs]: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html\n[driver-ssl-impl]: https://github.com/christkv/mongodb-core/blob/c3d21cb636d74d7a68134ecd3b9f6af536311279/lib/connection/connection.js#L365-L407\n[driver-ssl-tutorial]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/\n[driver-ssl-none]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#no-certificate-validation\n[driver-ssl-server]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate\n[driver-ssl-all]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate-and-present-valid-certificate\n","gitHead":"10815be8fd57f3bfd89d061e1592eb7136d4a0fb","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","test":"mocha","check":"npm run lint && npm run depcheck","pretest":"mongodb-runner install && mongodb-runner start --port=27018","test-ci":"npm run test","depcheck":"depcheck","posttest":"mongodb-runner stop --port=27018","posttest-ci":"node ../../scripts/killall-mongo.js","test-check-ci":"npm run check && npm test"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.17.0+x64 (linux)","description":"MongoDB connection model.","directories":{},"_nodeVersion":"16.17.0","compass:main":"index.js","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","debug":"^4.2.0","lodash":"^4.17.15","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.2.0","storage-mixin":"0.0.0-next-10815be8fd57f3bfd89d061e1592eb7136d4a0fb","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.2","@mongodb-js/ssh-tunnel":"0.0.0-next-10815be8fd57f3bfd89d061e1592eb7136d4a0fb","@mongodb-js/compass-utils":"0.0.0-next-10815be8fd57f3bfd89d061e1592eb7136d4a0fb","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.5.4"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"^4.10.0","depcheck":"^1.4.1","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.9.0","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^4.10.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_0.0.0-next-10815be8fd57f3bfd89d061e1592eb7136d4a0fb_1667388648331_0.7920492588987553","host":"s3://npm-registry-packages"}},"0.0.0-next-59e1f6f134da2a3417bd69a71c7788320608ee5d":{"name":"mongodb-connection-model","version":"0.0.0-next-59e1f6f134da2a3417bd69a71c7788320608ee5d","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@0.0.0-next-59e1f6f134da2a3417bd69a71c7788320608ee5d","maintainers":[{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"iteng@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"9d19689be9170db6c99f3b42e3999db4fdd190a7","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-0.0.0-next-59e1f6f134da2a3417bd69a71c7788320608ee5d.tgz","fileCount":20,"integrity":"sha512-sge3rbCmep6wx/3hQWDYiUOcbuFeJ/RnD/IeOP4qZMCvDb+7yG1/t7JKFuFm6ILwDCA4sQc631iUC4hyWv4r/Q==","signatures":[{"sig":"MEYCIQCq4p7dr5gGZUUtOI01RobXTBFGp7eHaBToP9PSMvdQTwIhAMbtSv2SLiY7q3eNjZrEv+X6iALJkWV5o+rRi9rOtQ6g","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":108152,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjZIKOACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqLZQ//W5kUTaat0QdiRZOyt5eNOFSSMGqS29Dwjurp98b/bPWsZQuw\r\nsAcUhdB4mwZMKU4sGE/b6dF9Ym4Gq/6UgmI+HaLNQ/ZkvO78eybISmNXHkNv\r\nVwbNc/iELElyOrkoPxjVpGbvlX+6jI1jaXKB/FndXpOk6vba4VNdVsNuoMT1\r\nG23qzpQLRKsW0IAZm4OkmxSugFDnhvs2s7YhraQmZS9YiatfPt2K20SNQ3Zv\r\nvdUjuwWQLPh63V+HX/7gpt4ZLT2UqQda4bBQy0hZ2ylETMqkpoFXhtpf1peK\r\ngsM4pmjHW2vM2V+5YgpzzhutG/F0eQl6k9D3eH1QJUuEy1HVKBVE7BP8rGEK\r\n+jOiCw6Osrvz/+wniRrNJ0M1aH3OtcGGB2cep+AzEXwoa+ddnYkpHNdRs8Ve\r\nfZUotiCZEwd6oWGUJcj4gk3/CdxGwSxf71wXkb3g/MEDaKap/85W2s3hGcdj\r\ni+s77vH4Zy/u1EnSn7Vmea4aj4rxJBcFZ6RsW+Gme6h71CyniKVapU5gL6/t\r\nXsVXLfzCybsgbAlDbuf3lmiqt5prjfsmqkkEs35LFEB1vHdAZy6/M1oWXysK\r\n3Io2fCGxcPXQK+HO3NjigrUaCckeWYOIYWHX+A4ttWaBiY5F8kcp2MhoU0+0\r\nPYJf2zu7iT7I0SkUWwL3BqWjegIDp9Bw0mk=\r\n=tval\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","readme":"# mongodb-connection-model [![][workflow_img]][workflow_url] [![][npm_img]][npm_url]\n\n> MongoDB connection model\n\nThe main purpose of the MongoDB connection model is to be a domain model around a MongoDB connection. It encapsulates generating a [Connection String URI](https://docs.mongodb.com/manual/reference/connection-string/) from a group of attributes and parses URI using the [MongoDB Node.JS Driver URI Parser](https://github.com/mongodb-js/mongodb-core/blob/master/lib/uri_parser.js).\n\n## Installation\n\n```\nnpm install --save mongodb-connection-model\n```\n\n## Usage\n\n### Building URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\nconst c = new Connection({ appname: 'My App Name' });\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://localhost:27017/?readPreference=primary&appname=My%20App&ssl=false'\n```\n\n### Parsing URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\n\nConnection.from(\n  'mongodb://someUsername:testPassword@localhost',\n  (error, result) => {\n    console.log(result);\n    >>> `{\n      hosts: [{ host: 'localhost', port: 27017 }],\n      hostname: 'localhost',\n      port: 27017,\n      auth: {\n        username: 'someUsername',\n        password: 'testPassword',\n        db: 'admin'\n      },\n      isSrvRecord: false,\n      authStrategy: 'MONGODB',\n      mongodbUsername: 'someUsername',\n      mongodbPassword: 'testPassword',\n      mongodbDatabaseName: 'admin',\n      extraOptions: {},\n      connectionType: 'NODE_DRIVER',\n      readPreference: 'primary',\n      kerberosCanonicalizeHostname: false,\n      sslMethod: 'NONE',\n      sshTunnel: 'NONE',\n      sshTunnelPort: 22\n    }`\n  }\n);\n```\n\n## Properties\n\nMongoDB connection model is based on Ampersand.js framework and consist of [props](https://ampersandjs.com/docs/#ampersand-state-props) and [derived props](https://ampersandjs.com/docs/#ampersand-state-derived). The props object describes the observable properties that MongoDB connection model gets from the Node.js Driver API.\n\n```javascript\nconst с = new Connection();\nconst props = с.getAttributes({ props: true });\n```\n\n#### See Also\n\n- [URI Generic Syntax](https://tools.ietf.org/html/rfc3986)\n- [URI Options Specification](https://github.com/mongodb/specifications/blob/master/source/uri-options/uri-options.rst)\n\n### General Properties\n\n```javascript\nconst c = new Connection({ isSrvRecord: true });\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ns` | String | A valid [ns][ns] the user can read from | `undefined` |\n| `isSrvRecord` | Boolean | Indicates SRV record | `false` |\n| `auth` | Object | Authentication from driver (username, user, db, password) | `undefined` |\n| `hostname` | String | Hostname of a MongoDB Instance. In case of the replica set the first host and port will be taken | `localhost` |\n| `port` | Number | TCP port of a MongoDB Instance | `27017` |\n| `hosts` | Array | Contains all hosts and ports for replica set | `[{ host: 'localhost', port: 27017 }]` |\n| `extraOptions` | Object | Extra options passed to the node driver as part of `driverOptions` | `{}` |\n| `connectionType` | String | The desired connection type. Possible values: `NODE_DRIVER`, `STITCH_ON_PREM`, `STITCH_ATLAS` | `NODE_DRIVER` |\n| `authStrategy` | String | The desired authentication strategy. Possible values: `NONE`, `MONGODB`, `X509`, `KERBEROS`, `LDAP`, `SCRAM-SHA-256` | `NONE` |\n\n### Connection string options\n\n```javascript\nconst c = new Connection({ appname: 'My App', replicaSet: 'testing' });\n```\n\n#### General connection string options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `replicaSet` | String | Specifies the name of the replica set, if the mongod is a member of a replica set | `undefined` |\n| `connectTimeoutMS` | Number | The time in milliseconds to attempt a connection before timing out | `undefined` |\n| `socketTimeoutMS` | Number | The time in milliseconds to attempt a send or receive on a socket before the attempt times out | `undefined` |\n| `compression` | Object | Object includes compressors and a compression level. The following compressors can be specified: `snappy`, `zlib` (Available in MongoDB 3.6 or greater) | `undefined` |\n\n#### Connection Pool Option\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `maxPoolSize` | Number | The maximum number of connections in the connection pool | `undefined` |\n| `minPoolSize` | Number | The minimum number of connections in the connection pool | `undefined` |\n| `maxIdleTimeMS` | Number | The maximum number of milliseconds that a connection can remain idle in the pool before being removed and closed | `undefined` |\n| `waitQueueMultiple` | Number | A number that the driver multiples the maxPoolSize value to, to provide the maximum number of threads allowed to wait for a connection to become available from the pool | `undefined` |\n| `waitQueueTimeoutMS` | Number | The maximum time in milliseconds that a thread can wait for a connection to become available | `undefined` |\n\n#### Write Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `w` | Number/String | Corresponds to the write concern [w Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-w) | `undefined` |\n| `wTimeoutMS` | Number | Corresponds to the write concern [wtimeout](https://docs.mongodb.com/manual/reference/write-concern/#wc-wtimeout) | `undefined` |\n| `journal` | Boolean | Corresponds to the write concern [j Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-j) | `undefined` |\n\n#### Read Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readConcernLevel` | String | The level of isolation | `undefined` |\n\n#### Read Preference Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readPreference` | String | Specifies the read preferences for this connection. Possible values: `PRIMARY`, `PRIMARY_PREFERRED`, `SECONDARY`, `SECONDARY_PREFERRED`, `NEAREST` | `PRIMARY` |\n| `maxStalenessSeconds` | Number | Specifies, in seconds, how stale a secondary can be before the client stops using it for read operations | `undefined` |\n| `readPreferenceTags` | Object | Default read preference tags for the client | `undefined` |\n\n#### Authentication Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `authSource` | String | Specify the database name associated with the user’s credentials | `undefined` |\n| `authMechanism` | String | Specifies the authentication mechanism that MongoDB will use to authenticate the connection. Possible values: `DEFAULT`, `GSSAPI`, `MONGODB-X509`, `PLAIN`, `SCRAM-SHA-256` | `undefined` |\n| `authMechanismProperties` | Object | Additional options provided for authentication (e.g. to enable hostname canonicalization for GSSAPI) | `undefined` |\n| `gssapiServiceName` | String | Set the Kerberos service name when connecting to Kerberized MongoDB instances | `undefined` |\n| `gssapiServiceRealm` | String | Set the Realm service name | `undefined` |\n| `gssapiCanonicalizeHostName` | Boolean | Whether canonicalized hostname | `undefined` |\n\n#### Server Selection and Discovery Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `localThresholdMS` | Number | The size (in milliseconds) of the latency window for selecting among multiple suitable MongoDB instances | `undefined` |\n| `serverSelectionTimeoutMS` | Number | Specifies how long (in milliseconds) to block for server selection before throwing an exception | `undefined` |\n| `serverSelectionTryOnce` | Boolean | Instructs the driver to scan the MongoDB deployment exactly once after server selection fails and then either select a server or raise an error | `undefined` |\n| `heartbeatFrequencyMS` | Number | Controls when the driver checks the state of the MongoDB deployment | `undefined` |\n\n#### Miscellaneous Configuration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `appname` | String | An application name passed to server as client metadata | `undefined` |\n| `retryWrites` | Boolean | Enable retryable writes | `undefined` |\n| `uuidRepresentation` | String | The legacy representation of UUID. Possible values: `standard`, `csharpLegacy`, `javaLegacy`, `pythonLegacy` | `undefined` |\n| `loadBalanced` | Boolean | Whether or not the server is running in load balanced mode | `undefined` |\n\n### Stitch attributes\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `stitchServiceName` | String | Stitch service name | `undefined` |\n| `stitchClientAppId` | String | Stitch сlient app ID | `undefined` |\n| `stitchGroupId` | String | Stitch group ID | `undefined` |\n| `stitchBaseUrl` | String | Stitch base Url | `undefined` |\n\n### MONGODB authentication\n\n```javascript\nconst c = new Connection({\n  mongodbUsername: 'arlo',\n  mongodbPassword: 'w@of'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/?slaveOk=true&authSource=admin'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `mongodbUsername` | String | MongoDB username | `undefined` |\n| `mongodbPassword` | String | MongoDB password | `undefined` |\n| `mongodbDatabaseName` | String | The database name associated with the user's credentials | `undefined` |\n| `promoteValues` | Boolean | Whether BSON values should be promoted to their JS type counterparts | `undefined` |\n\n### KERBEROS authentication\n\n```javascript\nconst c = new Connection({\n  kerberosServiceName: 'mongodb',\n  kerberosPrincipal: 'arlo/dog@krb5.mongodb.parts',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo%252Fdog%2540krb5.mongodb.parts@localhost:27017/toys?authMechanism=GSSAPI'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n> @note (imlucas): Kerberos on Windows is broken out as it's own state for UX consideration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `kerberosServiceName` | String | Any program or computer you access over a network | `undefined` |\n| `kerberosPrincipal` | String | The format of a typical Kerberos V5 principal is `primary/instance@REALM` | `undefined` |\n| `kerberosCanonicalizeHostname` | Boolean | Whether canonicalized kerberos hostname | `undefined` |\n\n#### See Also\n\n- [node.js driver Kerberos reference](http://bit.ly/mongodb-node-driver-kerberos)\n- [node.js driver Kerberos functional test][kerberos-functional]\n\n### LDAP authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  ldapUsername: 'arlo',\n  ldapPassword: 'w@of',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/toys?slaveOk=true&authMechanism=PLAIN'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ldapUsername` | String | LDAP username | `undefined` |\n| `ldapPassword` | String | LDAP password | `undefined` |\n\n#### See Also\n\n- [node.js driver LDAP reference](http://bit.ly/mongodb-node-driver-ldap)\n- [node.js driver X509 functional test][ldap-functional]\n\n### X509 authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  x509Username: 'CN=client,OU=arlo,O=MongoDB,L=Philadelphia,ST=Pennsylvania,C=US'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://CN%253Dclient%252COU%253Darlo%252CO%253DMongoDB%252CL%253DPhiladelphia%252CST%253DPennsylvania%252CC%253DUS@localhost:27017?slaveOk=true&authMechanism=MONGODB-X509'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `x509Username` | String | The x.509 certificate derived user name, e.g. `CN=user,OU=OrgUnit,O=myOrg,...` | `undefined` |\n\n#### See Also\n\n- [node.js driver X509 reference](http://bit.ly/mongodb-node-driver-x509)\n- [node.js driver X509 functional test][x509-functional]\n\n### SSL\n\n> **Note**: Not to be confused with `authentication=X509`\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ssl` | Number/String | A boolean to enable or disables TLS/SSL for the connection | `undefined` |\n| `sslMethod` | String | The desired ssl method. Possible values: `NONE`, `SYSTEMCA`, `IFAVAILABLE`, `UNVALIDATED`, `SERVER`, `ALL` | `NONE` |\n| `sslCA` | Buffer/String | Array of valid certificates | `undefined` |\n| `sslCert` | Buffer/String | The certificate | `undefined` |\n| `sslKey` | Buffer/String | The certificate private key | `undefined` |\n| `sslPass` | Buffer/String | The certificate password | `undefined` |\n\nDescription of `sslMethod` values:\n\n- `SYSTEMCA` - SSL required, validate using System CA, with host verification.\n- `IFAVAILABLE` - The driver should try SSL first, fall back to no SSL if unavailable, and use the system's Certificate Authority.\n- `SERVER` - The driver should validate the server certificate and fail to connect if validation fails. See also [node.js driver \"Validate Server Certificate\" docs][driver-ssl-server].\n- `ALL` - The driver must present a valid certificate and validate the server certificate. See also [node.js driver \"Validate Server Certificate and Present Valid Certificate\" docs][driver-ssl-all].\n- `NONE` - No SSL (Not recommended).\n- `UNVALIDATED` - Use SSL but do not perform any validation of the certificate chain. See also [node.js driver \"No Certificate Validation\" docs][driver-ssl-none]. **Very** not recommended and likely to be deprecated in future releases because it exposes potential Man-In-The-Middle attack vectors.\n\n#### See also\n\n- [node.js driver SSL implementation][driver-ssl-impl]\n- [node.js driver SSL tutorial][driver-ssl-tutorial]\n\n### SSH TUNNEL\n\n> New in mongodb-connection-model@5.0.0\n\nBecause [authentication](#authentication) is quite difficult for operators to migrate to, the most common method of securing a MongoDB deployment is to use an [SSH tunnel][sf-ssh-tunnel].  This allows operators to leverage their existing SSH security infrastructure to also provide secure access to MongoDB.  For a standard deployment of MongoDB on AWS, this is almost always to strategy.  Because of this, we now support creating SSH tunnels automatically when connecting to MongoDB.\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options, (connectionError, client) => {\n  if (connectionError) {\n    return console.log(connectionError);\n  }\n\n  client.db('mongodb').collection('fanclub').count((countingError, count) => {\n    console.log('counted:', countingError, count);\n    client.close();\n  });\n});\n```\n\nThe above provides the same functionality as creating the tunnel using the bash\ncommand below and connecting to MongoDB via another terminal. Notice that\nconnection-model uses a random local port each time it creates a tunnel.\nUsing the command line, you'd have to replace `<random port>` with an actual\nport number.\n\n```bash\nssh -i ~/.ssh/my-key-aws-pair.pem -L <random port>:localhost:27017 ubuntu@ec2-11-111-111-111.compute-1.amazonaws.com\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `sshTunnel` | String | The desired SSH tunnel strategy. Possible values: `NONE`, `USER_PASSWORD`, `IDENTITY_FILE` | `undefined` |\n| `sshTunnelHostname` | String | The hostname of the SSH remote host | `undefined` |\n| `sshTunnelPort` | Port | The SSH port of the remote host | `22` |\n| `sshTunnelBindToLocalPort` | Port | Bind the localhost endpoint of the SSH Tunnel to this port | `undefined` |\n| `sshTunnelUsername` | String | The optional SSH username for the remote host | `undefined` |\n| `sshTunnelPassword` | String | The optional SSH password for the remote host | `undefined` |\n| `sshTunnelIdentityFile` | String/Array | The optional path to the SSH identity file for the remote host | `undefined` |\n| `sshTunnelPassphrase` | String | The optional passphrase for `sshTunnelIdentityFile` | `undefined` |\n\nDescription of `sshTunnel` values:\n\n- `NONE` - Do not use SSH tunneling.\n- `USER_PASSWORD` - The tunnel is created with SSH username and password only.\n- `IDENTITY_FILE` - The tunnel is created using an identity file.\n\n## Derived Properties\n\nDerived properties (also known as computed properties) are properties of the state object that depend on other properties to determine their value.\n\n```javascript\nconst c = new Connection();\nconst derivedProps = c.getAttributes({ derived: true });\n```\n\n| Derived Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `instanceId` | String | The mongoscope | `localhost:27017` |\n| `driverAuthMechanism` | String | Converts the value of `authStrategy` for humans into the `authMechanism` value for the driver | `undefined` |\n| `safeUrl` | String | The URL where a password is replaced with stars | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrl` | String | Use this URL in order to connect via DataService | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrlWithSsh` | String | Use this URL in order to connect via connection model itself | `mongodb://localhost:29201/?readPreference=primary&ssl=false` |\n| `driverOptions` | String | The second argument `mongoscope-server` passes to `mongodb.connect` | `{}` |\n\n## Events\n\n> New in mongodb-connection-model@5.0.0\n\n#### Example: SSH Tunnel\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', skipped: true,\n  reason: 'The selected SSL mode does not need to load any files.' }\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', complete: true}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n#### Example: SSL\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  ssl: 'ALL',\n  sslCA: '~/.ssl/my-ca.pem',\n  sslCert: '~/.ssl/my-server.pem',\n  sslKey: '~/.ssl/my-server.pem'\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', complete: true}\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', skipped: true,\n  reason: 'The selected SSH Tunnel mode is NONE.'}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n[workflow_img]: https://github.com/mongodb-js/connection-model/workflows/Check%20and%20Test/badge.svg?event=push\n[workflow_url]: https://github.com/mongodb-js/connection-model/actions?query=workflow%3A%22Check+and+Test%22\n[npm_img]: https://img.shields.io/npm/v/mongodb-connection-model.svg?style=flat-square\n[npm_url]: https://www.npmjs.org/package/mongodb-connection-model\n[gitter_img]: https://badges.gitter.im/Join%20Chat.svg\n[gitter_url]: http://gitter.im/mongodb-js/mongodb-js\n[enterprise_img]: https://img.shields.io/badge/MongoDB-Enterprise-blue.svg?style=flat-square\n[coming_soon_img]: https://img.shields.io/badge/-Coming%20Soon-ff69b4.svg?style=flat-square\n[kerberos-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/kerberos_tests.js\n[ldap-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ldap_tests.js\n[x509-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ssl_x509_tests.js\n[ns]: https://github.com/mongodb-js/ns\n[sf-ssh-tunnel]: http://serverfault.com/questions/597765/how-to-connect-to-mongodb-server-via-ssh-tunnel\n[ec2-key-pairs]: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html\n[driver-ssl-impl]: https://github.com/christkv/mongodb-core/blob/c3d21cb636d74d7a68134ecd3b9f6af536311279/lib/connection/connection.js#L365-L407\n[driver-ssl-tutorial]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/\n[driver-ssl-none]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#no-certificate-validation\n[driver-ssl-server]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate\n[driver-ssl-all]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate-and-present-valid-certificate\n","gitHead":"59e1f6f134da2a3417bd69a71c7788320608ee5d","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","test":"mocha","check":"npm run lint && npm run depcheck","pretest":"mongodb-runner install && mongodb-runner start --port=27018","test-ci":"npm run test","depcheck":"depcheck","posttest":"mongodb-runner stop --port=27018","posttest-ci":"node ../../scripts/killall-mongo.js","test-check-ci":"npm run check && npm test"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.17.0+x64 (linux)","description":"MongoDB connection model.","directories":{},"_nodeVersion":"16.17.0","compass:main":"index.js","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","debug":"^4.2.0","lodash":"^4.17.15","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.2.0","storage-mixin":"0.0.0-next-59e1f6f134da2a3417bd69a71c7788320608ee5d","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.2","@mongodb-js/ssh-tunnel":"0.0.0-next-59e1f6f134da2a3417bd69a71c7788320608ee5d","@mongodb-js/compass-utils":"0.0.0-next-59e1f6f134da2a3417bd69a71c7788320608ee5d","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.5.4"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"^4.10.0","depcheck":"^1.4.1","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.9.0","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^4.10.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_0.0.0-next-59e1f6f134da2a3417bd69a71c7788320608ee5d_1667531406624_0.15568110018310888","host":"s3://npm-registry-packages"}},"0.0.0-next-ea4f317e964c0504e54c01d83c385280a9135bba":{"name":"mongodb-connection-model","version":"0.0.0-next-ea4f317e964c0504e54c01d83c385280a9135bba","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@0.0.0-next-ea4f317e964c0504e54c01d83c385280a9135bba","maintainers":[{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"iteng@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"38f7d947c57493e02cbc7713df75d6c25f5a6adb","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-0.0.0-next-ea4f317e964c0504e54c01d83c385280a9135bba.tgz","fileCount":20,"integrity":"sha512-86mkzBm64nbIRFbdeZL4vus8IFIGZFbj4nb07m/eb75dfKbnd+NIX1mpw/Q+rItlKoXhbWuINK3SqVESxDh82g==","signatures":[{"sig":"MEUCIGnCYmZV2wDpQdgzjOODUWaZZlGXwNnTTIWEYJ2IxeooAiEAisNL2ajgi42UrP/vqwCyIKypS/Giq3YF2Iuf85aZXu4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":108152,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjZIR1ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrVfw//WBnXWmfyoi/v6dgmZRNkVqW5DXcSgN/dZNaeOnNBEPSUL+LL\r\nwhijWtfXBpGcgFK53HraEYqOJ8y48IabvE1DhxQR6279CCPKr1s6lV0IV6hR\r\nym5CFzhStwX3BpcZ4jiQANl8f1QPUV2KfCsFMl9/JUsEETJqmHjthtupMoEQ\r\nN7MgfAQSEf03nqs9QfofxzwqaKVgHIQFeHVLrjqcXyY0kgmlgvUQlNxyEcRR\r\n2vs8y9yiqMIzEjh/LINIcWBWkS777NqpUA4jaqfaR9zV4wFX8H/swv1N4LtK\r\n+ydzdzAcHgHYrVXf+vW4CTAjMDw+1yrUsoSydfZgfK6giCM4UgnWiyiLeVYE\r\n5F3qIE7hs0JLP1J2FK/0pBHVy3XopqJuD4zEj7HKBFl4Cpu5Iq8jGLlJ5x3c\r\njBPm7GdrBjBcBeP1/PWsgwr5qR80ptW+Aj1gi2UxLrBDQu/aRDq+AFxcyhQE\r\nVAWTXu/v4yQgNhbPn94UhfCjvhpaCHiKZSjXT6cnYPU7ukzu6M0vENeFwvmy\r\nmk6fpaq6Qr3kglUilv/jyq/8HLHH3BQwBWaXVb1bZeamMxAKIhm/2YLs/KsS\r\n6EpFc1R9KjcVnhvCHnfIPNX4nFqupEd49LArqtvcjmbdejHLj8qpkRsd6Iy2\r\nOEy5FW0NqYQm2ILbb9Hh7W6AJngt884QhkE=\r\n=A1Ul\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","readme":"# mongodb-connection-model [![][workflow_img]][workflow_url] [![][npm_img]][npm_url]\n\n> MongoDB connection model\n\nThe main purpose of the MongoDB connection model is to be a domain model around a MongoDB connection. It encapsulates generating a [Connection String URI](https://docs.mongodb.com/manual/reference/connection-string/) from a group of attributes and parses URI using the [MongoDB Node.JS Driver URI Parser](https://github.com/mongodb-js/mongodb-core/blob/master/lib/uri_parser.js).\n\n## Installation\n\n```\nnpm install --save mongodb-connection-model\n```\n\n## Usage\n\n### Building URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\nconst c = new Connection({ appname: 'My App Name' });\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://localhost:27017/?readPreference=primary&appname=My%20App&ssl=false'\n```\n\n### Parsing URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\n\nConnection.from(\n  'mongodb://someUsername:testPassword@localhost',\n  (error, result) => {\n    console.log(result);\n    >>> `{\n      hosts: [{ host: 'localhost', port: 27017 }],\n      hostname: 'localhost',\n      port: 27017,\n      auth: {\n        username: 'someUsername',\n        password: 'testPassword',\n        db: 'admin'\n      },\n      isSrvRecord: false,\n      authStrategy: 'MONGODB',\n      mongodbUsername: 'someUsername',\n      mongodbPassword: 'testPassword',\n      mongodbDatabaseName: 'admin',\n      extraOptions: {},\n      connectionType: 'NODE_DRIVER',\n      readPreference: 'primary',\n      kerberosCanonicalizeHostname: false,\n      sslMethod: 'NONE',\n      sshTunnel: 'NONE',\n      sshTunnelPort: 22\n    }`\n  }\n);\n```\n\n## Properties\n\nMongoDB connection model is based on Ampersand.js framework and consist of [props](https://ampersandjs.com/docs/#ampersand-state-props) and [derived props](https://ampersandjs.com/docs/#ampersand-state-derived). The props object describes the observable properties that MongoDB connection model gets from the Node.js Driver API.\n\n```javascript\nconst с = new Connection();\nconst props = с.getAttributes({ props: true });\n```\n\n#### See Also\n\n- [URI Generic Syntax](https://tools.ietf.org/html/rfc3986)\n- [URI Options Specification](https://github.com/mongodb/specifications/blob/master/source/uri-options/uri-options.rst)\n\n### General Properties\n\n```javascript\nconst c = new Connection({ isSrvRecord: true });\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ns` | String | A valid [ns][ns] the user can read from | `undefined` |\n| `isSrvRecord` | Boolean | Indicates SRV record | `false` |\n| `auth` | Object | Authentication from driver (username, user, db, password) | `undefined` |\n| `hostname` | String | Hostname of a MongoDB Instance. In case of the replica set the first host and port will be taken | `localhost` |\n| `port` | Number | TCP port of a MongoDB Instance | `27017` |\n| `hosts` | Array | Contains all hosts and ports for replica set | `[{ host: 'localhost', port: 27017 }]` |\n| `extraOptions` | Object | Extra options passed to the node driver as part of `driverOptions` | `{}` |\n| `connectionType` | String | The desired connection type. Possible values: `NODE_DRIVER`, `STITCH_ON_PREM`, `STITCH_ATLAS` | `NODE_DRIVER` |\n| `authStrategy` | String | The desired authentication strategy. Possible values: `NONE`, `MONGODB`, `X509`, `KERBEROS`, `LDAP`, `SCRAM-SHA-256` | `NONE` |\n\n### Connection string options\n\n```javascript\nconst c = new Connection({ appname: 'My App', replicaSet: 'testing' });\n```\n\n#### General connection string options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `replicaSet` | String | Specifies the name of the replica set, if the mongod is a member of a replica set | `undefined` |\n| `connectTimeoutMS` | Number | The time in milliseconds to attempt a connection before timing out | `undefined` |\n| `socketTimeoutMS` | Number | The time in milliseconds to attempt a send or receive on a socket before the attempt times out | `undefined` |\n| `compression` | Object | Object includes compressors and a compression level. The following compressors can be specified: `snappy`, `zlib` (Available in MongoDB 3.6 or greater) | `undefined` |\n\n#### Connection Pool Option\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `maxPoolSize` | Number | The maximum number of connections in the connection pool | `undefined` |\n| `minPoolSize` | Number | The minimum number of connections in the connection pool | `undefined` |\n| `maxIdleTimeMS` | Number | The maximum number of milliseconds that a connection can remain idle in the pool before being removed and closed | `undefined` |\n| `waitQueueMultiple` | Number | A number that the driver multiples the maxPoolSize value to, to provide the maximum number of threads allowed to wait for a connection to become available from the pool | `undefined` |\n| `waitQueueTimeoutMS` | Number | The maximum time in milliseconds that a thread can wait for a connection to become available | `undefined` |\n\n#### Write Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `w` | Number/String | Corresponds to the write concern [w Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-w) | `undefined` |\n| `wTimeoutMS` | Number | Corresponds to the write concern [wtimeout](https://docs.mongodb.com/manual/reference/write-concern/#wc-wtimeout) | `undefined` |\n| `journal` | Boolean | Corresponds to the write concern [j Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-j) | `undefined` |\n\n#### Read Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readConcernLevel` | String | The level of isolation | `undefined` |\n\n#### Read Preference Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readPreference` | String | Specifies the read preferences for this connection. Possible values: `PRIMARY`, `PRIMARY_PREFERRED`, `SECONDARY`, `SECONDARY_PREFERRED`, `NEAREST` | `PRIMARY` |\n| `maxStalenessSeconds` | Number | Specifies, in seconds, how stale a secondary can be before the client stops using it for read operations | `undefined` |\n| `readPreferenceTags` | Object | Default read preference tags for the client | `undefined` |\n\n#### Authentication Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `authSource` | String | Specify the database name associated with the user’s credentials | `undefined` |\n| `authMechanism` | String | Specifies the authentication mechanism that MongoDB will use to authenticate the connection. Possible values: `DEFAULT`, `GSSAPI`, `MONGODB-X509`, `PLAIN`, `SCRAM-SHA-256` | `undefined` |\n| `authMechanismProperties` | Object | Additional options provided for authentication (e.g. to enable hostname canonicalization for GSSAPI) | `undefined` |\n| `gssapiServiceName` | String | Set the Kerberos service name when connecting to Kerberized MongoDB instances | `undefined` |\n| `gssapiServiceRealm` | String | Set the Realm service name | `undefined` |\n| `gssapiCanonicalizeHostName` | Boolean | Whether canonicalized hostname | `undefined` |\n\n#### Server Selection and Discovery Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `localThresholdMS` | Number | The size (in milliseconds) of the latency window for selecting among multiple suitable MongoDB instances | `undefined` |\n| `serverSelectionTimeoutMS` | Number | Specifies how long (in milliseconds) to block for server selection before throwing an exception | `undefined` |\n| `serverSelectionTryOnce` | Boolean | Instructs the driver to scan the MongoDB deployment exactly once after server selection fails and then either select a server or raise an error | `undefined` |\n| `heartbeatFrequencyMS` | Number | Controls when the driver checks the state of the MongoDB deployment | `undefined` |\n\n#### Miscellaneous Configuration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `appname` | String | An application name passed to server as client metadata | `undefined` |\n| `retryWrites` | Boolean | Enable retryable writes | `undefined` |\n| `uuidRepresentation` | String | The legacy representation of UUID. Possible values: `standard`, `csharpLegacy`, `javaLegacy`, `pythonLegacy` | `undefined` |\n| `loadBalanced` | Boolean | Whether or not the server is running in load balanced mode | `undefined` |\n\n### Stitch attributes\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `stitchServiceName` | String | Stitch service name | `undefined` |\n| `stitchClientAppId` | String | Stitch сlient app ID | `undefined` |\n| `stitchGroupId` | String | Stitch group ID | `undefined` |\n| `stitchBaseUrl` | String | Stitch base Url | `undefined` |\n\n### MONGODB authentication\n\n```javascript\nconst c = new Connection({\n  mongodbUsername: 'arlo',\n  mongodbPassword: 'w@of'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/?slaveOk=true&authSource=admin'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `mongodbUsername` | String | MongoDB username | `undefined` |\n| `mongodbPassword` | String | MongoDB password | `undefined` |\n| `mongodbDatabaseName` | String | The database name associated with the user's credentials | `undefined` |\n| `promoteValues` | Boolean | Whether BSON values should be promoted to their JS type counterparts | `undefined` |\n\n### KERBEROS authentication\n\n```javascript\nconst c = new Connection({\n  kerberosServiceName: 'mongodb',\n  kerberosPrincipal: 'arlo/dog@krb5.mongodb.parts',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo%252Fdog%2540krb5.mongodb.parts@localhost:27017/toys?authMechanism=GSSAPI'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n> @note (imlucas): Kerberos on Windows is broken out as it's own state for UX consideration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `kerberosServiceName` | String | Any program or computer you access over a network | `undefined` |\n| `kerberosPrincipal` | String | The format of a typical Kerberos V5 principal is `primary/instance@REALM` | `undefined` |\n| `kerberosCanonicalizeHostname` | Boolean | Whether canonicalized kerberos hostname | `undefined` |\n\n#### See Also\n\n- [node.js driver Kerberos reference](http://bit.ly/mongodb-node-driver-kerberos)\n- [node.js driver Kerberos functional test][kerberos-functional]\n\n### LDAP authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  ldapUsername: 'arlo',\n  ldapPassword: 'w@of',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/toys?slaveOk=true&authMechanism=PLAIN'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ldapUsername` | String | LDAP username | `undefined` |\n| `ldapPassword` | String | LDAP password | `undefined` |\n\n#### See Also\n\n- [node.js driver LDAP reference](http://bit.ly/mongodb-node-driver-ldap)\n- [node.js driver X509 functional test][ldap-functional]\n\n### X509 authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  x509Username: 'CN=client,OU=arlo,O=MongoDB,L=Philadelphia,ST=Pennsylvania,C=US'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://CN%253Dclient%252COU%253Darlo%252CO%253DMongoDB%252CL%253DPhiladelphia%252CST%253DPennsylvania%252CC%253DUS@localhost:27017?slaveOk=true&authMechanism=MONGODB-X509'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `x509Username` | String | The x.509 certificate derived user name, e.g. `CN=user,OU=OrgUnit,O=myOrg,...` | `undefined` |\n\n#### See Also\n\n- [node.js driver X509 reference](http://bit.ly/mongodb-node-driver-x509)\n- [node.js driver X509 functional test][x509-functional]\n\n### SSL\n\n> **Note**: Not to be confused with `authentication=X509`\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ssl` | Number/String | A boolean to enable or disables TLS/SSL for the connection | `undefined` |\n| `sslMethod` | String | The desired ssl method. Possible values: `NONE`, `SYSTEMCA`, `IFAVAILABLE`, `UNVALIDATED`, `SERVER`, `ALL` | `NONE` |\n| `sslCA` | Buffer/String | Array of valid certificates | `undefined` |\n| `sslCert` | Buffer/String | The certificate | `undefined` |\n| `sslKey` | Buffer/String | The certificate private key | `undefined` |\n| `sslPass` | Buffer/String | The certificate password | `undefined` |\n\nDescription of `sslMethod` values:\n\n- `SYSTEMCA` - SSL required, validate using System CA, with host verification.\n- `IFAVAILABLE` - The driver should try SSL first, fall back to no SSL if unavailable, and use the system's Certificate Authority.\n- `SERVER` - The driver should validate the server certificate and fail to connect if validation fails. See also [node.js driver \"Validate Server Certificate\" docs][driver-ssl-server].\n- `ALL` - The driver must present a valid certificate and validate the server certificate. See also [node.js driver \"Validate Server Certificate and Present Valid Certificate\" docs][driver-ssl-all].\n- `NONE` - No SSL (Not recommended).\n- `UNVALIDATED` - Use SSL but do not perform any validation of the certificate chain. See also [node.js driver \"No Certificate Validation\" docs][driver-ssl-none]. **Very** not recommended and likely to be deprecated in future releases because it exposes potential Man-In-The-Middle attack vectors.\n\n#### See also\n\n- [node.js driver SSL implementation][driver-ssl-impl]\n- [node.js driver SSL tutorial][driver-ssl-tutorial]\n\n### SSH TUNNEL\n\n> New in mongodb-connection-model@5.0.0\n\nBecause [authentication](#authentication) is quite difficult for operators to migrate to, the most common method of securing a MongoDB deployment is to use an [SSH tunnel][sf-ssh-tunnel].  This allows operators to leverage their existing SSH security infrastructure to also provide secure access to MongoDB.  For a standard deployment of MongoDB on AWS, this is almost always to strategy.  Because of this, we now support creating SSH tunnels automatically when connecting to MongoDB.\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options, (connectionError, client) => {\n  if (connectionError) {\n    return console.log(connectionError);\n  }\n\n  client.db('mongodb').collection('fanclub').count((countingError, count) => {\n    console.log('counted:', countingError, count);\n    client.close();\n  });\n});\n```\n\nThe above provides the same functionality as creating the tunnel using the bash\ncommand below and connecting to MongoDB via another terminal. Notice that\nconnection-model uses a random local port each time it creates a tunnel.\nUsing the command line, you'd have to replace `<random port>` with an actual\nport number.\n\n```bash\nssh -i ~/.ssh/my-key-aws-pair.pem -L <random port>:localhost:27017 ubuntu@ec2-11-111-111-111.compute-1.amazonaws.com\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `sshTunnel` | String | The desired SSH tunnel strategy. Possible values: `NONE`, `USER_PASSWORD`, `IDENTITY_FILE` | `undefined` |\n| `sshTunnelHostname` | String | The hostname of the SSH remote host | `undefined` |\n| `sshTunnelPort` | Port | The SSH port of the remote host | `22` |\n| `sshTunnelBindToLocalPort` | Port | Bind the localhost endpoint of the SSH Tunnel to this port | `undefined` |\n| `sshTunnelUsername` | String | The optional SSH username for the remote host | `undefined` |\n| `sshTunnelPassword` | String | The optional SSH password for the remote host | `undefined` |\n| `sshTunnelIdentityFile` | String/Array | The optional path to the SSH identity file for the remote host | `undefined` |\n| `sshTunnelPassphrase` | String | The optional passphrase for `sshTunnelIdentityFile` | `undefined` |\n\nDescription of `sshTunnel` values:\n\n- `NONE` - Do not use SSH tunneling.\n- `USER_PASSWORD` - The tunnel is created with SSH username and password only.\n- `IDENTITY_FILE` - The tunnel is created using an identity file.\n\n## Derived Properties\n\nDerived properties (also known as computed properties) are properties of the state object that depend on other properties to determine their value.\n\n```javascript\nconst c = new Connection();\nconst derivedProps = c.getAttributes({ derived: true });\n```\n\n| Derived Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `instanceId` | String | The mongoscope | `localhost:27017` |\n| `driverAuthMechanism` | String | Converts the value of `authStrategy` for humans into the `authMechanism` value for the driver | `undefined` |\n| `safeUrl` | String | The URL where a password is replaced with stars | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrl` | String | Use this URL in order to connect via DataService | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrlWithSsh` | String | Use this URL in order to connect via connection model itself | `mongodb://localhost:29201/?readPreference=primary&ssl=false` |\n| `driverOptions` | String | The second argument `mongoscope-server` passes to `mongodb.connect` | `{}` |\n\n## Events\n\n> New in mongodb-connection-model@5.0.0\n\n#### Example: SSH Tunnel\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', skipped: true,\n  reason: 'The selected SSL mode does not need to load any files.' }\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', complete: true}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n#### Example: SSL\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  ssl: 'ALL',\n  sslCA: '~/.ssl/my-ca.pem',\n  sslCert: '~/.ssl/my-server.pem',\n  sslKey: '~/.ssl/my-server.pem'\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', complete: true}\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', skipped: true,\n  reason: 'The selected SSH Tunnel mode is NONE.'}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n[workflow_img]: https://github.com/mongodb-js/connection-model/workflows/Check%20and%20Test/badge.svg?event=push\n[workflow_url]: https://github.com/mongodb-js/connection-model/actions?query=workflow%3A%22Check+and+Test%22\n[npm_img]: https://img.shields.io/npm/v/mongodb-connection-model.svg?style=flat-square\n[npm_url]: https://www.npmjs.org/package/mongodb-connection-model\n[gitter_img]: https://badges.gitter.im/Join%20Chat.svg\n[gitter_url]: http://gitter.im/mongodb-js/mongodb-js\n[enterprise_img]: https://img.shields.io/badge/MongoDB-Enterprise-blue.svg?style=flat-square\n[coming_soon_img]: https://img.shields.io/badge/-Coming%20Soon-ff69b4.svg?style=flat-square\n[kerberos-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/kerberos_tests.js\n[ldap-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ldap_tests.js\n[x509-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ssl_x509_tests.js\n[ns]: https://github.com/mongodb-js/ns\n[sf-ssh-tunnel]: http://serverfault.com/questions/597765/how-to-connect-to-mongodb-server-via-ssh-tunnel\n[ec2-key-pairs]: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html\n[driver-ssl-impl]: https://github.com/christkv/mongodb-core/blob/c3d21cb636d74d7a68134ecd3b9f6af536311279/lib/connection/connection.js#L365-L407\n[driver-ssl-tutorial]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/\n[driver-ssl-none]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#no-certificate-validation\n[driver-ssl-server]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate\n[driver-ssl-all]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate-and-present-valid-certificate\n","gitHead":"ea4f317e964c0504e54c01d83c385280a9135bba","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","test":"mocha","check":"npm run lint && npm run depcheck","pretest":"mongodb-runner install && mongodb-runner start --port=27018","test-ci":"npm run test","depcheck":"depcheck","posttest":"mongodb-runner stop --port=27018","posttest-ci":"node ../../scripts/killall-mongo.js","test-check-ci":"npm run check && npm test"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.17.0+x64 (linux)","description":"MongoDB connection model.","directories":{},"_nodeVersion":"16.17.0","compass:main":"index.js","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","debug":"^4.2.0","lodash":"^4.17.15","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.2.0","storage-mixin":"0.0.0-next-ea4f317e964c0504e54c01d83c385280a9135bba","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.2","@mongodb-js/ssh-tunnel":"0.0.0-next-ea4f317e964c0504e54c01d83c385280a9135bba","@mongodb-js/compass-utils":"0.0.0-next-ea4f317e964c0504e54c01d83c385280a9135bba","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.5.4"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"^4.10.0","depcheck":"^1.4.1","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.9.0","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^4.10.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_0.0.0-next-ea4f317e964c0504e54c01d83c385280a9135bba_1667531893509_0.24724803158627373","host":"s3://npm-registry-packages"}},"0.0.0-next-bfa0f33f79b0349abe5ad03576e17682f507fe04":{"name":"mongodb-connection-model","version":"0.0.0-next-bfa0f33f79b0349abe5ad03576e17682f507fe04","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@0.0.0-next-bfa0f33f79b0349abe5ad03576e17682f507fe04","maintainers":[{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"iteng@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"eec166c9f7f4fb3880ada2ec5ea307ad7b84e0ae","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-0.0.0-next-bfa0f33f79b0349abe5ad03576e17682f507fe04.tgz","fileCount":20,"integrity":"sha512-WTqhoE6W6XKMgY32c0q8+02BxF3CfsFW4YO+cKqOlpeQvQrYmcE8r3ohazBGd5EDoD7nkhlcvbnFL6zI5C6P8Q==","signatures":[{"sig":"MEUCIGmF+KfI7uD1/EytjiY/yg1J936oUMdfnn/ay0fpnK4oAiEAiq8maFBN7YtiSJNyCiwuS1HHbpYv8GtBkld2Lv4QXY8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":108152,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjasm3ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo+/w/+OzGwelnjSAKwfAuaT3wFMuUkQtozBCaw54t8aZAxiguYwpWO\r\nYA1pypNPKGBQvnxwBctkBS4uwYzyf0Rh3lyS5OlBQvyIYjt5t2abyANAvRXl\r\n/OUX6HEYMXiWzKHfRL/tMehcHOP2DOEeHcu2ZGx+eWZR40lnzxtHnq3L3Ux9\r\nKHWSF4roYbnod8mNGlPmFI5WemWHPfOituaafrunBc5il4U0lpoOYahKa0Tj\r\nFOwYrFnWvSYPgWchR4CRZCipJeYHh97YHOxbti5THho+1G+jY4MjR0qCEbzs\r\njWeUytFHDrMZX02A4dn6OBik6Vowo4KiPQ9gXyndWy3nySP/IxoXvEpN3MKy\r\nn6nWBMuY9MSyjOEJ2DWqAjmlW3er5QaWBdW5BrCBNrPsX17uwWNJUdA1q3zq\r\n8FEt6FIyz7uxZZUwmV8WjiZ+egVw3NYhqC2vZx8VMt1XxyVURUWHVJwtQj85\r\nRw2SnVFLINsE/+d6+AMKnBpvjy94fgdTFr+SWFBJII1GNFdwUmMmGMIWYfCY\r\nw5PzxncMTxQKWVJU4Jc/jVZHDefSDQ2qnxSRCEJU1AfhvrCymWFzjK3Xrjk3\r\n4t0tu7bCV98Z+ZhC5845VdOylnakeoAnNRilM3h2oPcAK3BbV5G9OEvp2Nwh\r\nVkmdoQ70XVKJHCaxyX5SLugQ4AavVF2Fl+w=\r\n=8RoR\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","readme":"# mongodb-connection-model [![][workflow_img]][workflow_url] [![][npm_img]][npm_url]\n\n> MongoDB connection model\n\nThe main purpose of the MongoDB connection model is to be a domain model around a MongoDB connection. It encapsulates generating a [Connection String URI](https://docs.mongodb.com/manual/reference/connection-string/) from a group of attributes and parses URI using the [MongoDB Node.JS Driver URI Parser](https://github.com/mongodb-js/mongodb-core/blob/master/lib/uri_parser.js).\n\n## Installation\n\n```\nnpm install --save mongodb-connection-model\n```\n\n## Usage\n\n### Building URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\nconst c = new Connection({ appname: 'My App Name' });\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://localhost:27017/?readPreference=primary&appname=My%20App&ssl=false'\n```\n\n### Parsing URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\n\nConnection.from(\n  'mongodb://someUsername:testPassword@localhost',\n  (error, result) => {\n    console.log(result);\n    >>> `{\n      hosts: [{ host: 'localhost', port: 27017 }],\n      hostname: 'localhost',\n      port: 27017,\n      auth: {\n        username: 'someUsername',\n        password: 'testPassword',\n        db: 'admin'\n      },\n      isSrvRecord: false,\n      authStrategy: 'MONGODB',\n      mongodbUsername: 'someUsername',\n      mongodbPassword: 'testPassword',\n      mongodbDatabaseName: 'admin',\n      extraOptions: {},\n      connectionType: 'NODE_DRIVER',\n      readPreference: 'primary',\n      kerberosCanonicalizeHostname: false,\n      sslMethod: 'NONE',\n      sshTunnel: 'NONE',\n      sshTunnelPort: 22\n    }`\n  }\n);\n```\n\n## Properties\n\nMongoDB connection model is based on Ampersand.js framework and consist of [props](https://ampersandjs.com/docs/#ampersand-state-props) and [derived props](https://ampersandjs.com/docs/#ampersand-state-derived). The props object describes the observable properties that MongoDB connection model gets from the Node.js Driver API.\n\n```javascript\nconst с = new Connection();\nconst props = с.getAttributes({ props: true });\n```\n\n#### See Also\n\n- [URI Generic Syntax](https://tools.ietf.org/html/rfc3986)\n- [URI Options Specification](https://github.com/mongodb/specifications/blob/master/source/uri-options/uri-options.rst)\n\n### General Properties\n\n```javascript\nconst c = new Connection({ isSrvRecord: true });\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ns` | String | A valid [ns][ns] the user can read from | `undefined` |\n| `isSrvRecord` | Boolean | Indicates SRV record | `false` |\n| `auth` | Object | Authentication from driver (username, user, db, password) | `undefined` |\n| `hostname` | String | Hostname of a MongoDB Instance. In case of the replica set the first host and port will be taken | `localhost` |\n| `port` | Number | TCP port of a MongoDB Instance | `27017` |\n| `hosts` | Array | Contains all hosts and ports for replica set | `[{ host: 'localhost', port: 27017 }]` |\n| `extraOptions` | Object | Extra options passed to the node driver as part of `driverOptions` | `{}` |\n| `connectionType` | String | The desired connection type. Possible values: `NODE_DRIVER`, `STITCH_ON_PREM`, `STITCH_ATLAS` | `NODE_DRIVER` |\n| `authStrategy` | String | The desired authentication strategy. Possible values: `NONE`, `MONGODB`, `X509`, `KERBEROS`, `LDAP`, `SCRAM-SHA-256` | `NONE` |\n\n### Connection string options\n\n```javascript\nconst c = new Connection({ appname: 'My App', replicaSet: 'testing' });\n```\n\n#### General connection string options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `replicaSet` | String | Specifies the name of the replica set, if the mongod is a member of a replica set | `undefined` |\n| `connectTimeoutMS` | Number | The time in milliseconds to attempt a connection before timing out | `undefined` |\n| `socketTimeoutMS` | Number | The time in milliseconds to attempt a send or receive on a socket before the attempt times out | `undefined` |\n| `compression` | Object | Object includes compressors and a compression level. The following compressors can be specified: `snappy`, `zlib` (Available in MongoDB 3.6 or greater) | `undefined` |\n\n#### Connection Pool Option\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `maxPoolSize` | Number | The maximum number of connections in the connection pool | `undefined` |\n| `minPoolSize` | Number | The minimum number of connections in the connection pool | `undefined` |\n| `maxIdleTimeMS` | Number | The maximum number of milliseconds that a connection can remain idle in the pool before being removed and closed | `undefined` |\n| `waitQueueMultiple` | Number | A number that the driver multiples the maxPoolSize value to, to provide the maximum number of threads allowed to wait for a connection to become available from the pool | `undefined` |\n| `waitQueueTimeoutMS` | Number | The maximum time in milliseconds that a thread can wait for a connection to become available | `undefined` |\n\n#### Write Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `w` | Number/String | Corresponds to the write concern [w Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-w) | `undefined` |\n| `wTimeoutMS` | Number | Corresponds to the write concern [wtimeout](https://docs.mongodb.com/manual/reference/write-concern/#wc-wtimeout) | `undefined` |\n| `journal` | Boolean | Corresponds to the write concern [j Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-j) | `undefined` |\n\n#### Read Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readConcernLevel` | String | The level of isolation | `undefined` |\n\n#### Read Preference Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readPreference` | String | Specifies the read preferences for this connection. Possible values: `PRIMARY`, `PRIMARY_PREFERRED`, `SECONDARY`, `SECONDARY_PREFERRED`, `NEAREST` | `PRIMARY` |\n| `maxStalenessSeconds` | Number | Specifies, in seconds, how stale a secondary can be before the client stops using it for read operations | `undefined` |\n| `readPreferenceTags` | Object | Default read preference tags for the client | `undefined` |\n\n#### Authentication Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `authSource` | String | Specify the database name associated with the user’s credentials | `undefined` |\n| `authMechanism` | String | Specifies the authentication mechanism that MongoDB will use to authenticate the connection. Possible values: `DEFAULT`, `GSSAPI`, `MONGODB-X509`, `PLAIN`, `SCRAM-SHA-256` | `undefined` |\n| `authMechanismProperties` | Object | Additional options provided for authentication (e.g. to enable hostname canonicalization for GSSAPI) | `undefined` |\n| `gssapiServiceName` | String | Set the Kerberos service name when connecting to Kerberized MongoDB instances | `undefined` |\n| `gssapiServiceRealm` | String | Set the Realm service name | `undefined` |\n| `gssapiCanonicalizeHostName` | Boolean | Whether canonicalized hostname | `undefined` |\n\n#### Server Selection and Discovery Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `localThresholdMS` | Number | The size (in milliseconds) of the latency window for selecting among multiple suitable MongoDB instances | `undefined` |\n| `serverSelectionTimeoutMS` | Number | Specifies how long (in milliseconds) to block for server selection before throwing an exception | `undefined` |\n| `serverSelectionTryOnce` | Boolean | Instructs the driver to scan the MongoDB deployment exactly once after server selection fails and then either select a server or raise an error | `undefined` |\n| `heartbeatFrequencyMS` | Number | Controls when the driver checks the state of the MongoDB deployment | `undefined` |\n\n#### Miscellaneous Configuration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `appname` | String | An application name passed to server as client metadata | `undefined` |\n| `retryWrites` | Boolean | Enable retryable writes | `undefined` |\n| `uuidRepresentation` | String | The legacy representation of UUID. Possible values: `standard`, `csharpLegacy`, `javaLegacy`, `pythonLegacy` | `undefined` |\n| `loadBalanced` | Boolean | Whether or not the server is running in load balanced mode | `undefined` |\n\n### Stitch attributes\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `stitchServiceName` | String | Stitch service name | `undefined` |\n| `stitchClientAppId` | String | Stitch сlient app ID | `undefined` |\n| `stitchGroupId` | String | Stitch group ID | `undefined` |\n| `stitchBaseUrl` | String | Stitch base Url | `undefined` |\n\n### MONGODB authentication\n\n```javascript\nconst c = new Connection({\n  mongodbUsername: 'arlo',\n  mongodbPassword: 'w@of'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/?slaveOk=true&authSource=admin'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `mongodbUsername` | String | MongoDB username | `undefined` |\n| `mongodbPassword` | String | MongoDB password | `undefined` |\n| `mongodbDatabaseName` | String | The database name associated with the user's credentials | `undefined` |\n| `promoteValues` | Boolean | Whether BSON values should be promoted to their JS type counterparts | `undefined` |\n\n### KERBEROS authentication\n\n```javascript\nconst c = new Connection({\n  kerberosServiceName: 'mongodb',\n  kerberosPrincipal: 'arlo/dog@krb5.mongodb.parts',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo%252Fdog%2540krb5.mongodb.parts@localhost:27017/toys?authMechanism=GSSAPI'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n> @note (imlucas): Kerberos on Windows is broken out as it's own state for UX consideration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `kerberosServiceName` | String | Any program or computer you access over a network | `undefined` |\n| `kerberosPrincipal` | String | The format of a typical Kerberos V5 principal is `primary/instance@REALM` | `undefined` |\n| `kerberosCanonicalizeHostname` | Boolean | Whether canonicalized kerberos hostname | `undefined` |\n\n#### See Also\n\n- [node.js driver Kerberos reference](http://bit.ly/mongodb-node-driver-kerberos)\n- [node.js driver Kerberos functional test][kerberos-functional]\n\n### LDAP authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  ldapUsername: 'arlo',\n  ldapPassword: 'w@of',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/toys?slaveOk=true&authMechanism=PLAIN'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ldapUsername` | String | LDAP username | `undefined` |\n| `ldapPassword` | String | LDAP password | `undefined` |\n\n#### See Also\n\n- [node.js driver LDAP reference](http://bit.ly/mongodb-node-driver-ldap)\n- [node.js driver X509 functional test][ldap-functional]\n\n### X509 authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  x509Username: 'CN=client,OU=arlo,O=MongoDB,L=Philadelphia,ST=Pennsylvania,C=US'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://CN%253Dclient%252COU%253Darlo%252CO%253DMongoDB%252CL%253DPhiladelphia%252CST%253DPennsylvania%252CC%253DUS@localhost:27017?slaveOk=true&authMechanism=MONGODB-X509'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `x509Username` | String | The x.509 certificate derived user name, e.g. `CN=user,OU=OrgUnit,O=myOrg,...` | `undefined` |\n\n#### See Also\n\n- [node.js driver X509 reference](http://bit.ly/mongodb-node-driver-x509)\n- [node.js driver X509 functional test][x509-functional]\n\n### SSL\n\n> **Note**: Not to be confused with `authentication=X509`\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ssl` | Number/String | A boolean to enable or disables TLS/SSL for the connection | `undefined` |\n| `sslMethod` | String | The desired ssl method. Possible values: `NONE`, `SYSTEMCA`, `IFAVAILABLE`, `UNVALIDATED`, `SERVER`, `ALL` | `NONE` |\n| `sslCA` | Buffer/String | Array of valid certificates | `undefined` |\n| `sslCert` | Buffer/String | The certificate | `undefined` |\n| `sslKey` | Buffer/String | The certificate private key | `undefined` |\n| `sslPass` | Buffer/String | The certificate password | `undefined` |\n\nDescription of `sslMethod` values:\n\n- `SYSTEMCA` - SSL required, validate using System CA, with host verification.\n- `IFAVAILABLE` - The driver should try SSL first, fall back to no SSL if unavailable, and use the system's Certificate Authority.\n- `SERVER` - The driver should validate the server certificate and fail to connect if validation fails. See also [node.js driver \"Validate Server Certificate\" docs][driver-ssl-server].\n- `ALL` - The driver must present a valid certificate and validate the server certificate. See also [node.js driver \"Validate Server Certificate and Present Valid Certificate\" docs][driver-ssl-all].\n- `NONE` - No SSL (Not recommended).\n- `UNVALIDATED` - Use SSL but do not perform any validation of the certificate chain. See also [node.js driver \"No Certificate Validation\" docs][driver-ssl-none]. **Very** not recommended and likely to be deprecated in future releases because it exposes potential Man-In-The-Middle attack vectors.\n\n#### See also\n\n- [node.js driver SSL implementation][driver-ssl-impl]\n- [node.js driver SSL tutorial][driver-ssl-tutorial]\n\n### SSH TUNNEL\n\n> New in mongodb-connection-model@5.0.0\n\nBecause [authentication](#authentication) is quite difficult for operators to migrate to, the most common method of securing a MongoDB deployment is to use an [SSH tunnel][sf-ssh-tunnel].  This allows operators to leverage their existing SSH security infrastructure to also provide secure access to MongoDB.  For a standard deployment of MongoDB on AWS, this is almost always to strategy.  Because of this, we now support creating SSH tunnels automatically when connecting to MongoDB.\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options, (connectionError, client) => {\n  if (connectionError) {\n    return console.log(connectionError);\n  }\n\n  client.db('mongodb').collection('fanclub').count((countingError, count) => {\n    console.log('counted:', countingError, count);\n    client.close();\n  });\n});\n```\n\nThe above provides the same functionality as creating the tunnel using the bash\ncommand below and connecting to MongoDB via another terminal. Notice that\nconnection-model uses a random local port each time it creates a tunnel.\nUsing the command line, you'd have to replace `<random port>` with an actual\nport number.\n\n```bash\nssh -i ~/.ssh/my-key-aws-pair.pem -L <random port>:localhost:27017 ubuntu@ec2-11-111-111-111.compute-1.amazonaws.com\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `sshTunnel` | String | The desired SSH tunnel strategy. Possible values: `NONE`, `USER_PASSWORD`, `IDENTITY_FILE` | `undefined` |\n| `sshTunnelHostname` | String | The hostname of the SSH remote host | `undefined` |\n| `sshTunnelPort` | Port | The SSH port of the remote host | `22` |\n| `sshTunnelBindToLocalPort` | Port | Bind the localhost endpoint of the SSH Tunnel to this port | `undefined` |\n| `sshTunnelUsername` | String | The optional SSH username for the remote host | `undefined` |\n| `sshTunnelPassword` | String | The optional SSH password for the remote host | `undefined` |\n| `sshTunnelIdentityFile` | String/Array | The optional path to the SSH identity file for the remote host | `undefined` |\n| `sshTunnelPassphrase` | String | The optional passphrase for `sshTunnelIdentityFile` | `undefined` |\n\nDescription of `sshTunnel` values:\n\n- `NONE` - Do not use SSH tunneling.\n- `USER_PASSWORD` - The tunnel is created with SSH username and password only.\n- `IDENTITY_FILE` - The tunnel is created using an identity file.\n\n## Derived Properties\n\nDerived properties (also known as computed properties) are properties of the state object that depend on other properties to determine their value.\n\n```javascript\nconst c = new Connection();\nconst derivedProps = c.getAttributes({ derived: true });\n```\n\n| Derived Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `instanceId` | String | The mongoscope | `localhost:27017` |\n| `driverAuthMechanism` | String | Converts the value of `authStrategy` for humans into the `authMechanism` value for the driver | `undefined` |\n| `safeUrl` | String | The URL where a password is replaced with stars | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrl` | String | Use this URL in order to connect via DataService | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrlWithSsh` | String | Use this URL in order to connect via connection model itself | `mongodb://localhost:29201/?readPreference=primary&ssl=false` |\n| `driverOptions` | String | The second argument `mongoscope-server` passes to `mongodb.connect` | `{}` |\n\n## Events\n\n> New in mongodb-connection-model@5.0.0\n\n#### Example: SSH Tunnel\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', skipped: true,\n  reason: 'The selected SSL mode does not need to load any files.' }\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', complete: true}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n#### Example: SSL\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  ssl: 'ALL',\n  sslCA: '~/.ssl/my-ca.pem',\n  sslCert: '~/.ssl/my-server.pem',\n  sslKey: '~/.ssl/my-server.pem'\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', complete: true}\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', skipped: true,\n  reason: 'The selected SSH Tunnel mode is NONE.'}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n[workflow_img]: https://github.com/mongodb-js/connection-model/workflows/Check%20and%20Test/badge.svg?event=push\n[workflow_url]: https://github.com/mongodb-js/connection-model/actions?query=workflow%3A%22Check+and+Test%22\n[npm_img]: https://img.shields.io/npm/v/mongodb-connection-model.svg?style=flat-square\n[npm_url]: https://www.npmjs.org/package/mongodb-connection-model\n[gitter_img]: https://badges.gitter.im/Join%20Chat.svg\n[gitter_url]: http://gitter.im/mongodb-js/mongodb-js\n[enterprise_img]: https://img.shields.io/badge/MongoDB-Enterprise-blue.svg?style=flat-square\n[coming_soon_img]: https://img.shields.io/badge/-Coming%20Soon-ff69b4.svg?style=flat-square\n[kerberos-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/kerberos_tests.js\n[ldap-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ldap_tests.js\n[x509-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ssl_x509_tests.js\n[ns]: https://github.com/mongodb-js/ns\n[sf-ssh-tunnel]: http://serverfault.com/questions/597765/how-to-connect-to-mongodb-server-via-ssh-tunnel\n[ec2-key-pairs]: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html\n[driver-ssl-impl]: https://github.com/christkv/mongodb-core/blob/c3d21cb636d74d7a68134ecd3b9f6af536311279/lib/connection/connection.js#L365-L407\n[driver-ssl-tutorial]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/\n[driver-ssl-none]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#no-certificate-validation\n[driver-ssl-server]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate\n[driver-ssl-all]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate-and-present-valid-certificate\n","gitHead":"bfa0f33f79b0349abe5ad03576e17682f507fe04","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","test":"mocha","check":"npm run lint && npm run depcheck","pretest":"mongodb-runner install && mongodb-runner start --port=27018","test-ci":"npm run test","depcheck":"depcheck","posttest":"mongodb-runner stop --port=27018","posttest-ci":"node ../../scripts/killall-mongo.js","test-check-ci":"npm run check && npm test"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.17.0+x64 (linux)","description":"MongoDB connection model.","directories":{},"_nodeVersion":"16.17.0","compass:main":"index.js","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","debug":"^4.2.0","lodash":"^4.17.15","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.2.0","storage-mixin":"0.0.0-next-bfa0f33f79b0349abe5ad03576e17682f507fe04","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.2","@mongodb-js/ssh-tunnel":"0.0.0-next-bfa0f33f79b0349abe5ad03576e17682f507fe04","@mongodb-js/compass-utils":"0.0.0-next-bfa0f33f79b0349abe5ad03576e17682f507fe04","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.5.4"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"^4.10.0","depcheck":"^1.4.1","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.9.0","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^4.10.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_0.0.0-next-bfa0f33f79b0349abe5ad03576e17682f507fe04_1667942838849_0.3498231515700343","host":"s3://npm-registry-packages"}},"0.0.0-next-5f5cecf01c890c348e17907482b03cea2f8c5f21":{"name":"mongodb-connection-model","version":"0.0.0-next-5f5cecf01c890c348e17907482b03cea2f8c5f21","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@0.0.0-next-5f5cecf01c890c348e17907482b03cea2f8c5f21","maintainers":[{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"iteng@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"73a9080b12cd3eaf394f0cacfc5c3315b35a005a","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-0.0.0-next-5f5cecf01c890c348e17907482b03cea2f8c5f21.tgz","fileCount":20,"integrity":"sha512-9vHsATggsti4dMeGOJK5p6cFvDmKKOnnxCEe81cev+mlPgoGWqTrL4Cyqvf4o5ipdMkcqGdf48qHd6ZvWy9NHQ==","signatures":[{"sig":"MEYCIQCK5h/LWIO00RZlBrvAcgjm50SkUMkyDZYNFe/BwS6EdQIhAPmB9v2R+8w+XALy+Bqkbmo90/Zwpw/siGDkyoiGgDzr","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":108152,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjbDtbACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpDkBAAkGC5/KY8cLygKlSBzlf3ZZgxsLlLzi1sxlI+9yN4PiHCv5iT\r\nvJybDaFNXxob9OwnE9RKvlj0imyGwuu1SzPkomNk+9qqclUd0+OD0scRhkcw\r\niHPieq0w7FSz9E7cuZbt14T3qVoeuQtzw6Z3zrrqQ0wXyR8m6DTgX30HQ0kC\r\nZH9Z3RuMISx3cwQA7khFI6/WIoTpmN1ya/qys/GAEozNoxXJoUPv5sa0Lum8\r\nsNns6vJepxGS3EIn3+O1y6msYdltxgN1DQQfQca9+IoDRi7H3nAE2F8Pxbv+\r\nDbEjoC4KA9uzD7cQIHFDELZfPRwujAAtMqIcZRPiD4UnIlDJFJiL8OvTLyui\r\nEsqvoAbUCnKHeC9FUlKHAD6N5K+OH4y1nZdn0tplX+K5KPMAmCW9XKDF8nBf\r\nohTbFuB0KwmWTkmz48WRyVOnuVN/tmRl7ynDTjqaaVOBjXSNto48vpM5X6Z0\r\nGGvoEJRvaFX8xnol2nQqXpNcgC6j8GPJ21YaY98mRS7Ibmc7V+Ib49o2s9MJ\r\nS+dl6/fYULB3rcK31Tnn8Jko1WTDYO2KmQweMPhQ7KtWXhwNmRUn1FYoM+iE\r\nJC0VJVdQJkUU+4ay2TCBv73NFqvjUMv2BK3xB4m5GbJeOI8Z8A6pUkPzr+ly\r\nu5sbWfSEEY0t8pVxWENh/MGN7sqoFdNsz2c=\r\n=BVtV\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","readme":"# mongodb-connection-model [![][workflow_img]][workflow_url] [![][npm_img]][npm_url]\n\n> MongoDB connection model\n\nThe main purpose of the MongoDB connection model is to be a domain model around a MongoDB connection. It encapsulates generating a [Connection String URI](https://docs.mongodb.com/manual/reference/connection-string/) from a group of attributes and parses URI using the [MongoDB Node.JS Driver URI Parser](https://github.com/mongodb-js/mongodb-core/blob/master/lib/uri_parser.js).\n\n## Installation\n\n```\nnpm install --save mongodb-connection-model\n```\n\n## Usage\n\n### Building URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\nconst c = new Connection({ appname: 'My App Name' });\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://localhost:27017/?readPreference=primary&appname=My%20App&ssl=false'\n```\n\n### Parsing URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\n\nConnection.from(\n  'mongodb://someUsername:testPassword@localhost',\n  (error, result) => {\n    console.log(result);\n    >>> `{\n      hosts: [{ host: 'localhost', port: 27017 }],\n      hostname: 'localhost',\n      port: 27017,\n      auth: {\n        username: 'someUsername',\n        password: 'testPassword',\n        db: 'admin'\n      },\n      isSrvRecord: false,\n      authStrategy: 'MONGODB',\n      mongodbUsername: 'someUsername',\n      mongodbPassword: 'testPassword',\n      mongodbDatabaseName: 'admin',\n      extraOptions: {},\n      connectionType: 'NODE_DRIVER',\n      readPreference: 'primary',\n      kerberosCanonicalizeHostname: false,\n      sslMethod: 'NONE',\n      sshTunnel: 'NONE',\n      sshTunnelPort: 22\n    }`\n  }\n);\n```\n\n## Properties\n\nMongoDB connection model is based on Ampersand.js framework and consist of [props](https://ampersandjs.com/docs/#ampersand-state-props) and [derived props](https://ampersandjs.com/docs/#ampersand-state-derived). The props object describes the observable properties that MongoDB connection model gets from the Node.js Driver API.\n\n```javascript\nconst с = new Connection();\nconst props = с.getAttributes({ props: true });\n```\n\n#### See Also\n\n- [URI Generic Syntax](https://tools.ietf.org/html/rfc3986)\n- [URI Options Specification](https://github.com/mongodb/specifications/blob/master/source/uri-options/uri-options.rst)\n\n### General Properties\n\n```javascript\nconst c = new Connection({ isSrvRecord: true });\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ns` | String | A valid [ns][ns] the user can read from | `undefined` |\n| `isSrvRecord` | Boolean | Indicates SRV record | `false` |\n| `auth` | Object | Authentication from driver (username, user, db, password) | `undefined` |\n| `hostname` | String | Hostname of a MongoDB Instance. In case of the replica set the first host and port will be taken | `localhost` |\n| `port` | Number | TCP port of a MongoDB Instance | `27017` |\n| `hosts` | Array | Contains all hosts and ports for replica set | `[{ host: 'localhost', port: 27017 }]` |\n| `extraOptions` | Object | Extra options passed to the node driver as part of `driverOptions` | `{}` |\n| `connectionType` | String | The desired connection type. Possible values: `NODE_DRIVER`, `STITCH_ON_PREM`, `STITCH_ATLAS` | `NODE_DRIVER` |\n| `authStrategy` | String | The desired authentication strategy. Possible values: `NONE`, `MONGODB`, `X509`, `KERBEROS`, `LDAP`, `SCRAM-SHA-256` | `NONE` |\n\n### Connection string options\n\n```javascript\nconst c = new Connection({ appname: 'My App', replicaSet: 'testing' });\n```\n\n#### General connection string options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `replicaSet` | String | Specifies the name of the replica set, if the mongod is a member of a replica set | `undefined` |\n| `connectTimeoutMS` | Number | The time in milliseconds to attempt a connection before timing out | `undefined` |\n| `socketTimeoutMS` | Number | The time in milliseconds to attempt a send or receive on a socket before the attempt times out | `undefined` |\n| `compression` | Object | Object includes compressors and a compression level. The following compressors can be specified: `snappy`, `zlib` (Available in MongoDB 3.6 or greater) | `undefined` |\n\n#### Connection Pool Option\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `maxPoolSize` | Number | The maximum number of connections in the connection pool | `undefined` |\n| `minPoolSize` | Number | The minimum number of connections in the connection pool | `undefined` |\n| `maxIdleTimeMS` | Number | The maximum number of milliseconds that a connection can remain idle in the pool before being removed and closed | `undefined` |\n| `waitQueueMultiple` | Number | A number that the driver multiples the maxPoolSize value to, to provide the maximum number of threads allowed to wait for a connection to become available from the pool | `undefined` |\n| `waitQueueTimeoutMS` | Number | The maximum time in milliseconds that a thread can wait for a connection to become available | `undefined` |\n\n#### Write Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `w` | Number/String | Corresponds to the write concern [w Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-w) | `undefined` |\n| `wTimeoutMS` | Number | Corresponds to the write concern [wtimeout](https://docs.mongodb.com/manual/reference/write-concern/#wc-wtimeout) | `undefined` |\n| `journal` | Boolean | Corresponds to the write concern [j Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-j) | `undefined` |\n\n#### Read Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readConcernLevel` | String | The level of isolation | `undefined` |\n\n#### Read Preference Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readPreference` | String | Specifies the read preferences for this connection. Possible values: `PRIMARY`, `PRIMARY_PREFERRED`, `SECONDARY`, `SECONDARY_PREFERRED`, `NEAREST` | `PRIMARY` |\n| `maxStalenessSeconds` | Number | Specifies, in seconds, how stale a secondary can be before the client stops using it for read operations | `undefined` |\n| `readPreferenceTags` | Object | Default read preference tags for the client | `undefined` |\n\n#### Authentication Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `authSource` | String | Specify the database name associated with the user’s credentials | `undefined` |\n| `authMechanism` | String | Specifies the authentication mechanism that MongoDB will use to authenticate the connection. Possible values: `DEFAULT`, `GSSAPI`, `MONGODB-X509`, `PLAIN`, `SCRAM-SHA-256` | `undefined` |\n| `authMechanismProperties` | Object | Additional options provided for authentication (e.g. to enable hostname canonicalization for GSSAPI) | `undefined` |\n| `gssapiServiceName` | String | Set the Kerberos service name when connecting to Kerberized MongoDB instances | `undefined` |\n| `gssapiServiceRealm` | String | Set the Realm service name | `undefined` |\n| `gssapiCanonicalizeHostName` | Boolean | Whether canonicalized hostname | `undefined` |\n\n#### Server Selection and Discovery Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `localThresholdMS` | Number | The size (in milliseconds) of the latency window for selecting among multiple suitable MongoDB instances | `undefined` |\n| `serverSelectionTimeoutMS` | Number | Specifies how long (in milliseconds) to block for server selection before throwing an exception | `undefined` |\n| `serverSelectionTryOnce` | Boolean | Instructs the driver to scan the MongoDB deployment exactly once after server selection fails and then either select a server or raise an error | `undefined` |\n| `heartbeatFrequencyMS` | Number | Controls when the driver checks the state of the MongoDB deployment | `undefined` |\n\n#### Miscellaneous Configuration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `appname` | String | An application name passed to server as client metadata | `undefined` |\n| `retryWrites` | Boolean | Enable retryable writes | `undefined` |\n| `uuidRepresentation` | String | The legacy representation of UUID. Possible values: `standard`, `csharpLegacy`, `javaLegacy`, `pythonLegacy` | `undefined` |\n| `loadBalanced` | Boolean | Whether or not the server is running in load balanced mode | `undefined` |\n\n### Stitch attributes\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `stitchServiceName` | String | Stitch service name | `undefined` |\n| `stitchClientAppId` | String | Stitch сlient app ID | `undefined` |\n| `stitchGroupId` | String | Stitch group ID | `undefined` |\n| `stitchBaseUrl` | String | Stitch base Url | `undefined` |\n\n### MONGODB authentication\n\n```javascript\nconst c = new Connection({\n  mongodbUsername: 'arlo',\n  mongodbPassword: 'w@of'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/?slaveOk=true&authSource=admin'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `mongodbUsername` | String | MongoDB username | `undefined` |\n| `mongodbPassword` | String | MongoDB password | `undefined` |\n| `mongodbDatabaseName` | String | The database name associated with the user's credentials | `undefined` |\n| `promoteValues` | Boolean | Whether BSON values should be promoted to their JS type counterparts | `undefined` |\n\n### KERBEROS authentication\n\n```javascript\nconst c = new Connection({\n  kerberosServiceName: 'mongodb',\n  kerberosPrincipal: 'arlo/dog@krb5.mongodb.parts',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo%252Fdog%2540krb5.mongodb.parts@localhost:27017/toys?authMechanism=GSSAPI'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n> @note (imlucas): Kerberos on Windows is broken out as it's own state for UX consideration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `kerberosServiceName` | String | Any program or computer you access over a network | `undefined` |\n| `kerberosPrincipal` | String | The format of a typical Kerberos V5 principal is `primary/instance@REALM` | `undefined` |\n| `kerberosCanonicalizeHostname` | Boolean | Whether canonicalized kerberos hostname | `undefined` |\n\n#### See Also\n\n- [node.js driver Kerberos reference](http://bit.ly/mongodb-node-driver-kerberos)\n- [node.js driver Kerberos functional test][kerberos-functional]\n\n### LDAP authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  ldapUsername: 'arlo',\n  ldapPassword: 'w@of',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/toys?slaveOk=true&authMechanism=PLAIN'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ldapUsername` | String | LDAP username | `undefined` |\n| `ldapPassword` | String | LDAP password | `undefined` |\n\n#### See Also\n\n- [node.js driver LDAP reference](http://bit.ly/mongodb-node-driver-ldap)\n- [node.js driver X509 functional test][ldap-functional]\n\n### X509 authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  x509Username: 'CN=client,OU=arlo,O=MongoDB,L=Philadelphia,ST=Pennsylvania,C=US'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://CN%253Dclient%252COU%253Darlo%252CO%253DMongoDB%252CL%253DPhiladelphia%252CST%253DPennsylvania%252CC%253DUS@localhost:27017?slaveOk=true&authMechanism=MONGODB-X509'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `x509Username` | String | The x.509 certificate derived user name, e.g. `CN=user,OU=OrgUnit,O=myOrg,...` | `undefined` |\n\n#### See Also\n\n- [node.js driver X509 reference](http://bit.ly/mongodb-node-driver-x509)\n- [node.js driver X509 functional test][x509-functional]\n\n### SSL\n\n> **Note**: Not to be confused with `authentication=X509`\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ssl` | Number/String | A boolean to enable or disables TLS/SSL for the connection | `undefined` |\n| `sslMethod` | String | The desired ssl method. Possible values: `NONE`, `SYSTEMCA`, `IFAVAILABLE`, `UNVALIDATED`, `SERVER`, `ALL` | `NONE` |\n| `sslCA` | Buffer/String | Array of valid certificates | `undefined` |\n| `sslCert` | Buffer/String | The certificate | `undefined` |\n| `sslKey` | Buffer/String | The certificate private key | `undefined` |\n| `sslPass` | Buffer/String | The certificate password | `undefined` |\n\nDescription of `sslMethod` values:\n\n- `SYSTEMCA` - SSL required, validate using System CA, with host verification.\n- `IFAVAILABLE` - The driver should try SSL first, fall back to no SSL if unavailable, and use the system's Certificate Authority.\n- `SERVER` - The driver should validate the server certificate and fail to connect if validation fails. See also [node.js driver \"Validate Server Certificate\" docs][driver-ssl-server].\n- `ALL` - The driver must present a valid certificate and validate the server certificate. See also [node.js driver \"Validate Server Certificate and Present Valid Certificate\" docs][driver-ssl-all].\n- `NONE` - No SSL (Not recommended).\n- `UNVALIDATED` - Use SSL but do not perform any validation of the certificate chain. See also [node.js driver \"No Certificate Validation\" docs][driver-ssl-none]. **Very** not recommended and likely to be deprecated in future releases because it exposes potential Man-In-The-Middle attack vectors.\n\n#### See also\n\n- [node.js driver SSL implementation][driver-ssl-impl]\n- [node.js driver SSL tutorial][driver-ssl-tutorial]\n\n### SSH TUNNEL\n\n> New in mongodb-connection-model@5.0.0\n\nBecause [authentication](#authentication) is quite difficult for operators to migrate to, the most common method of securing a MongoDB deployment is to use an [SSH tunnel][sf-ssh-tunnel].  This allows operators to leverage their existing SSH security infrastructure to also provide secure access to MongoDB.  For a standard deployment of MongoDB on AWS, this is almost always to strategy.  Because of this, we now support creating SSH tunnels automatically when connecting to MongoDB.\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options, (connectionError, client) => {\n  if (connectionError) {\n    return console.log(connectionError);\n  }\n\n  client.db('mongodb').collection('fanclub').count((countingError, count) => {\n    console.log('counted:', countingError, count);\n    client.close();\n  });\n});\n```\n\nThe above provides the same functionality as creating the tunnel using the bash\ncommand below and connecting to MongoDB via another terminal. Notice that\nconnection-model uses a random local port each time it creates a tunnel.\nUsing the command line, you'd have to replace `<random port>` with an actual\nport number.\n\n```bash\nssh -i ~/.ssh/my-key-aws-pair.pem -L <random port>:localhost:27017 ubuntu@ec2-11-111-111-111.compute-1.amazonaws.com\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `sshTunnel` | String | The desired SSH tunnel strategy. Possible values: `NONE`, `USER_PASSWORD`, `IDENTITY_FILE` | `undefined` |\n| `sshTunnelHostname` | String | The hostname of the SSH remote host | `undefined` |\n| `sshTunnelPort` | Port | The SSH port of the remote host | `22` |\n| `sshTunnelBindToLocalPort` | Port | Bind the localhost endpoint of the SSH Tunnel to this port | `undefined` |\n| `sshTunnelUsername` | String | The optional SSH username for the remote host | `undefined` |\n| `sshTunnelPassword` | String | The optional SSH password for the remote host | `undefined` |\n| `sshTunnelIdentityFile` | String/Array | The optional path to the SSH identity file for the remote host | `undefined` |\n| `sshTunnelPassphrase` | String | The optional passphrase for `sshTunnelIdentityFile` | `undefined` |\n\nDescription of `sshTunnel` values:\n\n- `NONE` - Do not use SSH tunneling.\n- `USER_PASSWORD` - The tunnel is created with SSH username and password only.\n- `IDENTITY_FILE` - The tunnel is created using an identity file.\n\n## Derived Properties\n\nDerived properties (also known as computed properties) are properties of the state object that depend on other properties to determine their value.\n\n```javascript\nconst c = new Connection();\nconst derivedProps = c.getAttributes({ derived: true });\n```\n\n| Derived Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `instanceId` | String | The mongoscope | `localhost:27017` |\n| `driverAuthMechanism` | String | Converts the value of `authStrategy` for humans into the `authMechanism` value for the driver | `undefined` |\n| `safeUrl` | String | The URL where a password is replaced with stars | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrl` | String | Use this URL in order to connect via DataService | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrlWithSsh` | String | Use this URL in order to connect via connection model itself | `mongodb://localhost:29201/?readPreference=primary&ssl=false` |\n| `driverOptions` | String | The second argument `mongoscope-server` passes to `mongodb.connect` | `{}` |\n\n## Events\n\n> New in mongodb-connection-model@5.0.0\n\n#### Example: SSH Tunnel\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', skipped: true,\n  reason: 'The selected SSL mode does not need to load any files.' }\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', complete: true}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n#### Example: SSL\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  ssl: 'ALL',\n  sslCA: '~/.ssl/my-ca.pem',\n  sslCert: '~/.ssl/my-server.pem',\n  sslKey: '~/.ssl/my-server.pem'\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', complete: true}\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', skipped: true,\n  reason: 'The selected SSH Tunnel mode is NONE.'}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n[workflow_img]: https://github.com/mongodb-js/connection-model/workflows/Check%20and%20Test/badge.svg?event=push\n[workflow_url]: https://github.com/mongodb-js/connection-model/actions?query=workflow%3A%22Check+and+Test%22\n[npm_img]: https://img.shields.io/npm/v/mongodb-connection-model.svg?style=flat-square\n[npm_url]: https://www.npmjs.org/package/mongodb-connection-model\n[gitter_img]: https://badges.gitter.im/Join%20Chat.svg\n[gitter_url]: http://gitter.im/mongodb-js/mongodb-js\n[enterprise_img]: https://img.shields.io/badge/MongoDB-Enterprise-blue.svg?style=flat-square\n[coming_soon_img]: https://img.shields.io/badge/-Coming%20Soon-ff69b4.svg?style=flat-square\n[kerberos-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/kerberos_tests.js\n[ldap-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ldap_tests.js\n[x509-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ssl_x509_tests.js\n[ns]: https://github.com/mongodb-js/ns\n[sf-ssh-tunnel]: http://serverfault.com/questions/597765/how-to-connect-to-mongodb-server-via-ssh-tunnel\n[ec2-key-pairs]: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html\n[driver-ssl-impl]: https://github.com/christkv/mongodb-core/blob/c3d21cb636d74d7a68134ecd3b9f6af536311279/lib/connection/connection.js#L365-L407\n[driver-ssl-tutorial]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/\n[driver-ssl-none]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#no-certificate-validation\n[driver-ssl-server]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate\n[driver-ssl-all]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate-and-present-valid-certificate\n","gitHead":"5f5cecf01c890c348e17907482b03cea2f8c5f21","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","test":"mocha","check":"npm run lint && npm run depcheck","pretest":"mongodb-runner install && mongodb-runner start --port=27018","test-ci":"npm run test","depcheck":"depcheck","posttest":"mongodb-runner stop --port=27018","posttest-ci":"node ../../scripts/killall-mongo.js","test-check-ci":"npm run check && npm test"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.17.0+x64 (linux)","description":"MongoDB connection model.","directories":{},"_nodeVersion":"16.17.0","compass:main":"index.js","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","debug":"^4.2.0","lodash":"^4.17.15","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.2.0","storage-mixin":"0.0.0-next-5f5cecf01c890c348e17907482b03cea2f8c5f21","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.2","@mongodb-js/ssh-tunnel":"0.0.0-next-5f5cecf01c890c348e17907482b03cea2f8c5f21","@mongodb-js/compass-utils":"0.0.0-next-5f5cecf01c890c348e17907482b03cea2f8c5f21","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.5.4"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"^4.10.0","depcheck":"^1.4.1","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.9.0","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^4.10.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_0.0.0-next-5f5cecf01c890c348e17907482b03cea2f8c5f21_1668037467503_0.04747543708158819","host":"s3://npm-registry-packages"}},"0.0.0-next-51a8e00f16dc1652cb0f0674c540570614a8895e":{"name":"mongodb-connection-model","version":"0.0.0-next-51a8e00f16dc1652cb0f0674c540570614a8895e","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@0.0.0-next-51a8e00f16dc1652cb0f0674c540570614a8895e","maintainers":[{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"iteng@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"5de78449038ee2a1d4de2b590625af75b4429d14","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-0.0.0-next-51a8e00f16dc1652cb0f0674c540570614a8895e.tgz","fileCount":20,"integrity":"sha512-qb4w9BBiQYTXVsyptAQa/XL4Da685CbQZ6NqDFYKTHcmTFh55WXkMoTEIn/dztC0Z0fkorSpJlTtP2vN8ut86w==","signatures":[{"sig":"MEUCIQCtNpkOUErxTFNyF9f56EzEL5pP8FeYb7b3v0kYNbQmvwIgGf7xaLK9UefZSqVdXJy8c8RFRDDh9FV8nXRY2+IIa2g=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":108152,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjbDy0ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqoSw/+KYJFzfriLbjMlc2sm5qbIU/vIpVJ+VuOtw8IvIlLq0spOkXn\r\nVK5pEvmeUyNGiG8s66FNdm7M8WgCfcGMxS33kfJJcttA2tweNSvH1swDzftn\r\n753sqKNKQw+iYiDy1hBj2vnRnIZpyAeDkOTNXRk2TfrQwJKGXwH8H2PUE9Fn\r\noOgPeR16gIGr736px1MvuV2p7V1Kv1snJk79HXp8blgcomdV+/GBEFTejlPy\r\nZ2AghwLX8R2QX6fjjSO5Xcriy37S4ejmLUJmRFRaKFWW1WVCXhITBfUgp6cv\r\nXxXZx3kHzOBWizBhrvt8774uA26qvX6HRJ1JIvC+8lRSMqg/IZNRiFurS1zF\r\nlg0BunvQy7tz9JjWZcp+utvSdBB2lpclnz12ITiHuvAtQh+SyQ+8yp++e2mm\r\nkQoSzuf/f6TmCaHjFPQLCpHXqmuYTiNLAOj9tD0XK2kLfg2Eg1eXYkQOhTFQ\r\nRjb/fHASsrxMQ/pN09X4gG1AyjJmB3s47PY8BSlkbrcykNZEa1i3h5M7WuRu\r\nwTBWaE7oVoMRC1LKskxYG1qGj34XkHA4a3Pd5yHgSbI6+LHeTHjk/EDj5CGV\r\nTYGL7O/rB5GHXAlKwRnbh01UbCyvl8SYf7hOo2yQhOIVj+6AlhuUp/m5Zduf\r\n97HqvyycJqO9X1tSbZy6bS0bPo8MIInMkQg=\r\n=47Q3\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","readme":"# mongodb-connection-model [![][workflow_img]][workflow_url] [![][npm_img]][npm_url]\n\n> MongoDB connection model\n\nThe main purpose of the MongoDB connection model is to be a domain model around a MongoDB connection. It encapsulates generating a [Connection String URI](https://docs.mongodb.com/manual/reference/connection-string/) from a group of attributes and parses URI using the [MongoDB Node.JS Driver URI Parser](https://github.com/mongodb-js/mongodb-core/blob/master/lib/uri_parser.js).\n\n## Installation\n\n```\nnpm install --save mongodb-connection-model\n```\n\n## Usage\n\n### Building URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\nconst c = new Connection({ appname: 'My App Name' });\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://localhost:27017/?readPreference=primary&appname=My%20App&ssl=false'\n```\n\n### Parsing URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\n\nConnection.from(\n  'mongodb://someUsername:testPassword@localhost',\n  (error, result) => {\n    console.log(result);\n    >>> `{\n      hosts: [{ host: 'localhost', port: 27017 }],\n      hostname: 'localhost',\n      port: 27017,\n      auth: {\n        username: 'someUsername',\n        password: 'testPassword',\n        db: 'admin'\n      },\n      isSrvRecord: false,\n      authStrategy: 'MONGODB',\n      mongodbUsername: 'someUsername',\n      mongodbPassword: 'testPassword',\n      mongodbDatabaseName: 'admin',\n      extraOptions: {},\n      connectionType: 'NODE_DRIVER',\n      readPreference: 'primary',\n      kerberosCanonicalizeHostname: false,\n      sslMethod: 'NONE',\n      sshTunnel: 'NONE',\n      sshTunnelPort: 22\n    }`\n  }\n);\n```\n\n## Properties\n\nMongoDB connection model is based on Ampersand.js framework and consist of [props](https://ampersandjs.com/docs/#ampersand-state-props) and [derived props](https://ampersandjs.com/docs/#ampersand-state-derived). The props object describes the observable properties that MongoDB connection model gets from the Node.js Driver API.\n\n```javascript\nconst с = new Connection();\nconst props = с.getAttributes({ props: true });\n```\n\n#### See Also\n\n- [URI Generic Syntax](https://tools.ietf.org/html/rfc3986)\n- [URI Options Specification](https://github.com/mongodb/specifications/blob/master/source/uri-options/uri-options.rst)\n\n### General Properties\n\n```javascript\nconst c = new Connection({ isSrvRecord: true });\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ns` | String | A valid [ns][ns] the user can read from | `undefined` |\n| `isSrvRecord` | Boolean | Indicates SRV record | `false` |\n| `auth` | Object | Authentication from driver (username, user, db, password) | `undefined` |\n| `hostname` | String | Hostname of a MongoDB Instance. In case of the replica set the first host and port will be taken | `localhost` |\n| `port` | Number | TCP port of a MongoDB Instance | `27017` |\n| `hosts` | Array | Contains all hosts and ports for replica set | `[{ host: 'localhost', port: 27017 }]` |\n| `extraOptions` | Object | Extra options passed to the node driver as part of `driverOptions` | `{}` |\n| `connectionType` | String | The desired connection type. Possible values: `NODE_DRIVER`, `STITCH_ON_PREM`, `STITCH_ATLAS` | `NODE_DRIVER` |\n| `authStrategy` | String | The desired authentication strategy. Possible values: `NONE`, `MONGODB`, `X509`, `KERBEROS`, `LDAP`, `SCRAM-SHA-256` | `NONE` |\n\n### Connection string options\n\n```javascript\nconst c = new Connection({ appname: 'My App', replicaSet: 'testing' });\n```\n\n#### General connection string options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `replicaSet` | String | Specifies the name of the replica set, if the mongod is a member of a replica set | `undefined` |\n| `connectTimeoutMS` | Number | The time in milliseconds to attempt a connection before timing out | `undefined` |\n| `socketTimeoutMS` | Number | The time in milliseconds to attempt a send or receive on a socket before the attempt times out | `undefined` |\n| `compression` | Object | Object includes compressors and a compression level. The following compressors can be specified: `snappy`, `zlib` (Available in MongoDB 3.6 or greater) | `undefined` |\n\n#### Connection Pool Option\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `maxPoolSize` | Number | The maximum number of connections in the connection pool | `undefined` |\n| `minPoolSize` | Number | The minimum number of connections in the connection pool | `undefined` |\n| `maxIdleTimeMS` | Number | The maximum number of milliseconds that a connection can remain idle in the pool before being removed and closed | `undefined` |\n| `waitQueueMultiple` | Number | A number that the driver multiples the maxPoolSize value to, to provide the maximum number of threads allowed to wait for a connection to become available from the pool | `undefined` |\n| `waitQueueTimeoutMS` | Number | The maximum time in milliseconds that a thread can wait for a connection to become available | `undefined` |\n\n#### Write Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `w` | Number/String | Corresponds to the write concern [w Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-w) | `undefined` |\n| `wTimeoutMS` | Number | Corresponds to the write concern [wtimeout](https://docs.mongodb.com/manual/reference/write-concern/#wc-wtimeout) | `undefined` |\n| `journal` | Boolean | Corresponds to the write concern [j Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-j) | `undefined` |\n\n#### Read Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readConcernLevel` | String | The level of isolation | `undefined` |\n\n#### Read Preference Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readPreference` | String | Specifies the read preferences for this connection. Possible values: `PRIMARY`, `PRIMARY_PREFERRED`, `SECONDARY`, `SECONDARY_PREFERRED`, `NEAREST` | `PRIMARY` |\n| `maxStalenessSeconds` | Number | Specifies, in seconds, how stale a secondary can be before the client stops using it for read operations | `undefined` |\n| `readPreferenceTags` | Object | Default read preference tags for the client | `undefined` |\n\n#### Authentication Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `authSource` | String | Specify the database name associated with the user’s credentials | `undefined` |\n| `authMechanism` | String | Specifies the authentication mechanism that MongoDB will use to authenticate the connection. Possible values: `DEFAULT`, `GSSAPI`, `MONGODB-X509`, `PLAIN`, `SCRAM-SHA-256` | `undefined` |\n| `authMechanismProperties` | Object | Additional options provided for authentication (e.g. to enable hostname canonicalization for GSSAPI) | `undefined` |\n| `gssapiServiceName` | String | Set the Kerberos service name when connecting to Kerberized MongoDB instances | `undefined` |\n| `gssapiServiceRealm` | String | Set the Realm service name | `undefined` |\n| `gssapiCanonicalizeHostName` | Boolean | Whether canonicalized hostname | `undefined` |\n\n#### Server Selection and Discovery Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `localThresholdMS` | Number | The size (in milliseconds) of the latency window for selecting among multiple suitable MongoDB instances | `undefined` |\n| `serverSelectionTimeoutMS` | Number | Specifies how long (in milliseconds) to block for server selection before throwing an exception | `undefined` |\n| `serverSelectionTryOnce` | Boolean | Instructs the driver to scan the MongoDB deployment exactly once after server selection fails and then either select a server or raise an error | `undefined` |\n| `heartbeatFrequencyMS` | Number | Controls when the driver checks the state of the MongoDB deployment | `undefined` |\n\n#### Miscellaneous Configuration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `appname` | String | An application name passed to server as client metadata | `undefined` |\n| `retryWrites` | Boolean | Enable retryable writes | `undefined` |\n| `uuidRepresentation` | String | The legacy representation of UUID. Possible values: `standard`, `csharpLegacy`, `javaLegacy`, `pythonLegacy` | `undefined` |\n| `loadBalanced` | Boolean | Whether or not the server is running in load balanced mode | `undefined` |\n\n### Stitch attributes\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `stitchServiceName` | String | Stitch service name | `undefined` |\n| `stitchClientAppId` | String | Stitch сlient app ID | `undefined` |\n| `stitchGroupId` | String | Stitch group ID | `undefined` |\n| `stitchBaseUrl` | String | Stitch base Url | `undefined` |\n\n### MONGODB authentication\n\n```javascript\nconst c = new Connection({\n  mongodbUsername: 'arlo',\n  mongodbPassword: 'w@of'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/?slaveOk=true&authSource=admin'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `mongodbUsername` | String | MongoDB username | `undefined` |\n| `mongodbPassword` | String | MongoDB password | `undefined` |\n| `mongodbDatabaseName` | String | The database name associated with the user's credentials | `undefined` |\n| `promoteValues` | Boolean | Whether BSON values should be promoted to their JS type counterparts | `undefined` |\n\n### KERBEROS authentication\n\n```javascript\nconst c = new Connection({\n  kerberosServiceName: 'mongodb',\n  kerberosPrincipal: 'arlo/dog@krb5.mongodb.parts',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo%252Fdog%2540krb5.mongodb.parts@localhost:27017/toys?authMechanism=GSSAPI'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n> @note (imlucas): Kerberos on Windows is broken out as it's own state for UX consideration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `kerberosServiceName` | String | Any program or computer you access over a network | `undefined` |\n| `kerberosPrincipal` | String | The format of a typical Kerberos V5 principal is `primary/instance@REALM` | `undefined` |\n| `kerberosCanonicalizeHostname` | Boolean | Whether canonicalized kerberos hostname | `undefined` |\n\n#### See Also\n\n- [node.js driver Kerberos reference](http://bit.ly/mongodb-node-driver-kerberos)\n- [node.js driver Kerberos functional test][kerberos-functional]\n\n### LDAP authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  ldapUsername: 'arlo',\n  ldapPassword: 'w@of',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/toys?slaveOk=true&authMechanism=PLAIN'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ldapUsername` | String | LDAP username | `undefined` |\n| `ldapPassword` | String | LDAP password | `undefined` |\n\n#### See Also\n\n- [node.js driver LDAP reference](http://bit.ly/mongodb-node-driver-ldap)\n- [node.js driver X509 functional test][ldap-functional]\n\n### X509 authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  x509Username: 'CN=client,OU=arlo,O=MongoDB,L=Philadelphia,ST=Pennsylvania,C=US'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://CN%253Dclient%252COU%253Darlo%252CO%253DMongoDB%252CL%253DPhiladelphia%252CST%253DPennsylvania%252CC%253DUS@localhost:27017?slaveOk=true&authMechanism=MONGODB-X509'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `x509Username` | String | The x.509 certificate derived user name, e.g. `CN=user,OU=OrgUnit,O=myOrg,...` | `undefined` |\n\n#### See Also\n\n- [node.js driver X509 reference](http://bit.ly/mongodb-node-driver-x509)\n- [node.js driver X509 functional test][x509-functional]\n\n### SSL\n\n> **Note**: Not to be confused with `authentication=X509`\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ssl` | Number/String | A boolean to enable or disables TLS/SSL for the connection | `undefined` |\n| `sslMethod` | String | The desired ssl method. Possible values: `NONE`, `SYSTEMCA`, `IFAVAILABLE`, `UNVALIDATED`, `SERVER`, `ALL` | `NONE` |\n| `sslCA` | Buffer/String | Array of valid certificates | `undefined` |\n| `sslCert` | Buffer/String | The certificate | `undefined` |\n| `sslKey` | Buffer/String | The certificate private key | `undefined` |\n| `sslPass` | Buffer/String | The certificate password | `undefined` |\n\nDescription of `sslMethod` values:\n\n- `SYSTEMCA` - SSL required, validate using System CA, with host verification.\n- `IFAVAILABLE` - The driver should try SSL first, fall back to no SSL if unavailable, and use the system's Certificate Authority.\n- `SERVER` - The driver should validate the server certificate and fail to connect if validation fails. See also [node.js driver \"Validate Server Certificate\" docs][driver-ssl-server].\n- `ALL` - The driver must present a valid certificate and validate the server certificate. See also [node.js driver \"Validate Server Certificate and Present Valid Certificate\" docs][driver-ssl-all].\n- `NONE` - No SSL (Not recommended).\n- `UNVALIDATED` - Use SSL but do not perform any validation of the certificate chain. See also [node.js driver \"No Certificate Validation\" docs][driver-ssl-none]. **Very** not recommended and likely to be deprecated in future releases because it exposes potential Man-In-The-Middle attack vectors.\n\n#### See also\n\n- [node.js driver SSL implementation][driver-ssl-impl]\n- [node.js driver SSL tutorial][driver-ssl-tutorial]\n\n### SSH TUNNEL\n\n> New in mongodb-connection-model@5.0.0\n\nBecause [authentication](#authentication) is quite difficult for operators to migrate to, the most common method of securing a MongoDB deployment is to use an [SSH tunnel][sf-ssh-tunnel].  This allows operators to leverage their existing SSH security infrastructure to also provide secure access to MongoDB.  For a standard deployment of MongoDB on AWS, this is almost always to strategy.  Because of this, we now support creating SSH tunnels automatically when connecting to MongoDB.\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options, (connectionError, client) => {\n  if (connectionError) {\n    return console.log(connectionError);\n  }\n\n  client.db('mongodb').collection('fanclub').count((countingError, count) => {\n    console.log('counted:', countingError, count);\n    client.close();\n  });\n});\n```\n\nThe above provides the same functionality as creating the tunnel using the bash\ncommand below and connecting to MongoDB via another terminal. Notice that\nconnection-model uses a random local port each time it creates a tunnel.\nUsing the command line, you'd have to replace `<random port>` with an actual\nport number.\n\n```bash\nssh -i ~/.ssh/my-key-aws-pair.pem -L <random port>:localhost:27017 ubuntu@ec2-11-111-111-111.compute-1.amazonaws.com\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `sshTunnel` | String | The desired SSH tunnel strategy. Possible values: `NONE`, `USER_PASSWORD`, `IDENTITY_FILE` | `undefined` |\n| `sshTunnelHostname` | String | The hostname of the SSH remote host | `undefined` |\n| `sshTunnelPort` | Port | The SSH port of the remote host | `22` |\n| `sshTunnelBindToLocalPort` | Port | Bind the localhost endpoint of the SSH Tunnel to this port | `undefined` |\n| `sshTunnelUsername` | String | The optional SSH username for the remote host | `undefined` |\n| `sshTunnelPassword` | String | The optional SSH password for the remote host | `undefined` |\n| `sshTunnelIdentityFile` | String/Array | The optional path to the SSH identity file for the remote host | `undefined` |\n| `sshTunnelPassphrase` | String | The optional passphrase for `sshTunnelIdentityFile` | `undefined` |\n\nDescription of `sshTunnel` values:\n\n- `NONE` - Do not use SSH tunneling.\n- `USER_PASSWORD` - The tunnel is created with SSH username and password only.\n- `IDENTITY_FILE` - The tunnel is created using an identity file.\n\n## Derived Properties\n\nDerived properties (also known as computed properties) are properties of the state object that depend on other properties to determine their value.\n\n```javascript\nconst c = new Connection();\nconst derivedProps = c.getAttributes({ derived: true });\n```\n\n| Derived Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `instanceId` | String | The mongoscope | `localhost:27017` |\n| `driverAuthMechanism` | String | Converts the value of `authStrategy` for humans into the `authMechanism` value for the driver | `undefined` |\n| `safeUrl` | String | The URL where a password is replaced with stars | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrl` | String | Use this URL in order to connect via DataService | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrlWithSsh` | String | Use this URL in order to connect via connection model itself | `mongodb://localhost:29201/?readPreference=primary&ssl=false` |\n| `driverOptions` | String | The second argument `mongoscope-server` passes to `mongodb.connect` | `{}` |\n\n## Events\n\n> New in mongodb-connection-model@5.0.0\n\n#### Example: SSH Tunnel\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', skipped: true,\n  reason: 'The selected SSL mode does not need to load any files.' }\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', complete: true}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n#### Example: SSL\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  ssl: 'ALL',\n  sslCA: '~/.ssl/my-ca.pem',\n  sslCert: '~/.ssl/my-server.pem',\n  sslKey: '~/.ssl/my-server.pem'\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', complete: true}\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', skipped: true,\n  reason: 'The selected SSH Tunnel mode is NONE.'}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n[workflow_img]: https://github.com/mongodb-js/connection-model/workflows/Check%20and%20Test/badge.svg?event=push\n[workflow_url]: https://github.com/mongodb-js/connection-model/actions?query=workflow%3A%22Check+and+Test%22\n[npm_img]: https://img.shields.io/npm/v/mongodb-connection-model.svg?style=flat-square\n[npm_url]: https://www.npmjs.org/package/mongodb-connection-model\n[gitter_img]: https://badges.gitter.im/Join%20Chat.svg\n[gitter_url]: http://gitter.im/mongodb-js/mongodb-js\n[enterprise_img]: https://img.shields.io/badge/MongoDB-Enterprise-blue.svg?style=flat-square\n[coming_soon_img]: https://img.shields.io/badge/-Coming%20Soon-ff69b4.svg?style=flat-square\n[kerberos-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/kerberos_tests.js\n[ldap-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ldap_tests.js\n[x509-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ssl_x509_tests.js\n[ns]: https://github.com/mongodb-js/ns\n[sf-ssh-tunnel]: http://serverfault.com/questions/597765/how-to-connect-to-mongodb-server-via-ssh-tunnel\n[ec2-key-pairs]: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html\n[driver-ssl-impl]: https://github.com/christkv/mongodb-core/blob/c3d21cb636d74d7a68134ecd3b9f6af536311279/lib/connection/connection.js#L365-L407\n[driver-ssl-tutorial]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/\n[driver-ssl-none]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#no-certificate-validation\n[driver-ssl-server]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate\n[driver-ssl-all]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate-and-present-valid-certificate\n","gitHead":"51a8e00f16dc1652cb0f0674c540570614a8895e","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","test":"mocha","check":"npm run lint && npm run depcheck","pretest":"mongodb-runner install && mongodb-runner start --port=27018","test-ci":"npm run test","depcheck":"depcheck","posttest":"mongodb-runner stop --port=27018","posttest-ci":"node ../../scripts/killall-mongo.js","test-check-ci":"npm run check && npm test"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.17.0+x64 (linux)","description":"MongoDB connection model.","directories":{},"_nodeVersion":"16.17.0","compass:main":"index.js","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","debug":"^4.2.0","lodash":"^4.17.15","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.2.0","storage-mixin":"0.0.0-next-51a8e00f16dc1652cb0f0674c540570614a8895e","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.2","@mongodb-js/ssh-tunnel":"0.0.0-next-51a8e00f16dc1652cb0f0674c540570614a8895e","@mongodb-js/compass-utils":"0.0.0-next-51a8e00f16dc1652cb0f0674c540570614a8895e","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.5.4"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"^4.10.0","depcheck":"^1.4.1","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.9.0","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^4.10.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_0.0.0-next-51a8e00f16dc1652cb0f0674c540570614a8895e_1668037812426_0.8385261722272557","host":"s3://npm-registry-packages"}},"0.0.0-next-6d1491390706ac21857752412a5e4d10e112a29a":{"name":"mongodb-connection-model","version":"0.0.0-next-6d1491390706ac21857752412a5e4d10e112a29a","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@0.0.0-next-6d1491390706ac21857752412a5e4d10e112a29a","maintainers":[{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"iteng@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"903c01acdf1c8697dc8864b42fb3160dc2aaccee","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-0.0.0-next-6d1491390706ac21857752412a5e4d10e112a29a.tgz","fileCount":20,"integrity":"sha512-CuFyE7uBRVtF1ake6YlC0JUgcxCeriBm0Cl+msOpTzC5r3NVIwUplQW4JsmWfiv3+Zpn0jiPbpXF05dYc5P8VQ==","signatures":[{"sig":"MEUCIH0e3xir/MA9c7REARvm0bdM8jEg7QZveJJYTT7tl9E6AiEA3hjMYAABer85/qjylI85PqjPNVS3/RIc7nig9vYGy2A=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":108152,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjbD2yACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo4QA//QbS7/w7rKnyQMKIiRqlCL1ovmSBObaVxl7/xz3TaU1S8y1cf\r\nPBriY2jxAHJsKa0qn0WF2cwF7ALsj/fkNGefYhu7gUnvzX8c97GYypfibc8n\r\nxoHgZxk4Ao4Ygj63Mlly7SXbrGXtY8w+g3YVXdCR3q0pfzq2vC4wJ95TmXPP\r\nG3mFo2a1m34A1jz0R1J9fp6uMgwxihLqGXGdVzdSasZOlTL6mNBduoKmu65r\r\nh4Y/JNHPTBmnhumN8cLMa9Ze4RMlIyxaexBzHqF6OqxTOX0gYqoDYTll16FG\r\ndEk8gAp7PYCGrEFaLHQrOWMnqUh6KB5ystb02S1x5SCDdo4HQtOlOQ1Syjmf\r\nU7zWYf3bWXKiC2KfR/AnxR3+bVb/kVkTfeT4eAOuhC1cG80UUA0Hrl/sMewG\r\ntZyBy/UwOsH9P4FoJcU988j/5fmfCMac15lOreV7ICeWF6YdsU856NInbp8x\r\nl5pELI1d3TOuXRg4Xt0IwWfn2IoNC9Y8hkBXWOZUJoSCaPkMM5T2utILM7+v\r\nNWPNU4iLKHau9qhP0Q+TBOlVw6EEeHOOnAC6JlyMuft/WeBX6aSmtQ2WD0JG\r\nNyMK0MMMhLScnlqB0zllS0UGl/HExvD9WH5yv33GOXLNp/7aO7ZW2bk7yv36\r\nPJ/sQm3tZf/3Pba7TqlI80Aj+DmDiIDRSSE=\r\n=JrA5\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","readme":"# mongodb-connection-model [![][workflow_img]][workflow_url] [![][npm_img]][npm_url]\n\n> MongoDB connection model\n\nThe main purpose of the MongoDB connection model is to be a domain model around a MongoDB connection. It encapsulates generating a [Connection String URI](https://docs.mongodb.com/manual/reference/connection-string/) from a group of attributes and parses URI using the [MongoDB Node.JS Driver URI Parser](https://github.com/mongodb-js/mongodb-core/blob/master/lib/uri_parser.js).\n\n## Installation\n\n```\nnpm install --save mongodb-connection-model\n```\n\n## Usage\n\n### Building URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\nconst c = new Connection({ appname: 'My App Name' });\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://localhost:27017/?readPreference=primary&appname=My%20App&ssl=false'\n```\n\n### Parsing URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\n\nConnection.from(\n  'mongodb://someUsername:testPassword@localhost',\n  (error, result) => {\n    console.log(result);\n    >>> `{\n      hosts: [{ host: 'localhost', port: 27017 }],\n      hostname: 'localhost',\n      port: 27017,\n      auth: {\n        username: 'someUsername',\n        password: 'testPassword',\n        db: 'admin'\n      },\n      isSrvRecord: false,\n      authStrategy: 'MONGODB',\n      mongodbUsername: 'someUsername',\n      mongodbPassword: 'testPassword',\n      mongodbDatabaseName: 'admin',\n      extraOptions: {},\n      connectionType: 'NODE_DRIVER',\n      readPreference: 'primary',\n      kerberosCanonicalizeHostname: false,\n      sslMethod: 'NONE',\n      sshTunnel: 'NONE',\n      sshTunnelPort: 22\n    }`\n  }\n);\n```\n\n## Properties\n\nMongoDB connection model is based on Ampersand.js framework and consist of [props](https://ampersandjs.com/docs/#ampersand-state-props) and [derived props](https://ampersandjs.com/docs/#ampersand-state-derived). The props object describes the observable properties that MongoDB connection model gets from the Node.js Driver API.\n\n```javascript\nconst с = new Connection();\nconst props = с.getAttributes({ props: true });\n```\n\n#### See Also\n\n- [URI Generic Syntax](https://tools.ietf.org/html/rfc3986)\n- [URI Options Specification](https://github.com/mongodb/specifications/blob/master/source/uri-options/uri-options.rst)\n\n### General Properties\n\n```javascript\nconst c = new Connection({ isSrvRecord: true });\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ns` | String | A valid [ns][ns] the user can read from | `undefined` |\n| `isSrvRecord` | Boolean | Indicates SRV record | `false` |\n| `auth` | Object | Authentication from driver (username, user, db, password) | `undefined` |\n| `hostname` | String | Hostname of a MongoDB Instance. In case of the replica set the first host and port will be taken | `localhost` |\n| `port` | Number | TCP port of a MongoDB Instance | `27017` |\n| `hosts` | Array | Contains all hosts and ports for replica set | `[{ host: 'localhost', port: 27017 }]` |\n| `extraOptions` | Object | Extra options passed to the node driver as part of `driverOptions` | `{}` |\n| `connectionType` | String | The desired connection type. Possible values: `NODE_DRIVER`, `STITCH_ON_PREM`, `STITCH_ATLAS` | `NODE_DRIVER` |\n| `authStrategy` | String | The desired authentication strategy. Possible values: `NONE`, `MONGODB`, `X509`, `KERBEROS`, `LDAP`, `SCRAM-SHA-256` | `NONE` |\n\n### Connection string options\n\n```javascript\nconst c = new Connection({ appname: 'My App', replicaSet: 'testing' });\n```\n\n#### General connection string options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `replicaSet` | String | Specifies the name of the replica set, if the mongod is a member of a replica set | `undefined` |\n| `connectTimeoutMS` | Number | The time in milliseconds to attempt a connection before timing out | `undefined` |\n| `socketTimeoutMS` | Number | The time in milliseconds to attempt a send or receive on a socket before the attempt times out | `undefined` |\n| `compression` | Object | Object includes compressors and a compression level. The following compressors can be specified: `snappy`, `zlib` (Available in MongoDB 3.6 or greater) | `undefined` |\n\n#### Connection Pool Option\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `maxPoolSize` | Number | The maximum number of connections in the connection pool | `undefined` |\n| `minPoolSize` | Number | The minimum number of connections in the connection pool | `undefined` |\n| `maxIdleTimeMS` | Number | The maximum number of milliseconds that a connection can remain idle in the pool before being removed and closed | `undefined` |\n| `waitQueueMultiple` | Number | A number that the driver multiples the maxPoolSize value to, to provide the maximum number of threads allowed to wait for a connection to become available from the pool | `undefined` |\n| `waitQueueTimeoutMS` | Number | The maximum time in milliseconds that a thread can wait for a connection to become available | `undefined` |\n\n#### Write Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `w` | Number/String | Corresponds to the write concern [w Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-w) | `undefined` |\n| `wTimeoutMS` | Number | Corresponds to the write concern [wtimeout](https://docs.mongodb.com/manual/reference/write-concern/#wc-wtimeout) | `undefined` |\n| `journal` | Boolean | Corresponds to the write concern [j Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-j) | `undefined` |\n\n#### Read Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readConcernLevel` | String | The level of isolation | `undefined` |\n\n#### Read Preference Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readPreference` | String | Specifies the read preferences for this connection. Possible values: `PRIMARY`, `PRIMARY_PREFERRED`, `SECONDARY`, `SECONDARY_PREFERRED`, `NEAREST` | `PRIMARY` |\n| `maxStalenessSeconds` | Number | Specifies, in seconds, how stale a secondary can be before the client stops using it for read operations | `undefined` |\n| `readPreferenceTags` | Object | Default read preference tags for the client | `undefined` |\n\n#### Authentication Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `authSource` | String | Specify the database name associated with the user’s credentials | `undefined` |\n| `authMechanism` | String | Specifies the authentication mechanism that MongoDB will use to authenticate the connection. Possible values: `DEFAULT`, `GSSAPI`, `MONGODB-X509`, `PLAIN`, `SCRAM-SHA-256` | `undefined` |\n| `authMechanismProperties` | Object | Additional options provided for authentication (e.g. to enable hostname canonicalization for GSSAPI) | `undefined` |\n| `gssapiServiceName` | String | Set the Kerberos service name when connecting to Kerberized MongoDB instances | `undefined` |\n| `gssapiServiceRealm` | String | Set the Realm service name | `undefined` |\n| `gssapiCanonicalizeHostName` | Boolean | Whether canonicalized hostname | `undefined` |\n\n#### Server Selection and Discovery Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `localThresholdMS` | Number | The size (in milliseconds) of the latency window for selecting among multiple suitable MongoDB instances | `undefined` |\n| `serverSelectionTimeoutMS` | Number | Specifies how long (in milliseconds) to block for server selection before throwing an exception | `undefined` |\n| `serverSelectionTryOnce` | Boolean | Instructs the driver to scan the MongoDB deployment exactly once after server selection fails and then either select a server or raise an error | `undefined` |\n| `heartbeatFrequencyMS` | Number | Controls when the driver checks the state of the MongoDB deployment | `undefined` |\n\n#### Miscellaneous Configuration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `appname` | String | An application name passed to server as client metadata | `undefined` |\n| `retryWrites` | Boolean | Enable retryable writes | `undefined` |\n| `uuidRepresentation` | String | The legacy representation of UUID. Possible values: `standard`, `csharpLegacy`, `javaLegacy`, `pythonLegacy` | `undefined` |\n| `loadBalanced` | Boolean | Whether or not the server is running in load balanced mode | `undefined` |\n\n### Stitch attributes\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `stitchServiceName` | String | Stitch service name | `undefined` |\n| `stitchClientAppId` | String | Stitch сlient app ID | `undefined` |\n| `stitchGroupId` | String | Stitch group ID | `undefined` |\n| `stitchBaseUrl` | String | Stitch base Url | `undefined` |\n\n### MONGODB authentication\n\n```javascript\nconst c = new Connection({\n  mongodbUsername: 'arlo',\n  mongodbPassword: 'w@of'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/?slaveOk=true&authSource=admin'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `mongodbUsername` | String | MongoDB username | `undefined` |\n| `mongodbPassword` | String | MongoDB password | `undefined` |\n| `mongodbDatabaseName` | String | The database name associated with the user's credentials | `undefined` |\n| `promoteValues` | Boolean | Whether BSON values should be promoted to their JS type counterparts | `undefined` |\n\n### KERBEROS authentication\n\n```javascript\nconst c = new Connection({\n  kerberosServiceName: 'mongodb',\n  kerberosPrincipal: 'arlo/dog@krb5.mongodb.parts',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo%252Fdog%2540krb5.mongodb.parts@localhost:27017/toys?authMechanism=GSSAPI'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n> @note (imlucas): Kerberos on Windows is broken out as it's own state for UX consideration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `kerberosServiceName` | String | Any program or computer you access over a network | `undefined` |\n| `kerberosPrincipal` | String | The format of a typical Kerberos V5 principal is `primary/instance@REALM` | `undefined` |\n| `kerberosCanonicalizeHostname` | Boolean | Whether canonicalized kerberos hostname | `undefined` |\n\n#### See Also\n\n- [node.js driver Kerberos reference](http://bit.ly/mongodb-node-driver-kerberos)\n- [node.js driver Kerberos functional test][kerberos-functional]\n\n### LDAP authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  ldapUsername: 'arlo',\n  ldapPassword: 'w@of',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/toys?slaveOk=true&authMechanism=PLAIN'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ldapUsername` | String | LDAP username | `undefined` |\n| `ldapPassword` | String | LDAP password | `undefined` |\n\n#### See Also\n\n- [node.js driver LDAP reference](http://bit.ly/mongodb-node-driver-ldap)\n- [node.js driver X509 functional test][ldap-functional]\n\n### X509 authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  x509Username: 'CN=client,OU=arlo,O=MongoDB,L=Philadelphia,ST=Pennsylvania,C=US'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://CN%253Dclient%252COU%253Darlo%252CO%253DMongoDB%252CL%253DPhiladelphia%252CST%253DPennsylvania%252CC%253DUS@localhost:27017?slaveOk=true&authMechanism=MONGODB-X509'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `x509Username` | String | The x.509 certificate derived user name, e.g. `CN=user,OU=OrgUnit,O=myOrg,...` | `undefined` |\n\n#### See Also\n\n- [node.js driver X509 reference](http://bit.ly/mongodb-node-driver-x509)\n- [node.js driver X509 functional test][x509-functional]\n\n### SSL\n\n> **Note**: Not to be confused with `authentication=X509`\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ssl` | Number/String | A boolean to enable or disables TLS/SSL for the connection | `undefined` |\n| `sslMethod` | String | The desired ssl method. Possible values: `NONE`, `SYSTEMCA`, `IFAVAILABLE`, `UNVALIDATED`, `SERVER`, `ALL` | `NONE` |\n| `sslCA` | Buffer/String | Array of valid certificates | `undefined` |\n| `sslCert` | Buffer/String | The certificate | `undefined` |\n| `sslKey` | Buffer/String | The certificate private key | `undefined` |\n| `sslPass` | Buffer/String | The certificate password | `undefined` |\n\nDescription of `sslMethod` values:\n\n- `SYSTEMCA` - SSL required, validate using System CA, with host verification.\n- `IFAVAILABLE` - The driver should try SSL first, fall back to no SSL if unavailable, and use the system's Certificate Authority.\n- `SERVER` - The driver should validate the server certificate and fail to connect if validation fails. See also [node.js driver \"Validate Server Certificate\" docs][driver-ssl-server].\n- `ALL` - The driver must present a valid certificate and validate the server certificate. See also [node.js driver \"Validate Server Certificate and Present Valid Certificate\" docs][driver-ssl-all].\n- `NONE` - No SSL (Not recommended).\n- `UNVALIDATED` - Use SSL but do not perform any validation of the certificate chain. See also [node.js driver \"No Certificate Validation\" docs][driver-ssl-none]. **Very** not recommended and likely to be deprecated in future releases because it exposes potential Man-In-The-Middle attack vectors.\n\n#### See also\n\n- [node.js driver SSL implementation][driver-ssl-impl]\n- [node.js driver SSL tutorial][driver-ssl-tutorial]\n\n### SSH TUNNEL\n\n> New in mongodb-connection-model@5.0.0\n\nBecause [authentication](#authentication) is quite difficult for operators to migrate to, the most common method of securing a MongoDB deployment is to use an [SSH tunnel][sf-ssh-tunnel].  This allows operators to leverage their existing SSH security infrastructure to also provide secure access to MongoDB.  For a standard deployment of MongoDB on AWS, this is almost always to strategy.  Because of this, we now support creating SSH tunnels automatically when connecting to MongoDB.\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options, (connectionError, client) => {\n  if (connectionError) {\n    return console.log(connectionError);\n  }\n\n  client.db('mongodb').collection('fanclub').count((countingError, count) => {\n    console.log('counted:', countingError, count);\n    client.close();\n  });\n});\n```\n\nThe above provides the same functionality as creating the tunnel using the bash\ncommand below and connecting to MongoDB via another terminal. Notice that\nconnection-model uses a random local port each time it creates a tunnel.\nUsing the command line, you'd have to replace `<random port>` with an actual\nport number.\n\n```bash\nssh -i ~/.ssh/my-key-aws-pair.pem -L <random port>:localhost:27017 ubuntu@ec2-11-111-111-111.compute-1.amazonaws.com\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `sshTunnel` | String | The desired SSH tunnel strategy. Possible values: `NONE`, `USER_PASSWORD`, `IDENTITY_FILE` | `undefined` |\n| `sshTunnelHostname` | String | The hostname of the SSH remote host | `undefined` |\n| `sshTunnelPort` | Port | The SSH port of the remote host | `22` |\n| `sshTunnelBindToLocalPort` | Port | Bind the localhost endpoint of the SSH Tunnel to this port | `undefined` |\n| `sshTunnelUsername` | String | The optional SSH username for the remote host | `undefined` |\n| `sshTunnelPassword` | String | The optional SSH password for the remote host | `undefined` |\n| `sshTunnelIdentityFile` | String/Array | The optional path to the SSH identity file for the remote host | `undefined` |\n| `sshTunnelPassphrase` | String | The optional passphrase for `sshTunnelIdentityFile` | `undefined` |\n\nDescription of `sshTunnel` values:\n\n- `NONE` - Do not use SSH tunneling.\n- `USER_PASSWORD` - The tunnel is created with SSH username and password only.\n- `IDENTITY_FILE` - The tunnel is created using an identity file.\n\n## Derived Properties\n\nDerived properties (also known as computed properties) are properties of the state object that depend on other properties to determine their value.\n\n```javascript\nconst c = new Connection();\nconst derivedProps = c.getAttributes({ derived: true });\n```\n\n| Derived Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `instanceId` | String | The mongoscope | `localhost:27017` |\n| `driverAuthMechanism` | String | Converts the value of `authStrategy` for humans into the `authMechanism` value for the driver | `undefined` |\n| `safeUrl` | String | The URL where a password is replaced with stars | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrl` | String | Use this URL in order to connect via DataService | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrlWithSsh` | String | Use this URL in order to connect via connection model itself | `mongodb://localhost:29201/?readPreference=primary&ssl=false` |\n| `driverOptions` | String | The second argument `mongoscope-server` passes to `mongodb.connect` | `{}` |\n\n## Events\n\n> New in mongodb-connection-model@5.0.0\n\n#### Example: SSH Tunnel\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', skipped: true,\n  reason: 'The selected SSL mode does not need to load any files.' }\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', complete: true}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n#### Example: SSL\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  ssl: 'ALL',\n  sslCA: '~/.ssl/my-ca.pem',\n  sslCert: '~/.ssl/my-server.pem',\n  sslKey: '~/.ssl/my-server.pem'\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', complete: true}\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', skipped: true,\n  reason: 'The selected SSH Tunnel mode is NONE.'}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n[workflow_img]: https://github.com/mongodb-js/connection-model/workflows/Check%20and%20Test/badge.svg?event=push\n[workflow_url]: https://github.com/mongodb-js/connection-model/actions?query=workflow%3A%22Check+and+Test%22\n[npm_img]: https://img.shields.io/npm/v/mongodb-connection-model.svg?style=flat-square\n[npm_url]: https://www.npmjs.org/package/mongodb-connection-model\n[gitter_img]: https://badges.gitter.im/Join%20Chat.svg\n[gitter_url]: http://gitter.im/mongodb-js/mongodb-js\n[enterprise_img]: https://img.shields.io/badge/MongoDB-Enterprise-blue.svg?style=flat-square\n[coming_soon_img]: https://img.shields.io/badge/-Coming%20Soon-ff69b4.svg?style=flat-square\n[kerberos-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/kerberos_tests.js\n[ldap-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ldap_tests.js\n[x509-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ssl_x509_tests.js\n[ns]: https://github.com/mongodb-js/ns\n[sf-ssh-tunnel]: http://serverfault.com/questions/597765/how-to-connect-to-mongodb-server-via-ssh-tunnel\n[ec2-key-pairs]: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html\n[driver-ssl-impl]: https://github.com/christkv/mongodb-core/blob/c3d21cb636d74d7a68134ecd3b9f6af536311279/lib/connection/connection.js#L365-L407\n[driver-ssl-tutorial]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/\n[driver-ssl-none]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#no-certificate-validation\n[driver-ssl-server]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate\n[driver-ssl-all]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate-and-present-valid-certificate\n","gitHead":"6d1491390706ac21857752412a5e4d10e112a29a","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","test":"mocha","check":"npm run lint && npm run depcheck","pretest":"mongodb-runner install && mongodb-runner start --port=27018","test-ci":"npm run test","depcheck":"depcheck","posttest":"mongodb-runner stop --port=27018","posttest-ci":"node ../../scripts/killall-mongo.js","test-check-ci":"npm run check && npm test"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.17.0+x64 (linux)","description":"MongoDB connection model.","directories":{},"_nodeVersion":"16.17.0","compass:main":"index.js","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","debug":"^4.2.0","lodash":"^4.17.15","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.2.0","storage-mixin":"0.0.0-next-6d1491390706ac21857752412a5e4d10e112a29a","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.2","@mongodb-js/ssh-tunnel":"0.0.0-next-6d1491390706ac21857752412a5e4d10e112a29a","@mongodb-js/compass-utils":"0.0.0-next-6d1491390706ac21857752412a5e4d10e112a29a","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.5.4"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"^4.10.0","depcheck":"^1.4.1","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.9.0","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^4.10.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_0.0.0-next-6d1491390706ac21857752412a5e4d10e112a29a_1668038066616_0.30297401574188143","host":"s3://npm-registry-packages"}},"0.0.0-next-44318443f2cd1088082181789b25fc26a7a11bb2":{"name":"mongodb-connection-model","version":"0.0.0-next-44318443f2cd1088082181789b25fc26a7a11bb2","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@0.0.0-next-44318443f2cd1088082181789b25fc26a7a11bb2","maintainers":[{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"iteng@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"ba8b694a9226dc57d7170f15108fd7e1adb34aed","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-0.0.0-next-44318443f2cd1088082181789b25fc26a7a11bb2.tgz","fileCount":20,"integrity":"sha512-sAIVLgso36lCTu6gjCXmK6xmp4n134yZwH0QEDc4a9l+43w08Vt8yIUjsRwHSK4VKNXGer0BiGhIg4RSkncgOA==","signatures":[{"sig":"MEUCIQCbrl65NKhFftYJ8AOVQg6n9Y/deJVUEfzAuCxsk06jVAIgYm7H7E7BXEDK1CJGeU0mvZkaz1kh52jDjff5pwclGis=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":108152,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjbD4XACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoEog/9GRzwzHdeyRPdKV8LivAgYHdmLsk1v55RpzVxjtQQo6WuYE/X\r\nT17zQrwy6E5l2wKfiDxwM28VRSVAUbwpv8mBxnLc+Rl1KJGLZCgUq4TbDc5w\r\nQmDQJjqF8Ta2984Eo2jG013+gOS3ooo/m3KG1eL4kZn9MTwPsrp6ZH2Pdged\r\nop5veoQ6brsPUZk7scMfXn3x/D7dIULX5hQddX3P/qcAayfLpcTw/5bg9ivv\r\nGStiSyffrJYTMMw2a1ff8/oZQ4mn/mBNg8vOua5K7wTgkBKZLuujlAlPaXQu\r\n/sEDKkTRdtufWKbXm9Qfwv6v3NxFNAGoFlqXtA7l7/fD3cU7p2PSElupkLF8\r\n3s8b7TJiPAvm/jO5bVi4sTKe8k88YhXlHxr/EULgmqxLjfKh6v508WRhRJ2/\r\nf/rEsfvw3fga20bOmglePFGwy59WRQKh3oat64mD8DYWxzzJJhJ5pj0gY1D/\r\nt3uaAXYL+eIKR34WwxbHDU3A//Q+9BtOcJrocihUg9eJo/5Kb4fStb1tvokQ\r\neMNGbdONgiyVJem8xsqXdhX7ujOKuB6eq2yAgSBxD8968t8ZCOZhgJ8oD8dQ\r\n2aSD1DhZn+KQoppU6J1YqtUWXhAEKzXunCiF8dXAbgciLEx7aNns0vJWCTUV\r\n3cpryoffsDgATYMavZj1pBQxdRBaqLp47fI=\r\n=ezVM\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","readme":"# mongodb-connection-model [![][workflow_img]][workflow_url] [![][npm_img]][npm_url]\n\n> MongoDB connection model\n\nThe main purpose of the MongoDB connection model is to be a domain model around a MongoDB connection. It encapsulates generating a [Connection String URI](https://docs.mongodb.com/manual/reference/connection-string/) from a group of attributes and parses URI using the [MongoDB Node.JS Driver URI Parser](https://github.com/mongodb-js/mongodb-core/blob/master/lib/uri_parser.js).\n\n## Installation\n\n```\nnpm install --save mongodb-connection-model\n```\n\n## Usage\n\n### Building URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\nconst c = new Connection({ appname: 'My App Name' });\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://localhost:27017/?readPreference=primary&appname=My%20App&ssl=false'\n```\n\n### Parsing URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\n\nConnection.from(\n  'mongodb://someUsername:testPassword@localhost',\n  (error, result) => {\n    console.log(result);\n    >>> `{\n      hosts: [{ host: 'localhost', port: 27017 }],\n      hostname: 'localhost',\n      port: 27017,\n      auth: {\n        username: 'someUsername',\n        password: 'testPassword',\n        db: 'admin'\n      },\n      isSrvRecord: false,\n      authStrategy: 'MONGODB',\n      mongodbUsername: 'someUsername',\n      mongodbPassword: 'testPassword',\n      mongodbDatabaseName: 'admin',\n      extraOptions: {},\n      connectionType: 'NODE_DRIVER',\n      readPreference: 'primary',\n      kerberosCanonicalizeHostname: false,\n      sslMethod: 'NONE',\n      sshTunnel: 'NONE',\n      sshTunnelPort: 22\n    }`\n  }\n);\n```\n\n## Properties\n\nMongoDB connection model is based on Ampersand.js framework and consist of [props](https://ampersandjs.com/docs/#ampersand-state-props) and [derived props](https://ampersandjs.com/docs/#ampersand-state-derived). The props object describes the observable properties that MongoDB connection model gets from the Node.js Driver API.\n\n```javascript\nconst с = new Connection();\nconst props = с.getAttributes({ props: true });\n```\n\n#### See Also\n\n- [URI Generic Syntax](https://tools.ietf.org/html/rfc3986)\n- [URI Options Specification](https://github.com/mongodb/specifications/blob/master/source/uri-options/uri-options.rst)\n\n### General Properties\n\n```javascript\nconst c = new Connection({ isSrvRecord: true });\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ns` | String | A valid [ns][ns] the user can read from | `undefined` |\n| `isSrvRecord` | Boolean | Indicates SRV record | `false` |\n| `auth` | Object | Authentication from driver (username, user, db, password) | `undefined` |\n| `hostname` | String | Hostname of a MongoDB Instance. In case of the replica set the first host and port will be taken | `localhost` |\n| `port` | Number | TCP port of a MongoDB Instance | `27017` |\n| `hosts` | Array | Contains all hosts and ports for replica set | `[{ host: 'localhost', port: 27017 }]` |\n| `extraOptions` | Object | Extra options passed to the node driver as part of `driverOptions` | `{}` |\n| `connectionType` | String | The desired connection type. Possible values: `NODE_DRIVER`, `STITCH_ON_PREM`, `STITCH_ATLAS` | `NODE_DRIVER` |\n| `authStrategy` | String | The desired authentication strategy. Possible values: `NONE`, `MONGODB`, `X509`, `KERBEROS`, `LDAP`, `SCRAM-SHA-256` | `NONE` |\n\n### Connection string options\n\n```javascript\nconst c = new Connection({ appname: 'My App', replicaSet: 'testing' });\n```\n\n#### General connection string options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `replicaSet` | String | Specifies the name of the replica set, if the mongod is a member of a replica set | `undefined` |\n| `connectTimeoutMS` | Number | The time in milliseconds to attempt a connection before timing out | `undefined` |\n| `socketTimeoutMS` | Number | The time in milliseconds to attempt a send or receive on a socket before the attempt times out | `undefined` |\n| `compression` | Object | Object includes compressors and a compression level. The following compressors can be specified: `snappy`, `zlib` (Available in MongoDB 3.6 or greater) | `undefined` |\n\n#### Connection Pool Option\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `maxPoolSize` | Number | The maximum number of connections in the connection pool | `undefined` |\n| `minPoolSize` | Number | The minimum number of connections in the connection pool | `undefined` |\n| `maxIdleTimeMS` | Number | The maximum number of milliseconds that a connection can remain idle in the pool before being removed and closed | `undefined` |\n| `waitQueueMultiple` | Number | A number that the driver multiples the maxPoolSize value to, to provide the maximum number of threads allowed to wait for a connection to become available from the pool | `undefined` |\n| `waitQueueTimeoutMS` | Number | The maximum time in milliseconds that a thread can wait for a connection to become available | `undefined` |\n\n#### Write Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `w` | Number/String | Corresponds to the write concern [w Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-w) | `undefined` |\n| `wTimeoutMS` | Number | Corresponds to the write concern [wtimeout](https://docs.mongodb.com/manual/reference/write-concern/#wc-wtimeout) | `undefined` |\n| `journal` | Boolean | Corresponds to the write concern [j Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-j) | `undefined` |\n\n#### Read Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readConcernLevel` | String | The level of isolation | `undefined` |\n\n#### Read Preference Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readPreference` | String | Specifies the read preferences for this connection. Possible values: `PRIMARY`, `PRIMARY_PREFERRED`, `SECONDARY`, `SECONDARY_PREFERRED`, `NEAREST` | `PRIMARY` |\n| `maxStalenessSeconds` | Number | Specifies, in seconds, how stale a secondary can be before the client stops using it for read operations | `undefined` |\n| `readPreferenceTags` | Object | Default read preference tags for the client | `undefined` |\n\n#### Authentication Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `authSource` | String | Specify the database name associated with the user’s credentials | `undefined` |\n| `authMechanism` | String | Specifies the authentication mechanism that MongoDB will use to authenticate the connection. Possible values: `DEFAULT`, `GSSAPI`, `MONGODB-X509`, `PLAIN`, `SCRAM-SHA-256` | `undefined` |\n| `authMechanismProperties` | Object | Additional options provided for authentication (e.g. to enable hostname canonicalization for GSSAPI) | `undefined` |\n| `gssapiServiceName` | String | Set the Kerberos service name when connecting to Kerberized MongoDB instances | `undefined` |\n| `gssapiServiceRealm` | String | Set the Realm service name | `undefined` |\n| `gssapiCanonicalizeHostName` | Boolean | Whether canonicalized hostname | `undefined` |\n\n#### Server Selection and Discovery Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `localThresholdMS` | Number | The size (in milliseconds) of the latency window for selecting among multiple suitable MongoDB instances | `undefined` |\n| `serverSelectionTimeoutMS` | Number | Specifies how long (in milliseconds) to block for server selection before throwing an exception | `undefined` |\n| `serverSelectionTryOnce` | Boolean | Instructs the driver to scan the MongoDB deployment exactly once after server selection fails and then either select a server or raise an error | `undefined` |\n| `heartbeatFrequencyMS` | Number | Controls when the driver checks the state of the MongoDB deployment | `undefined` |\n\n#### Miscellaneous Configuration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `appname` | String | An application name passed to server as client metadata | `undefined` |\n| `retryWrites` | Boolean | Enable retryable writes | `undefined` |\n| `uuidRepresentation` | String | The legacy representation of UUID. Possible values: `standard`, `csharpLegacy`, `javaLegacy`, `pythonLegacy` | `undefined` |\n| `loadBalanced` | Boolean | Whether or not the server is running in load balanced mode | `undefined` |\n\n### Stitch attributes\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `stitchServiceName` | String | Stitch service name | `undefined` |\n| `stitchClientAppId` | String | Stitch сlient app ID | `undefined` |\n| `stitchGroupId` | String | Stitch group ID | `undefined` |\n| `stitchBaseUrl` | String | Stitch base Url | `undefined` |\n\n### MONGODB authentication\n\n```javascript\nconst c = new Connection({\n  mongodbUsername: 'arlo',\n  mongodbPassword: 'w@of'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/?slaveOk=true&authSource=admin'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `mongodbUsername` | String | MongoDB username | `undefined` |\n| `mongodbPassword` | String | MongoDB password | `undefined` |\n| `mongodbDatabaseName` | String | The database name associated with the user's credentials | `undefined` |\n| `promoteValues` | Boolean | Whether BSON values should be promoted to their JS type counterparts | `undefined` |\n\n### KERBEROS authentication\n\n```javascript\nconst c = new Connection({\n  kerberosServiceName: 'mongodb',\n  kerberosPrincipal: 'arlo/dog@krb5.mongodb.parts',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo%252Fdog%2540krb5.mongodb.parts@localhost:27017/toys?authMechanism=GSSAPI'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n> @note (imlucas): Kerberos on Windows is broken out as it's own state for UX consideration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `kerberosServiceName` | String | Any program or computer you access over a network | `undefined` |\n| `kerberosPrincipal` | String | The format of a typical Kerberos V5 principal is `primary/instance@REALM` | `undefined` |\n| `kerberosCanonicalizeHostname` | Boolean | Whether canonicalized kerberos hostname | `undefined` |\n\n#### See Also\n\n- [node.js driver Kerberos reference](http://bit.ly/mongodb-node-driver-kerberos)\n- [node.js driver Kerberos functional test][kerberos-functional]\n\n### LDAP authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  ldapUsername: 'arlo',\n  ldapPassword: 'w@of',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/toys?slaveOk=true&authMechanism=PLAIN'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ldapUsername` | String | LDAP username | `undefined` |\n| `ldapPassword` | String | LDAP password | `undefined` |\n\n#### See Also\n\n- [node.js driver LDAP reference](http://bit.ly/mongodb-node-driver-ldap)\n- [node.js driver X509 functional test][ldap-functional]\n\n### X509 authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  x509Username: 'CN=client,OU=arlo,O=MongoDB,L=Philadelphia,ST=Pennsylvania,C=US'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://CN%253Dclient%252COU%253Darlo%252CO%253DMongoDB%252CL%253DPhiladelphia%252CST%253DPennsylvania%252CC%253DUS@localhost:27017?slaveOk=true&authMechanism=MONGODB-X509'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `x509Username` | String | The x.509 certificate derived user name, e.g. `CN=user,OU=OrgUnit,O=myOrg,...` | `undefined` |\n\n#### See Also\n\n- [node.js driver X509 reference](http://bit.ly/mongodb-node-driver-x509)\n- [node.js driver X509 functional test][x509-functional]\n\n### SSL\n\n> **Note**: Not to be confused with `authentication=X509`\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ssl` | Number/String | A boolean to enable or disables TLS/SSL for the connection | `undefined` |\n| `sslMethod` | String | The desired ssl method. Possible values: `NONE`, `SYSTEMCA`, `IFAVAILABLE`, `UNVALIDATED`, `SERVER`, `ALL` | `NONE` |\n| `sslCA` | Buffer/String | Array of valid certificates | `undefined` |\n| `sslCert` | Buffer/String | The certificate | `undefined` |\n| `sslKey` | Buffer/String | The certificate private key | `undefined` |\n| `sslPass` | Buffer/String | The certificate password | `undefined` |\n\nDescription of `sslMethod` values:\n\n- `SYSTEMCA` - SSL required, validate using System CA, with host verification.\n- `IFAVAILABLE` - The driver should try SSL first, fall back to no SSL if unavailable, and use the system's Certificate Authority.\n- `SERVER` - The driver should validate the server certificate and fail to connect if validation fails. See also [node.js driver \"Validate Server Certificate\" docs][driver-ssl-server].\n- `ALL` - The driver must present a valid certificate and validate the server certificate. See also [node.js driver \"Validate Server Certificate and Present Valid Certificate\" docs][driver-ssl-all].\n- `NONE` - No SSL (Not recommended).\n- `UNVALIDATED` - Use SSL but do not perform any validation of the certificate chain. See also [node.js driver \"No Certificate Validation\" docs][driver-ssl-none]. **Very** not recommended and likely to be deprecated in future releases because it exposes potential Man-In-The-Middle attack vectors.\n\n#### See also\n\n- [node.js driver SSL implementation][driver-ssl-impl]\n- [node.js driver SSL tutorial][driver-ssl-tutorial]\n\n### SSH TUNNEL\n\n> New in mongodb-connection-model@5.0.0\n\nBecause [authentication](#authentication) is quite difficult for operators to migrate to, the most common method of securing a MongoDB deployment is to use an [SSH tunnel][sf-ssh-tunnel].  This allows operators to leverage their existing SSH security infrastructure to also provide secure access to MongoDB.  For a standard deployment of MongoDB on AWS, this is almost always to strategy.  Because of this, we now support creating SSH tunnels automatically when connecting to MongoDB.\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options, (connectionError, client) => {\n  if (connectionError) {\n    return console.log(connectionError);\n  }\n\n  client.db('mongodb').collection('fanclub').count((countingError, count) => {\n    console.log('counted:', countingError, count);\n    client.close();\n  });\n});\n```\n\nThe above provides the same functionality as creating the tunnel using the bash\ncommand below and connecting to MongoDB via another terminal. Notice that\nconnection-model uses a random local port each time it creates a tunnel.\nUsing the command line, you'd have to replace `<random port>` with an actual\nport number.\n\n```bash\nssh -i ~/.ssh/my-key-aws-pair.pem -L <random port>:localhost:27017 ubuntu@ec2-11-111-111-111.compute-1.amazonaws.com\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `sshTunnel` | String | The desired SSH tunnel strategy. Possible values: `NONE`, `USER_PASSWORD`, `IDENTITY_FILE` | `undefined` |\n| `sshTunnelHostname` | String | The hostname of the SSH remote host | `undefined` |\n| `sshTunnelPort` | Port | The SSH port of the remote host | `22` |\n| `sshTunnelBindToLocalPort` | Port | Bind the localhost endpoint of the SSH Tunnel to this port | `undefined` |\n| `sshTunnelUsername` | String | The optional SSH username for the remote host | `undefined` |\n| `sshTunnelPassword` | String | The optional SSH password for the remote host | `undefined` |\n| `sshTunnelIdentityFile` | String/Array | The optional path to the SSH identity file for the remote host | `undefined` |\n| `sshTunnelPassphrase` | String | The optional passphrase for `sshTunnelIdentityFile` | `undefined` |\n\nDescription of `sshTunnel` values:\n\n- `NONE` - Do not use SSH tunneling.\n- `USER_PASSWORD` - The tunnel is created with SSH username and password only.\n- `IDENTITY_FILE` - The tunnel is created using an identity file.\n\n## Derived Properties\n\nDerived properties (also known as computed properties) are properties of the state object that depend on other properties to determine their value.\n\n```javascript\nconst c = new Connection();\nconst derivedProps = c.getAttributes({ derived: true });\n```\n\n| Derived Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `instanceId` | String | The mongoscope | `localhost:27017` |\n| `driverAuthMechanism` | String | Converts the value of `authStrategy` for humans into the `authMechanism` value for the driver | `undefined` |\n| `safeUrl` | String | The URL where a password is replaced with stars | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrl` | String | Use this URL in order to connect via DataService | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrlWithSsh` | String | Use this URL in order to connect via connection model itself | `mongodb://localhost:29201/?readPreference=primary&ssl=false` |\n| `driverOptions` | String | The second argument `mongoscope-server` passes to `mongodb.connect` | `{}` |\n\n## Events\n\n> New in mongodb-connection-model@5.0.0\n\n#### Example: SSH Tunnel\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', skipped: true,\n  reason: 'The selected SSL mode does not need to load any files.' }\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', complete: true}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n#### Example: SSL\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  ssl: 'ALL',\n  sslCA: '~/.ssl/my-ca.pem',\n  sslCert: '~/.ssl/my-server.pem',\n  sslKey: '~/.ssl/my-server.pem'\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', complete: true}\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', skipped: true,\n  reason: 'The selected SSH Tunnel mode is NONE.'}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n[workflow_img]: https://github.com/mongodb-js/connection-model/workflows/Check%20and%20Test/badge.svg?event=push\n[workflow_url]: https://github.com/mongodb-js/connection-model/actions?query=workflow%3A%22Check+and+Test%22\n[npm_img]: https://img.shields.io/npm/v/mongodb-connection-model.svg?style=flat-square\n[npm_url]: https://www.npmjs.org/package/mongodb-connection-model\n[gitter_img]: https://badges.gitter.im/Join%20Chat.svg\n[gitter_url]: http://gitter.im/mongodb-js/mongodb-js\n[enterprise_img]: https://img.shields.io/badge/MongoDB-Enterprise-blue.svg?style=flat-square\n[coming_soon_img]: https://img.shields.io/badge/-Coming%20Soon-ff69b4.svg?style=flat-square\n[kerberos-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/kerberos_tests.js\n[ldap-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ldap_tests.js\n[x509-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ssl_x509_tests.js\n[ns]: https://github.com/mongodb-js/ns\n[sf-ssh-tunnel]: http://serverfault.com/questions/597765/how-to-connect-to-mongodb-server-via-ssh-tunnel\n[ec2-key-pairs]: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html\n[driver-ssl-impl]: https://github.com/christkv/mongodb-core/blob/c3d21cb636d74d7a68134ecd3b9f6af536311279/lib/connection/connection.js#L365-L407\n[driver-ssl-tutorial]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/\n[driver-ssl-none]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#no-certificate-validation\n[driver-ssl-server]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate\n[driver-ssl-all]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate-and-present-valid-certificate\n","gitHead":"44318443f2cd1088082181789b25fc26a7a11bb2","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","test":"mocha","check":"npm run lint && npm run depcheck","pretest":"mongodb-runner install && mongodb-runner start --port=27018","test-ci":"npm run test","depcheck":"depcheck","posttest":"mongodb-runner stop --port=27018","posttest-ci":"node ../../scripts/killall-mongo.js","test-check-ci":"npm run check && npm test"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.17.0+x64 (linux)","description":"MongoDB connection model.","directories":{},"_nodeVersion":"16.17.0","compass:main":"index.js","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","debug":"^4.2.0","lodash":"^4.17.15","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.2.0","storage-mixin":"0.0.0-next-44318443f2cd1088082181789b25fc26a7a11bb2","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.2","@mongodb-js/ssh-tunnel":"0.0.0-next-44318443f2cd1088082181789b25fc26a7a11bb2","@mongodb-js/compass-utils":"0.0.0-next-44318443f2cd1088082181789b25fc26a7a11bb2","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.5.4"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"^4.10.0","depcheck":"^1.4.1","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.9.0","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^4.10.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_0.0.0-next-44318443f2cd1088082181789b25fc26a7a11bb2_1668038167185_0.027058701865046997","host":"s3://npm-registry-packages"}},"0.0.0-next-3b50f8232d3349fe79554f36417d7fbb45b6352a":{"name":"mongodb-connection-model","version":"0.0.0-next-3b50f8232d3349fe79554f36417d7fbb45b6352a","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@0.0.0-next-3b50f8232d3349fe79554f36417d7fbb45b6352a","maintainers":[{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"iteng@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"64888826e699825d53aa118d0cdae7ac77da2d58","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-0.0.0-next-3b50f8232d3349fe79554f36417d7fbb45b6352a.tgz","fileCount":20,"integrity":"sha512-bVmSoaoHbH4vu1Is5H34lTDLNoNe9/hYNN7ijDVGgfqvijNeWz+PAsh3mENIwjgh5gg1TJ5G33FVAApMXV5ftA==","signatures":[{"sig":"MEQCIHE4XFgLFtepZuebMfAYhCZbkOsw6JR2KdaRVSTkOotYAiBt3o+wk16js4b+Ljkrsig6V6rmZPbjMgCvSIgE6GTwXg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":108152,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjbD8cACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmporhAAovThACdyr4B96T1SADYAUMw8WDFlFyBJlLsMgRBf5gRTsIrq\r\nvj0dq6KFMe+vx62Yu7NZhUlg1MhiGs06a3epBFEi6HcGsgoh21O82AvfhVuI\r\nwCg0RokEXQ/jZ/zmaq5Z20sncyrYSlJB2WuDSgR7osIF95xfeJi9YRP7wJQy\r\nRAVXwFmGzfjKIhvrZoj5C4EFtLfkzPPJ5/Dv+wlMe+Eh5QNtzdNtvEbXN8R/\r\n3Wrwfb08COTswmIcOKUscxMoXiv4jnueE2WPE0Gb31+f2vRTbuXSb95YlFQm\r\n6Z4mflxvT17gHrX7wiMvUuIrHdgVIXisERxiLFEmAcdkIg12Pk1FlIaBTp91\r\n0setXM7YVJO0I+6JjUn/TkK5opcb5UkHRgwELPfc4LyFHykQEIddzJr6zhaS\r\nm1F9hXcj4O4BZITur6IyFNnr2yCq14pp58w06kxF3u5zTYyDca7sKOjxBhyi\r\nUcWgiPkx9Kt/PtbmQmpcQ/QZkS9pPp+eUPrzFWI/rpXnYBXLDOU3sjapVD/b\r\n/2HDp0/uzq1CWlU04VA0MKcdbr5LlihGYF7w7HH0Hp93HiN8p1T2Mf7X9RMT\r\nT4CsQBZ3efj5OGs91YhmypwAwzlAC8UFlT1jjm+9xhE8mRGlNPAbDNyxJgKe\r\neYr5Vmvz0wkeqMsF0BlfKhoVkWEyCz++i2Q=\r\n=PIdU\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","readme":"# mongodb-connection-model [![][workflow_img]][workflow_url] [![][npm_img]][npm_url]\n\n> MongoDB connection model\n\nThe main purpose of the MongoDB connection model is to be a domain model around a MongoDB connection. It encapsulates generating a [Connection String URI](https://docs.mongodb.com/manual/reference/connection-string/) from a group of attributes and parses URI using the [MongoDB Node.JS Driver URI Parser](https://github.com/mongodb-js/mongodb-core/blob/master/lib/uri_parser.js).\n\n## Installation\n\n```\nnpm install --save mongodb-connection-model\n```\n\n## Usage\n\n### Building URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\nconst c = new Connection({ appname: 'My App Name' });\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://localhost:27017/?readPreference=primary&appname=My%20App&ssl=false'\n```\n\n### Parsing URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\n\nConnection.from(\n  'mongodb://someUsername:testPassword@localhost',\n  (error, result) => {\n    console.log(result);\n    >>> `{\n      hosts: [{ host: 'localhost', port: 27017 }],\n      hostname: 'localhost',\n      port: 27017,\n      auth: {\n        username: 'someUsername',\n        password: 'testPassword',\n        db: 'admin'\n      },\n      isSrvRecord: false,\n      authStrategy: 'MONGODB',\n      mongodbUsername: 'someUsername',\n      mongodbPassword: 'testPassword',\n      mongodbDatabaseName: 'admin',\n      extraOptions: {},\n      connectionType: 'NODE_DRIVER',\n      readPreference: 'primary',\n      kerberosCanonicalizeHostname: false,\n      sslMethod: 'NONE',\n      sshTunnel: 'NONE',\n      sshTunnelPort: 22\n    }`\n  }\n);\n```\n\n## Properties\n\nMongoDB connection model is based on Ampersand.js framework and consist of [props](https://ampersandjs.com/docs/#ampersand-state-props) and [derived props](https://ampersandjs.com/docs/#ampersand-state-derived). The props object describes the observable properties that MongoDB connection model gets from the Node.js Driver API.\n\n```javascript\nconst с = new Connection();\nconst props = с.getAttributes({ props: true });\n```\n\n#### See Also\n\n- [URI Generic Syntax](https://tools.ietf.org/html/rfc3986)\n- [URI Options Specification](https://github.com/mongodb/specifications/blob/master/source/uri-options/uri-options.rst)\n\n### General Properties\n\n```javascript\nconst c = new Connection({ isSrvRecord: true });\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ns` | String | A valid [ns][ns] the user can read from | `undefined` |\n| `isSrvRecord` | Boolean | Indicates SRV record | `false` |\n| `auth` | Object | Authentication from driver (username, user, db, password) | `undefined` |\n| `hostname` | String | Hostname of a MongoDB Instance. In case of the replica set the first host and port will be taken | `localhost` |\n| `port` | Number | TCP port of a MongoDB Instance | `27017` |\n| `hosts` | Array | Contains all hosts and ports for replica set | `[{ host: 'localhost', port: 27017 }]` |\n| `extraOptions` | Object | Extra options passed to the node driver as part of `driverOptions` | `{}` |\n| `connectionType` | String | The desired connection type. Possible values: `NODE_DRIVER`, `STITCH_ON_PREM`, `STITCH_ATLAS` | `NODE_DRIVER` |\n| `authStrategy` | String | The desired authentication strategy. Possible values: `NONE`, `MONGODB`, `X509`, `KERBEROS`, `LDAP`, `SCRAM-SHA-256` | `NONE` |\n\n### Connection string options\n\n```javascript\nconst c = new Connection({ appname: 'My App', replicaSet: 'testing' });\n```\n\n#### General connection string options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `replicaSet` | String | Specifies the name of the replica set, if the mongod is a member of a replica set | `undefined` |\n| `connectTimeoutMS` | Number | The time in milliseconds to attempt a connection before timing out | `undefined` |\n| `socketTimeoutMS` | Number | The time in milliseconds to attempt a send or receive on a socket before the attempt times out | `undefined` |\n| `compression` | Object | Object includes compressors and a compression level. The following compressors can be specified: `snappy`, `zlib` (Available in MongoDB 3.6 or greater) | `undefined` |\n\n#### Connection Pool Option\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `maxPoolSize` | Number | The maximum number of connections in the connection pool | `undefined` |\n| `minPoolSize` | Number | The minimum number of connections in the connection pool | `undefined` |\n| `maxIdleTimeMS` | Number | The maximum number of milliseconds that a connection can remain idle in the pool before being removed and closed | `undefined` |\n| `waitQueueMultiple` | Number | A number that the driver multiples the maxPoolSize value to, to provide the maximum number of threads allowed to wait for a connection to become available from the pool | `undefined` |\n| `waitQueueTimeoutMS` | Number | The maximum time in milliseconds that a thread can wait for a connection to become available | `undefined` |\n\n#### Write Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `w` | Number/String | Corresponds to the write concern [w Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-w) | `undefined` |\n| `wTimeoutMS` | Number | Corresponds to the write concern [wtimeout](https://docs.mongodb.com/manual/reference/write-concern/#wc-wtimeout) | `undefined` |\n| `journal` | Boolean | Corresponds to the write concern [j Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-j) | `undefined` |\n\n#### Read Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readConcernLevel` | String | The level of isolation | `undefined` |\n\n#### Read Preference Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readPreference` | String | Specifies the read preferences for this connection. Possible values: `PRIMARY`, `PRIMARY_PREFERRED`, `SECONDARY`, `SECONDARY_PREFERRED`, `NEAREST` | `PRIMARY` |\n| `maxStalenessSeconds` | Number | Specifies, in seconds, how stale a secondary can be before the client stops using it for read operations | `undefined` |\n| `readPreferenceTags` | Object | Default read preference tags for the client | `undefined` |\n\n#### Authentication Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `authSource` | String | Specify the database name associated with the user’s credentials | `undefined` |\n| `authMechanism` | String | Specifies the authentication mechanism that MongoDB will use to authenticate the connection. Possible values: `DEFAULT`, `GSSAPI`, `MONGODB-X509`, `PLAIN`, `SCRAM-SHA-256` | `undefined` |\n| `authMechanismProperties` | Object | Additional options provided for authentication (e.g. to enable hostname canonicalization for GSSAPI) | `undefined` |\n| `gssapiServiceName` | String | Set the Kerberos service name when connecting to Kerberized MongoDB instances | `undefined` |\n| `gssapiServiceRealm` | String | Set the Realm service name | `undefined` |\n| `gssapiCanonicalizeHostName` | Boolean | Whether canonicalized hostname | `undefined` |\n\n#### Server Selection and Discovery Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `localThresholdMS` | Number | The size (in milliseconds) of the latency window for selecting among multiple suitable MongoDB instances | `undefined` |\n| `serverSelectionTimeoutMS` | Number | Specifies how long (in milliseconds) to block for server selection before throwing an exception | `undefined` |\n| `serverSelectionTryOnce` | Boolean | Instructs the driver to scan the MongoDB deployment exactly once after server selection fails and then either select a server or raise an error | `undefined` |\n| `heartbeatFrequencyMS` | Number | Controls when the driver checks the state of the MongoDB deployment | `undefined` |\n\n#### Miscellaneous Configuration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `appname` | String | An application name passed to server as client metadata | `undefined` |\n| `retryWrites` | Boolean | Enable retryable writes | `undefined` |\n| `uuidRepresentation` | String | The legacy representation of UUID. Possible values: `standard`, `csharpLegacy`, `javaLegacy`, `pythonLegacy` | `undefined` |\n| `loadBalanced` | Boolean | Whether or not the server is running in load balanced mode | `undefined` |\n\n### Stitch attributes\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `stitchServiceName` | String | Stitch service name | `undefined` |\n| `stitchClientAppId` | String | Stitch сlient app ID | `undefined` |\n| `stitchGroupId` | String | Stitch group ID | `undefined` |\n| `stitchBaseUrl` | String | Stitch base Url | `undefined` |\n\n### MONGODB authentication\n\n```javascript\nconst c = new Connection({\n  mongodbUsername: 'arlo',\n  mongodbPassword: 'w@of'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/?slaveOk=true&authSource=admin'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `mongodbUsername` | String | MongoDB username | `undefined` |\n| `mongodbPassword` | String | MongoDB password | `undefined` |\n| `mongodbDatabaseName` | String | The database name associated with the user's credentials | `undefined` |\n| `promoteValues` | Boolean | Whether BSON values should be promoted to their JS type counterparts | `undefined` |\n\n### KERBEROS authentication\n\n```javascript\nconst c = new Connection({\n  kerberosServiceName: 'mongodb',\n  kerberosPrincipal: 'arlo/dog@krb5.mongodb.parts',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo%252Fdog%2540krb5.mongodb.parts@localhost:27017/toys?authMechanism=GSSAPI'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n> @note (imlucas): Kerberos on Windows is broken out as it's own state for UX consideration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `kerberosServiceName` | String | Any program or computer you access over a network | `undefined` |\n| `kerberosPrincipal` | String | The format of a typical Kerberos V5 principal is `primary/instance@REALM` | `undefined` |\n| `kerberosCanonicalizeHostname` | Boolean | Whether canonicalized kerberos hostname | `undefined` |\n\n#### See Also\n\n- [node.js driver Kerberos reference](http://bit.ly/mongodb-node-driver-kerberos)\n- [node.js driver Kerberos functional test][kerberos-functional]\n\n### LDAP authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  ldapUsername: 'arlo',\n  ldapPassword: 'w@of',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/toys?slaveOk=true&authMechanism=PLAIN'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ldapUsername` | String | LDAP username | `undefined` |\n| `ldapPassword` | String | LDAP password | `undefined` |\n\n#### See Also\n\n- [node.js driver LDAP reference](http://bit.ly/mongodb-node-driver-ldap)\n- [node.js driver X509 functional test][ldap-functional]\n\n### X509 authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  x509Username: 'CN=client,OU=arlo,O=MongoDB,L=Philadelphia,ST=Pennsylvania,C=US'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://CN%253Dclient%252COU%253Darlo%252CO%253DMongoDB%252CL%253DPhiladelphia%252CST%253DPennsylvania%252CC%253DUS@localhost:27017?slaveOk=true&authMechanism=MONGODB-X509'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `x509Username` | String | The x.509 certificate derived user name, e.g. `CN=user,OU=OrgUnit,O=myOrg,...` | `undefined` |\n\n#### See Also\n\n- [node.js driver X509 reference](http://bit.ly/mongodb-node-driver-x509)\n- [node.js driver X509 functional test][x509-functional]\n\n### SSL\n\n> **Note**: Not to be confused with `authentication=X509`\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ssl` | Number/String | A boolean to enable or disables TLS/SSL for the connection | `undefined` |\n| `sslMethod` | String | The desired ssl method. Possible values: `NONE`, `SYSTEMCA`, `IFAVAILABLE`, `UNVALIDATED`, `SERVER`, `ALL` | `NONE` |\n| `sslCA` | Buffer/String | Array of valid certificates | `undefined` |\n| `sslCert` | Buffer/String | The certificate | `undefined` |\n| `sslKey` | Buffer/String | The certificate private key | `undefined` |\n| `sslPass` | Buffer/String | The certificate password | `undefined` |\n\nDescription of `sslMethod` values:\n\n- `SYSTEMCA` - SSL required, validate using System CA, with host verification.\n- `IFAVAILABLE` - The driver should try SSL first, fall back to no SSL if unavailable, and use the system's Certificate Authority.\n- `SERVER` - The driver should validate the server certificate and fail to connect if validation fails. See also [node.js driver \"Validate Server Certificate\" docs][driver-ssl-server].\n- `ALL` - The driver must present a valid certificate and validate the server certificate. See also [node.js driver \"Validate Server Certificate and Present Valid Certificate\" docs][driver-ssl-all].\n- `NONE` - No SSL (Not recommended).\n- `UNVALIDATED` - Use SSL but do not perform any validation of the certificate chain. See also [node.js driver \"No Certificate Validation\" docs][driver-ssl-none]. **Very** not recommended and likely to be deprecated in future releases because it exposes potential Man-In-The-Middle attack vectors.\n\n#### See also\n\n- [node.js driver SSL implementation][driver-ssl-impl]\n- [node.js driver SSL tutorial][driver-ssl-tutorial]\n\n### SSH TUNNEL\n\n> New in mongodb-connection-model@5.0.0\n\nBecause [authentication](#authentication) is quite difficult for operators to migrate to, the most common method of securing a MongoDB deployment is to use an [SSH tunnel][sf-ssh-tunnel].  This allows operators to leverage their existing SSH security infrastructure to also provide secure access to MongoDB.  For a standard deployment of MongoDB on AWS, this is almost always to strategy.  Because of this, we now support creating SSH tunnels automatically when connecting to MongoDB.\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options, (connectionError, client) => {\n  if (connectionError) {\n    return console.log(connectionError);\n  }\n\n  client.db('mongodb').collection('fanclub').count((countingError, count) => {\n    console.log('counted:', countingError, count);\n    client.close();\n  });\n});\n```\n\nThe above provides the same functionality as creating the tunnel using the bash\ncommand below and connecting to MongoDB via another terminal. Notice that\nconnection-model uses a random local port each time it creates a tunnel.\nUsing the command line, you'd have to replace `<random port>` with an actual\nport number.\n\n```bash\nssh -i ~/.ssh/my-key-aws-pair.pem -L <random port>:localhost:27017 ubuntu@ec2-11-111-111-111.compute-1.amazonaws.com\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `sshTunnel` | String | The desired SSH tunnel strategy. Possible values: `NONE`, `USER_PASSWORD`, `IDENTITY_FILE` | `undefined` |\n| `sshTunnelHostname` | String | The hostname of the SSH remote host | `undefined` |\n| `sshTunnelPort` | Port | The SSH port of the remote host | `22` |\n| `sshTunnelBindToLocalPort` | Port | Bind the localhost endpoint of the SSH Tunnel to this port | `undefined` |\n| `sshTunnelUsername` | String | The optional SSH username for the remote host | `undefined` |\n| `sshTunnelPassword` | String | The optional SSH password for the remote host | `undefined` |\n| `sshTunnelIdentityFile` | String/Array | The optional path to the SSH identity file for the remote host | `undefined` |\n| `sshTunnelPassphrase` | String | The optional passphrase for `sshTunnelIdentityFile` | `undefined` |\n\nDescription of `sshTunnel` values:\n\n- `NONE` - Do not use SSH tunneling.\n- `USER_PASSWORD` - The tunnel is created with SSH username and password only.\n- `IDENTITY_FILE` - The tunnel is created using an identity file.\n\n## Derived Properties\n\nDerived properties (also known as computed properties) are properties of the state object that depend on other properties to determine their value.\n\n```javascript\nconst c = new Connection();\nconst derivedProps = c.getAttributes({ derived: true });\n```\n\n| Derived Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `instanceId` | String | The mongoscope | `localhost:27017` |\n| `driverAuthMechanism` | String | Converts the value of `authStrategy` for humans into the `authMechanism` value for the driver | `undefined` |\n| `safeUrl` | String | The URL where a password is replaced with stars | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrl` | String | Use this URL in order to connect via DataService | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrlWithSsh` | String | Use this URL in order to connect via connection model itself | `mongodb://localhost:29201/?readPreference=primary&ssl=false` |\n| `driverOptions` | String | The second argument `mongoscope-server` passes to `mongodb.connect` | `{}` |\n\n## Events\n\n> New in mongodb-connection-model@5.0.0\n\n#### Example: SSH Tunnel\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', skipped: true,\n  reason: 'The selected SSL mode does not need to load any files.' }\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', complete: true}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n#### Example: SSL\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  ssl: 'ALL',\n  sslCA: '~/.ssl/my-ca.pem',\n  sslCert: '~/.ssl/my-server.pem',\n  sslKey: '~/.ssl/my-server.pem'\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', complete: true}\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', skipped: true,\n  reason: 'The selected SSH Tunnel mode is NONE.'}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n[workflow_img]: https://github.com/mongodb-js/connection-model/workflows/Check%20and%20Test/badge.svg?event=push\n[workflow_url]: https://github.com/mongodb-js/connection-model/actions?query=workflow%3A%22Check+and+Test%22\n[npm_img]: https://img.shields.io/npm/v/mongodb-connection-model.svg?style=flat-square\n[npm_url]: https://www.npmjs.org/package/mongodb-connection-model\n[gitter_img]: https://badges.gitter.im/Join%20Chat.svg\n[gitter_url]: http://gitter.im/mongodb-js/mongodb-js\n[enterprise_img]: https://img.shields.io/badge/MongoDB-Enterprise-blue.svg?style=flat-square\n[coming_soon_img]: https://img.shields.io/badge/-Coming%20Soon-ff69b4.svg?style=flat-square\n[kerberos-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/kerberos_tests.js\n[ldap-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ldap_tests.js\n[x509-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ssl_x509_tests.js\n[ns]: https://github.com/mongodb-js/ns\n[sf-ssh-tunnel]: http://serverfault.com/questions/597765/how-to-connect-to-mongodb-server-via-ssh-tunnel\n[ec2-key-pairs]: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html\n[driver-ssl-impl]: https://github.com/christkv/mongodb-core/blob/c3d21cb636d74d7a68134ecd3b9f6af536311279/lib/connection/connection.js#L365-L407\n[driver-ssl-tutorial]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/\n[driver-ssl-none]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#no-certificate-validation\n[driver-ssl-server]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate\n[driver-ssl-all]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate-and-present-valid-certificate\n","gitHead":"3b50f8232d3349fe79554f36417d7fbb45b6352a","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","test":"mocha","check":"npm run lint && npm run depcheck","pretest":"mongodb-runner install && mongodb-runner start --port=27018","test-ci":"npm run test","depcheck":"depcheck","posttest":"mongodb-runner stop --port=27018","posttest-ci":"node ../../scripts/killall-mongo.js","test-check-ci":"npm run check && npm test"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.17.0+x64 (linux)","description":"MongoDB connection model.","directories":{},"_nodeVersion":"16.17.0","compass:main":"index.js","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","debug":"^4.2.0","lodash":"^4.17.15","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.2.0","storage-mixin":"0.0.0-next-3b50f8232d3349fe79554f36417d7fbb45b6352a","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.2","@mongodb-js/ssh-tunnel":"0.0.0-next-3b50f8232d3349fe79554f36417d7fbb45b6352a","@mongodb-js/compass-utils":"0.0.0-next-3b50f8232d3349fe79554f36417d7fbb45b6352a","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.5.4"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"^4.10.0","depcheck":"^1.4.1","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.9.0","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^4.10.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_0.0.0-next-3b50f8232d3349fe79554f36417d7fbb45b6352a_1668038428551_0.0034759928581165056","host":"s3://npm-registry-packages"}},"0.0.0-next-47b085701d7c0b212b54bcac46f6106d34ec429e":{"name":"mongodb-connection-model","version":"0.0.0-next-47b085701d7c0b212b54bcac46f6106d34ec429e","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@0.0.0-next-47b085701d7c0b212b54bcac46f6106d34ec429e","maintainers":[{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"iteng@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"efaa6aca9233a71a6df45e743096198fe6441bf0","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-0.0.0-next-47b085701d7c0b212b54bcac46f6106d34ec429e.tgz","fileCount":20,"integrity":"sha512-dEkrjYZMhQpwnCh/wLwWBBStnjT3v58qIg9l8NuyaSxtsD/uCLMMdxLlCVstAL/1IIGLI+MWaGWRdojqabavfg==","signatures":[{"sig":"MEMCIDracuQoLIGQueGnaClL2GbrJZu++rdVsHH3qPnsvsdZAh81/wRMy8qc3IWswO6SiUJ1P/cdQqaWYAywtbHCQdiy","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":108152,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjbPKJACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmriSg/9EbxB3tqW+M1GEj5poTfhUH0piYRhYEHLvAx0hoiFTJgenCD6\r\nuSxpkPGSzgSnSc96QsvblgGgbvMFXJUD9aKsJUfqi0DLVujNukQqA4v1D++/\r\nReTlrTWxL2WBwACpgfeQKNOjvql3MIYz7JHvkVMuJCwCdmjwZqXJsXVlZbHu\r\nDCg9hPs4DKV2LuUOqs4OloaLm9mkcBkMKoJLFF9od8XM+gSS8jW71Iqw/v9+\r\nCJBLVt0G1U4Tgc7ZSSusqwMSAhmeg/y+RJI1xnZO0xrIpszKGVID1Q5+1vTJ\r\nkJd17mutD8AcfctcoEQCMr9NAa3+jP7ZIcaNjv9jJNUqHG0pDUpKLn3nnc45\r\nCNVJ0T3H2xtwQuq0Uwpkr1w+5tXYqGMbrEdfxQQItt55Y79D9ydx2dZoAtcG\r\nY+hZ+hyZu0uK0fLxns5Fz7hrZwF1mfAs2FjFAcxJSWrMFazMAJvz3o/fJSlk\r\nZKek8OCK5n2o4CEimUDVdtTHGjjAenyGc45PFxeqjGdvE+TsQCQqdZ5DRSNt\r\n9+2uG0IbAqz+EsPiUeOqFeL6UubLvFUSBV1S1+ccuI/zH2p9BJ9URAwJf3a0\r\nvgTeR5hG7RVWe9ZZc8Ef/zuz82Sa7Vk0/cb/QmOLGnXR36mogqXDxxh1Tdt7\r\nfeCPNqExZ8rFg94daZv3SqUA55T9B+oOoyA=\r\n=GQOf\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","readme":"# mongodb-connection-model [![][workflow_img]][workflow_url] [![][npm_img]][npm_url]\n\n> MongoDB connection model\n\nThe main purpose of the MongoDB connection model is to be a domain model around a MongoDB connection. It encapsulates generating a [Connection String URI](https://docs.mongodb.com/manual/reference/connection-string/) from a group of attributes and parses URI using the [MongoDB Node.JS Driver URI Parser](https://github.com/mongodb-js/mongodb-core/blob/master/lib/uri_parser.js).\n\n## Installation\n\n```\nnpm install --save mongodb-connection-model\n```\n\n## Usage\n\n### Building URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\nconst c = new Connection({ appname: 'My App Name' });\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://localhost:27017/?readPreference=primary&appname=My%20App&ssl=false'\n```\n\n### Parsing URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\n\nConnection.from(\n  'mongodb://someUsername:testPassword@localhost',\n  (error, result) => {\n    console.log(result);\n    >>> `{\n      hosts: [{ host: 'localhost', port: 27017 }],\n      hostname: 'localhost',\n      port: 27017,\n      auth: {\n        username: 'someUsername',\n        password: 'testPassword',\n        db: 'admin'\n      },\n      isSrvRecord: false,\n      authStrategy: 'MONGODB',\n      mongodbUsername: 'someUsername',\n      mongodbPassword: 'testPassword',\n      mongodbDatabaseName: 'admin',\n      extraOptions: {},\n      connectionType: 'NODE_DRIVER',\n      readPreference: 'primary',\n      kerberosCanonicalizeHostname: false,\n      sslMethod: 'NONE',\n      sshTunnel: 'NONE',\n      sshTunnelPort: 22\n    }`\n  }\n);\n```\n\n## Properties\n\nMongoDB connection model is based on Ampersand.js framework and consist of [props](https://ampersandjs.com/docs/#ampersand-state-props) and [derived props](https://ampersandjs.com/docs/#ampersand-state-derived). The props object describes the observable properties that MongoDB connection model gets from the Node.js Driver API.\n\n```javascript\nconst с = new Connection();\nconst props = с.getAttributes({ props: true });\n```\n\n#### See Also\n\n- [URI Generic Syntax](https://tools.ietf.org/html/rfc3986)\n- [URI Options Specification](https://github.com/mongodb/specifications/blob/master/source/uri-options/uri-options.rst)\n\n### General Properties\n\n```javascript\nconst c = new Connection({ isSrvRecord: true });\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ns` | String | A valid [ns][ns] the user can read from | `undefined` |\n| `isSrvRecord` | Boolean | Indicates SRV record | `false` |\n| `auth` | Object | Authentication from driver (username, user, db, password) | `undefined` |\n| `hostname` | String | Hostname of a MongoDB Instance. In case of the replica set the first host and port will be taken | `localhost` |\n| `port` | Number | TCP port of a MongoDB Instance | `27017` |\n| `hosts` | Array | Contains all hosts and ports for replica set | `[{ host: 'localhost', port: 27017 }]` |\n| `extraOptions` | Object | Extra options passed to the node driver as part of `driverOptions` | `{}` |\n| `connectionType` | String | The desired connection type. Possible values: `NODE_DRIVER`, `STITCH_ON_PREM`, `STITCH_ATLAS` | `NODE_DRIVER` |\n| `authStrategy` | String | The desired authentication strategy. Possible values: `NONE`, `MONGODB`, `X509`, `KERBEROS`, `LDAP`, `SCRAM-SHA-256` | `NONE` |\n\n### Connection string options\n\n```javascript\nconst c = new Connection({ appname: 'My App', replicaSet: 'testing' });\n```\n\n#### General connection string options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `replicaSet` | String | Specifies the name of the replica set, if the mongod is a member of a replica set | `undefined` |\n| `connectTimeoutMS` | Number | The time in milliseconds to attempt a connection before timing out | `undefined` |\n| `socketTimeoutMS` | Number | The time in milliseconds to attempt a send or receive on a socket before the attempt times out | `undefined` |\n| `compression` | Object | Object includes compressors and a compression level. The following compressors can be specified: `snappy`, `zlib` (Available in MongoDB 3.6 or greater) | `undefined` |\n\n#### Connection Pool Option\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `maxPoolSize` | Number | The maximum number of connections in the connection pool | `undefined` |\n| `minPoolSize` | Number | The minimum number of connections in the connection pool | `undefined` |\n| `maxIdleTimeMS` | Number | The maximum number of milliseconds that a connection can remain idle in the pool before being removed and closed | `undefined` |\n| `waitQueueMultiple` | Number | A number that the driver multiples the maxPoolSize value to, to provide the maximum number of threads allowed to wait for a connection to become available from the pool | `undefined` |\n| `waitQueueTimeoutMS` | Number | The maximum time in milliseconds that a thread can wait for a connection to become available | `undefined` |\n\n#### Write Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `w` | Number/String | Corresponds to the write concern [w Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-w) | `undefined` |\n| `wTimeoutMS` | Number | Corresponds to the write concern [wtimeout](https://docs.mongodb.com/manual/reference/write-concern/#wc-wtimeout) | `undefined` |\n| `journal` | Boolean | Corresponds to the write concern [j Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-j) | `undefined` |\n\n#### Read Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readConcernLevel` | String | The level of isolation | `undefined` |\n\n#### Read Preference Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readPreference` | String | Specifies the read preferences for this connection. Possible values: `PRIMARY`, `PRIMARY_PREFERRED`, `SECONDARY`, `SECONDARY_PREFERRED`, `NEAREST` | `PRIMARY` |\n| `maxStalenessSeconds` | Number | Specifies, in seconds, how stale a secondary can be before the client stops using it for read operations | `undefined` |\n| `readPreferenceTags` | Object | Default read preference tags for the client | `undefined` |\n\n#### Authentication Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `authSource` | String | Specify the database name associated with the user’s credentials | `undefined` |\n| `authMechanism` | String | Specifies the authentication mechanism that MongoDB will use to authenticate the connection. Possible values: `DEFAULT`, `GSSAPI`, `MONGODB-X509`, `PLAIN`, `SCRAM-SHA-256` | `undefined` |\n| `authMechanismProperties` | Object | Additional options provided for authentication (e.g. to enable hostname canonicalization for GSSAPI) | `undefined` |\n| `gssapiServiceName` | String | Set the Kerberos service name when connecting to Kerberized MongoDB instances | `undefined` |\n| `gssapiServiceRealm` | String | Set the Realm service name | `undefined` |\n| `gssapiCanonicalizeHostName` | Boolean | Whether canonicalized hostname | `undefined` |\n\n#### Server Selection and Discovery Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `localThresholdMS` | Number | The size (in milliseconds) of the latency window for selecting among multiple suitable MongoDB instances | `undefined` |\n| `serverSelectionTimeoutMS` | Number | Specifies how long (in milliseconds) to block for server selection before throwing an exception | `undefined` |\n| `serverSelectionTryOnce` | Boolean | Instructs the driver to scan the MongoDB deployment exactly once after server selection fails and then either select a server or raise an error | `undefined` |\n| `heartbeatFrequencyMS` | Number | Controls when the driver checks the state of the MongoDB deployment | `undefined` |\n\n#### Miscellaneous Configuration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `appname` | String | An application name passed to server as client metadata | `undefined` |\n| `retryWrites` | Boolean | Enable retryable writes | `undefined` |\n| `uuidRepresentation` | String | The legacy representation of UUID. Possible values: `standard`, `csharpLegacy`, `javaLegacy`, `pythonLegacy` | `undefined` |\n| `loadBalanced` | Boolean | Whether or not the server is running in load balanced mode | `undefined` |\n\n### Stitch attributes\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `stitchServiceName` | String | Stitch service name | `undefined` |\n| `stitchClientAppId` | String | Stitch сlient app ID | `undefined` |\n| `stitchGroupId` | String | Stitch group ID | `undefined` |\n| `stitchBaseUrl` | String | Stitch base Url | `undefined` |\n\n### MONGODB authentication\n\n```javascript\nconst c = new Connection({\n  mongodbUsername: 'arlo',\n  mongodbPassword: 'w@of'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/?slaveOk=true&authSource=admin'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `mongodbUsername` | String | MongoDB username | `undefined` |\n| `mongodbPassword` | String | MongoDB password | `undefined` |\n| `mongodbDatabaseName` | String | The database name associated with the user's credentials | `undefined` |\n| `promoteValues` | Boolean | Whether BSON values should be promoted to their JS type counterparts | `undefined` |\n\n### KERBEROS authentication\n\n```javascript\nconst c = new Connection({\n  kerberosServiceName: 'mongodb',\n  kerberosPrincipal: 'arlo/dog@krb5.mongodb.parts',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo%252Fdog%2540krb5.mongodb.parts@localhost:27017/toys?authMechanism=GSSAPI'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n> @note (imlucas): Kerberos on Windows is broken out as it's own state for UX consideration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `kerberosServiceName` | String | Any program or computer you access over a network | `undefined` |\n| `kerberosPrincipal` | String | The format of a typical Kerberos V5 principal is `primary/instance@REALM` | `undefined` |\n| `kerberosCanonicalizeHostname` | Boolean | Whether canonicalized kerberos hostname | `undefined` |\n\n#### See Also\n\n- [node.js driver Kerberos reference](http://bit.ly/mongodb-node-driver-kerberos)\n- [node.js driver Kerberos functional test][kerberos-functional]\n\n### LDAP authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  ldapUsername: 'arlo',\n  ldapPassword: 'w@of',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/toys?slaveOk=true&authMechanism=PLAIN'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ldapUsername` | String | LDAP username | `undefined` |\n| `ldapPassword` | String | LDAP password | `undefined` |\n\n#### See Also\n\n- [node.js driver LDAP reference](http://bit.ly/mongodb-node-driver-ldap)\n- [node.js driver X509 functional test][ldap-functional]\n\n### X509 authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  x509Username: 'CN=client,OU=arlo,O=MongoDB,L=Philadelphia,ST=Pennsylvania,C=US'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://CN%253Dclient%252COU%253Darlo%252CO%253DMongoDB%252CL%253DPhiladelphia%252CST%253DPennsylvania%252CC%253DUS@localhost:27017?slaveOk=true&authMechanism=MONGODB-X509'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `x509Username` | String | The x.509 certificate derived user name, e.g. `CN=user,OU=OrgUnit,O=myOrg,...` | `undefined` |\n\n#### See Also\n\n- [node.js driver X509 reference](http://bit.ly/mongodb-node-driver-x509)\n- [node.js driver X509 functional test][x509-functional]\n\n### SSL\n\n> **Note**: Not to be confused with `authentication=X509`\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ssl` | Number/String | A boolean to enable or disables TLS/SSL for the connection | `undefined` |\n| `sslMethod` | String | The desired ssl method. Possible values: `NONE`, `SYSTEMCA`, `IFAVAILABLE`, `UNVALIDATED`, `SERVER`, `ALL` | `NONE` |\n| `sslCA` | Buffer/String | Array of valid certificates | `undefined` |\n| `sslCert` | Buffer/String | The certificate | `undefined` |\n| `sslKey` | Buffer/String | The certificate private key | `undefined` |\n| `sslPass` | Buffer/String | The certificate password | `undefined` |\n\nDescription of `sslMethod` values:\n\n- `SYSTEMCA` - SSL required, validate using System CA, with host verification.\n- `IFAVAILABLE` - The driver should try SSL first, fall back to no SSL if unavailable, and use the system's Certificate Authority.\n- `SERVER` - The driver should validate the server certificate and fail to connect if validation fails. See also [node.js driver \"Validate Server Certificate\" docs][driver-ssl-server].\n- `ALL` - The driver must present a valid certificate and validate the server certificate. See also [node.js driver \"Validate Server Certificate and Present Valid Certificate\" docs][driver-ssl-all].\n- `NONE` - No SSL (Not recommended).\n- `UNVALIDATED` - Use SSL but do not perform any validation of the certificate chain. See also [node.js driver \"No Certificate Validation\" docs][driver-ssl-none]. **Very** not recommended and likely to be deprecated in future releases because it exposes potential Man-In-The-Middle attack vectors.\n\n#### See also\n\n- [node.js driver SSL implementation][driver-ssl-impl]\n- [node.js driver SSL tutorial][driver-ssl-tutorial]\n\n### SSH TUNNEL\n\n> New in mongodb-connection-model@5.0.0\n\nBecause [authentication](#authentication) is quite difficult for operators to migrate to, the most common method of securing a MongoDB deployment is to use an [SSH tunnel][sf-ssh-tunnel].  This allows operators to leverage their existing SSH security infrastructure to also provide secure access to MongoDB.  For a standard deployment of MongoDB on AWS, this is almost always to strategy.  Because of this, we now support creating SSH tunnels automatically when connecting to MongoDB.\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options, (connectionError, client) => {\n  if (connectionError) {\n    return console.log(connectionError);\n  }\n\n  client.db('mongodb').collection('fanclub').count((countingError, count) => {\n    console.log('counted:', countingError, count);\n    client.close();\n  });\n});\n```\n\nThe above provides the same functionality as creating the tunnel using the bash\ncommand below and connecting to MongoDB via another terminal. Notice that\nconnection-model uses a random local port each time it creates a tunnel.\nUsing the command line, you'd have to replace `<random port>` with an actual\nport number.\n\n```bash\nssh -i ~/.ssh/my-key-aws-pair.pem -L <random port>:localhost:27017 ubuntu@ec2-11-111-111-111.compute-1.amazonaws.com\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `sshTunnel` | String | The desired SSH tunnel strategy. Possible values: `NONE`, `USER_PASSWORD`, `IDENTITY_FILE` | `undefined` |\n| `sshTunnelHostname` | String | The hostname of the SSH remote host | `undefined` |\n| `sshTunnelPort` | Port | The SSH port of the remote host | `22` |\n| `sshTunnelBindToLocalPort` | Port | Bind the localhost endpoint of the SSH Tunnel to this port | `undefined` |\n| `sshTunnelUsername` | String | The optional SSH username for the remote host | `undefined` |\n| `sshTunnelPassword` | String | The optional SSH password for the remote host | `undefined` |\n| `sshTunnelIdentityFile` | String/Array | The optional path to the SSH identity file for the remote host | `undefined` |\n| `sshTunnelPassphrase` | String | The optional passphrase for `sshTunnelIdentityFile` | `undefined` |\n\nDescription of `sshTunnel` values:\n\n- `NONE` - Do not use SSH tunneling.\n- `USER_PASSWORD` - The tunnel is created with SSH username and password only.\n- `IDENTITY_FILE` - The tunnel is created using an identity file.\n\n## Derived Properties\n\nDerived properties (also known as computed properties) are properties of the state object that depend on other properties to determine their value.\n\n```javascript\nconst c = new Connection();\nconst derivedProps = c.getAttributes({ derived: true });\n```\n\n| Derived Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `instanceId` | String | The mongoscope | `localhost:27017` |\n| `driverAuthMechanism` | String | Converts the value of `authStrategy` for humans into the `authMechanism` value for the driver | `undefined` |\n| `safeUrl` | String | The URL where a password is replaced with stars | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrl` | String | Use this URL in order to connect via DataService | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrlWithSsh` | String | Use this URL in order to connect via connection model itself | `mongodb://localhost:29201/?readPreference=primary&ssl=false` |\n| `driverOptions` | String | The second argument `mongoscope-server` passes to `mongodb.connect` | `{}` |\n\n## Events\n\n> New in mongodb-connection-model@5.0.0\n\n#### Example: SSH Tunnel\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', skipped: true,\n  reason: 'The selected SSL mode does not need to load any files.' }\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', complete: true}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n#### Example: SSL\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  ssl: 'ALL',\n  sslCA: '~/.ssl/my-ca.pem',\n  sslCert: '~/.ssl/my-server.pem',\n  sslKey: '~/.ssl/my-server.pem'\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', complete: true}\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', skipped: true,\n  reason: 'The selected SSH Tunnel mode is NONE.'}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n[workflow_img]: https://github.com/mongodb-js/connection-model/workflows/Check%20and%20Test/badge.svg?event=push\n[workflow_url]: https://github.com/mongodb-js/connection-model/actions?query=workflow%3A%22Check+and+Test%22\n[npm_img]: https://img.shields.io/npm/v/mongodb-connection-model.svg?style=flat-square\n[npm_url]: https://www.npmjs.org/package/mongodb-connection-model\n[gitter_img]: https://badges.gitter.im/Join%20Chat.svg\n[gitter_url]: http://gitter.im/mongodb-js/mongodb-js\n[enterprise_img]: https://img.shields.io/badge/MongoDB-Enterprise-blue.svg?style=flat-square\n[coming_soon_img]: https://img.shields.io/badge/-Coming%20Soon-ff69b4.svg?style=flat-square\n[kerberos-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/kerberos_tests.js\n[ldap-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ldap_tests.js\n[x509-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ssl_x509_tests.js\n[ns]: https://github.com/mongodb-js/ns\n[sf-ssh-tunnel]: http://serverfault.com/questions/597765/how-to-connect-to-mongodb-server-via-ssh-tunnel\n[ec2-key-pairs]: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html\n[driver-ssl-impl]: https://github.com/christkv/mongodb-core/blob/c3d21cb636d74d7a68134ecd3b9f6af536311279/lib/connection/connection.js#L365-L407\n[driver-ssl-tutorial]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/\n[driver-ssl-none]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#no-certificate-validation\n[driver-ssl-server]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate\n[driver-ssl-all]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate-and-present-valid-certificate\n","gitHead":"47b085701d7c0b212b54bcac46f6106d34ec429e","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","test":"mocha","check":"npm run lint && npm run depcheck","pretest":"mongodb-runner install && mongodb-runner start --port=27018","test-ci":"npm run test","depcheck":"depcheck","posttest":"mongodb-runner stop --port=27018","posttest-ci":"node ../../scripts/killall-mongo.js","test-check-ci":"npm run check && npm test"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.17.0+x64 (linux)","description":"MongoDB connection model.","directories":{},"_nodeVersion":"16.17.0","compass:main":"index.js","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","debug":"^4.2.0","lodash":"^4.17.15","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.2.0","storage-mixin":"0.0.0-next-47b085701d7c0b212b54bcac46f6106d34ec429e","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.2","@mongodb-js/ssh-tunnel":"0.0.0-next-47b085701d7c0b212b54bcac46f6106d34ec429e","@mongodb-js/compass-utils":"0.0.0-next-47b085701d7c0b212b54bcac46f6106d34ec429e","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.5.4"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"^4.10.0","depcheck":"^1.4.1","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.9.0","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^4.10.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_0.0.0-next-47b085701d7c0b212b54bcac46f6106d34ec429e_1668084361680_0.4553576163882438","host":"s3://npm-registry-packages"}},"0.0.0-next-9e3b266e199e346a30e2c20aac373d48c2ea9888":{"name":"mongodb-connection-model","version":"0.0.0-next-9e3b266e199e346a30e2c20aac373d48c2ea9888","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@0.0.0-next-9e3b266e199e346a30e2c20aac373d48c2ea9888","maintainers":[{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"iteng@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"1c97245cdbdb103ca6ddaed15de26e2d1c633c4f","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-0.0.0-next-9e3b266e199e346a30e2c20aac373d48c2ea9888.tgz","fileCount":20,"integrity":"sha512-7w2VD2Lqfb1tuNvRU/djgPQqcBieAZW1AZKgRS/xe6whjZ12pBQKORGxV86iuo302Dg+vP8B2j3qleeHNGaLSg==","signatures":[{"sig":"MEUCIQCoGZ95BBSydNva7GpNrZU1FSIULQolBpLg0sRHAijucAIgG1d1TGf0KgTYyZiFvaHIFjEnrACnpXKVm17WZbp4xVo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":108152,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjbrP6ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq81w//R+uJtomNHDBf856/FCXKGL+K9y7hmdoRUd1K4GmgMqzahULT\r\nCw1C1RcD7AAD8ErhSHHlwxhnp7+x3kBo7V4zBpjWqsudh35cJDMZ1aTLm9Fo\r\nqfpSg4G8Jg5V3OPB0G31nJl5zXmaOOaPkgjLJtFJp2DOBfQygh/5ityWgC+N\r\n6jnYNeuT7TmZuP5zPQSjX5w10CXv+rNJtjWzbRm7RbEStNHeom8lsYpODX/v\r\n035GHcCWym+/CQqj61cD2/tSLUp0AihrVYRrDZG8cLfoeKXoMVV2PO6orRc9\r\n1rSn+FUPcnRaZMz/7QCcRLkjLrjK6q9+9spxDfjryTu7fcXTrWR0NRAWv4i9\r\nWwL2LgW200xuTjzBeQ6EpAX7GAfXJAMp9eBvTQWqdFWOh2481xQuQ0t5Fafe\r\nbgx5gAWpPuMwWJqsrB68dVX8ZP++4jYO4H4/TEZiYR4DaMesM03RqqubdLCW\r\nfuo/JY1HiXg4UPDhybw84HIUuPGZ7OoBnYMzNrEsaCjiExawSzEHPRj1jxQu\r\ndcWAHFJiAYGoZ545FM51LU65U5WgjvSwwFLhyYXzgC1VUe1Rcr+r8vYR97my\r\nj2e/0/LombjdbzHf4ABwSrU0NdubdWUK1DvViSkkGJia3It9EVWFQmP4axms\r\nKppHYNJLZsDJNE33M/18L+K/7sFvaXVgkXM=\r\n=VzF5\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","readme":"# mongodb-connection-model [![][workflow_img]][workflow_url] [![][npm_img]][npm_url]\n\n> MongoDB connection model\n\nThe main purpose of the MongoDB connection model is to be a domain model around a MongoDB connection. It encapsulates generating a [Connection String URI](https://docs.mongodb.com/manual/reference/connection-string/) from a group of attributes and parses URI using the [MongoDB Node.JS Driver URI Parser](https://github.com/mongodb-js/mongodb-core/blob/master/lib/uri_parser.js).\n\n## Installation\n\n```\nnpm install --save mongodb-connection-model\n```\n\n## Usage\n\n### Building URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\nconst c = new Connection({ appname: 'My App Name' });\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://localhost:27017/?readPreference=primary&appname=My%20App&ssl=false'\n```\n\n### Parsing URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\n\nConnection.from(\n  'mongodb://someUsername:testPassword@localhost',\n  (error, result) => {\n    console.log(result);\n    >>> `{\n      hosts: [{ host: 'localhost', port: 27017 }],\n      hostname: 'localhost',\n      port: 27017,\n      auth: {\n        username: 'someUsername',\n        password: 'testPassword',\n        db: 'admin'\n      },\n      isSrvRecord: false,\n      authStrategy: 'MONGODB',\n      mongodbUsername: 'someUsername',\n      mongodbPassword: 'testPassword',\n      mongodbDatabaseName: 'admin',\n      extraOptions: {},\n      connectionType: 'NODE_DRIVER',\n      readPreference: 'primary',\n      kerberosCanonicalizeHostname: false,\n      sslMethod: 'NONE',\n      sshTunnel: 'NONE',\n      sshTunnelPort: 22\n    }`\n  }\n);\n```\n\n## Properties\n\nMongoDB connection model is based on Ampersand.js framework and consist of [props](https://ampersandjs.com/docs/#ampersand-state-props) and [derived props](https://ampersandjs.com/docs/#ampersand-state-derived). The props object describes the observable properties that MongoDB connection model gets from the Node.js Driver API.\n\n```javascript\nconst с = new Connection();\nconst props = с.getAttributes({ props: true });\n```\n\n#### See Also\n\n- [URI Generic Syntax](https://tools.ietf.org/html/rfc3986)\n- [URI Options Specification](https://github.com/mongodb/specifications/blob/master/source/uri-options/uri-options.rst)\n\n### General Properties\n\n```javascript\nconst c = new Connection({ isSrvRecord: true });\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ns` | String | A valid [ns][ns] the user can read from | `undefined` |\n| `isSrvRecord` | Boolean | Indicates SRV record | `false` |\n| `auth` | Object | Authentication from driver (username, user, db, password) | `undefined` |\n| `hostname` | String | Hostname of a MongoDB Instance. In case of the replica set the first host and port will be taken | `localhost` |\n| `port` | Number | TCP port of a MongoDB Instance | `27017` |\n| `hosts` | Array | Contains all hosts and ports for replica set | `[{ host: 'localhost', port: 27017 }]` |\n| `extraOptions` | Object | Extra options passed to the node driver as part of `driverOptions` | `{}` |\n| `connectionType` | String | The desired connection type. Possible values: `NODE_DRIVER`, `STITCH_ON_PREM`, `STITCH_ATLAS` | `NODE_DRIVER` |\n| `authStrategy` | String | The desired authentication strategy. Possible values: `NONE`, `MONGODB`, `X509`, `KERBEROS`, `LDAP`, `SCRAM-SHA-256` | `NONE` |\n\n### Connection string options\n\n```javascript\nconst c = new Connection({ appname: 'My App', replicaSet: 'testing' });\n```\n\n#### General connection string options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `replicaSet` | String | Specifies the name of the replica set, if the mongod is a member of a replica set | `undefined` |\n| `connectTimeoutMS` | Number | The time in milliseconds to attempt a connection before timing out | `undefined` |\n| `socketTimeoutMS` | Number | The time in milliseconds to attempt a send or receive on a socket before the attempt times out | `undefined` |\n| `compression` | Object | Object includes compressors and a compression level. The following compressors can be specified: `snappy`, `zlib` (Available in MongoDB 3.6 or greater) | `undefined` |\n\n#### Connection Pool Option\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `maxPoolSize` | Number | The maximum number of connections in the connection pool | `undefined` |\n| `minPoolSize` | Number | The minimum number of connections in the connection pool | `undefined` |\n| `maxIdleTimeMS` | Number | The maximum number of milliseconds that a connection can remain idle in the pool before being removed and closed | `undefined` |\n| `waitQueueMultiple` | Number | A number that the driver multiples the maxPoolSize value to, to provide the maximum number of threads allowed to wait for a connection to become available from the pool | `undefined` |\n| `waitQueueTimeoutMS` | Number | The maximum time in milliseconds that a thread can wait for a connection to become available | `undefined` |\n\n#### Write Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `w` | Number/String | Corresponds to the write concern [w Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-w) | `undefined` |\n| `wTimeoutMS` | Number | Corresponds to the write concern [wtimeout](https://docs.mongodb.com/manual/reference/write-concern/#wc-wtimeout) | `undefined` |\n| `journal` | Boolean | Corresponds to the write concern [j Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-j) | `undefined` |\n\n#### Read Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readConcernLevel` | String | The level of isolation | `undefined` |\n\n#### Read Preference Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readPreference` | String | Specifies the read preferences for this connection. Possible values: `PRIMARY`, `PRIMARY_PREFERRED`, `SECONDARY`, `SECONDARY_PREFERRED`, `NEAREST` | `PRIMARY` |\n| `maxStalenessSeconds` | Number | Specifies, in seconds, how stale a secondary can be before the client stops using it for read operations | `undefined` |\n| `readPreferenceTags` | Object | Default read preference tags for the client | `undefined` |\n\n#### Authentication Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `authSource` | String | Specify the database name associated with the user’s credentials | `undefined` |\n| `authMechanism` | String | Specifies the authentication mechanism that MongoDB will use to authenticate the connection. Possible values: `DEFAULT`, `GSSAPI`, `MONGODB-X509`, `PLAIN`, `SCRAM-SHA-256` | `undefined` |\n| `authMechanismProperties` | Object | Additional options provided for authentication (e.g. to enable hostname canonicalization for GSSAPI) | `undefined` |\n| `gssapiServiceName` | String | Set the Kerberos service name when connecting to Kerberized MongoDB instances | `undefined` |\n| `gssapiServiceRealm` | String | Set the Realm service name | `undefined` |\n| `gssapiCanonicalizeHostName` | Boolean | Whether canonicalized hostname | `undefined` |\n\n#### Server Selection and Discovery Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `localThresholdMS` | Number | The size (in milliseconds) of the latency window for selecting among multiple suitable MongoDB instances | `undefined` |\n| `serverSelectionTimeoutMS` | Number | Specifies how long (in milliseconds) to block for server selection before throwing an exception | `undefined` |\n| `serverSelectionTryOnce` | Boolean | Instructs the driver to scan the MongoDB deployment exactly once after server selection fails and then either select a server or raise an error | `undefined` |\n| `heartbeatFrequencyMS` | Number | Controls when the driver checks the state of the MongoDB deployment | `undefined` |\n\n#### Miscellaneous Configuration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `appname` | String | An application name passed to server as client metadata | `undefined` |\n| `retryWrites` | Boolean | Enable retryable writes | `undefined` |\n| `uuidRepresentation` | String | The legacy representation of UUID. Possible values: `standard`, `csharpLegacy`, `javaLegacy`, `pythonLegacy` | `undefined` |\n| `loadBalanced` | Boolean | Whether or not the server is running in load balanced mode | `undefined` |\n\n### Stitch attributes\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `stitchServiceName` | String | Stitch service name | `undefined` |\n| `stitchClientAppId` | String | Stitch сlient app ID | `undefined` |\n| `stitchGroupId` | String | Stitch group ID | `undefined` |\n| `stitchBaseUrl` | String | Stitch base Url | `undefined` |\n\n### MONGODB authentication\n\n```javascript\nconst c = new Connection({\n  mongodbUsername: 'arlo',\n  mongodbPassword: 'w@of'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/?slaveOk=true&authSource=admin'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `mongodbUsername` | String | MongoDB username | `undefined` |\n| `mongodbPassword` | String | MongoDB password | `undefined` |\n| `mongodbDatabaseName` | String | The database name associated with the user's credentials | `undefined` |\n| `promoteValues` | Boolean | Whether BSON values should be promoted to their JS type counterparts | `undefined` |\n\n### KERBEROS authentication\n\n```javascript\nconst c = new Connection({\n  kerberosServiceName: 'mongodb',\n  kerberosPrincipal: 'arlo/dog@krb5.mongodb.parts',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo%252Fdog%2540krb5.mongodb.parts@localhost:27017/toys?authMechanism=GSSAPI'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n> @note (imlucas): Kerberos on Windows is broken out as it's own state for UX consideration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `kerberosServiceName` | String | Any program or computer you access over a network | `undefined` |\n| `kerberosPrincipal` | String | The format of a typical Kerberos V5 principal is `primary/instance@REALM` | `undefined` |\n| `kerberosCanonicalizeHostname` | Boolean | Whether canonicalized kerberos hostname | `undefined` |\n\n#### See Also\n\n- [node.js driver Kerberos reference](http://bit.ly/mongodb-node-driver-kerberos)\n- [node.js driver Kerberos functional test][kerberos-functional]\n\n### LDAP authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  ldapUsername: 'arlo',\n  ldapPassword: 'w@of',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/toys?slaveOk=true&authMechanism=PLAIN'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ldapUsername` | String | LDAP username | `undefined` |\n| `ldapPassword` | String | LDAP password | `undefined` |\n\n#### See Also\n\n- [node.js driver LDAP reference](http://bit.ly/mongodb-node-driver-ldap)\n- [node.js driver X509 functional test][ldap-functional]\n\n### X509 authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  x509Username: 'CN=client,OU=arlo,O=MongoDB,L=Philadelphia,ST=Pennsylvania,C=US'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://CN%253Dclient%252COU%253Darlo%252CO%253DMongoDB%252CL%253DPhiladelphia%252CST%253DPennsylvania%252CC%253DUS@localhost:27017?slaveOk=true&authMechanism=MONGODB-X509'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `x509Username` | String | The x.509 certificate derived user name, e.g. `CN=user,OU=OrgUnit,O=myOrg,...` | `undefined` |\n\n#### See Also\n\n- [node.js driver X509 reference](http://bit.ly/mongodb-node-driver-x509)\n- [node.js driver X509 functional test][x509-functional]\n\n### SSL\n\n> **Note**: Not to be confused with `authentication=X509`\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ssl` | Number/String | A boolean to enable or disables TLS/SSL for the connection | `undefined` |\n| `sslMethod` | String | The desired ssl method. Possible values: `NONE`, `SYSTEMCA`, `IFAVAILABLE`, `UNVALIDATED`, `SERVER`, `ALL` | `NONE` |\n| `sslCA` | Buffer/String | Array of valid certificates | `undefined` |\n| `sslCert` | Buffer/String | The certificate | `undefined` |\n| `sslKey` | Buffer/String | The certificate private key | `undefined` |\n| `sslPass` | Buffer/String | The certificate password | `undefined` |\n\nDescription of `sslMethod` values:\n\n- `SYSTEMCA` - SSL required, validate using System CA, with host verification.\n- `IFAVAILABLE` - The driver should try SSL first, fall back to no SSL if unavailable, and use the system's Certificate Authority.\n- `SERVER` - The driver should validate the server certificate and fail to connect if validation fails. See also [node.js driver \"Validate Server Certificate\" docs][driver-ssl-server].\n- `ALL` - The driver must present a valid certificate and validate the server certificate. See also [node.js driver \"Validate Server Certificate and Present Valid Certificate\" docs][driver-ssl-all].\n- `NONE` - No SSL (Not recommended).\n- `UNVALIDATED` - Use SSL but do not perform any validation of the certificate chain. See also [node.js driver \"No Certificate Validation\" docs][driver-ssl-none]. **Very** not recommended and likely to be deprecated in future releases because it exposes potential Man-In-The-Middle attack vectors.\n\n#### See also\n\n- [node.js driver SSL implementation][driver-ssl-impl]\n- [node.js driver SSL tutorial][driver-ssl-tutorial]\n\n### SSH TUNNEL\n\n> New in mongodb-connection-model@5.0.0\n\nBecause [authentication](#authentication) is quite difficult for operators to migrate to, the most common method of securing a MongoDB deployment is to use an [SSH tunnel][sf-ssh-tunnel].  This allows operators to leverage their existing SSH security infrastructure to also provide secure access to MongoDB.  For a standard deployment of MongoDB on AWS, this is almost always to strategy.  Because of this, we now support creating SSH tunnels automatically when connecting to MongoDB.\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options, (connectionError, client) => {\n  if (connectionError) {\n    return console.log(connectionError);\n  }\n\n  client.db('mongodb').collection('fanclub').count((countingError, count) => {\n    console.log('counted:', countingError, count);\n    client.close();\n  });\n});\n```\n\nThe above provides the same functionality as creating the tunnel using the bash\ncommand below and connecting to MongoDB via another terminal. Notice that\nconnection-model uses a random local port each time it creates a tunnel.\nUsing the command line, you'd have to replace `<random port>` with an actual\nport number.\n\n```bash\nssh -i ~/.ssh/my-key-aws-pair.pem -L <random port>:localhost:27017 ubuntu@ec2-11-111-111-111.compute-1.amazonaws.com\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `sshTunnel` | String | The desired SSH tunnel strategy. Possible values: `NONE`, `USER_PASSWORD`, `IDENTITY_FILE` | `undefined` |\n| `sshTunnelHostname` | String | The hostname of the SSH remote host | `undefined` |\n| `sshTunnelPort` | Port | The SSH port of the remote host | `22` |\n| `sshTunnelBindToLocalPort` | Port | Bind the localhost endpoint of the SSH Tunnel to this port | `undefined` |\n| `sshTunnelUsername` | String | The optional SSH username for the remote host | `undefined` |\n| `sshTunnelPassword` | String | The optional SSH password for the remote host | `undefined` |\n| `sshTunnelIdentityFile` | String/Array | The optional path to the SSH identity file for the remote host | `undefined` |\n| `sshTunnelPassphrase` | String | The optional passphrase for `sshTunnelIdentityFile` | `undefined` |\n\nDescription of `sshTunnel` values:\n\n- `NONE` - Do not use SSH tunneling.\n- `USER_PASSWORD` - The tunnel is created with SSH username and password only.\n- `IDENTITY_FILE` - The tunnel is created using an identity file.\n\n## Derived Properties\n\nDerived properties (also known as computed properties) are properties of the state object that depend on other properties to determine their value.\n\n```javascript\nconst c = new Connection();\nconst derivedProps = c.getAttributes({ derived: true });\n```\n\n| Derived Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `instanceId` | String | The mongoscope | `localhost:27017` |\n| `driverAuthMechanism` | String | Converts the value of `authStrategy` for humans into the `authMechanism` value for the driver | `undefined` |\n| `safeUrl` | String | The URL where a password is replaced with stars | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrl` | String | Use this URL in order to connect via DataService | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrlWithSsh` | String | Use this URL in order to connect via connection model itself | `mongodb://localhost:29201/?readPreference=primary&ssl=false` |\n| `driverOptions` | String | The second argument `mongoscope-server` passes to `mongodb.connect` | `{}` |\n\n## Events\n\n> New in mongodb-connection-model@5.0.0\n\n#### Example: SSH Tunnel\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', skipped: true,\n  reason: 'The selected SSL mode does not need to load any files.' }\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', complete: true}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n#### Example: SSL\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  ssl: 'ALL',\n  sslCA: '~/.ssl/my-ca.pem',\n  sslCert: '~/.ssl/my-server.pem',\n  sslKey: '~/.ssl/my-server.pem'\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', complete: true}\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', skipped: true,\n  reason: 'The selected SSH Tunnel mode is NONE.'}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n[workflow_img]: https://github.com/mongodb-js/connection-model/workflows/Check%20and%20Test/badge.svg?event=push\n[workflow_url]: https://github.com/mongodb-js/connection-model/actions?query=workflow%3A%22Check+and+Test%22\n[npm_img]: https://img.shields.io/npm/v/mongodb-connection-model.svg?style=flat-square\n[npm_url]: https://www.npmjs.org/package/mongodb-connection-model\n[gitter_img]: https://badges.gitter.im/Join%20Chat.svg\n[gitter_url]: http://gitter.im/mongodb-js/mongodb-js\n[enterprise_img]: https://img.shields.io/badge/MongoDB-Enterprise-blue.svg?style=flat-square\n[coming_soon_img]: https://img.shields.io/badge/-Coming%20Soon-ff69b4.svg?style=flat-square\n[kerberos-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/kerberos_tests.js\n[ldap-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ldap_tests.js\n[x509-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ssl_x509_tests.js\n[ns]: https://github.com/mongodb-js/ns\n[sf-ssh-tunnel]: http://serverfault.com/questions/597765/how-to-connect-to-mongodb-server-via-ssh-tunnel\n[ec2-key-pairs]: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html\n[driver-ssl-impl]: https://github.com/christkv/mongodb-core/blob/c3d21cb636d74d7a68134ecd3b9f6af536311279/lib/connection/connection.js#L365-L407\n[driver-ssl-tutorial]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/\n[driver-ssl-none]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#no-certificate-validation\n[driver-ssl-server]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate\n[driver-ssl-all]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate-and-present-valid-certificate\n","gitHead":"9e3b266e199e346a30e2c20aac373d48c2ea9888","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","test":"mocha","check":"npm run lint && npm run depcheck","pretest":"mongodb-runner install && mongodb-runner start --port=27018","test-ci":"npm run test","depcheck":"depcheck","posttest":"mongodb-runner stop --port=27018","posttest-ci":"node ../../scripts/killall-mongo.js","test-check-ci":"npm run check && npm test"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.17.0+x64 (linux)","description":"MongoDB connection model.","directories":{},"_nodeVersion":"16.17.0","compass:main":"index.js","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","debug":"^4.2.0","lodash":"^4.17.15","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.2.0","storage-mixin":"0.0.0-next-9e3b266e199e346a30e2c20aac373d48c2ea9888","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.2","@mongodb-js/ssh-tunnel":"0.0.0-next-9e3b266e199e346a30e2c20aac373d48c2ea9888","@mongodb-js/compass-utils":"0.0.0-next-9e3b266e199e346a30e2c20aac373d48c2ea9888","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.5.4"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"^4.10.0","depcheck":"^1.4.1","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.9.0","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^4.10.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_0.0.0-next-9e3b266e199e346a30e2c20aac373d48c2ea9888_1668199418523_0.3433339019123778","host":"s3://npm-registry-packages"}},"0.0.0-next-91daa029e219b08cf0b775b6648d35867f2272d0":{"name":"mongodb-connection-model","version":"0.0.0-next-91daa029e219b08cf0b775b6648d35867f2272d0","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@0.0.0-next-91daa029e219b08cf0b775b6648d35867f2272d0","maintainers":[{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"iteng@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"d7a4161129a840615d674f923a228738577ab344","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-0.0.0-next-91daa029e219b08cf0b775b6648d35867f2272d0.tgz","fileCount":20,"integrity":"sha512-/VUMJugPZ/73ouP8z1ubJ5Q/z1+6BaUBiDlEPNCsVHHadFnNS+mfOFWMaOqgdOdoyU4ccsWHEZoaJfT73kwSvw==","signatures":[{"sig":"MEUCIQCyqwp702D2oBwXIikCVYOZ1Bjx1zNyCFnquLmTqc2qnAIgflA6p4h+6ss6iWYm9wjgAfvDl0symF9BVHOm4YKkh70=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":108152,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjdW5hACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmonOBAAouy1WuRGi0/zDj2n52IPeJNBkYyCYbJqZEmAAkhOcnzzEUrp\r\nYhBSzihvQTj/mPD6NZGsoIrfLtvWfGVWCgtHy+1CVR7GGqb1FJXSW0uL37sM\r\nGuHwhelOMfWCb8RCTSsZowQ6m+QHl/v43ThWeV96ESa+LiBosTHse19l715v\r\nUokTr66fjLhwUV6gItHRR1J6iNnSNxVYjxXuwU3zqFaF4kuoT7QUusdWdqFV\r\nFZaIt9H1vNfJKdrhiWVB7W1Ef53zvgLG26Cr5DnEymoc3QXFzjHybsKorpjj\r\ndd44QoCvYArl3nOgZr1im+XhBUmxu/nVBxE6VqBQS63sU0aCU2pAmZOMGBWP\r\nX8nUXtf+B+ZTXSVyH32/vhLJnn0qrYonbQSJsmXmkC/HUO0o7G3Vhnhb83Me\r\nOnNFOaRSQsJkBTfpLPb3bE7aGdLXwuaOC0jwgsn2NvlWL0l1ZDkR+NB9n6ux\r\nbVb+uc5dmmozMM5meMO0ctlFzMbdmYsvJHhibAYA1TDuPJT4QOMTXz0/VdRC\r\nQISVEwvSRibV+9zG2byBNx8gzJ2+8WRK/DCnXQpfvnYdGT1t9CYRTiQ6Y49o\r\n6h+8eJ2JzJKsslBZE4Z8fncbOAu8ThR7Td6owMCUGLq8HoWk+RyOmLEir3+G\r\nRCMAS276ckUO7fssLWXSVrqozhPZlMio89M=\r\n=zjQ6\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","readme":"# mongodb-connection-model [![][workflow_img]][workflow_url] [![][npm_img]][npm_url]\n\n> MongoDB connection model\n\nThe main purpose of the MongoDB connection model is to be a domain model around a MongoDB connection. It encapsulates generating a [Connection String URI](https://docs.mongodb.com/manual/reference/connection-string/) from a group of attributes and parses URI using the [MongoDB Node.JS Driver URI Parser](https://github.com/mongodb-js/mongodb-core/blob/master/lib/uri_parser.js).\n\n## Installation\n\n```\nnpm install --save mongodb-connection-model\n```\n\n## Usage\n\n### Building URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\nconst c = new Connection({ appname: 'My App Name' });\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://localhost:27017/?readPreference=primary&appname=My%20App&ssl=false'\n```\n\n### Parsing URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\n\nConnection.from(\n  'mongodb://someUsername:testPassword@localhost',\n  (error, result) => {\n    console.log(result);\n    >>> `{\n      hosts: [{ host: 'localhost', port: 27017 }],\n      hostname: 'localhost',\n      port: 27017,\n      auth: {\n        username: 'someUsername',\n        password: 'testPassword',\n        db: 'admin'\n      },\n      isSrvRecord: false,\n      authStrategy: 'MONGODB',\n      mongodbUsername: 'someUsername',\n      mongodbPassword: 'testPassword',\n      mongodbDatabaseName: 'admin',\n      extraOptions: {},\n      connectionType: 'NODE_DRIVER',\n      readPreference: 'primary',\n      kerberosCanonicalizeHostname: false,\n      sslMethod: 'NONE',\n      sshTunnel: 'NONE',\n      sshTunnelPort: 22\n    }`\n  }\n);\n```\n\n## Properties\n\nMongoDB connection model is based on Ampersand.js framework and consist of [props](https://ampersandjs.com/docs/#ampersand-state-props) and [derived props](https://ampersandjs.com/docs/#ampersand-state-derived). The props object describes the observable properties that MongoDB connection model gets from the Node.js Driver API.\n\n```javascript\nconst с = new Connection();\nconst props = с.getAttributes({ props: true });\n```\n\n#### See Also\n\n- [URI Generic Syntax](https://tools.ietf.org/html/rfc3986)\n- [URI Options Specification](https://github.com/mongodb/specifications/blob/master/source/uri-options/uri-options.rst)\n\n### General Properties\n\n```javascript\nconst c = new Connection({ isSrvRecord: true });\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ns` | String | A valid [ns][ns] the user can read from | `undefined` |\n| `isSrvRecord` | Boolean | Indicates SRV record | `false` |\n| `auth` | Object | Authentication from driver (username, user, db, password) | `undefined` |\n| `hostname` | String | Hostname of a MongoDB Instance. In case of the replica set the first host and port will be taken | `localhost` |\n| `port` | Number | TCP port of a MongoDB Instance | `27017` |\n| `hosts` | Array | Contains all hosts and ports for replica set | `[{ host: 'localhost', port: 27017 }]` |\n| `extraOptions` | Object | Extra options passed to the node driver as part of `driverOptions` | `{}` |\n| `connectionType` | String | The desired connection type. Possible values: `NODE_DRIVER`, `STITCH_ON_PREM`, `STITCH_ATLAS` | `NODE_DRIVER` |\n| `authStrategy` | String | The desired authentication strategy. Possible values: `NONE`, `MONGODB`, `X509`, `KERBEROS`, `LDAP`, `SCRAM-SHA-256` | `NONE` |\n\n### Connection string options\n\n```javascript\nconst c = new Connection({ appname: 'My App', replicaSet: 'testing' });\n```\n\n#### General connection string options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `replicaSet` | String | Specifies the name of the replica set, if the mongod is a member of a replica set | `undefined` |\n| `connectTimeoutMS` | Number | The time in milliseconds to attempt a connection before timing out | `undefined` |\n| `socketTimeoutMS` | Number | The time in milliseconds to attempt a send or receive on a socket before the attempt times out | `undefined` |\n| `compression` | Object | Object includes compressors and a compression level. The following compressors can be specified: `snappy`, `zlib` (Available in MongoDB 3.6 or greater) | `undefined` |\n\n#### Connection Pool Option\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `maxPoolSize` | Number | The maximum number of connections in the connection pool | `undefined` |\n| `minPoolSize` | Number | The minimum number of connections in the connection pool | `undefined` |\n| `maxIdleTimeMS` | Number | The maximum number of milliseconds that a connection can remain idle in the pool before being removed and closed | `undefined` |\n| `waitQueueMultiple` | Number | A number that the driver multiples the maxPoolSize value to, to provide the maximum number of threads allowed to wait for a connection to become available from the pool | `undefined` |\n| `waitQueueTimeoutMS` | Number | The maximum time in milliseconds that a thread can wait for a connection to become available | `undefined` |\n\n#### Write Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `w` | Number/String | Corresponds to the write concern [w Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-w) | `undefined` |\n| `wTimeoutMS` | Number | Corresponds to the write concern [wtimeout](https://docs.mongodb.com/manual/reference/write-concern/#wc-wtimeout) | `undefined` |\n| `journal` | Boolean | Corresponds to the write concern [j Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-j) | `undefined` |\n\n#### Read Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readConcernLevel` | String | The level of isolation | `undefined` |\n\n#### Read Preference Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readPreference` | String | Specifies the read preferences for this connection. Possible values: `PRIMARY`, `PRIMARY_PREFERRED`, `SECONDARY`, `SECONDARY_PREFERRED`, `NEAREST` | `PRIMARY` |\n| `maxStalenessSeconds` | Number | Specifies, in seconds, how stale a secondary can be before the client stops using it for read operations | `undefined` |\n| `readPreferenceTags` | Object | Default read preference tags for the client | `undefined` |\n\n#### Authentication Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `authSource` | String | Specify the database name associated with the user’s credentials | `undefined` |\n| `authMechanism` | String | Specifies the authentication mechanism that MongoDB will use to authenticate the connection. Possible values: `DEFAULT`, `GSSAPI`, `MONGODB-X509`, `PLAIN`, `SCRAM-SHA-256` | `undefined` |\n| `authMechanismProperties` | Object | Additional options provided for authentication (e.g. to enable hostname canonicalization for GSSAPI) | `undefined` |\n| `gssapiServiceName` | String | Set the Kerberos service name when connecting to Kerberized MongoDB instances | `undefined` |\n| `gssapiServiceRealm` | String | Set the Realm service name | `undefined` |\n| `gssapiCanonicalizeHostName` | Boolean | Whether canonicalized hostname | `undefined` |\n\n#### Server Selection and Discovery Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `localThresholdMS` | Number | The size (in milliseconds) of the latency window for selecting among multiple suitable MongoDB instances | `undefined` |\n| `serverSelectionTimeoutMS` | Number | Specifies how long (in milliseconds) to block for server selection before throwing an exception | `undefined` |\n| `serverSelectionTryOnce` | Boolean | Instructs the driver to scan the MongoDB deployment exactly once after server selection fails and then either select a server or raise an error | `undefined` |\n| `heartbeatFrequencyMS` | Number | Controls when the driver checks the state of the MongoDB deployment | `undefined` |\n\n#### Miscellaneous Configuration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `appname` | String | An application name passed to server as client metadata | `undefined` |\n| `retryWrites` | Boolean | Enable retryable writes | `undefined` |\n| `uuidRepresentation` | String | The legacy representation of UUID. Possible values: `standard`, `csharpLegacy`, `javaLegacy`, `pythonLegacy` | `undefined` |\n| `loadBalanced` | Boolean | Whether or not the server is running in load balanced mode | `undefined` |\n\n### Stitch attributes\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `stitchServiceName` | String | Stitch service name | `undefined` |\n| `stitchClientAppId` | String | Stitch сlient app ID | `undefined` |\n| `stitchGroupId` | String | Stitch group ID | `undefined` |\n| `stitchBaseUrl` | String | Stitch base Url | `undefined` |\n\n### MONGODB authentication\n\n```javascript\nconst c = new Connection({\n  mongodbUsername: 'arlo',\n  mongodbPassword: 'w@of'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/?slaveOk=true&authSource=admin'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `mongodbUsername` | String | MongoDB username | `undefined` |\n| `mongodbPassword` | String | MongoDB password | `undefined` |\n| `mongodbDatabaseName` | String | The database name associated with the user's credentials | `undefined` |\n| `promoteValues` | Boolean | Whether BSON values should be promoted to their JS type counterparts | `undefined` |\n\n### KERBEROS authentication\n\n```javascript\nconst c = new Connection({\n  kerberosServiceName: 'mongodb',\n  kerberosPrincipal: 'arlo/dog@krb5.mongodb.parts',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo%252Fdog%2540krb5.mongodb.parts@localhost:27017/toys?authMechanism=GSSAPI'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n> @note (imlucas): Kerberos on Windows is broken out as it's own state for UX consideration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `kerberosServiceName` | String | Any program or computer you access over a network | `undefined` |\n| `kerberosPrincipal` | String | The format of a typical Kerberos V5 principal is `primary/instance@REALM` | `undefined` |\n| `kerberosCanonicalizeHostname` | Boolean | Whether canonicalized kerberos hostname | `undefined` |\n\n#### See Also\n\n- [node.js driver Kerberos reference](http://bit.ly/mongodb-node-driver-kerberos)\n- [node.js driver Kerberos functional test][kerberos-functional]\n\n### LDAP authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  ldapUsername: 'arlo',\n  ldapPassword: 'w@of',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/toys?slaveOk=true&authMechanism=PLAIN'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ldapUsername` | String | LDAP username | `undefined` |\n| `ldapPassword` | String | LDAP password | `undefined` |\n\n#### See Also\n\n- [node.js driver LDAP reference](http://bit.ly/mongodb-node-driver-ldap)\n- [node.js driver X509 functional test][ldap-functional]\n\n### X509 authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  x509Username: 'CN=client,OU=arlo,O=MongoDB,L=Philadelphia,ST=Pennsylvania,C=US'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://CN%253Dclient%252COU%253Darlo%252CO%253DMongoDB%252CL%253DPhiladelphia%252CST%253DPennsylvania%252CC%253DUS@localhost:27017?slaveOk=true&authMechanism=MONGODB-X509'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `x509Username` | String | The x.509 certificate derived user name, e.g. `CN=user,OU=OrgUnit,O=myOrg,...` | `undefined` |\n\n#### See Also\n\n- [node.js driver X509 reference](http://bit.ly/mongodb-node-driver-x509)\n- [node.js driver X509 functional test][x509-functional]\n\n### SSL\n\n> **Note**: Not to be confused with `authentication=X509`\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ssl` | Number/String | A boolean to enable or disables TLS/SSL for the connection | `undefined` |\n| `sslMethod` | String | The desired ssl method. Possible values: `NONE`, `SYSTEMCA`, `IFAVAILABLE`, `UNVALIDATED`, `SERVER`, `ALL` | `NONE` |\n| `sslCA` | Buffer/String | Array of valid certificates | `undefined` |\n| `sslCert` | Buffer/String | The certificate | `undefined` |\n| `sslKey` | Buffer/String | The certificate private key | `undefined` |\n| `sslPass` | Buffer/String | The certificate password | `undefined` |\n\nDescription of `sslMethod` values:\n\n- `SYSTEMCA` - SSL required, validate using System CA, with host verification.\n- `IFAVAILABLE` - The driver should try SSL first, fall back to no SSL if unavailable, and use the system's Certificate Authority.\n- `SERVER` - The driver should validate the server certificate and fail to connect if validation fails. See also [node.js driver \"Validate Server Certificate\" docs][driver-ssl-server].\n- `ALL` - The driver must present a valid certificate and validate the server certificate. See also [node.js driver \"Validate Server Certificate and Present Valid Certificate\" docs][driver-ssl-all].\n- `NONE` - No SSL (Not recommended).\n- `UNVALIDATED` - Use SSL but do not perform any validation of the certificate chain. See also [node.js driver \"No Certificate Validation\" docs][driver-ssl-none]. **Very** not recommended and likely to be deprecated in future releases because it exposes potential Man-In-The-Middle attack vectors.\n\n#### See also\n\n- [node.js driver SSL implementation][driver-ssl-impl]\n- [node.js driver SSL tutorial][driver-ssl-tutorial]\n\n### SSH TUNNEL\n\n> New in mongodb-connection-model@5.0.0\n\nBecause [authentication](#authentication) is quite difficult for operators to migrate to, the most common method of securing a MongoDB deployment is to use an [SSH tunnel][sf-ssh-tunnel].  This allows operators to leverage their existing SSH security infrastructure to also provide secure access to MongoDB.  For a standard deployment of MongoDB on AWS, this is almost always to strategy.  Because of this, we now support creating SSH tunnels automatically when connecting to MongoDB.\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options, (connectionError, client) => {\n  if (connectionError) {\n    return console.log(connectionError);\n  }\n\n  client.db('mongodb').collection('fanclub').count((countingError, count) => {\n    console.log('counted:', countingError, count);\n    client.close();\n  });\n});\n```\n\nThe above provides the same functionality as creating the tunnel using the bash\ncommand below and connecting to MongoDB via another terminal. Notice that\nconnection-model uses a random local port each time it creates a tunnel.\nUsing the command line, you'd have to replace `<random port>` with an actual\nport number.\n\n```bash\nssh -i ~/.ssh/my-key-aws-pair.pem -L <random port>:localhost:27017 ubuntu@ec2-11-111-111-111.compute-1.amazonaws.com\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `sshTunnel` | String | The desired SSH tunnel strategy. Possible values: `NONE`, `USER_PASSWORD`, `IDENTITY_FILE` | `undefined` |\n| `sshTunnelHostname` | String | The hostname of the SSH remote host | `undefined` |\n| `sshTunnelPort` | Port | The SSH port of the remote host | `22` |\n| `sshTunnelBindToLocalPort` | Port | Bind the localhost endpoint of the SSH Tunnel to this port | `undefined` |\n| `sshTunnelUsername` | String | The optional SSH username for the remote host | `undefined` |\n| `sshTunnelPassword` | String | The optional SSH password for the remote host | `undefined` |\n| `sshTunnelIdentityFile` | String/Array | The optional path to the SSH identity file for the remote host | `undefined` |\n| `sshTunnelPassphrase` | String | The optional passphrase for `sshTunnelIdentityFile` | `undefined` |\n\nDescription of `sshTunnel` values:\n\n- `NONE` - Do not use SSH tunneling.\n- `USER_PASSWORD` - The tunnel is created with SSH username and password only.\n- `IDENTITY_FILE` - The tunnel is created using an identity file.\n\n## Derived Properties\n\nDerived properties (also known as computed properties) are properties of the state object that depend on other properties to determine their value.\n\n```javascript\nconst c = new Connection();\nconst derivedProps = c.getAttributes({ derived: true });\n```\n\n| Derived Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `instanceId` | String | The mongoscope | `localhost:27017` |\n| `driverAuthMechanism` | String | Converts the value of `authStrategy` for humans into the `authMechanism` value for the driver | `undefined` |\n| `safeUrl` | String | The URL where a password is replaced with stars | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrl` | String | Use this URL in order to connect via DataService | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrlWithSsh` | String | Use this URL in order to connect via connection model itself | `mongodb://localhost:29201/?readPreference=primary&ssl=false` |\n| `driverOptions` | String | The second argument `mongoscope-server` passes to `mongodb.connect` | `{}` |\n\n## Events\n\n> New in mongodb-connection-model@5.0.0\n\n#### Example: SSH Tunnel\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', skipped: true,\n  reason: 'The selected SSL mode does not need to load any files.' }\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', complete: true}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n#### Example: SSL\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  ssl: 'ALL',\n  sslCA: '~/.ssl/my-ca.pem',\n  sslCert: '~/.ssl/my-server.pem',\n  sslKey: '~/.ssl/my-server.pem'\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', complete: true}\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', skipped: true,\n  reason: 'The selected SSH Tunnel mode is NONE.'}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n[workflow_img]: https://github.com/mongodb-js/connection-model/workflows/Check%20and%20Test/badge.svg?event=push\n[workflow_url]: https://github.com/mongodb-js/connection-model/actions?query=workflow%3A%22Check+and+Test%22\n[npm_img]: https://img.shields.io/npm/v/mongodb-connection-model.svg?style=flat-square\n[npm_url]: https://www.npmjs.org/package/mongodb-connection-model\n[gitter_img]: https://badges.gitter.im/Join%20Chat.svg\n[gitter_url]: http://gitter.im/mongodb-js/mongodb-js\n[enterprise_img]: https://img.shields.io/badge/MongoDB-Enterprise-blue.svg?style=flat-square\n[coming_soon_img]: https://img.shields.io/badge/-Coming%20Soon-ff69b4.svg?style=flat-square\n[kerberos-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/kerberos_tests.js\n[ldap-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ldap_tests.js\n[x509-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ssl_x509_tests.js\n[ns]: https://github.com/mongodb-js/ns\n[sf-ssh-tunnel]: http://serverfault.com/questions/597765/how-to-connect-to-mongodb-server-via-ssh-tunnel\n[ec2-key-pairs]: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html\n[driver-ssl-impl]: https://github.com/christkv/mongodb-core/blob/c3d21cb636d74d7a68134ecd3b9f6af536311279/lib/connection/connection.js#L365-L407\n[driver-ssl-tutorial]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/\n[driver-ssl-none]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#no-certificate-validation\n[driver-ssl-server]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate\n[driver-ssl-all]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate-and-present-valid-certificate\n","gitHead":"91daa029e219b08cf0b775b6648d35867f2272d0","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","test":"mocha","check":"npm run lint && npm run depcheck","pretest":"mongodb-runner install && mongodb-runner start --port=27018","test-ci":"npm run test","depcheck":"depcheck","posttest":"mongodb-runner stop --port=27018","posttest-ci":"node ../../scripts/killall-mongo.js","test-check-ci":"npm run check && npm test"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.17.0+x64 (linux)","description":"MongoDB connection model.","directories":{},"_nodeVersion":"16.17.0","compass:main":"index.js","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","debug":"^4.2.0","lodash":"^4.17.15","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.2.0","storage-mixin":"0.0.0-next-91daa029e219b08cf0b775b6648d35867f2272d0","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.2","@mongodb-js/ssh-tunnel":"0.0.0-next-91daa029e219b08cf0b775b6648d35867f2272d0","@mongodb-js/compass-utils":"0.0.0-next-91daa029e219b08cf0b775b6648d35867f2272d0","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.5.4"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"^4.10.0","depcheck":"^1.4.1","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.9.0","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^4.10.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_0.0.0-next-91daa029e219b08cf0b775b6648d35867f2272d0_1668640353317_0.3601158946203007","host":"s3://npm-registry-packages"}},"0.0.0-next-7f1112246f97f222dc289edb7b9f0359d8f020cb":{"name":"mongodb-connection-model","version":"0.0.0-next-7f1112246f97f222dc289edb7b9f0359d8f020cb","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@0.0.0-next-7f1112246f97f222dc289edb7b9f0359d8f020cb","maintainers":[{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"iteng@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"cf4e65b5a12f4a63fa5818cf5a322536d565fd2e","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-0.0.0-next-7f1112246f97f222dc289edb7b9f0359d8f020cb.tgz","fileCount":20,"integrity":"sha512-7JaAl/GiLZLQLOY0i9uEj9NGYqUCvtt+oor7AvX3vaQ/YtrNttL0JiYmBxszESpGXozQdbX3gWvpL6XHibWE5w==","signatures":[{"sig":"MEUCIQDYkPSVfKoJT0lksFYRFsv2a4r0oFD89Qsp4fssSjftxwIgJ8N1/iTVHwm8t0L9uSaNfVKDzfe6UwMnG30iUqJM4vA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":108152,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjdaFjACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmokgQ//Q35vxtXO343qqNhE8XGcwdSVKYH4gOCRLkB15O5EwHvIXI6O\r\nSSN/rnmFRwfAhfi+NF2MSBqlH2/oHgNuy1m6+xc8e7HmcLK4VzkQKtd/DmwT\r\nbv9E60Uvo0DdgLO40WliqOqL6pHfZgbS5iFDoqYb9yHbrJnvoO7BZDT1DfFZ\r\nnilwjGr93yTM3rML6AzQ5eK2XRYMT65rAQ+EaHQhoI3c6HdNWHOtivjbLvZ/\r\nPxP9U2fsDrhOtUiuHNN7P5pGsjLunnzjjq1S3hX19awrAQFm0EFVrRARDqa6\r\n+cukZRLziP/kpbjAbRPCEnZHCFy2/O75a51hzdTLtFxn8NvQc+SMLj5NKPFL\r\nBti1xnWNMvUdjLN15Sm2OptPHbg3qFAqhrGWesqi82qf0gD+Z9Qn733G5+q+\r\nv5hi+z70ow55Usqqdirpp2KHG5CI1fArz79bhSVFJ1xTtql4DVgBKpOrWrq9\r\nY1kaECqN+xdunWjXEpGnY29Nn/31gD22wklRVyHayt/OWeBzVGZVreM1QauX\r\n6jR3mYjjJ49YuyEgp65EfHYtLjIuv5Wawe6ADFMMnUa4VcJaP7osFBlmqK7H\r\nqxu4M04sDi7zVXkBUOGWFsT2ddAt9IV0rCm2xzKXXjwQM+j4vlQuJCiCxeZh\r\nK6TeclXQcqPPedcuhyW7q5eBVh/jRD0al6s=\r\n=3olL\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","readme":"# mongodb-connection-model [![][workflow_img]][workflow_url] [![][npm_img]][npm_url]\n\n> MongoDB connection model\n\nThe main purpose of the MongoDB connection model is to be a domain model around a MongoDB connection. It encapsulates generating a [Connection String URI](https://docs.mongodb.com/manual/reference/connection-string/) from a group of attributes and parses URI using the [MongoDB Node.JS Driver URI Parser](https://github.com/mongodb-js/mongodb-core/blob/master/lib/uri_parser.js).\n\n## Installation\n\n```\nnpm install --save mongodb-connection-model\n```\n\n## Usage\n\n### Building URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\nconst c = new Connection({ appname: 'My App Name' });\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://localhost:27017/?readPreference=primary&appname=My%20App&ssl=false'\n```\n\n### Parsing URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\n\nConnection.from(\n  'mongodb://someUsername:testPassword@localhost',\n  (error, result) => {\n    console.log(result);\n    >>> `{\n      hosts: [{ host: 'localhost', port: 27017 }],\n      hostname: 'localhost',\n      port: 27017,\n      auth: {\n        username: 'someUsername',\n        password: 'testPassword',\n        db: 'admin'\n      },\n      isSrvRecord: false,\n      authStrategy: 'MONGODB',\n      mongodbUsername: 'someUsername',\n      mongodbPassword: 'testPassword',\n      mongodbDatabaseName: 'admin',\n      extraOptions: {},\n      connectionType: 'NODE_DRIVER',\n      readPreference: 'primary',\n      kerberosCanonicalizeHostname: false,\n      sslMethod: 'NONE',\n      sshTunnel: 'NONE',\n      sshTunnelPort: 22\n    }`\n  }\n);\n```\n\n## Properties\n\nMongoDB connection model is based on Ampersand.js framework and consist of [props](https://ampersandjs.com/docs/#ampersand-state-props) and [derived props](https://ampersandjs.com/docs/#ampersand-state-derived). The props object describes the observable properties that MongoDB connection model gets from the Node.js Driver API.\n\n```javascript\nconst с = new Connection();\nconst props = с.getAttributes({ props: true });\n```\n\n#### See Also\n\n- [URI Generic Syntax](https://tools.ietf.org/html/rfc3986)\n- [URI Options Specification](https://github.com/mongodb/specifications/blob/master/source/uri-options/uri-options.rst)\n\n### General Properties\n\n```javascript\nconst c = new Connection({ isSrvRecord: true });\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ns` | String | A valid [ns][ns] the user can read from | `undefined` |\n| `isSrvRecord` | Boolean | Indicates SRV record | `false` |\n| `auth` | Object | Authentication from driver (username, user, db, password) | `undefined` |\n| `hostname` | String | Hostname of a MongoDB Instance. In case of the replica set the first host and port will be taken | `localhost` |\n| `port` | Number | TCP port of a MongoDB Instance | `27017` |\n| `hosts` | Array | Contains all hosts and ports for replica set | `[{ host: 'localhost', port: 27017 }]` |\n| `extraOptions` | Object | Extra options passed to the node driver as part of `driverOptions` | `{}` |\n| `connectionType` | String | The desired connection type. Possible values: `NODE_DRIVER`, `STITCH_ON_PREM`, `STITCH_ATLAS` | `NODE_DRIVER` |\n| `authStrategy` | String | The desired authentication strategy. Possible values: `NONE`, `MONGODB`, `X509`, `KERBEROS`, `LDAP`, `SCRAM-SHA-256` | `NONE` |\n\n### Connection string options\n\n```javascript\nconst c = new Connection({ appname: 'My App', replicaSet: 'testing' });\n```\n\n#### General connection string options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `replicaSet` | String | Specifies the name of the replica set, if the mongod is a member of a replica set | `undefined` |\n| `connectTimeoutMS` | Number | The time in milliseconds to attempt a connection before timing out | `undefined` |\n| `socketTimeoutMS` | Number | The time in milliseconds to attempt a send or receive on a socket before the attempt times out | `undefined` |\n| `compression` | Object | Object includes compressors and a compression level. The following compressors can be specified: `snappy`, `zlib` (Available in MongoDB 3.6 or greater) | `undefined` |\n\n#### Connection Pool Option\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `maxPoolSize` | Number | The maximum number of connections in the connection pool | `undefined` |\n| `minPoolSize` | Number | The minimum number of connections in the connection pool | `undefined` |\n| `maxIdleTimeMS` | Number | The maximum number of milliseconds that a connection can remain idle in the pool before being removed and closed | `undefined` |\n| `waitQueueMultiple` | Number | A number that the driver multiples the maxPoolSize value to, to provide the maximum number of threads allowed to wait for a connection to become available from the pool | `undefined` |\n| `waitQueueTimeoutMS` | Number | The maximum time in milliseconds that a thread can wait for a connection to become available | `undefined` |\n\n#### Write Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `w` | Number/String | Corresponds to the write concern [w Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-w) | `undefined` |\n| `wTimeoutMS` | Number | Corresponds to the write concern [wtimeout](https://docs.mongodb.com/manual/reference/write-concern/#wc-wtimeout) | `undefined` |\n| `journal` | Boolean | Corresponds to the write concern [j Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-j) | `undefined` |\n\n#### Read Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readConcernLevel` | String | The level of isolation | `undefined` |\n\n#### Read Preference Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readPreference` | String | Specifies the read preferences for this connection. Possible values: `PRIMARY`, `PRIMARY_PREFERRED`, `SECONDARY`, `SECONDARY_PREFERRED`, `NEAREST` | `PRIMARY` |\n| `maxStalenessSeconds` | Number | Specifies, in seconds, how stale a secondary can be before the client stops using it for read operations | `undefined` |\n| `readPreferenceTags` | Object | Default read preference tags for the client | `undefined` |\n\n#### Authentication Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `authSource` | String | Specify the database name associated with the user’s credentials | `undefined` |\n| `authMechanism` | String | Specifies the authentication mechanism that MongoDB will use to authenticate the connection. Possible values: `DEFAULT`, `GSSAPI`, `MONGODB-X509`, `PLAIN`, `SCRAM-SHA-256` | `undefined` |\n| `authMechanismProperties` | Object | Additional options provided for authentication (e.g. to enable hostname canonicalization for GSSAPI) | `undefined` |\n| `gssapiServiceName` | String | Set the Kerberos service name when connecting to Kerberized MongoDB instances | `undefined` |\n| `gssapiServiceRealm` | String | Set the Realm service name | `undefined` |\n| `gssapiCanonicalizeHostName` | Boolean | Whether canonicalized hostname | `undefined` |\n\n#### Server Selection and Discovery Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `localThresholdMS` | Number | The size (in milliseconds) of the latency window for selecting among multiple suitable MongoDB instances | `undefined` |\n| `serverSelectionTimeoutMS` | Number | Specifies how long (in milliseconds) to block for server selection before throwing an exception | `undefined` |\n| `serverSelectionTryOnce` | Boolean | Instructs the driver to scan the MongoDB deployment exactly once after server selection fails and then either select a server or raise an error | `undefined` |\n| `heartbeatFrequencyMS` | Number | Controls when the driver checks the state of the MongoDB deployment | `undefined` |\n\n#### Miscellaneous Configuration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `appname` | String | An application name passed to server as client metadata | `undefined` |\n| `retryWrites` | Boolean | Enable retryable writes | `undefined` |\n| `uuidRepresentation` | String | The legacy representation of UUID. Possible values: `standard`, `csharpLegacy`, `javaLegacy`, `pythonLegacy` | `undefined` |\n| `loadBalanced` | Boolean | Whether or not the server is running in load balanced mode | `undefined` |\n\n### Stitch attributes\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `stitchServiceName` | String | Stitch service name | `undefined` |\n| `stitchClientAppId` | String | Stitch сlient app ID | `undefined` |\n| `stitchGroupId` | String | Stitch group ID | `undefined` |\n| `stitchBaseUrl` | String | Stitch base Url | `undefined` |\n\n### MONGODB authentication\n\n```javascript\nconst c = new Connection({\n  mongodbUsername: 'arlo',\n  mongodbPassword: 'w@of'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/?slaveOk=true&authSource=admin'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `mongodbUsername` | String | MongoDB username | `undefined` |\n| `mongodbPassword` | String | MongoDB password | `undefined` |\n| `mongodbDatabaseName` | String | The database name associated with the user's credentials | `undefined` |\n| `promoteValues` | Boolean | Whether BSON values should be promoted to their JS type counterparts | `undefined` |\n\n### KERBEROS authentication\n\n```javascript\nconst c = new Connection({\n  kerberosServiceName: 'mongodb',\n  kerberosPrincipal: 'arlo/dog@krb5.mongodb.parts',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo%252Fdog%2540krb5.mongodb.parts@localhost:27017/toys?authMechanism=GSSAPI'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n> @note (imlucas): Kerberos on Windows is broken out as it's own state for UX consideration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `kerberosServiceName` | String | Any program or computer you access over a network | `undefined` |\n| `kerberosPrincipal` | String | The format of a typical Kerberos V5 principal is `primary/instance@REALM` | `undefined` |\n| `kerberosCanonicalizeHostname` | Boolean | Whether canonicalized kerberos hostname | `undefined` |\n\n#### See Also\n\n- [node.js driver Kerberos reference](http://bit.ly/mongodb-node-driver-kerberos)\n- [node.js driver Kerberos functional test][kerberos-functional]\n\n### LDAP authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  ldapUsername: 'arlo',\n  ldapPassword: 'w@of',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/toys?slaveOk=true&authMechanism=PLAIN'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ldapUsername` | String | LDAP username | `undefined` |\n| `ldapPassword` | String | LDAP password | `undefined` |\n\n#### See Also\n\n- [node.js driver LDAP reference](http://bit.ly/mongodb-node-driver-ldap)\n- [node.js driver X509 functional test][ldap-functional]\n\n### X509 authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  x509Username: 'CN=client,OU=arlo,O=MongoDB,L=Philadelphia,ST=Pennsylvania,C=US'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://CN%253Dclient%252COU%253Darlo%252CO%253DMongoDB%252CL%253DPhiladelphia%252CST%253DPennsylvania%252CC%253DUS@localhost:27017?slaveOk=true&authMechanism=MONGODB-X509'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `x509Username` | String | The x.509 certificate derived user name, e.g. `CN=user,OU=OrgUnit,O=myOrg,...` | `undefined` |\n\n#### See Also\n\n- [node.js driver X509 reference](http://bit.ly/mongodb-node-driver-x509)\n- [node.js driver X509 functional test][x509-functional]\n\n### SSL\n\n> **Note**: Not to be confused with `authentication=X509`\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ssl` | Number/String | A boolean to enable or disables TLS/SSL for the connection | `undefined` |\n| `sslMethod` | String | The desired ssl method. Possible values: `NONE`, `SYSTEMCA`, `IFAVAILABLE`, `UNVALIDATED`, `SERVER`, `ALL` | `NONE` |\n| `sslCA` | Buffer/String | Array of valid certificates | `undefined` |\n| `sslCert` | Buffer/String | The certificate | `undefined` |\n| `sslKey` | Buffer/String | The certificate private key | `undefined` |\n| `sslPass` | Buffer/String | The certificate password | `undefined` |\n\nDescription of `sslMethod` values:\n\n- `SYSTEMCA` - SSL required, validate using System CA, with host verification.\n- `IFAVAILABLE` - The driver should try SSL first, fall back to no SSL if unavailable, and use the system's Certificate Authority.\n- `SERVER` - The driver should validate the server certificate and fail to connect if validation fails. See also [node.js driver \"Validate Server Certificate\" docs][driver-ssl-server].\n- `ALL` - The driver must present a valid certificate and validate the server certificate. See also [node.js driver \"Validate Server Certificate and Present Valid Certificate\" docs][driver-ssl-all].\n- `NONE` - No SSL (Not recommended).\n- `UNVALIDATED` - Use SSL but do not perform any validation of the certificate chain. See also [node.js driver \"No Certificate Validation\" docs][driver-ssl-none]. **Very** not recommended and likely to be deprecated in future releases because it exposes potential Man-In-The-Middle attack vectors.\n\n#### See also\n\n- [node.js driver SSL implementation][driver-ssl-impl]\n- [node.js driver SSL tutorial][driver-ssl-tutorial]\n\n### SSH TUNNEL\n\n> New in mongodb-connection-model@5.0.0\n\nBecause [authentication](#authentication) is quite difficult for operators to migrate to, the most common method of securing a MongoDB deployment is to use an [SSH tunnel][sf-ssh-tunnel].  This allows operators to leverage their existing SSH security infrastructure to also provide secure access to MongoDB.  For a standard deployment of MongoDB on AWS, this is almost always to strategy.  Because of this, we now support creating SSH tunnels automatically when connecting to MongoDB.\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options, (connectionError, client) => {\n  if (connectionError) {\n    return console.log(connectionError);\n  }\n\n  client.db('mongodb').collection('fanclub').count((countingError, count) => {\n    console.log('counted:', countingError, count);\n    client.close();\n  });\n});\n```\n\nThe above provides the same functionality as creating the tunnel using the bash\ncommand below and connecting to MongoDB via another terminal. Notice that\nconnection-model uses a random local port each time it creates a tunnel.\nUsing the command line, you'd have to replace `<random port>` with an actual\nport number.\n\n```bash\nssh -i ~/.ssh/my-key-aws-pair.pem -L <random port>:localhost:27017 ubuntu@ec2-11-111-111-111.compute-1.amazonaws.com\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `sshTunnel` | String | The desired SSH tunnel strategy. Possible values: `NONE`, `USER_PASSWORD`, `IDENTITY_FILE` | `undefined` |\n| `sshTunnelHostname` | String | The hostname of the SSH remote host | `undefined` |\n| `sshTunnelPort` | Port | The SSH port of the remote host | `22` |\n| `sshTunnelBindToLocalPort` | Port | Bind the localhost endpoint of the SSH Tunnel to this port | `undefined` |\n| `sshTunnelUsername` | String | The optional SSH username for the remote host | `undefined` |\n| `sshTunnelPassword` | String | The optional SSH password for the remote host | `undefined` |\n| `sshTunnelIdentityFile` | String/Array | The optional path to the SSH identity file for the remote host | `undefined` |\n| `sshTunnelPassphrase` | String | The optional passphrase for `sshTunnelIdentityFile` | `undefined` |\n\nDescription of `sshTunnel` values:\n\n- `NONE` - Do not use SSH tunneling.\n- `USER_PASSWORD` - The tunnel is created with SSH username and password only.\n- `IDENTITY_FILE` - The tunnel is created using an identity file.\n\n## Derived Properties\n\nDerived properties (also known as computed properties) are properties of the state object that depend on other properties to determine their value.\n\n```javascript\nconst c = new Connection();\nconst derivedProps = c.getAttributes({ derived: true });\n```\n\n| Derived Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `instanceId` | String | The mongoscope | `localhost:27017` |\n| `driverAuthMechanism` | String | Converts the value of `authStrategy` for humans into the `authMechanism` value for the driver | `undefined` |\n| `safeUrl` | String | The URL where a password is replaced with stars | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrl` | String | Use this URL in order to connect via DataService | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrlWithSsh` | String | Use this URL in order to connect via connection model itself | `mongodb://localhost:29201/?readPreference=primary&ssl=false` |\n| `driverOptions` | String | The second argument `mongoscope-server` passes to `mongodb.connect` | `{}` |\n\n## Events\n\n> New in mongodb-connection-model@5.0.0\n\n#### Example: SSH Tunnel\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', skipped: true,\n  reason: 'The selected SSL mode does not need to load any files.' }\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', complete: true}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n#### Example: SSL\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  ssl: 'ALL',\n  sslCA: '~/.ssl/my-ca.pem',\n  sslCert: '~/.ssl/my-server.pem',\n  sslKey: '~/.ssl/my-server.pem'\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', complete: true}\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', skipped: true,\n  reason: 'The selected SSH Tunnel mode is NONE.'}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n[workflow_img]: https://github.com/mongodb-js/connection-model/workflows/Check%20and%20Test/badge.svg?event=push\n[workflow_url]: https://github.com/mongodb-js/connection-model/actions?query=workflow%3A%22Check+and+Test%22\n[npm_img]: https://img.shields.io/npm/v/mongodb-connection-model.svg?style=flat-square\n[npm_url]: https://www.npmjs.org/package/mongodb-connection-model\n[gitter_img]: https://badges.gitter.im/Join%20Chat.svg\n[gitter_url]: http://gitter.im/mongodb-js/mongodb-js\n[enterprise_img]: https://img.shields.io/badge/MongoDB-Enterprise-blue.svg?style=flat-square\n[coming_soon_img]: https://img.shields.io/badge/-Coming%20Soon-ff69b4.svg?style=flat-square\n[kerberos-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/kerberos_tests.js\n[ldap-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ldap_tests.js\n[x509-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ssl_x509_tests.js\n[ns]: https://github.com/mongodb-js/ns\n[sf-ssh-tunnel]: http://serverfault.com/questions/597765/how-to-connect-to-mongodb-server-via-ssh-tunnel\n[ec2-key-pairs]: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html\n[driver-ssl-impl]: https://github.com/christkv/mongodb-core/blob/c3d21cb636d74d7a68134ecd3b9f6af536311279/lib/connection/connection.js#L365-L407\n[driver-ssl-tutorial]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/\n[driver-ssl-none]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#no-certificate-validation\n[driver-ssl-server]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate\n[driver-ssl-all]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate-and-present-valid-certificate\n","gitHead":"7f1112246f97f222dc289edb7b9f0359d8f020cb","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","test":"mocha","check":"npm run lint && npm run depcheck","pretest":"mongodb-runner install && mongodb-runner start --port=27018","test-ci":"npm run test","depcheck":"depcheck","posttest":"mongodb-runner stop --port=27018","posttest-ci":"node ../../scripts/killall-mongo.js","test-check-ci":"npm run check && npm test"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.17.0+x64 (linux)","description":"MongoDB connection model.","directories":{},"_nodeVersion":"16.17.0","compass:main":"index.js","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","debug":"^4.2.0","lodash":"^4.17.15","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.2.0","storage-mixin":"0.0.0-next-7f1112246f97f222dc289edb7b9f0359d8f020cb","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.2","@mongodb-js/ssh-tunnel":"0.0.0-next-7f1112246f97f222dc289edb7b9f0359d8f020cb","@mongodb-js/compass-utils":"0.0.0-next-7f1112246f97f222dc289edb7b9f0359d8f020cb","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.5.4"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"^4.10.0","depcheck":"^1.4.1","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.9.0","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^4.10.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_0.0.0-next-7f1112246f97f222dc289edb7b9f0359d8f020cb_1668653411533_0.5094000431841816","host":"s3://npm-registry-packages"}},"0.0.0-next-c12720c09369b6620405de027fa85d469db43e9c":{"name":"mongodb-connection-model","version":"0.0.0-next-c12720c09369b6620405de027fa85d469db43e9c","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@0.0.0-next-c12720c09369b6620405de027fa85d469db43e9c","maintainers":[{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"iteng@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"9b7529fd4921998e115a8d238e5576517dd04296","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-0.0.0-next-c12720c09369b6620405de027fa85d469db43e9c.tgz","fileCount":20,"integrity":"sha512-uO6ix4TgjhMVeByoV8joqinCtr8ByunXFZktinKeDm1DThFzTn1ZTNwkYdYbds1vJwD6XTXwl3lbJWgwnNJbmg==","signatures":[{"sig":"MEUCIE5gtvvu8mtbkcFU8AGQ01jrtq9rJSHYSFQoYWbjaUevAiEAqqZuo5/9Ip2UyMwgh3uDLlCECYmYYMaNMd2GJVClqj4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":108152,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjdxE+ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpFAQ//aTA95Zr0iftHWCNsQzwrvJ1/2dXqQMgwdiNCYHpnSbxvuEmL\r\n7OOLR1fCaKthNcPc+1MDSE8wLnE4Tz81cGPpOuUrpxVzYuABP/h/SMATvL5z\r\n4HoN/r6xKolcNyOyGVMtEzC4Bd7sAomuhpAFLu2BB7KPA9GBI+lIJ5OxIKUn\r\n4CwRN2sgurdPU5EuX57eDwjvWdzdvdQcuLjvkP7E6kblM0WeIfIZqeemG1Vn\r\nNjdPlzNhE9sm+OI2cPWZPj6vDaAx73NLvltPtUy3Xi20ikGl8PhmbyiQKPQG\r\nXEplDRhwA0PNx3NDus+12wsixfRUppgRjlrXBmhmApw6DPGMrKjHmZ++H0T4\r\nwNkZg3fv+TxAyyoAzuB7GneLtgdrIZBC//B53TaKt5/dk+ZTWtDhoxV53eGh\r\nohyjYNpm82V40E2t8ptd2MB6fTZboKiKaAg015cCYRC/SYRNUqFoqF6jCSN6\r\niai2zB+Z6znUe7x/jwz4tV+J94Vyvl7Dob3zRSnXzfYAXSPnvXe75KBR+iIg\r\nfsWLWswvQL64nvCQzSp2MdmGwJe/U9dkJH9fGAhqEmlJW8Zbjk6MnwHH//kL\r\n9uDkxeL12m1ui8iAIGszmYl21FLdWH8IWskkW+XfM+cg7u/iVaCI0DiaxJ6k\r\nrfYd2AIgzC2rpYo0J+s4tX0NqsraR0QhYY8=\r\n=oe+F\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","readme":"# mongodb-connection-model [![][workflow_img]][workflow_url] [![][npm_img]][npm_url]\n\n> MongoDB connection model\n\nThe main purpose of the MongoDB connection model is to be a domain model around a MongoDB connection. It encapsulates generating a [Connection String URI](https://docs.mongodb.com/manual/reference/connection-string/) from a group of attributes and parses URI using the [MongoDB Node.JS Driver URI Parser](https://github.com/mongodb-js/mongodb-core/blob/master/lib/uri_parser.js).\n\n## Installation\n\n```\nnpm install --save mongodb-connection-model\n```\n\n## Usage\n\n### Building URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\nconst c = new Connection({ appname: 'My App Name' });\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://localhost:27017/?readPreference=primary&appname=My%20App&ssl=false'\n```\n\n### Parsing URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\n\nConnection.from(\n  'mongodb://someUsername:testPassword@localhost',\n  (error, result) => {\n    console.log(result);\n    >>> `{\n      hosts: [{ host: 'localhost', port: 27017 }],\n      hostname: 'localhost',\n      port: 27017,\n      auth: {\n        username: 'someUsername',\n        password: 'testPassword',\n        db: 'admin'\n      },\n      isSrvRecord: false,\n      authStrategy: 'MONGODB',\n      mongodbUsername: 'someUsername',\n      mongodbPassword: 'testPassword',\n      mongodbDatabaseName: 'admin',\n      extraOptions: {},\n      connectionType: 'NODE_DRIVER',\n      readPreference: 'primary',\n      kerberosCanonicalizeHostname: false,\n      sslMethod: 'NONE',\n      sshTunnel: 'NONE',\n      sshTunnelPort: 22\n    }`\n  }\n);\n```\n\n## Properties\n\nMongoDB connection model is based on Ampersand.js framework and consist of [props](https://ampersandjs.com/docs/#ampersand-state-props) and [derived props](https://ampersandjs.com/docs/#ampersand-state-derived). The props object describes the observable properties that MongoDB connection model gets from the Node.js Driver API.\n\n```javascript\nconst с = new Connection();\nconst props = с.getAttributes({ props: true });\n```\n\n#### See Also\n\n- [URI Generic Syntax](https://tools.ietf.org/html/rfc3986)\n- [URI Options Specification](https://github.com/mongodb/specifications/blob/master/source/uri-options/uri-options.rst)\n\n### General Properties\n\n```javascript\nconst c = new Connection({ isSrvRecord: true });\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ns` | String | A valid [ns][ns] the user can read from | `undefined` |\n| `isSrvRecord` | Boolean | Indicates SRV record | `false` |\n| `auth` | Object | Authentication from driver (username, user, db, password) | `undefined` |\n| `hostname` | String | Hostname of a MongoDB Instance. In case of the replica set the first host and port will be taken | `localhost` |\n| `port` | Number | TCP port of a MongoDB Instance | `27017` |\n| `hosts` | Array | Contains all hosts and ports for replica set | `[{ host: 'localhost', port: 27017 }]` |\n| `extraOptions` | Object | Extra options passed to the node driver as part of `driverOptions` | `{}` |\n| `connectionType` | String | The desired connection type. Possible values: `NODE_DRIVER`, `STITCH_ON_PREM`, `STITCH_ATLAS` | `NODE_DRIVER` |\n| `authStrategy` | String | The desired authentication strategy. Possible values: `NONE`, `MONGODB`, `X509`, `KERBEROS`, `LDAP`, `SCRAM-SHA-256` | `NONE` |\n\n### Connection string options\n\n```javascript\nconst c = new Connection({ appname: 'My App', replicaSet: 'testing' });\n```\n\n#### General connection string options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `replicaSet` | String | Specifies the name of the replica set, if the mongod is a member of a replica set | `undefined` |\n| `connectTimeoutMS` | Number | The time in milliseconds to attempt a connection before timing out | `undefined` |\n| `socketTimeoutMS` | Number | The time in milliseconds to attempt a send or receive on a socket before the attempt times out | `undefined` |\n| `compression` | Object | Object includes compressors and a compression level. The following compressors can be specified: `snappy`, `zlib` (Available in MongoDB 3.6 or greater) | `undefined` |\n\n#### Connection Pool Option\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `maxPoolSize` | Number | The maximum number of connections in the connection pool | `undefined` |\n| `minPoolSize` | Number | The minimum number of connections in the connection pool | `undefined` |\n| `maxIdleTimeMS` | Number | The maximum number of milliseconds that a connection can remain idle in the pool before being removed and closed | `undefined` |\n| `waitQueueMultiple` | Number | A number that the driver multiples the maxPoolSize value to, to provide the maximum number of threads allowed to wait for a connection to become available from the pool | `undefined` |\n| `waitQueueTimeoutMS` | Number | The maximum time in milliseconds that a thread can wait for a connection to become available | `undefined` |\n\n#### Write Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `w` | Number/String | Corresponds to the write concern [w Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-w) | `undefined` |\n| `wTimeoutMS` | Number | Corresponds to the write concern [wtimeout](https://docs.mongodb.com/manual/reference/write-concern/#wc-wtimeout) | `undefined` |\n| `journal` | Boolean | Corresponds to the write concern [j Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-j) | `undefined` |\n\n#### Read Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readConcernLevel` | String | The level of isolation | `undefined` |\n\n#### Read Preference Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readPreference` | String | Specifies the read preferences for this connection. Possible values: `PRIMARY`, `PRIMARY_PREFERRED`, `SECONDARY`, `SECONDARY_PREFERRED`, `NEAREST` | `PRIMARY` |\n| `maxStalenessSeconds` | Number | Specifies, in seconds, how stale a secondary can be before the client stops using it for read operations | `undefined` |\n| `readPreferenceTags` | Object | Default read preference tags for the client | `undefined` |\n\n#### Authentication Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `authSource` | String | Specify the database name associated with the user’s credentials | `undefined` |\n| `authMechanism` | String | Specifies the authentication mechanism that MongoDB will use to authenticate the connection. Possible values: `DEFAULT`, `GSSAPI`, `MONGODB-X509`, `PLAIN`, `SCRAM-SHA-256` | `undefined` |\n| `authMechanismProperties` | Object | Additional options provided for authentication (e.g. to enable hostname canonicalization for GSSAPI) | `undefined` |\n| `gssapiServiceName` | String | Set the Kerberos service name when connecting to Kerberized MongoDB instances | `undefined` |\n| `gssapiServiceRealm` | String | Set the Realm service name | `undefined` |\n| `gssapiCanonicalizeHostName` | Boolean | Whether canonicalized hostname | `undefined` |\n\n#### Server Selection and Discovery Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `localThresholdMS` | Number | The size (in milliseconds) of the latency window for selecting among multiple suitable MongoDB instances | `undefined` |\n| `serverSelectionTimeoutMS` | Number | Specifies how long (in milliseconds) to block for server selection before throwing an exception | `undefined` |\n| `serverSelectionTryOnce` | Boolean | Instructs the driver to scan the MongoDB deployment exactly once after server selection fails and then either select a server or raise an error | `undefined` |\n| `heartbeatFrequencyMS` | Number | Controls when the driver checks the state of the MongoDB deployment | `undefined` |\n\n#### Miscellaneous Configuration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `appname` | String | An application name passed to server as client metadata | `undefined` |\n| `retryWrites` | Boolean | Enable retryable writes | `undefined` |\n| `uuidRepresentation` | String | The legacy representation of UUID. Possible values: `standard`, `csharpLegacy`, `javaLegacy`, `pythonLegacy` | `undefined` |\n| `loadBalanced` | Boolean | Whether or not the server is running in load balanced mode | `undefined` |\n\n### Stitch attributes\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `stitchServiceName` | String | Stitch service name | `undefined` |\n| `stitchClientAppId` | String | Stitch сlient app ID | `undefined` |\n| `stitchGroupId` | String | Stitch group ID | `undefined` |\n| `stitchBaseUrl` | String | Stitch base Url | `undefined` |\n\n### MONGODB authentication\n\n```javascript\nconst c = new Connection({\n  mongodbUsername: 'arlo',\n  mongodbPassword: 'w@of'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/?slaveOk=true&authSource=admin'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `mongodbUsername` | String | MongoDB username | `undefined` |\n| `mongodbPassword` | String | MongoDB password | `undefined` |\n| `mongodbDatabaseName` | String | The database name associated with the user's credentials | `undefined` |\n| `promoteValues` | Boolean | Whether BSON values should be promoted to their JS type counterparts | `undefined` |\n\n### KERBEROS authentication\n\n```javascript\nconst c = new Connection({\n  kerberosServiceName: 'mongodb',\n  kerberosPrincipal: 'arlo/dog@krb5.mongodb.parts',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo%252Fdog%2540krb5.mongodb.parts@localhost:27017/toys?authMechanism=GSSAPI'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n> @note (imlucas): Kerberos on Windows is broken out as it's own state for UX consideration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `kerberosServiceName` | String | Any program or computer you access over a network | `undefined` |\n| `kerberosPrincipal` | String | The format of a typical Kerberos V5 principal is `primary/instance@REALM` | `undefined` |\n| `kerberosCanonicalizeHostname` | Boolean | Whether canonicalized kerberos hostname | `undefined` |\n\n#### See Also\n\n- [node.js driver Kerberos reference](http://bit.ly/mongodb-node-driver-kerberos)\n- [node.js driver Kerberos functional test][kerberos-functional]\n\n### LDAP authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  ldapUsername: 'arlo',\n  ldapPassword: 'w@of',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/toys?slaveOk=true&authMechanism=PLAIN'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ldapUsername` | String | LDAP username | `undefined` |\n| `ldapPassword` | String | LDAP password | `undefined` |\n\n#### See Also\n\n- [node.js driver LDAP reference](http://bit.ly/mongodb-node-driver-ldap)\n- [node.js driver X509 functional test][ldap-functional]\n\n### X509 authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  x509Username: 'CN=client,OU=arlo,O=MongoDB,L=Philadelphia,ST=Pennsylvania,C=US'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://CN%253Dclient%252COU%253Darlo%252CO%253DMongoDB%252CL%253DPhiladelphia%252CST%253DPennsylvania%252CC%253DUS@localhost:27017?slaveOk=true&authMechanism=MONGODB-X509'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `x509Username` | String | The x.509 certificate derived user name, e.g. `CN=user,OU=OrgUnit,O=myOrg,...` | `undefined` |\n\n#### See Also\n\n- [node.js driver X509 reference](http://bit.ly/mongodb-node-driver-x509)\n- [node.js driver X509 functional test][x509-functional]\n\n### SSL\n\n> **Note**: Not to be confused with `authentication=X509`\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ssl` | Number/String | A boolean to enable or disables TLS/SSL for the connection | `undefined` |\n| `sslMethod` | String | The desired ssl method. Possible values: `NONE`, `SYSTEMCA`, `IFAVAILABLE`, `UNVALIDATED`, `SERVER`, `ALL` | `NONE` |\n| `sslCA` | Buffer/String | Array of valid certificates | `undefined` |\n| `sslCert` | Buffer/String | The certificate | `undefined` |\n| `sslKey` | Buffer/String | The certificate private key | `undefined` |\n| `sslPass` | Buffer/String | The certificate password | `undefined` |\n\nDescription of `sslMethod` values:\n\n- `SYSTEMCA` - SSL required, validate using System CA, with host verification.\n- `IFAVAILABLE` - The driver should try SSL first, fall back to no SSL if unavailable, and use the system's Certificate Authority.\n- `SERVER` - The driver should validate the server certificate and fail to connect if validation fails. See also [node.js driver \"Validate Server Certificate\" docs][driver-ssl-server].\n- `ALL` - The driver must present a valid certificate and validate the server certificate. See also [node.js driver \"Validate Server Certificate and Present Valid Certificate\" docs][driver-ssl-all].\n- `NONE` - No SSL (Not recommended).\n- `UNVALIDATED` - Use SSL but do not perform any validation of the certificate chain. See also [node.js driver \"No Certificate Validation\" docs][driver-ssl-none]. **Very** not recommended and likely to be deprecated in future releases because it exposes potential Man-In-The-Middle attack vectors.\n\n#### See also\n\n- [node.js driver SSL implementation][driver-ssl-impl]\n- [node.js driver SSL tutorial][driver-ssl-tutorial]\n\n### SSH TUNNEL\n\n> New in mongodb-connection-model@5.0.0\n\nBecause [authentication](#authentication) is quite difficult for operators to migrate to, the most common method of securing a MongoDB deployment is to use an [SSH tunnel][sf-ssh-tunnel].  This allows operators to leverage their existing SSH security infrastructure to also provide secure access to MongoDB.  For a standard deployment of MongoDB on AWS, this is almost always to strategy.  Because of this, we now support creating SSH tunnels automatically when connecting to MongoDB.\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options, (connectionError, client) => {\n  if (connectionError) {\n    return console.log(connectionError);\n  }\n\n  client.db('mongodb').collection('fanclub').count((countingError, count) => {\n    console.log('counted:', countingError, count);\n    client.close();\n  });\n});\n```\n\nThe above provides the same functionality as creating the tunnel using the bash\ncommand below and connecting to MongoDB via another terminal. Notice that\nconnection-model uses a random local port each time it creates a tunnel.\nUsing the command line, you'd have to replace `<random port>` with an actual\nport number.\n\n```bash\nssh -i ~/.ssh/my-key-aws-pair.pem -L <random port>:localhost:27017 ubuntu@ec2-11-111-111-111.compute-1.amazonaws.com\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `sshTunnel` | String | The desired SSH tunnel strategy. Possible values: `NONE`, `USER_PASSWORD`, `IDENTITY_FILE` | `undefined` |\n| `sshTunnelHostname` | String | The hostname of the SSH remote host | `undefined` |\n| `sshTunnelPort` | Port | The SSH port of the remote host | `22` |\n| `sshTunnelBindToLocalPort` | Port | Bind the localhost endpoint of the SSH Tunnel to this port | `undefined` |\n| `sshTunnelUsername` | String | The optional SSH username for the remote host | `undefined` |\n| `sshTunnelPassword` | String | The optional SSH password for the remote host | `undefined` |\n| `sshTunnelIdentityFile` | String/Array | The optional path to the SSH identity file for the remote host | `undefined` |\n| `sshTunnelPassphrase` | String | The optional passphrase for `sshTunnelIdentityFile` | `undefined` |\n\nDescription of `sshTunnel` values:\n\n- `NONE` - Do not use SSH tunneling.\n- `USER_PASSWORD` - The tunnel is created with SSH username and password only.\n- `IDENTITY_FILE` - The tunnel is created using an identity file.\n\n## Derived Properties\n\nDerived properties (also known as computed properties) are properties of the state object that depend on other properties to determine their value.\n\n```javascript\nconst c = new Connection();\nconst derivedProps = c.getAttributes({ derived: true });\n```\n\n| Derived Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `instanceId` | String | The mongoscope | `localhost:27017` |\n| `driverAuthMechanism` | String | Converts the value of `authStrategy` for humans into the `authMechanism` value for the driver | `undefined` |\n| `safeUrl` | String | The URL where a password is replaced with stars | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrl` | String | Use this URL in order to connect via DataService | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrlWithSsh` | String | Use this URL in order to connect via connection model itself | `mongodb://localhost:29201/?readPreference=primary&ssl=false` |\n| `driverOptions` | String | The second argument `mongoscope-server` passes to `mongodb.connect` | `{}` |\n\n## Events\n\n> New in mongodb-connection-model@5.0.0\n\n#### Example: SSH Tunnel\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', skipped: true,\n  reason: 'The selected SSL mode does not need to load any files.' }\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', complete: true}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n#### Example: SSL\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  ssl: 'ALL',\n  sslCA: '~/.ssl/my-ca.pem',\n  sslCert: '~/.ssl/my-server.pem',\n  sslKey: '~/.ssl/my-server.pem'\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', complete: true}\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', skipped: true,\n  reason: 'The selected SSH Tunnel mode is NONE.'}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n[workflow_img]: https://github.com/mongodb-js/connection-model/workflows/Check%20and%20Test/badge.svg?event=push\n[workflow_url]: https://github.com/mongodb-js/connection-model/actions?query=workflow%3A%22Check+and+Test%22\n[npm_img]: https://img.shields.io/npm/v/mongodb-connection-model.svg?style=flat-square\n[npm_url]: https://www.npmjs.org/package/mongodb-connection-model\n[gitter_img]: https://badges.gitter.im/Join%20Chat.svg\n[gitter_url]: http://gitter.im/mongodb-js/mongodb-js\n[enterprise_img]: https://img.shields.io/badge/MongoDB-Enterprise-blue.svg?style=flat-square\n[coming_soon_img]: https://img.shields.io/badge/-Coming%20Soon-ff69b4.svg?style=flat-square\n[kerberos-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/kerberos_tests.js\n[ldap-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ldap_tests.js\n[x509-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ssl_x509_tests.js\n[ns]: https://github.com/mongodb-js/ns\n[sf-ssh-tunnel]: http://serverfault.com/questions/597765/how-to-connect-to-mongodb-server-via-ssh-tunnel\n[ec2-key-pairs]: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html\n[driver-ssl-impl]: https://github.com/christkv/mongodb-core/blob/c3d21cb636d74d7a68134ecd3b9f6af536311279/lib/connection/connection.js#L365-L407\n[driver-ssl-tutorial]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/\n[driver-ssl-none]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#no-certificate-validation\n[driver-ssl-server]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate\n[driver-ssl-all]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate-and-present-valid-certificate\n","gitHead":"c12720c09369b6620405de027fa85d469db43e9c","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","test":"mocha","check":"npm run lint && npm run depcheck","pretest":"mongodb-runner install && mongodb-runner start --port=27018","test-ci":"npm run test","depcheck":"depcheck","posttest":"mongodb-runner stop --port=27018","posttest-ci":"node ../../scripts/killall-mongo.js","test-check-ci":"npm run check && npm test"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.17.0+x64 (linux)","description":"MongoDB connection model.","directories":{},"_nodeVersion":"16.17.0","compass:main":"index.js","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","debug":"^4.2.0","lodash":"^4.17.15","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.2.0","storage-mixin":"0.0.0-next-c12720c09369b6620405de027fa85d469db43e9c","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.2","@mongodb-js/ssh-tunnel":"0.0.0-next-c12720c09369b6620405de027fa85d469db43e9c","@mongodb-js/compass-utils":"0.0.0-next-c12720c09369b6620405de027fa85d469db43e9c","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.5.4"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"^4.10.0","depcheck":"^1.4.1","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.9.0","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^4.10.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_0.0.0-next-c12720c09369b6620405de027fa85d469db43e9c_1668747582744_0.4029326790895804","host":"s3://npm-registry-packages"}},"0.0.0-next-2122563cf622c0d212372dee10ec2a4a664d8006":{"name":"mongodb-connection-model","version":"0.0.0-next-2122563cf622c0d212372dee10ec2a4a664d8006","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@0.0.0-next-2122563cf622c0d212372dee10ec2a4a664d8006","maintainers":[{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"iteng@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"26199d74315a94364f5cfc29c820c1b7e6ec8af5","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-0.0.0-next-2122563cf622c0d212372dee10ec2a4a664d8006.tgz","fileCount":20,"integrity":"sha512-863zspGcIJbMOwJ/11xL7lN3eKDpjOOCLt3+wn7RdGLs2pVOVPbFDV0ZEmD/eF0VcutEe6ikCQ8yww3GACFlmw==","signatures":[{"sig":"MEUCIBLCFWOLnV8ajkvWEGofdYWBFUEWtsaM/9E4fGCxjdjOAiEA/kynqCXml/ZzcLoRPycwhKMq0xF3L4ATB9aYswWh/aY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":108152,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjdxOMACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmocRhAAhavPz4K0s7EIvOJ8Vlb4ywqG0JNGpJ2wEG1IU8v+uUFKqAv8\r\nhgn8RA92Bd0Rpvn0lIE7JD2t23tqBCvnBSDmQDJ1/eUeDYKwHlfu55sa/Z+h\r\n6WSejxfdJ0mtIGF735FfrVdEpWyKXlNaS2UIbyZBAmlrCUYe/c+/gaT3BM3Q\r\nxFvYG2tB4F5FrhKPxw7Y7EHtSSn2lREfFXvQdSmLbWahIsFVETisYsawO9P/\r\nCYjBD/i8HJe+R3SsTW50d7EyxgZyJ9rHn8/poGE72wxU279PaO7a3IJeJFLe\r\nI3jqyGX8kfWPiP+PoqeOXrCHvioCbO2k/odkm5luWhNz769B3KEtpbRRhCnT\r\njxPKhIs37FmphndYt9BTdF0w7Tzk3RCKFZTLyDJCmXWkXDqB5PpqKA5/vMpQ\r\nBp1UG8/4FCvqBUjH183hGx//BKTHi/M49tjxE6aa7tjaLt3m9w4Omc2toz8u\r\nRBcrnEZ8BxoFYAqVw0f6LdK+PD3MS6JsLhmR7SZItHkDpFTnPBGopC3jMPyO\r\nuhDBzeIW14DWV1VrlAejxBmii9L1FIbzBxhN9n3Fs61/sTOdK825n11cQECo\r\nedzMftoHOg7TovMV3SXcdyO+70yS4Wkgwr7P7336+oMpBIScCXomv4af+6SI\r\n8EgSCTY5ZZ9B0alTa2EY8CAnlaHatV2q8ks=\r\n=zV9e\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","readme":"# mongodb-connection-model [![][workflow_img]][workflow_url] [![][npm_img]][npm_url]\n\n> MongoDB connection model\n\nThe main purpose of the MongoDB connection model is to be a domain model around a MongoDB connection. It encapsulates generating a [Connection String URI](https://docs.mongodb.com/manual/reference/connection-string/) from a group of attributes and parses URI using the [MongoDB Node.JS Driver URI Parser](https://github.com/mongodb-js/mongodb-core/blob/master/lib/uri_parser.js).\n\n## Installation\n\n```\nnpm install --save mongodb-connection-model\n```\n\n## Usage\n\n### Building URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\nconst c = new Connection({ appname: 'My App Name' });\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://localhost:27017/?readPreference=primary&appname=My%20App&ssl=false'\n```\n\n### Parsing URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\n\nConnection.from(\n  'mongodb://someUsername:testPassword@localhost',\n  (error, result) => {\n    console.log(result);\n    >>> `{\n      hosts: [{ host: 'localhost', port: 27017 }],\n      hostname: 'localhost',\n      port: 27017,\n      auth: {\n        username: 'someUsername',\n        password: 'testPassword',\n        db: 'admin'\n      },\n      isSrvRecord: false,\n      authStrategy: 'MONGODB',\n      mongodbUsername: 'someUsername',\n      mongodbPassword: 'testPassword',\n      mongodbDatabaseName: 'admin',\n      extraOptions: {},\n      connectionType: 'NODE_DRIVER',\n      readPreference: 'primary',\n      kerberosCanonicalizeHostname: false,\n      sslMethod: 'NONE',\n      sshTunnel: 'NONE',\n      sshTunnelPort: 22\n    }`\n  }\n);\n```\n\n## Properties\n\nMongoDB connection model is based on Ampersand.js framework and consist of [props](https://ampersandjs.com/docs/#ampersand-state-props) and [derived props](https://ampersandjs.com/docs/#ampersand-state-derived). The props object describes the observable properties that MongoDB connection model gets from the Node.js Driver API.\n\n```javascript\nconst с = new Connection();\nconst props = с.getAttributes({ props: true });\n```\n\n#### See Also\n\n- [URI Generic Syntax](https://tools.ietf.org/html/rfc3986)\n- [URI Options Specification](https://github.com/mongodb/specifications/blob/master/source/uri-options/uri-options.rst)\n\n### General Properties\n\n```javascript\nconst c = new Connection({ isSrvRecord: true });\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ns` | String | A valid [ns][ns] the user can read from | `undefined` |\n| `isSrvRecord` | Boolean | Indicates SRV record | `false` |\n| `auth` | Object | Authentication from driver (username, user, db, password) | `undefined` |\n| `hostname` | String | Hostname of a MongoDB Instance. In case of the replica set the first host and port will be taken | `localhost` |\n| `port` | Number | TCP port of a MongoDB Instance | `27017` |\n| `hosts` | Array | Contains all hosts and ports for replica set | `[{ host: 'localhost', port: 27017 }]` |\n| `extraOptions` | Object | Extra options passed to the node driver as part of `driverOptions` | `{}` |\n| `connectionType` | String | The desired connection type. Possible values: `NODE_DRIVER`, `STITCH_ON_PREM`, `STITCH_ATLAS` | `NODE_DRIVER` |\n| `authStrategy` | String | The desired authentication strategy. Possible values: `NONE`, `MONGODB`, `X509`, `KERBEROS`, `LDAP`, `SCRAM-SHA-256` | `NONE` |\n\n### Connection string options\n\n```javascript\nconst c = new Connection({ appname: 'My App', replicaSet: 'testing' });\n```\n\n#### General connection string options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `replicaSet` | String | Specifies the name of the replica set, if the mongod is a member of a replica set | `undefined` |\n| `connectTimeoutMS` | Number | The time in milliseconds to attempt a connection before timing out | `undefined` |\n| `socketTimeoutMS` | Number | The time in milliseconds to attempt a send or receive on a socket before the attempt times out | `undefined` |\n| `compression` | Object | Object includes compressors and a compression level. The following compressors can be specified: `snappy`, `zlib` (Available in MongoDB 3.6 or greater) | `undefined` |\n\n#### Connection Pool Option\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `maxPoolSize` | Number | The maximum number of connections in the connection pool | `undefined` |\n| `minPoolSize` | Number | The minimum number of connections in the connection pool | `undefined` |\n| `maxIdleTimeMS` | Number | The maximum number of milliseconds that a connection can remain idle in the pool before being removed and closed | `undefined` |\n| `waitQueueMultiple` | Number | A number that the driver multiples the maxPoolSize value to, to provide the maximum number of threads allowed to wait for a connection to become available from the pool | `undefined` |\n| `waitQueueTimeoutMS` | Number | The maximum time in milliseconds that a thread can wait for a connection to become available | `undefined` |\n\n#### Write Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `w` | Number/String | Corresponds to the write concern [w Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-w) | `undefined` |\n| `wTimeoutMS` | Number | Corresponds to the write concern [wtimeout](https://docs.mongodb.com/manual/reference/write-concern/#wc-wtimeout) | `undefined` |\n| `journal` | Boolean | Corresponds to the write concern [j Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-j) | `undefined` |\n\n#### Read Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readConcernLevel` | String | The level of isolation | `undefined` |\n\n#### Read Preference Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readPreference` | String | Specifies the read preferences for this connection. Possible values: `PRIMARY`, `PRIMARY_PREFERRED`, `SECONDARY`, `SECONDARY_PREFERRED`, `NEAREST` | `PRIMARY` |\n| `maxStalenessSeconds` | Number | Specifies, in seconds, how stale a secondary can be before the client stops using it for read operations | `undefined` |\n| `readPreferenceTags` | Object | Default read preference tags for the client | `undefined` |\n\n#### Authentication Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `authSource` | String | Specify the database name associated with the user’s credentials | `undefined` |\n| `authMechanism` | String | Specifies the authentication mechanism that MongoDB will use to authenticate the connection. Possible values: `DEFAULT`, `GSSAPI`, `MONGODB-X509`, `PLAIN`, `SCRAM-SHA-256` | `undefined` |\n| `authMechanismProperties` | Object | Additional options provided for authentication (e.g. to enable hostname canonicalization for GSSAPI) | `undefined` |\n| `gssapiServiceName` | String | Set the Kerberos service name when connecting to Kerberized MongoDB instances | `undefined` |\n| `gssapiServiceRealm` | String | Set the Realm service name | `undefined` |\n| `gssapiCanonicalizeHostName` | Boolean | Whether canonicalized hostname | `undefined` |\n\n#### Server Selection and Discovery Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `localThresholdMS` | Number | The size (in milliseconds) of the latency window for selecting among multiple suitable MongoDB instances | `undefined` |\n| `serverSelectionTimeoutMS` | Number | Specifies how long (in milliseconds) to block for server selection before throwing an exception | `undefined` |\n| `serverSelectionTryOnce` | Boolean | Instructs the driver to scan the MongoDB deployment exactly once after server selection fails and then either select a server or raise an error | `undefined` |\n| `heartbeatFrequencyMS` | Number | Controls when the driver checks the state of the MongoDB deployment | `undefined` |\n\n#### Miscellaneous Configuration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `appname` | String | An application name passed to server as client metadata | `undefined` |\n| `retryWrites` | Boolean | Enable retryable writes | `undefined` |\n| `uuidRepresentation` | String | The legacy representation of UUID. Possible values: `standard`, `csharpLegacy`, `javaLegacy`, `pythonLegacy` | `undefined` |\n| `loadBalanced` | Boolean | Whether or not the server is running in load balanced mode | `undefined` |\n\n### Stitch attributes\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `stitchServiceName` | String | Stitch service name | `undefined` |\n| `stitchClientAppId` | String | Stitch сlient app ID | `undefined` |\n| `stitchGroupId` | String | Stitch group ID | `undefined` |\n| `stitchBaseUrl` | String | Stitch base Url | `undefined` |\n\n### MONGODB authentication\n\n```javascript\nconst c = new Connection({\n  mongodbUsername: 'arlo',\n  mongodbPassword: 'w@of'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/?slaveOk=true&authSource=admin'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `mongodbUsername` | String | MongoDB username | `undefined` |\n| `mongodbPassword` | String | MongoDB password | `undefined` |\n| `mongodbDatabaseName` | String | The database name associated with the user's credentials | `undefined` |\n| `promoteValues` | Boolean | Whether BSON values should be promoted to their JS type counterparts | `undefined` |\n\n### KERBEROS authentication\n\n```javascript\nconst c = new Connection({\n  kerberosServiceName: 'mongodb',\n  kerberosPrincipal: 'arlo/dog@krb5.mongodb.parts',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo%252Fdog%2540krb5.mongodb.parts@localhost:27017/toys?authMechanism=GSSAPI'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n> @note (imlucas): Kerberos on Windows is broken out as it's own state for UX consideration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `kerberosServiceName` | String | Any program or computer you access over a network | `undefined` |\n| `kerberosPrincipal` | String | The format of a typical Kerberos V5 principal is `primary/instance@REALM` | `undefined` |\n| `kerberosCanonicalizeHostname` | Boolean | Whether canonicalized kerberos hostname | `undefined` |\n\n#### See Also\n\n- [node.js driver Kerberos reference](http://bit.ly/mongodb-node-driver-kerberos)\n- [node.js driver Kerberos functional test][kerberos-functional]\n\n### LDAP authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  ldapUsername: 'arlo',\n  ldapPassword: 'w@of',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/toys?slaveOk=true&authMechanism=PLAIN'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ldapUsername` | String | LDAP username | `undefined` |\n| `ldapPassword` | String | LDAP password | `undefined` |\n\n#### See Also\n\n- [node.js driver LDAP reference](http://bit.ly/mongodb-node-driver-ldap)\n- [node.js driver X509 functional test][ldap-functional]\n\n### X509 authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  x509Username: 'CN=client,OU=arlo,O=MongoDB,L=Philadelphia,ST=Pennsylvania,C=US'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://CN%253Dclient%252COU%253Darlo%252CO%253DMongoDB%252CL%253DPhiladelphia%252CST%253DPennsylvania%252CC%253DUS@localhost:27017?slaveOk=true&authMechanism=MONGODB-X509'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `x509Username` | String | The x.509 certificate derived user name, e.g. `CN=user,OU=OrgUnit,O=myOrg,...` | `undefined` |\n\n#### See Also\n\n- [node.js driver X509 reference](http://bit.ly/mongodb-node-driver-x509)\n- [node.js driver X509 functional test][x509-functional]\n\n### SSL\n\n> **Note**: Not to be confused with `authentication=X509`\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ssl` | Number/String | A boolean to enable or disables TLS/SSL for the connection | `undefined` |\n| `sslMethod` | String | The desired ssl method. Possible values: `NONE`, `SYSTEMCA`, `IFAVAILABLE`, `UNVALIDATED`, `SERVER`, `ALL` | `NONE` |\n| `sslCA` | Buffer/String | Array of valid certificates | `undefined` |\n| `sslCert` | Buffer/String | The certificate | `undefined` |\n| `sslKey` | Buffer/String | The certificate private key | `undefined` |\n| `sslPass` | Buffer/String | The certificate password | `undefined` |\n\nDescription of `sslMethod` values:\n\n- `SYSTEMCA` - SSL required, validate using System CA, with host verification.\n- `IFAVAILABLE` - The driver should try SSL first, fall back to no SSL if unavailable, and use the system's Certificate Authority.\n- `SERVER` - The driver should validate the server certificate and fail to connect if validation fails. See also [node.js driver \"Validate Server Certificate\" docs][driver-ssl-server].\n- `ALL` - The driver must present a valid certificate and validate the server certificate. See also [node.js driver \"Validate Server Certificate and Present Valid Certificate\" docs][driver-ssl-all].\n- `NONE` - No SSL (Not recommended).\n- `UNVALIDATED` - Use SSL but do not perform any validation of the certificate chain. See also [node.js driver \"No Certificate Validation\" docs][driver-ssl-none]. **Very** not recommended and likely to be deprecated in future releases because it exposes potential Man-In-The-Middle attack vectors.\n\n#### See also\n\n- [node.js driver SSL implementation][driver-ssl-impl]\n- [node.js driver SSL tutorial][driver-ssl-tutorial]\n\n### SSH TUNNEL\n\n> New in mongodb-connection-model@5.0.0\n\nBecause [authentication](#authentication) is quite difficult for operators to migrate to, the most common method of securing a MongoDB deployment is to use an [SSH tunnel][sf-ssh-tunnel].  This allows operators to leverage their existing SSH security infrastructure to also provide secure access to MongoDB.  For a standard deployment of MongoDB on AWS, this is almost always to strategy.  Because of this, we now support creating SSH tunnels automatically when connecting to MongoDB.\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options, (connectionError, client) => {\n  if (connectionError) {\n    return console.log(connectionError);\n  }\n\n  client.db('mongodb').collection('fanclub').count((countingError, count) => {\n    console.log('counted:', countingError, count);\n    client.close();\n  });\n});\n```\n\nThe above provides the same functionality as creating the tunnel using the bash\ncommand below and connecting to MongoDB via another terminal. Notice that\nconnection-model uses a random local port each time it creates a tunnel.\nUsing the command line, you'd have to replace `<random port>` with an actual\nport number.\n\n```bash\nssh -i ~/.ssh/my-key-aws-pair.pem -L <random port>:localhost:27017 ubuntu@ec2-11-111-111-111.compute-1.amazonaws.com\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `sshTunnel` | String | The desired SSH tunnel strategy. Possible values: `NONE`, `USER_PASSWORD`, `IDENTITY_FILE` | `undefined` |\n| `sshTunnelHostname` | String | The hostname of the SSH remote host | `undefined` |\n| `sshTunnelPort` | Port | The SSH port of the remote host | `22` |\n| `sshTunnelBindToLocalPort` | Port | Bind the localhost endpoint of the SSH Tunnel to this port | `undefined` |\n| `sshTunnelUsername` | String | The optional SSH username for the remote host | `undefined` |\n| `sshTunnelPassword` | String | The optional SSH password for the remote host | `undefined` |\n| `sshTunnelIdentityFile` | String/Array | The optional path to the SSH identity file for the remote host | `undefined` |\n| `sshTunnelPassphrase` | String | The optional passphrase for `sshTunnelIdentityFile` | `undefined` |\n\nDescription of `sshTunnel` values:\n\n- `NONE` - Do not use SSH tunneling.\n- `USER_PASSWORD` - The tunnel is created with SSH username and password only.\n- `IDENTITY_FILE` - The tunnel is created using an identity file.\n\n## Derived Properties\n\nDerived properties (also known as computed properties) are properties of the state object that depend on other properties to determine their value.\n\n```javascript\nconst c = new Connection();\nconst derivedProps = c.getAttributes({ derived: true });\n```\n\n| Derived Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `instanceId` | String | The mongoscope | `localhost:27017` |\n| `driverAuthMechanism` | String | Converts the value of `authStrategy` for humans into the `authMechanism` value for the driver | `undefined` |\n| `safeUrl` | String | The URL where a password is replaced with stars | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrl` | String | Use this URL in order to connect via DataService | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrlWithSsh` | String | Use this URL in order to connect via connection model itself | `mongodb://localhost:29201/?readPreference=primary&ssl=false` |\n| `driverOptions` | String | The second argument `mongoscope-server` passes to `mongodb.connect` | `{}` |\n\n## Events\n\n> New in mongodb-connection-model@5.0.0\n\n#### Example: SSH Tunnel\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', skipped: true,\n  reason: 'The selected SSL mode does not need to load any files.' }\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', complete: true}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n#### Example: SSL\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  ssl: 'ALL',\n  sslCA: '~/.ssl/my-ca.pem',\n  sslCert: '~/.ssl/my-server.pem',\n  sslKey: '~/.ssl/my-server.pem'\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', complete: true}\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', skipped: true,\n  reason: 'The selected SSH Tunnel mode is NONE.'}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n[workflow_img]: https://github.com/mongodb-js/connection-model/workflows/Check%20and%20Test/badge.svg?event=push\n[workflow_url]: https://github.com/mongodb-js/connection-model/actions?query=workflow%3A%22Check+and+Test%22\n[npm_img]: https://img.shields.io/npm/v/mongodb-connection-model.svg?style=flat-square\n[npm_url]: https://www.npmjs.org/package/mongodb-connection-model\n[gitter_img]: https://badges.gitter.im/Join%20Chat.svg\n[gitter_url]: http://gitter.im/mongodb-js/mongodb-js\n[enterprise_img]: https://img.shields.io/badge/MongoDB-Enterprise-blue.svg?style=flat-square\n[coming_soon_img]: https://img.shields.io/badge/-Coming%20Soon-ff69b4.svg?style=flat-square\n[kerberos-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/kerberos_tests.js\n[ldap-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ldap_tests.js\n[x509-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ssl_x509_tests.js\n[ns]: https://github.com/mongodb-js/ns\n[sf-ssh-tunnel]: http://serverfault.com/questions/597765/how-to-connect-to-mongodb-server-via-ssh-tunnel\n[ec2-key-pairs]: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html\n[driver-ssl-impl]: https://github.com/christkv/mongodb-core/blob/c3d21cb636d74d7a68134ecd3b9f6af536311279/lib/connection/connection.js#L365-L407\n[driver-ssl-tutorial]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/\n[driver-ssl-none]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#no-certificate-validation\n[driver-ssl-server]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate\n[driver-ssl-all]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate-and-present-valid-certificate\n","gitHead":"2122563cf622c0d212372dee10ec2a4a664d8006","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","test":"mocha","check":"npm run lint && npm run depcheck","pretest":"mongodb-runner install && mongodb-runner start --port=27018","test-ci":"npm run test","depcheck":"depcheck","posttest":"mongodb-runner stop --port=27018","posttest-ci":"node ../../scripts/killall-mongo.js","test-check-ci":"npm run check && npm test"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.17.0+x64 (linux)","description":"MongoDB connection model.","directories":{},"_nodeVersion":"16.17.0","compass:main":"index.js","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","debug":"^4.2.0","lodash":"^4.17.15","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.2.0","storage-mixin":"0.0.0-next-2122563cf622c0d212372dee10ec2a4a664d8006","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.2","@mongodb-js/ssh-tunnel":"0.0.0-next-2122563cf622c0d212372dee10ec2a4a664d8006","@mongodb-js/compass-utils":"0.0.0-next-2122563cf622c0d212372dee10ec2a4a664d8006","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.5.4"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"^4.10.0","depcheck":"^1.4.1","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.9.0","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^4.10.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_0.0.0-next-2122563cf622c0d212372dee10ec2a4a664d8006_1668748172395_0.12057331957591444","host":"s3://npm-registry-packages"}},"0.0.0-next-c31c6db319e5099ee073b5782609b1dcfa2370d8":{"name":"mongodb-connection-model","version":"0.0.0-next-c31c6db319e5099ee073b5782609b1dcfa2370d8","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@0.0.0-next-c31c6db319e5099ee073b5782609b1dcfa2370d8","maintainers":[{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"iteng@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"aa9d567bbc53d31906386188c293d6c622a3f450","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-0.0.0-next-c31c6db319e5099ee073b5782609b1dcfa2370d8.tgz","fileCount":20,"integrity":"sha512-B0buYFj7Bgj9ikDtSxdg8OejVi/gdrtU/IrMVYCATmtJdLpKOPHFHWB12HxqV0iGXm9MFqzwCknF/O0cBt8Emw==","signatures":[{"sig":"MEUCIQDoiVJMd5XQN9y78pr2ANVhKTaLvLjp2yjLMklbJejHGAIgC1EQWdPSDt5JQMzfCCKkhLBFBcqwV6RmZveUdrph6oY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":108152,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjeHyqACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmonPw/+Inlqf64w4DVwviOL4Z44eb5ON0ATXndt69ryWYgkppKphw5f\r\nDTZsxz0BsFBfHRRrs6H/7aqMkWSFkUyt6t+n4inNsQ5Qi/+/zvft5BmGMAKO\r\ncbh58952PKM/VEnOHiA72ircgqknEj55u2XCtct7FZ3T7eX/wWv2T5CMs9hk\r\n0dzGKgQ6Pf03EkKTrqnWbuYLHlyy5erA6lHO+pUnEu6xY5S/b1HsaUHhyZES\r\nas//aBMYAWnXLKiYiRgP5o5duwBmNhODuFvJCu6LVhmmgWtCmUJ5oUpA9Kp7\r\no51dRQfXBMFaaHK0FPz+yof0FBB2lZ51S6v/EACLsK45a+hHPVlDDkrcQWEO\r\nG1JHPXC+uEt2ts96e9Zb0w03oQwH/1xbZPdKCk6zXNY11wHUntK51iwgBrF5\r\nYtJykj73oiU+PqK0BVPc0bFyIURiu+vIEXLx2XGfMXT189Tl4Vgik3j/ZDB9\r\ngHv6JXSecATJ2vJHqibu3O0WY1zhvMKCWluSXtz+AZjermRYzxs6bLQ9PWLW\r\nuI741as/ASWdmTxzGZPBVf9BfCVEt/nS5HF/36I/wD8ULxAgMw/OMYTW7/mL\r\nsFw8ZuQK6EVnjoyW0efWrAMeIl1evPNidp32HwBbzl1GWd+yYM6smUo3abqB\r\ny6ntKKPbOGrMEXFp7+hy8xFthde9gYhNsP8=\r\n=y5Da\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","readme":"# mongodb-connection-model [![][workflow_img]][workflow_url] [![][npm_img]][npm_url]\n\n> MongoDB connection model\n\nThe main purpose of the MongoDB connection model is to be a domain model around a MongoDB connection. It encapsulates generating a [Connection String URI](https://docs.mongodb.com/manual/reference/connection-string/) from a group of attributes and parses URI using the [MongoDB Node.JS Driver URI Parser](https://github.com/mongodb-js/mongodb-core/blob/master/lib/uri_parser.js).\n\n## Installation\n\n```\nnpm install --save mongodb-connection-model\n```\n\n## Usage\n\n### Building URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\nconst c = new Connection({ appname: 'My App Name' });\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://localhost:27017/?readPreference=primary&appname=My%20App&ssl=false'\n```\n\n### Parsing URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\n\nConnection.from(\n  'mongodb://someUsername:testPassword@localhost',\n  (error, result) => {\n    console.log(result);\n    >>> `{\n      hosts: [{ host: 'localhost', port: 27017 }],\n      hostname: 'localhost',\n      port: 27017,\n      auth: {\n        username: 'someUsername',\n        password: 'testPassword',\n        db: 'admin'\n      },\n      isSrvRecord: false,\n      authStrategy: 'MONGODB',\n      mongodbUsername: 'someUsername',\n      mongodbPassword: 'testPassword',\n      mongodbDatabaseName: 'admin',\n      extraOptions: {},\n      connectionType: 'NODE_DRIVER',\n      readPreference: 'primary',\n      kerberosCanonicalizeHostname: false,\n      sslMethod: 'NONE',\n      sshTunnel: 'NONE',\n      sshTunnelPort: 22\n    }`\n  }\n);\n```\n\n## Properties\n\nMongoDB connection model is based on Ampersand.js framework and consist of [props](https://ampersandjs.com/docs/#ampersand-state-props) and [derived props](https://ampersandjs.com/docs/#ampersand-state-derived). The props object describes the observable properties that MongoDB connection model gets from the Node.js Driver API.\n\n```javascript\nconst с = new Connection();\nconst props = с.getAttributes({ props: true });\n```\n\n#### See Also\n\n- [URI Generic Syntax](https://tools.ietf.org/html/rfc3986)\n- [URI Options Specification](https://github.com/mongodb/specifications/blob/master/source/uri-options/uri-options.rst)\n\n### General Properties\n\n```javascript\nconst c = new Connection({ isSrvRecord: true });\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ns` | String | A valid [ns][ns] the user can read from | `undefined` |\n| `isSrvRecord` | Boolean | Indicates SRV record | `false` |\n| `auth` | Object | Authentication from driver (username, user, db, password) | `undefined` |\n| `hostname` | String | Hostname of a MongoDB Instance. In case of the replica set the first host and port will be taken | `localhost` |\n| `port` | Number | TCP port of a MongoDB Instance | `27017` |\n| `hosts` | Array | Contains all hosts and ports for replica set | `[{ host: 'localhost', port: 27017 }]` |\n| `extraOptions` | Object | Extra options passed to the node driver as part of `driverOptions` | `{}` |\n| `connectionType` | String | The desired connection type. Possible values: `NODE_DRIVER`, `STITCH_ON_PREM`, `STITCH_ATLAS` | `NODE_DRIVER` |\n| `authStrategy` | String | The desired authentication strategy. Possible values: `NONE`, `MONGODB`, `X509`, `KERBEROS`, `LDAP`, `SCRAM-SHA-256` | `NONE` |\n\n### Connection string options\n\n```javascript\nconst c = new Connection({ appname: 'My App', replicaSet: 'testing' });\n```\n\n#### General connection string options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `replicaSet` | String | Specifies the name of the replica set, if the mongod is a member of a replica set | `undefined` |\n| `connectTimeoutMS` | Number | The time in milliseconds to attempt a connection before timing out | `undefined` |\n| `socketTimeoutMS` | Number | The time in milliseconds to attempt a send or receive on a socket before the attempt times out | `undefined` |\n| `compression` | Object | Object includes compressors and a compression level. The following compressors can be specified: `snappy`, `zlib` (Available in MongoDB 3.6 or greater) | `undefined` |\n\n#### Connection Pool Option\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `maxPoolSize` | Number | The maximum number of connections in the connection pool | `undefined` |\n| `minPoolSize` | Number | The minimum number of connections in the connection pool | `undefined` |\n| `maxIdleTimeMS` | Number | The maximum number of milliseconds that a connection can remain idle in the pool before being removed and closed | `undefined` |\n| `waitQueueMultiple` | Number | A number that the driver multiples the maxPoolSize value to, to provide the maximum number of threads allowed to wait for a connection to become available from the pool | `undefined` |\n| `waitQueueTimeoutMS` | Number | The maximum time in milliseconds that a thread can wait for a connection to become available | `undefined` |\n\n#### Write Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `w` | Number/String | Corresponds to the write concern [w Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-w) | `undefined` |\n| `wTimeoutMS` | Number | Corresponds to the write concern [wtimeout](https://docs.mongodb.com/manual/reference/write-concern/#wc-wtimeout) | `undefined` |\n| `journal` | Boolean | Corresponds to the write concern [j Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-j) | `undefined` |\n\n#### Read Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readConcernLevel` | String | The level of isolation | `undefined` |\n\n#### Read Preference Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readPreference` | String | Specifies the read preferences for this connection. Possible values: `PRIMARY`, `PRIMARY_PREFERRED`, `SECONDARY`, `SECONDARY_PREFERRED`, `NEAREST` | `PRIMARY` |\n| `maxStalenessSeconds` | Number | Specifies, in seconds, how stale a secondary can be before the client stops using it for read operations | `undefined` |\n| `readPreferenceTags` | Object | Default read preference tags for the client | `undefined` |\n\n#### Authentication Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `authSource` | String | Specify the database name associated with the user’s credentials | `undefined` |\n| `authMechanism` | String | Specifies the authentication mechanism that MongoDB will use to authenticate the connection. Possible values: `DEFAULT`, `GSSAPI`, `MONGODB-X509`, `PLAIN`, `SCRAM-SHA-256` | `undefined` |\n| `authMechanismProperties` | Object | Additional options provided for authentication (e.g. to enable hostname canonicalization for GSSAPI) | `undefined` |\n| `gssapiServiceName` | String | Set the Kerberos service name when connecting to Kerberized MongoDB instances | `undefined` |\n| `gssapiServiceRealm` | String | Set the Realm service name | `undefined` |\n| `gssapiCanonicalizeHostName` | Boolean | Whether canonicalized hostname | `undefined` |\n\n#### Server Selection and Discovery Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `localThresholdMS` | Number | The size (in milliseconds) of the latency window for selecting among multiple suitable MongoDB instances | `undefined` |\n| `serverSelectionTimeoutMS` | Number | Specifies how long (in milliseconds) to block for server selection before throwing an exception | `undefined` |\n| `serverSelectionTryOnce` | Boolean | Instructs the driver to scan the MongoDB deployment exactly once after server selection fails and then either select a server or raise an error | `undefined` |\n| `heartbeatFrequencyMS` | Number | Controls when the driver checks the state of the MongoDB deployment | `undefined` |\n\n#### Miscellaneous Configuration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `appname` | String | An application name passed to server as client metadata | `undefined` |\n| `retryWrites` | Boolean | Enable retryable writes | `undefined` |\n| `uuidRepresentation` | String | The legacy representation of UUID. Possible values: `standard`, `csharpLegacy`, `javaLegacy`, `pythonLegacy` | `undefined` |\n| `loadBalanced` | Boolean | Whether or not the server is running in load balanced mode | `undefined` |\n\n### Stitch attributes\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `stitchServiceName` | String | Stitch service name | `undefined` |\n| `stitchClientAppId` | String | Stitch сlient app ID | `undefined` |\n| `stitchGroupId` | String | Stitch group ID | `undefined` |\n| `stitchBaseUrl` | String | Stitch base Url | `undefined` |\n\n### MONGODB authentication\n\n```javascript\nconst c = new Connection({\n  mongodbUsername: 'arlo',\n  mongodbPassword: 'w@of'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/?slaveOk=true&authSource=admin'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `mongodbUsername` | String | MongoDB username | `undefined` |\n| `mongodbPassword` | String | MongoDB password | `undefined` |\n| `mongodbDatabaseName` | String | The database name associated with the user's credentials | `undefined` |\n| `promoteValues` | Boolean | Whether BSON values should be promoted to their JS type counterparts | `undefined` |\n\n### KERBEROS authentication\n\n```javascript\nconst c = new Connection({\n  kerberosServiceName: 'mongodb',\n  kerberosPrincipal: 'arlo/dog@krb5.mongodb.parts',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo%252Fdog%2540krb5.mongodb.parts@localhost:27017/toys?authMechanism=GSSAPI'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n> @note (imlucas): Kerberos on Windows is broken out as it's own state for UX consideration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `kerberosServiceName` | String | Any program or computer you access over a network | `undefined` |\n| `kerberosPrincipal` | String | The format of a typical Kerberos V5 principal is `primary/instance@REALM` | `undefined` |\n| `kerberosCanonicalizeHostname` | Boolean | Whether canonicalized kerberos hostname | `undefined` |\n\n#### See Also\n\n- [node.js driver Kerberos reference](http://bit.ly/mongodb-node-driver-kerberos)\n- [node.js driver Kerberos functional test][kerberos-functional]\n\n### LDAP authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  ldapUsername: 'arlo',\n  ldapPassword: 'w@of',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/toys?slaveOk=true&authMechanism=PLAIN'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ldapUsername` | String | LDAP username | `undefined` |\n| `ldapPassword` | String | LDAP password | `undefined` |\n\n#### See Also\n\n- [node.js driver LDAP reference](http://bit.ly/mongodb-node-driver-ldap)\n- [node.js driver X509 functional test][ldap-functional]\n\n### X509 authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  x509Username: 'CN=client,OU=arlo,O=MongoDB,L=Philadelphia,ST=Pennsylvania,C=US'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://CN%253Dclient%252COU%253Darlo%252CO%253DMongoDB%252CL%253DPhiladelphia%252CST%253DPennsylvania%252CC%253DUS@localhost:27017?slaveOk=true&authMechanism=MONGODB-X509'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `x509Username` | String | The x.509 certificate derived user name, e.g. `CN=user,OU=OrgUnit,O=myOrg,...` | `undefined` |\n\n#### See Also\n\n- [node.js driver X509 reference](http://bit.ly/mongodb-node-driver-x509)\n- [node.js driver X509 functional test][x509-functional]\n\n### SSL\n\n> **Note**: Not to be confused with `authentication=X509`\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ssl` | Number/String | A boolean to enable or disables TLS/SSL for the connection | `undefined` |\n| `sslMethod` | String | The desired ssl method. Possible values: `NONE`, `SYSTEMCA`, `IFAVAILABLE`, `UNVALIDATED`, `SERVER`, `ALL` | `NONE` |\n| `sslCA` | Buffer/String | Array of valid certificates | `undefined` |\n| `sslCert` | Buffer/String | The certificate | `undefined` |\n| `sslKey` | Buffer/String | The certificate private key | `undefined` |\n| `sslPass` | Buffer/String | The certificate password | `undefined` |\n\nDescription of `sslMethod` values:\n\n- `SYSTEMCA` - SSL required, validate using System CA, with host verification.\n- `IFAVAILABLE` - The driver should try SSL first, fall back to no SSL if unavailable, and use the system's Certificate Authority.\n- `SERVER` - The driver should validate the server certificate and fail to connect if validation fails. See also [node.js driver \"Validate Server Certificate\" docs][driver-ssl-server].\n- `ALL` - The driver must present a valid certificate and validate the server certificate. See also [node.js driver \"Validate Server Certificate and Present Valid Certificate\" docs][driver-ssl-all].\n- `NONE` - No SSL (Not recommended).\n- `UNVALIDATED` - Use SSL but do not perform any validation of the certificate chain. See also [node.js driver \"No Certificate Validation\" docs][driver-ssl-none]. **Very** not recommended and likely to be deprecated in future releases because it exposes potential Man-In-The-Middle attack vectors.\n\n#### See also\n\n- [node.js driver SSL implementation][driver-ssl-impl]\n- [node.js driver SSL tutorial][driver-ssl-tutorial]\n\n### SSH TUNNEL\n\n> New in mongodb-connection-model@5.0.0\n\nBecause [authentication](#authentication) is quite difficult for operators to migrate to, the most common method of securing a MongoDB deployment is to use an [SSH tunnel][sf-ssh-tunnel].  This allows operators to leverage their existing SSH security infrastructure to also provide secure access to MongoDB.  For a standard deployment of MongoDB on AWS, this is almost always to strategy.  Because of this, we now support creating SSH tunnels automatically when connecting to MongoDB.\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options, (connectionError, client) => {\n  if (connectionError) {\n    return console.log(connectionError);\n  }\n\n  client.db('mongodb').collection('fanclub').count((countingError, count) => {\n    console.log('counted:', countingError, count);\n    client.close();\n  });\n});\n```\n\nThe above provides the same functionality as creating the tunnel using the bash\ncommand below and connecting to MongoDB via another terminal. Notice that\nconnection-model uses a random local port each time it creates a tunnel.\nUsing the command line, you'd have to replace `<random port>` with an actual\nport number.\n\n```bash\nssh -i ~/.ssh/my-key-aws-pair.pem -L <random port>:localhost:27017 ubuntu@ec2-11-111-111-111.compute-1.amazonaws.com\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `sshTunnel` | String | The desired SSH tunnel strategy. Possible values: `NONE`, `USER_PASSWORD`, `IDENTITY_FILE` | `undefined` |\n| `sshTunnelHostname` | String | The hostname of the SSH remote host | `undefined` |\n| `sshTunnelPort` | Port | The SSH port of the remote host | `22` |\n| `sshTunnelBindToLocalPort` | Port | Bind the localhost endpoint of the SSH Tunnel to this port | `undefined` |\n| `sshTunnelUsername` | String | The optional SSH username for the remote host | `undefined` |\n| `sshTunnelPassword` | String | The optional SSH password for the remote host | `undefined` |\n| `sshTunnelIdentityFile` | String/Array | The optional path to the SSH identity file for the remote host | `undefined` |\n| `sshTunnelPassphrase` | String | The optional passphrase for `sshTunnelIdentityFile` | `undefined` |\n\nDescription of `sshTunnel` values:\n\n- `NONE` - Do not use SSH tunneling.\n- `USER_PASSWORD` - The tunnel is created with SSH username and password only.\n- `IDENTITY_FILE` - The tunnel is created using an identity file.\n\n## Derived Properties\n\nDerived properties (also known as computed properties) are properties of the state object that depend on other properties to determine their value.\n\n```javascript\nconst c = new Connection();\nconst derivedProps = c.getAttributes({ derived: true });\n```\n\n| Derived Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `instanceId` | String | The mongoscope | `localhost:27017` |\n| `driverAuthMechanism` | String | Converts the value of `authStrategy` for humans into the `authMechanism` value for the driver | `undefined` |\n| `safeUrl` | String | The URL where a password is replaced with stars | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrl` | String | Use this URL in order to connect via DataService | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrlWithSsh` | String | Use this URL in order to connect via connection model itself | `mongodb://localhost:29201/?readPreference=primary&ssl=false` |\n| `driverOptions` | String | The second argument `mongoscope-server` passes to `mongodb.connect` | `{}` |\n\n## Events\n\n> New in mongodb-connection-model@5.0.0\n\n#### Example: SSH Tunnel\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', skipped: true,\n  reason: 'The selected SSL mode does not need to load any files.' }\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', complete: true}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n#### Example: SSL\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  ssl: 'ALL',\n  sslCA: '~/.ssl/my-ca.pem',\n  sslCert: '~/.ssl/my-server.pem',\n  sslKey: '~/.ssl/my-server.pem'\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', complete: true}\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', skipped: true,\n  reason: 'The selected SSH Tunnel mode is NONE.'}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n[workflow_img]: https://github.com/mongodb-js/connection-model/workflows/Check%20and%20Test/badge.svg?event=push\n[workflow_url]: https://github.com/mongodb-js/connection-model/actions?query=workflow%3A%22Check+and+Test%22\n[npm_img]: https://img.shields.io/npm/v/mongodb-connection-model.svg?style=flat-square\n[npm_url]: https://www.npmjs.org/package/mongodb-connection-model\n[gitter_img]: https://badges.gitter.im/Join%20Chat.svg\n[gitter_url]: http://gitter.im/mongodb-js/mongodb-js\n[enterprise_img]: https://img.shields.io/badge/MongoDB-Enterprise-blue.svg?style=flat-square\n[coming_soon_img]: https://img.shields.io/badge/-Coming%20Soon-ff69b4.svg?style=flat-square\n[kerberos-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/kerberos_tests.js\n[ldap-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ldap_tests.js\n[x509-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ssl_x509_tests.js\n[ns]: https://github.com/mongodb-js/ns\n[sf-ssh-tunnel]: http://serverfault.com/questions/597765/how-to-connect-to-mongodb-server-via-ssh-tunnel\n[ec2-key-pairs]: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html\n[driver-ssl-impl]: https://github.com/christkv/mongodb-core/blob/c3d21cb636d74d7a68134ecd3b9f6af536311279/lib/connection/connection.js#L365-L407\n[driver-ssl-tutorial]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/\n[driver-ssl-none]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#no-certificate-validation\n[driver-ssl-server]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate\n[driver-ssl-all]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate-and-present-valid-certificate\n","gitHead":"c31c6db319e5099ee073b5782609b1dcfa2370d8","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","test":"mocha","check":"npm run lint && npm run depcheck","pretest":"mongodb-runner install && mongodb-runner start --port=27018","test-ci":"npm run test","depcheck":"depcheck","posttest":"mongodb-runner stop --port=27018","posttest-ci":"node ../../scripts/killall-mongo.js","test-check-ci":"npm run check && npm test"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.17.0+x64 (linux)","description":"MongoDB connection model.","directories":{},"_nodeVersion":"16.17.0","compass:main":"index.js","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","debug":"^4.2.0","lodash":"^4.17.15","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.2.0","storage-mixin":"0.0.0-next-c31c6db319e5099ee073b5782609b1dcfa2370d8","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.2","@mongodb-js/ssh-tunnel":"0.0.0-next-c31c6db319e5099ee073b5782609b1dcfa2370d8","@mongodb-js/compass-utils":"0.0.0-next-c31c6db319e5099ee073b5782609b1dcfa2370d8","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.5.4"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"^4.10.0","depcheck":"^1.4.1","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.9.0","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^4.10.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_0.0.0-next-c31c6db319e5099ee073b5782609b1dcfa2370d8_1668840618024_0.6377067816109365","host":"s3://npm-registry-packages"}},"0.0.0-next-981f8ae49e299320ca0add5ae8e58c8738baa699":{"name":"mongodb-connection-model","version":"0.0.0-next-981f8ae49e299320ca0add5ae8e58c8738baa699","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@0.0.0-next-981f8ae49e299320ca0add5ae8e58c8738baa699","maintainers":[{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"iteng@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"419abb5fb0af6c71861ce9cf845ef1ae2c96d92b","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-0.0.0-next-981f8ae49e299320ca0add5ae8e58c8738baa699.tgz","fileCount":20,"integrity":"sha512-ed/E25Y48tcL9wF612PMKW1UwGqpDiOrkGiueDi+FFRHrvh1aSI4NiDFc+HrHgqSHskbWK7hyeQHgpHOpHwOIg==","signatures":[{"sig":"MEYCIQC6tbPDVPK0x5EEXq3MxsXmtoNfpemwnpJUMUqUKHpR8AIhANNfPWmMzlGQU/tFUTv+Sy76cr61KjUyHIljrYPZNz0d","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":108152,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjeH/cACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpNYw//TjsvBvEgo3N9Q3JhIHwrkwmHt02JJOuR8d+h4i8ucI0Hfw97\r\nvo9Qvk7RaA/RAHnUZk3FCHI7VXACUCOz2Eg+ToCG0DMNgA0Avi7Xlr9HO0N9\r\ngzkktCbMrFOcairhtmNRScBF51sL27P0K3zpyprD3Ictrn6WlPRskABiL/sr\r\nAGjntWpvQpShxfARQ3EEdrOOoZeVm0N2XWWh4mP4WA8PiUMoUvUKbWoEM5iF\r\nxWO3bNVwbrH7yrbg+pMuMxbMH6fzJUisD3b/EFw9ehz7lUuEjZ014LLeC3M2\r\nZoZ7hoybRxBSC5kDarFwW71UKtRGttmsVWnxSAo8m8lRg5/2woFPGvTIYxc0\r\nxrpHX9sQkrCiRizCeEFgF5R423iZ1SHZsiFsgJXzf4IW6Wy6BHjc/Wk6EUXi\r\n30n2aRGvIND7YQJdkKFZt6+rVVmXGNttvLfjjuT8b8ROGbev+VDHkaVfpi/Y\r\nCJYN0RoeHtOdpyr/UpH3Kd3gXE94UlSMWKIaubpGNr7UpmY+MOdDIut4rX33\r\ndJDMmKRj46HXeaIsFuStHlsIQPFiZst7FAuDzCoyj3sBwp5F69bZCN6hQgZR\r\nWaJPhFknLSRsE4MV6A2LxfF5mnWtoWIN7hh+zjIfVC5JLHdAXeYb2rRJuOuO\r\nUd6HYzv9CtjRD8Haqoxcj7fZhqiMJ/xCyWE=\r\n=ukWa\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","readme":"# mongodb-connection-model [![][workflow_img]][workflow_url] [![][npm_img]][npm_url]\n\n> MongoDB connection model\n\nThe main purpose of the MongoDB connection model is to be a domain model around a MongoDB connection. It encapsulates generating a [Connection String URI](https://docs.mongodb.com/manual/reference/connection-string/) from a group of attributes and parses URI using the [MongoDB Node.JS Driver URI Parser](https://github.com/mongodb-js/mongodb-core/blob/master/lib/uri_parser.js).\n\n## Installation\n\n```\nnpm install --save mongodb-connection-model\n```\n\n## Usage\n\n### Building URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\nconst c = new Connection({ appname: 'My App Name' });\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://localhost:27017/?readPreference=primary&appname=My%20App&ssl=false'\n```\n\n### Parsing URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\n\nConnection.from(\n  'mongodb://someUsername:testPassword@localhost',\n  (error, result) => {\n    console.log(result);\n    >>> `{\n      hosts: [{ host: 'localhost', port: 27017 }],\n      hostname: 'localhost',\n      port: 27017,\n      auth: {\n        username: 'someUsername',\n        password: 'testPassword',\n        db: 'admin'\n      },\n      isSrvRecord: false,\n      authStrategy: 'MONGODB',\n      mongodbUsername: 'someUsername',\n      mongodbPassword: 'testPassword',\n      mongodbDatabaseName: 'admin',\n      extraOptions: {},\n      connectionType: 'NODE_DRIVER',\n      readPreference: 'primary',\n      kerberosCanonicalizeHostname: false,\n      sslMethod: 'NONE',\n      sshTunnel: 'NONE',\n      sshTunnelPort: 22\n    }`\n  }\n);\n```\n\n## Properties\n\nMongoDB connection model is based on Ampersand.js framework and consist of [props](https://ampersandjs.com/docs/#ampersand-state-props) and [derived props](https://ampersandjs.com/docs/#ampersand-state-derived). The props object describes the observable properties that MongoDB connection model gets from the Node.js Driver API.\n\n```javascript\nconst с = new Connection();\nconst props = с.getAttributes({ props: true });\n```\n\n#### See Also\n\n- [URI Generic Syntax](https://tools.ietf.org/html/rfc3986)\n- [URI Options Specification](https://github.com/mongodb/specifications/blob/master/source/uri-options/uri-options.rst)\n\n### General Properties\n\n```javascript\nconst c = new Connection({ isSrvRecord: true });\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ns` | String | A valid [ns][ns] the user can read from | `undefined` |\n| `isSrvRecord` | Boolean | Indicates SRV record | `false` |\n| `auth` | Object | Authentication from driver (username, user, db, password) | `undefined` |\n| `hostname` | String | Hostname of a MongoDB Instance. In case of the replica set the first host and port will be taken | `localhost` |\n| `port` | Number | TCP port of a MongoDB Instance | `27017` |\n| `hosts` | Array | Contains all hosts and ports for replica set | `[{ host: 'localhost', port: 27017 }]` |\n| `extraOptions` | Object | Extra options passed to the node driver as part of `driverOptions` | `{}` |\n| `connectionType` | String | The desired connection type. Possible values: `NODE_DRIVER`, `STITCH_ON_PREM`, `STITCH_ATLAS` | `NODE_DRIVER` |\n| `authStrategy` | String | The desired authentication strategy. Possible values: `NONE`, `MONGODB`, `X509`, `KERBEROS`, `LDAP`, `SCRAM-SHA-256` | `NONE` |\n\n### Connection string options\n\n```javascript\nconst c = new Connection({ appname: 'My App', replicaSet: 'testing' });\n```\n\n#### General connection string options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `replicaSet` | String | Specifies the name of the replica set, if the mongod is a member of a replica set | `undefined` |\n| `connectTimeoutMS` | Number | The time in milliseconds to attempt a connection before timing out | `undefined` |\n| `socketTimeoutMS` | Number | The time in milliseconds to attempt a send or receive on a socket before the attempt times out | `undefined` |\n| `compression` | Object | Object includes compressors and a compression level. The following compressors can be specified: `snappy`, `zlib` (Available in MongoDB 3.6 or greater) | `undefined` |\n\n#### Connection Pool Option\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `maxPoolSize` | Number | The maximum number of connections in the connection pool | `undefined` |\n| `minPoolSize` | Number | The minimum number of connections in the connection pool | `undefined` |\n| `maxIdleTimeMS` | Number | The maximum number of milliseconds that a connection can remain idle in the pool before being removed and closed | `undefined` |\n| `waitQueueMultiple` | Number | A number that the driver multiples the maxPoolSize value to, to provide the maximum number of threads allowed to wait for a connection to become available from the pool | `undefined` |\n| `waitQueueTimeoutMS` | Number | The maximum time in milliseconds that a thread can wait for a connection to become available | `undefined` |\n\n#### Write Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `w` | Number/String | Corresponds to the write concern [w Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-w) | `undefined` |\n| `wTimeoutMS` | Number | Corresponds to the write concern [wtimeout](https://docs.mongodb.com/manual/reference/write-concern/#wc-wtimeout) | `undefined` |\n| `journal` | Boolean | Corresponds to the write concern [j Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-j) | `undefined` |\n\n#### Read Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readConcernLevel` | String | The level of isolation | `undefined` |\n\n#### Read Preference Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readPreference` | String | Specifies the read preferences for this connection. Possible values: `PRIMARY`, `PRIMARY_PREFERRED`, `SECONDARY`, `SECONDARY_PREFERRED`, `NEAREST` | `PRIMARY` |\n| `maxStalenessSeconds` | Number | Specifies, in seconds, how stale a secondary can be before the client stops using it for read operations | `undefined` |\n| `readPreferenceTags` | Object | Default read preference tags for the client | `undefined` |\n\n#### Authentication Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `authSource` | String | Specify the database name associated with the user’s credentials | `undefined` |\n| `authMechanism` | String | Specifies the authentication mechanism that MongoDB will use to authenticate the connection. Possible values: `DEFAULT`, `GSSAPI`, `MONGODB-X509`, `PLAIN`, `SCRAM-SHA-256` | `undefined` |\n| `authMechanismProperties` | Object | Additional options provided for authentication (e.g. to enable hostname canonicalization for GSSAPI) | `undefined` |\n| `gssapiServiceName` | String | Set the Kerberos service name when connecting to Kerberized MongoDB instances | `undefined` |\n| `gssapiServiceRealm` | String | Set the Realm service name | `undefined` |\n| `gssapiCanonicalizeHostName` | Boolean | Whether canonicalized hostname | `undefined` |\n\n#### Server Selection and Discovery Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `localThresholdMS` | Number | The size (in milliseconds) of the latency window for selecting among multiple suitable MongoDB instances | `undefined` |\n| `serverSelectionTimeoutMS` | Number | Specifies how long (in milliseconds) to block for server selection before throwing an exception | `undefined` |\n| `serverSelectionTryOnce` | Boolean | Instructs the driver to scan the MongoDB deployment exactly once after server selection fails and then either select a server or raise an error | `undefined` |\n| `heartbeatFrequencyMS` | Number | Controls when the driver checks the state of the MongoDB deployment | `undefined` |\n\n#### Miscellaneous Configuration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `appname` | String | An application name passed to server as client metadata | `undefined` |\n| `retryWrites` | Boolean | Enable retryable writes | `undefined` |\n| `uuidRepresentation` | String | The legacy representation of UUID. Possible values: `standard`, `csharpLegacy`, `javaLegacy`, `pythonLegacy` | `undefined` |\n| `loadBalanced` | Boolean | Whether or not the server is running in load balanced mode | `undefined` |\n\n### Stitch attributes\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `stitchServiceName` | String | Stitch service name | `undefined` |\n| `stitchClientAppId` | String | Stitch сlient app ID | `undefined` |\n| `stitchGroupId` | String | Stitch group ID | `undefined` |\n| `stitchBaseUrl` | String | Stitch base Url | `undefined` |\n\n### MONGODB authentication\n\n```javascript\nconst c = new Connection({\n  mongodbUsername: 'arlo',\n  mongodbPassword: 'w@of'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/?slaveOk=true&authSource=admin'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `mongodbUsername` | String | MongoDB username | `undefined` |\n| `mongodbPassword` | String | MongoDB password | `undefined` |\n| `mongodbDatabaseName` | String | The database name associated with the user's credentials | `undefined` |\n| `promoteValues` | Boolean | Whether BSON values should be promoted to their JS type counterparts | `undefined` |\n\n### KERBEROS authentication\n\n```javascript\nconst c = new Connection({\n  kerberosServiceName: 'mongodb',\n  kerberosPrincipal: 'arlo/dog@krb5.mongodb.parts',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo%252Fdog%2540krb5.mongodb.parts@localhost:27017/toys?authMechanism=GSSAPI'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n> @note (imlucas): Kerberos on Windows is broken out as it's own state for UX consideration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `kerberosServiceName` | String | Any program or computer you access over a network | `undefined` |\n| `kerberosPrincipal` | String | The format of a typical Kerberos V5 principal is `primary/instance@REALM` | `undefined` |\n| `kerberosCanonicalizeHostname` | Boolean | Whether canonicalized kerberos hostname | `undefined` |\n\n#### See Also\n\n- [node.js driver Kerberos reference](http://bit.ly/mongodb-node-driver-kerberos)\n- [node.js driver Kerberos functional test][kerberos-functional]\n\n### LDAP authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  ldapUsername: 'arlo',\n  ldapPassword: 'w@of',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/toys?slaveOk=true&authMechanism=PLAIN'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ldapUsername` | String | LDAP username | `undefined` |\n| `ldapPassword` | String | LDAP password | `undefined` |\n\n#### See Also\n\n- [node.js driver LDAP reference](http://bit.ly/mongodb-node-driver-ldap)\n- [node.js driver X509 functional test][ldap-functional]\n\n### X509 authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  x509Username: 'CN=client,OU=arlo,O=MongoDB,L=Philadelphia,ST=Pennsylvania,C=US'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://CN%253Dclient%252COU%253Darlo%252CO%253DMongoDB%252CL%253DPhiladelphia%252CST%253DPennsylvania%252CC%253DUS@localhost:27017?slaveOk=true&authMechanism=MONGODB-X509'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `x509Username` | String | The x.509 certificate derived user name, e.g. `CN=user,OU=OrgUnit,O=myOrg,...` | `undefined` |\n\n#### See Also\n\n- [node.js driver X509 reference](http://bit.ly/mongodb-node-driver-x509)\n- [node.js driver X509 functional test][x509-functional]\n\n### SSL\n\n> **Note**: Not to be confused with `authentication=X509`\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ssl` | Number/String | A boolean to enable or disables TLS/SSL for the connection | `undefined` |\n| `sslMethod` | String | The desired ssl method. Possible values: `NONE`, `SYSTEMCA`, `IFAVAILABLE`, `UNVALIDATED`, `SERVER`, `ALL` | `NONE` |\n| `sslCA` | Buffer/String | Array of valid certificates | `undefined` |\n| `sslCert` | Buffer/String | The certificate | `undefined` |\n| `sslKey` | Buffer/String | The certificate private key | `undefined` |\n| `sslPass` | Buffer/String | The certificate password | `undefined` |\n\nDescription of `sslMethod` values:\n\n- `SYSTEMCA` - SSL required, validate using System CA, with host verification.\n- `IFAVAILABLE` - The driver should try SSL first, fall back to no SSL if unavailable, and use the system's Certificate Authority.\n- `SERVER` - The driver should validate the server certificate and fail to connect if validation fails. See also [node.js driver \"Validate Server Certificate\" docs][driver-ssl-server].\n- `ALL` - The driver must present a valid certificate and validate the server certificate. See also [node.js driver \"Validate Server Certificate and Present Valid Certificate\" docs][driver-ssl-all].\n- `NONE` - No SSL (Not recommended).\n- `UNVALIDATED` - Use SSL but do not perform any validation of the certificate chain. See also [node.js driver \"No Certificate Validation\" docs][driver-ssl-none]. **Very** not recommended and likely to be deprecated in future releases because it exposes potential Man-In-The-Middle attack vectors.\n\n#### See also\n\n- [node.js driver SSL implementation][driver-ssl-impl]\n- [node.js driver SSL tutorial][driver-ssl-tutorial]\n\n### SSH TUNNEL\n\n> New in mongodb-connection-model@5.0.0\n\nBecause [authentication](#authentication) is quite difficult for operators to migrate to, the most common method of securing a MongoDB deployment is to use an [SSH tunnel][sf-ssh-tunnel].  This allows operators to leverage their existing SSH security infrastructure to also provide secure access to MongoDB.  For a standard deployment of MongoDB on AWS, this is almost always to strategy.  Because of this, we now support creating SSH tunnels automatically when connecting to MongoDB.\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options, (connectionError, client) => {\n  if (connectionError) {\n    return console.log(connectionError);\n  }\n\n  client.db('mongodb').collection('fanclub').count((countingError, count) => {\n    console.log('counted:', countingError, count);\n    client.close();\n  });\n});\n```\n\nThe above provides the same functionality as creating the tunnel using the bash\ncommand below and connecting to MongoDB via another terminal. Notice that\nconnection-model uses a random local port each time it creates a tunnel.\nUsing the command line, you'd have to replace `<random port>` with an actual\nport number.\n\n```bash\nssh -i ~/.ssh/my-key-aws-pair.pem -L <random port>:localhost:27017 ubuntu@ec2-11-111-111-111.compute-1.amazonaws.com\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `sshTunnel` | String | The desired SSH tunnel strategy. Possible values: `NONE`, `USER_PASSWORD`, `IDENTITY_FILE` | `undefined` |\n| `sshTunnelHostname` | String | The hostname of the SSH remote host | `undefined` |\n| `sshTunnelPort` | Port | The SSH port of the remote host | `22` |\n| `sshTunnelBindToLocalPort` | Port | Bind the localhost endpoint of the SSH Tunnel to this port | `undefined` |\n| `sshTunnelUsername` | String | The optional SSH username for the remote host | `undefined` |\n| `sshTunnelPassword` | String | The optional SSH password for the remote host | `undefined` |\n| `sshTunnelIdentityFile` | String/Array | The optional path to the SSH identity file for the remote host | `undefined` |\n| `sshTunnelPassphrase` | String | The optional passphrase for `sshTunnelIdentityFile` | `undefined` |\n\nDescription of `sshTunnel` values:\n\n- `NONE` - Do not use SSH tunneling.\n- `USER_PASSWORD` - The tunnel is created with SSH username and password only.\n- `IDENTITY_FILE` - The tunnel is created using an identity file.\n\n## Derived Properties\n\nDerived properties (also known as computed properties) are properties of the state object that depend on other properties to determine their value.\n\n```javascript\nconst c = new Connection();\nconst derivedProps = c.getAttributes({ derived: true });\n```\n\n| Derived Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `instanceId` | String | The mongoscope | `localhost:27017` |\n| `driverAuthMechanism` | String | Converts the value of `authStrategy` for humans into the `authMechanism` value for the driver | `undefined` |\n| `safeUrl` | String | The URL where a password is replaced with stars | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrl` | String | Use this URL in order to connect via DataService | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrlWithSsh` | String | Use this URL in order to connect via connection model itself | `mongodb://localhost:29201/?readPreference=primary&ssl=false` |\n| `driverOptions` | String | The second argument `mongoscope-server` passes to `mongodb.connect` | `{}` |\n\n## Events\n\n> New in mongodb-connection-model@5.0.0\n\n#### Example: SSH Tunnel\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', skipped: true,\n  reason: 'The selected SSL mode does not need to load any files.' }\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', complete: true}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n#### Example: SSL\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  ssl: 'ALL',\n  sslCA: '~/.ssl/my-ca.pem',\n  sslCert: '~/.ssl/my-server.pem',\n  sslKey: '~/.ssl/my-server.pem'\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', complete: true}\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', skipped: true,\n  reason: 'The selected SSH Tunnel mode is NONE.'}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n[workflow_img]: https://github.com/mongodb-js/connection-model/workflows/Check%20and%20Test/badge.svg?event=push\n[workflow_url]: https://github.com/mongodb-js/connection-model/actions?query=workflow%3A%22Check+and+Test%22\n[npm_img]: https://img.shields.io/npm/v/mongodb-connection-model.svg?style=flat-square\n[npm_url]: https://www.npmjs.org/package/mongodb-connection-model\n[gitter_img]: https://badges.gitter.im/Join%20Chat.svg\n[gitter_url]: http://gitter.im/mongodb-js/mongodb-js\n[enterprise_img]: https://img.shields.io/badge/MongoDB-Enterprise-blue.svg?style=flat-square\n[coming_soon_img]: https://img.shields.io/badge/-Coming%20Soon-ff69b4.svg?style=flat-square\n[kerberos-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/kerberos_tests.js\n[ldap-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ldap_tests.js\n[x509-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ssl_x509_tests.js\n[ns]: https://github.com/mongodb-js/ns\n[sf-ssh-tunnel]: http://serverfault.com/questions/597765/how-to-connect-to-mongodb-server-via-ssh-tunnel\n[ec2-key-pairs]: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html\n[driver-ssl-impl]: https://github.com/christkv/mongodb-core/blob/c3d21cb636d74d7a68134ecd3b9f6af536311279/lib/connection/connection.js#L365-L407\n[driver-ssl-tutorial]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/\n[driver-ssl-none]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#no-certificate-validation\n[driver-ssl-server]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate\n[driver-ssl-all]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate-and-present-valid-certificate\n","gitHead":"981f8ae49e299320ca0add5ae8e58c8738baa699","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","test":"mocha","check":"npm run lint && npm run depcheck","pretest":"mongodb-runner install && mongodb-runner start --port=27018","test-ci":"npm run test","depcheck":"depcheck","posttest":"mongodb-runner stop --port=27018","posttest-ci":"node ../../scripts/killall-mongo.js","test-check-ci":"npm run check && npm test"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.17.0+x64 (linux)","description":"MongoDB connection model.","directories":{},"_nodeVersion":"16.17.0","compass:main":"index.js","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","debug":"^4.2.0","lodash":"^4.17.15","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.2.0","storage-mixin":"0.0.0-next-981f8ae49e299320ca0add5ae8e58c8738baa699","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.2","@mongodb-js/ssh-tunnel":"0.0.0-next-981f8ae49e299320ca0add5ae8e58c8738baa699","@mongodb-js/compass-utils":"0.0.0-next-981f8ae49e299320ca0add5ae8e58c8738baa699","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.5.4"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"^4.10.0","depcheck":"^1.4.1","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.9.0","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^4.10.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_0.0.0-next-981f8ae49e299320ca0add5ae8e58c8738baa699_1668841436506_0.38641194229441145","host":"s3://npm-registry-packages"}},"0.0.0-next-6a646700444fec2ae51cd86f87f6a29e58f774b0":{"name":"mongodb-connection-model","version":"0.0.0-next-6a646700444fec2ae51cd86f87f6a29e58f774b0","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@0.0.0-next-6a646700444fec2ae51cd86f87f6a29e58f774b0","maintainers":[{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"iteng@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"9ba34ef9ce9398c994a5d716ea14e6f33a457d9e","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-0.0.0-next-6a646700444fec2ae51cd86f87f6a29e58f774b0.tgz","fileCount":20,"integrity":"sha512-LMyHyUtHsZVzUzgNPzz7ywiypjDBRq2DO4O3ZYE1N2x8Y1YdvFAx0QifzFNO+TO88U/kxmRYwKD7E/g6na8z3w==","signatures":[{"sig":"MEUCIQDClrnuPgmi4+THjAFX5SVpTDMO553ejQQ3LDvtnC5yRwIgMSbKBM0XiALNyFXuR3pLQAchOUpT/i61+8jDRxUeHbw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":108152,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjeIB2ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq+AQ/8DqVHQCBPBl7IiUqh5syOTFirJjWnR1LD+gGNUIXOxWupT8Et\r\n/c09aAe0w+K7mZtsx70tgFHHY3XzfqBe+jlqSwA6jWA+2O7oaFEorbK+kWWy\r\ng0/j9Ngq/WZ/r+x+BJBEIyTA3jcXwxp3zhPDeYdbARIpRLwJO0c2KnRKQAQy\r\nLsn2ICClKhCT/Ml8/pCjKv8XOq0iDkuR9EOm+b5m8AxU6SGqCfKTCyEaQQCu\r\n7OhFA9pR0kOorzdJI9GUImEcKXUearkEWxePMGxAcY9MnIvxX6Uv8Ctsy7Bq\r\n3d2m/FNLRZdNIyc2v9wpTE/bJD7JnANGm2MNZB7Fju90x2YR7BR5vYjMoPyK\r\nutCz57EuLgrmb4mMHRYZziVqZD4LCvQnqFt2eumDlxPESgmLQK8I8vQUiGwe\r\nu+H5kJ/9RtbFXdoNBn/yYMA0wXkZ9aH2u02w3Uqt5bm7mNBAaPpftEsTdM98\r\nKVEZTyihaRDWhC2yZ+dTdT4dYR6sRIaEmmyku/6bQgFbhF3rJon9HUPbGzXB\r\nrVOeo3MAZREsKA3l+WZpTJ6bgyBkqnbgi4wG1tHKmqXH45Clde3e//59Zas2\r\n8gdiOtq6utstKuauyXuCey1Ra1fbWyZKRs2isgDQAGEQ5s7JXnOlpB0vVscz\r\nHRJtwrPJIeObRPwbYIAlhhx3ZsXirCRe56U=\r\n=F6lr\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","readme":"# mongodb-connection-model [![][workflow_img]][workflow_url] [![][npm_img]][npm_url]\n\n> MongoDB connection model\n\nThe main purpose of the MongoDB connection model is to be a domain model around a MongoDB connection. It encapsulates generating a [Connection String URI](https://docs.mongodb.com/manual/reference/connection-string/) from a group of attributes and parses URI using the [MongoDB Node.JS Driver URI Parser](https://github.com/mongodb-js/mongodb-core/blob/master/lib/uri_parser.js).\n\n## Installation\n\n```\nnpm install --save mongodb-connection-model\n```\n\n## Usage\n\n### Building URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\nconst c = new Connection({ appname: 'My App Name' });\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://localhost:27017/?readPreference=primary&appname=My%20App&ssl=false'\n```\n\n### Parsing URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\n\nConnection.from(\n  'mongodb://someUsername:testPassword@localhost',\n  (error, result) => {\n    console.log(result);\n    >>> `{\n      hosts: [{ host: 'localhost', port: 27017 }],\n      hostname: 'localhost',\n      port: 27017,\n      auth: {\n        username: 'someUsername',\n        password: 'testPassword',\n        db: 'admin'\n      },\n      isSrvRecord: false,\n      authStrategy: 'MONGODB',\n      mongodbUsername: 'someUsername',\n      mongodbPassword: 'testPassword',\n      mongodbDatabaseName: 'admin',\n      extraOptions: {},\n      connectionType: 'NODE_DRIVER',\n      readPreference: 'primary',\n      kerberosCanonicalizeHostname: false,\n      sslMethod: 'NONE',\n      sshTunnel: 'NONE',\n      sshTunnelPort: 22\n    }`\n  }\n);\n```\n\n## Properties\n\nMongoDB connection model is based on Ampersand.js framework and consist of [props](https://ampersandjs.com/docs/#ampersand-state-props) and [derived props](https://ampersandjs.com/docs/#ampersand-state-derived). The props object describes the observable properties that MongoDB connection model gets from the Node.js Driver API.\n\n```javascript\nconst с = new Connection();\nconst props = с.getAttributes({ props: true });\n```\n\n#### See Also\n\n- [URI Generic Syntax](https://tools.ietf.org/html/rfc3986)\n- [URI Options Specification](https://github.com/mongodb/specifications/blob/master/source/uri-options/uri-options.rst)\n\n### General Properties\n\n```javascript\nconst c = new Connection({ isSrvRecord: true });\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ns` | String | A valid [ns][ns] the user can read from | `undefined` |\n| `isSrvRecord` | Boolean | Indicates SRV record | `false` |\n| `auth` | Object | Authentication from driver (username, user, db, password) | `undefined` |\n| `hostname` | String | Hostname of a MongoDB Instance. In case of the replica set the first host and port will be taken | `localhost` |\n| `port` | Number | TCP port of a MongoDB Instance | `27017` |\n| `hosts` | Array | Contains all hosts and ports for replica set | `[{ host: 'localhost', port: 27017 }]` |\n| `extraOptions` | Object | Extra options passed to the node driver as part of `driverOptions` | `{}` |\n| `connectionType` | String | The desired connection type. Possible values: `NODE_DRIVER`, `STITCH_ON_PREM`, `STITCH_ATLAS` | `NODE_DRIVER` |\n| `authStrategy` | String | The desired authentication strategy. Possible values: `NONE`, `MONGODB`, `X509`, `KERBEROS`, `LDAP`, `SCRAM-SHA-256` | `NONE` |\n\n### Connection string options\n\n```javascript\nconst c = new Connection({ appname: 'My App', replicaSet: 'testing' });\n```\n\n#### General connection string options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `replicaSet` | String | Specifies the name of the replica set, if the mongod is a member of a replica set | `undefined` |\n| `connectTimeoutMS` | Number | The time in milliseconds to attempt a connection before timing out | `undefined` |\n| `socketTimeoutMS` | Number | The time in milliseconds to attempt a send or receive on a socket before the attempt times out | `undefined` |\n| `compression` | Object | Object includes compressors and a compression level. The following compressors can be specified: `snappy`, `zlib` (Available in MongoDB 3.6 or greater) | `undefined` |\n\n#### Connection Pool Option\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `maxPoolSize` | Number | The maximum number of connections in the connection pool | `undefined` |\n| `minPoolSize` | Number | The minimum number of connections in the connection pool | `undefined` |\n| `maxIdleTimeMS` | Number | The maximum number of milliseconds that a connection can remain idle in the pool before being removed and closed | `undefined` |\n| `waitQueueMultiple` | Number | A number that the driver multiples the maxPoolSize value to, to provide the maximum number of threads allowed to wait for a connection to become available from the pool | `undefined` |\n| `waitQueueTimeoutMS` | Number | The maximum time in milliseconds that a thread can wait for a connection to become available | `undefined` |\n\n#### Write Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `w` | Number/String | Corresponds to the write concern [w Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-w) | `undefined` |\n| `wTimeoutMS` | Number | Corresponds to the write concern [wtimeout](https://docs.mongodb.com/manual/reference/write-concern/#wc-wtimeout) | `undefined` |\n| `journal` | Boolean | Corresponds to the write concern [j Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-j) | `undefined` |\n\n#### Read Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readConcernLevel` | String | The level of isolation | `undefined` |\n\n#### Read Preference Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readPreference` | String | Specifies the read preferences for this connection. Possible values: `PRIMARY`, `PRIMARY_PREFERRED`, `SECONDARY`, `SECONDARY_PREFERRED`, `NEAREST` | `PRIMARY` |\n| `maxStalenessSeconds` | Number | Specifies, in seconds, how stale a secondary can be before the client stops using it for read operations | `undefined` |\n| `readPreferenceTags` | Object | Default read preference tags for the client | `undefined` |\n\n#### Authentication Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `authSource` | String | Specify the database name associated with the user’s credentials | `undefined` |\n| `authMechanism` | String | Specifies the authentication mechanism that MongoDB will use to authenticate the connection. Possible values: `DEFAULT`, `GSSAPI`, `MONGODB-X509`, `PLAIN`, `SCRAM-SHA-256` | `undefined` |\n| `authMechanismProperties` | Object | Additional options provided for authentication (e.g. to enable hostname canonicalization for GSSAPI) | `undefined` |\n| `gssapiServiceName` | String | Set the Kerberos service name when connecting to Kerberized MongoDB instances | `undefined` |\n| `gssapiServiceRealm` | String | Set the Realm service name | `undefined` |\n| `gssapiCanonicalizeHostName` | Boolean | Whether canonicalized hostname | `undefined` |\n\n#### Server Selection and Discovery Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `localThresholdMS` | Number | The size (in milliseconds) of the latency window for selecting among multiple suitable MongoDB instances | `undefined` |\n| `serverSelectionTimeoutMS` | Number | Specifies how long (in milliseconds) to block for server selection before throwing an exception | `undefined` |\n| `serverSelectionTryOnce` | Boolean | Instructs the driver to scan the MongoDB deployment exactly once after server selection fails and then either select a server or raise an error | `undefined` |\n| `heartbeatFrequencyMS` | Number | Controls when the driver checks the state of the MongoDB deployment | `undefined` |\n\n#### Miscellaneous Configuration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `appname` | String | An application name passed to server as client metadata | `undefined` |\n| `retryWrites` | Boolean | Enable retryable writes | `undefined` |\n| `uuidRepresentation` | String | The legacy representation of UUID. Possible values: `standard`, `csharpLegacy`, `javaLegacy`, `pythonLegacy` | `undefined` |\n| `loadBalanced` | Boolean | Whether or not the server is running in load balanced mode | `undefined` |\n\n### Stitch attributes\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `stitchServiceName` | String | Stitch service name | `undefined` |\n| `stitchClientAppId` | String | Stitch сlient app ID | `undefined` |\n| `stitchGroupId` | String | Stitch group ID | `undefined` |\n| `stitchBaseUrl` | String | Stitch base Url | `undefined` |\n\n### MONGODB authentication\n\n```javascript\nconst c = new Connection({\n  mongodbUsername: 'arlo',\n  mongodbPassword: 'w@of'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/?slaveOk=true&authSource=admin'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `mongodbUsername` | String | MongoDB username | `undefined` |\n| `mongodbPassword` | String | MongoDB password | `undefined` |\n| `mongodbDatabaseName` | String | The database name associated with the user's credentials | `undefined` |\n| `promoteValues` | Boolean | Whether BSON values should be promoted to their JS type counterparts | `undefined` |\n\n### KERBEROS authentication\n\n```javascript\nconst c = new Connection({\n  kerberosServiceName: 'mongodb',\n  kerberosPrincipal: 'arlo/dog@krb5.mongodb.parts',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo%252Fdog%2540krb5.mongodb.parts@localhost:27017/toys?authMechanism=GSSAPI'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n> @note (imlucas): Kerberos on Windows is broken out as it's own state for UX consideration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `kerberosServiceName` | String | Any program or computer you access over a network | `undefined` |\n| `kerberosPrincipal` | String | The format of a typical Kerberos V5 principal is `primary/instance@REALM` | `undefined` |\n| `kerberosCanonicalizeHostname` | Boolean | Whether canonicalized kerberos hostname | `undefined` |\n\n#### See Also\n\n- [node.js driver Kerberos reference](http://bit.ly/mongodb-node-driver-kerberos)\n- [node.js driver Kerberos functional test][kerberos-functional]\n\n### LDAP authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  ldapUsername: 'arlo',\n  ldapPassword: 'w@of',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/toys?slaveOk=true&authMechanism=PLAIN'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ldapUsername` | String | LDAP username | `undefined` |\n| `ldapPassword` | String | LDAP password | `undefined` |\n\n#### See Also\n\n- [node.js driver LDAP reference](http://bit.ly/mongodb-node-driver-ldap)\n- [node.js driver X509 functional test][ldap-functional]\n\n### X509 authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  x509Username: 'CN=client,OU=arlo,O=MongoDB,L=Philadelphia,ST=Pennsylvania,C=US'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://CN%253Dclient%252COU%253Darlo%252CO%253DMongoDB%252CL%253DPhiladelphia%252CST%253DPennsylvania%252CC%253DUS@localhost:27017?slaveOk=true&authMechanism=MONGODB-X509'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `x509Username` | String | The x.509 certificate derived user name, e.g. `CN=user,OU=OrgUnit,O=myOrg,...` | `undefined` |\n\n#### See Also\n\n- [node.js driver X509 reference](http://bit.ly/mongodb-node-driver-x509)\n- [node.js driver X509 functional test][x509-functional]\n\n### SSL\n\n> **Note**: Not to be confused with `authentication=X509`\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ssl` | Number/String | A boolean to enable or disables TLS/SSL for the connection | `undefined` |\n| `sslMethod` | String | The desired ssl method. Possible values: `NONE`, `SYSTEMCA`, `IFAVAILABLE`, `UNVALIDATED`, `SERVER`, `ALL` | `NONE` |\n| `sslCA` | Buffer/String | Array of valid certificates | `undefined` |\n| `sslCert` | Buffer/String | The certificate | `undefined` |\n| `sslKey` | Buffer/String | The certificate private key | `undefined` |\n| `sslPass` | Buffer/String | The certificate password | `undefined` |\n\nDescription of `sslMethod` values:\n\n- `SYSTEMCA` - SSL required, validate using System CA, with host verification.\n- `IFAVAILABLE` - The driver should try SSL first, fall back to no SSL if unavailable, and use the system's Certificate Authority.\n- `SERVER` - The driver should validate the server certificate and fail to connect if validation fails. See also [node.js driver \"Validate Server Certificate\" docs][driver-ssl-server].\n- `ALL` - The driver must present a valid certificate and validate the server certificate. See also [node.js driver \"Validate Server Certificate and Present Valid Certificate\" docs][driver-ssl-all].\n- `NONE` - No SSL (Not recommended).\n- `UNVALIDATED` - Use SSL but do not perform any validation of the certificate chain. See also [node.js driver \"No Certificate Validation\" docs][driver-ssl-none]. **Very** not recommended and likely to be deprecated in future releases because it exposes potential Man-In-The-Middle attack vectors.\n\n#### See also\n\n- [node.js driver SSL implementation][driver-ssl-impl]\n- [node.js driver SSL tutorial][driver-ssl-tutorial]\n\n### SSH TUNNEL\n\n> New in mongodb-connection-model@5.0.0\n\nBecause [authentication](#authentication) is quite difficult for operators to migrate to, the most common method of securing a MongoDB deployment is to use an [SSH tunnel][sf-ssh-tunnel].  This allows operators to leverage their existing SSH security infrastructure to also provide secure access to MongoDB.  For a standard deployment of MongoDB on AWS, this is almost always to strategy.  Because of this, we now support creating SSH tunnels automatically when connecting to MongoDB.\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options, (connectionError, client) => {\n  if (connectionError) {\n    return console.log(connectionError);\n  }\n\n  client.db('mongodb').collection('fanclub').count((countingError, count) => {\n    console.log('counted:', countingError, count);\n    client.close();\n  });\n});\n```\n\nThe above provides the same functionality as creating the tunnel using the bash\ncommand below and connecting to MongoDB via another terminal. Notice that\nconnection-model uses a random local port each time it creates a tunnel.\nUsing the command line, you'd have to replace `<random port>` with an actual\nport number.\n\n```bash\nssh -i ~/.ssh/my-key-aws-pair.pem -L <random port>:localhost:27017 ubuntu@ec2-11-111-111-111.compute-1.amazonaws.com\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `sshTunnel` | String | The desired SSH tunnel strategy. Possible values: `NONE`, `USER_PASSWORD`, `IDENTITY_FILE` | `undefined` |\n| `sshTunnelHostname` | String | The hostname of the SSH remote host | `undefined` |\n| `sshTunnelPort` | Port | The SSH port of the remote host | `22` |\n| `sshTunnelBindToLocalPort` | Port | Bind the localhost endpoint of the SSH Tunnel to this port | `undefined` |\n| `sshTunnelUsername` | String | The optional SSH username for the remote host | `undefined` |\n| `sshTunnelPassword` | String | The optional SSH password for the remote host | `undefined` |\n| `sshTunnelIdentityFile` | String/Array | The optional path to the SSH identity file for the remote host | `undefined` |\n| `sshTunnelPassphrase` | String | The optional passphrase for `sshTunnelIdentityFile` | `undefined` |\n\nDescription of `sshTunnel` values:\n\n- `NONE` - Do not use SSH tunneling.\n- `USER_PASSWORD` - The tunnel is created with SSH username and password only.\n- `IDENTITY_FILE` - The tunnel is created using an identity file.\n\n## Derived Properties\n\nDerived properties (also known as computed properties) are properties of the state object that depend on other properties to determine their value.\n\n```javascript\nconst c = new Connection();\nconst derivedProps = c.getAttributes({ derived: true });\n```\n\n| Derived Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `instanceId` | String | The mongoscope | `localhost:27017` |\n| `driverAuthMechanism` | String | Converts the value of `authStrategy` for humans into the `authMechanism` value for the driver | `undefined` |\n| `safeUrl` | String | The URL where a password is replaced with stars | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrl` | String | Use this URL in order to connect via DataService | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrlWithSsh` | String | Use this URL in order to connect via connection model itself | `mongodb://localhost:29201/?readPreference=primary&ssl=false` |\n| `driverOptions` | String | The second argument `mongoscope-server` passes to `mongodb.connect` | `{}` |\n\n## Events\n\n> New in mongodb-connection-model@5.0.0\n\n#### Example: SSH Tunnel\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', skipped: true,\n  reason: 'The selected SSL mode does not need to load any files.' }\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', complete: true}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n#### Example: SSL\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  ssl: 'ALL',\n  sslCA: '~/.ssl/my-ca.pem',\n  sslCert: '~/.ssl/my-server.pem',\n  sslKey: '~/.ssl/my-server.pem'\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', complete: true}\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', skipped: true,\n  reason: 'The selected SSH Tunnel mode is NONE.'}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n[workflow_img]: https://github.com/mongodb-js/connection-model/workflows/Check%20and%20Test/badge.svg?event=push\n[workflow_url]: https://github.com/mongodb-js/connection-model/actions?query=workflow%3A%22Check+and+Test%22\n[npm_img]: https://img.shields.io/npm/v/mongodb-connection-model.svg?style=flat-square\n[npm_url]: https://www.npmjs.org/package/mongodb-connection-model\n[gitter_img]: https://badges.gitter.im/Join%20Chat.svg\n[gitter_url]: http://gitter.im/mongodb-js/mongodb-js\n[enterprise_img]: https://img.shields.io/badge/MongoDB-Enterprise-blue.svg?style=flat-square\n[coming_soon_img]: https://img.shields.io/badge/-Coming%20Soon-ff69b4.svg?style=flat-square\n[kerberos-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/kerberos_tests.js\n[ldap-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ldap_tests.js\n[x509-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ssl_x509_tests.js\n[ns]: https://github.com/mongodb-js/ns\n[sf-ssh-tunnel]: http://serverfault.com/questions/597765/how-to-connect-to-mongodb-server-via-ssh-tunnel\n[ec2-key-pairs]: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html\n[driver-ssl-impl]: https://github.com/christkv/mongodb-core/blob/c3d21cb636d74d7a68134ecd3b9f6af536311279/lib/connection/connection.js#L365-L407\n[driver-ssl-tutorial]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/\n[driver-ssl-none]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#no-certificate-validation\n[driver-ssl-server]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate\n[driver-ssl-all]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate-and-present-valid-certificate\n","gitHead":"6a646700444fec2ae51cd86f87f6a29e58f774b0","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","test":"mocha","check":"npm run lint && npm run depcheck","pretest":"mongodb-runner install && mongodb-runner start --port=27018","test-ci":"npm run test","depcheck":"depcheck","posttest":"mongodb-runner stop --port=27018","posttest-ci":"node ../../scripts/killall-mongo.js","test-check-ci":"npm run check && npm test"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.17.0+x64 (linux)","description":"MongoDB connection model.","directories":{},"_nodeVersion":"16.17.0","compass:main":"index.js","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","debug":"^4.2.0","lodash":"^4.17.15","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.2.0","storage-mixin":"0.0.0-next-6a646700444fec2ae51cd86f87f6a29e58f774b0","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.2","@mongodb-js/ssh-tunnel":"0.0.0-next-6a646700444fec2ae51cd86f87f6a29e58f774b0","@mongodb-js/compass-utils":"0.0.0-next-6a646700444fec2ae51cd86f87f6a29e58f774b0","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.5.4"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"^4.10.0","depcheck":"^1.4.1","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.9.0","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^4.10.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_0.0.0-next-6a646700444fec2ae51cd86f87f6a29e58f774b0_1668841590599_0.3679184973863787","host":"s3://npm-registry-packages"}},"0.0.0-next-112bf8f8b20d7181824478f76e627ee32d6e03d7":{"name":"mongodb-connection-model","version":"0.0.0-next-112bf8f8b20d7181824478f76e627ee32d6e03d7","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@0.0.0-next-112bf8f8b20d7181824478f76e627ee32d6e03d7","maintainers":[{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"iteng@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"f46ae4904adfcd6ca54d0326dc4e52bd20a6894f","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-0.0.0-next-112bf8f8b20d7181824478f76e627ee32d6e03d7.tgz","fileCount":20,"integrity":"sha512-PcfI7roV2BZvi0upskS2C0NF84RtQQmrkVa0qnfBOf859/PUGATsOvf9gaLm+ROgSmzC3fleawtt18SER4G0iw==","signatures":[{"sig":"MEQCIDvo7L+r/m1BUWbZmjLNNvKg1oI+Hax4ZJe+JOsFCIPuAiBNv3tJZjgkgIfOsV0pPOatDmf7vfJ/1r96JiruNf8mKA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":108152,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjeT+8ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqRYA/+PYPGWfDQVE11HnQRG8YZx8wIItzVQPC6vrO2rKFWEZlqgNZT\r\nX6J9ihA3ZWCVVxccYKiGOMrMuYv8ZrgC+fwCUU7jI3a3LghCpKmupJ/sNWSC\r\nqTq4yOIjDmfVHefR8QuSS6iRIhe5y71UvqUkcNoHGWw5BuHdhmcfak1qXZQ5\r\ncsU9ClKMt4rZkW68aPk8og/rgGUf/nAKRkFz6O1ASDGtKRICLPzKOqJRVMLO\r\nONgsljQNHK7qVxX9pxJbN5jCUW7ddjwGi1i7I1L+1d2RJ5kS5HBKyZFnPk+h\r\n4MNXAu3dizHnisulqI7Nk3ZulPtaZjIdbx3Uxc3nIqbY0CUVe/NlU+E/DAcT\r\nlOx2qUP1VfR5rTQxyovD4C7un5qSPB6CZ/fj/IpTKW1vaXwe1G1V+JqZmHQI\r\n1GRSSV8+t5vTUHRXMG6ebT8Q6ZUe5MLwXHan0mB0mcbYLUzXnBVVG4sRdBs2\r\nPyPZ7nGiGRSbJaM+Hjsreq6oSze/CRozJk8sJLbDO53I9xo5ZD+ccWIuB3+i\r\n+hHPZ6Fe4goch75rdBM0ksTjHbZvUlof0jSWULFVQX2IlWYwg40DYDbqrjRd\r\nmedoT8BMlE5NMIZnHAb0xnAUeHIDs3JRRLwv1eGSYtjca832IfEHFD7ZViQ6\r\nT/xNz3j0eXK0eyht5z3qWcw4xuWF0Jn88CQ=\r\n=Xjtf\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","readme":"# mongodb-connection-model [![][workflow_img]][workflow_url] [![][npm_img]][npm_url]\n\n> MongoDB connection model\n\nThe main purpose of the MongoDB connection model is to be a domain model around a MongoDB connection. It encapsulates generating a [Connection String URI](https://docs.mongodb.com/manual/reference/connection-string/) from a group of attributes and parses URI using the [MongoDB Node.JS Driver URI Parser](https://github.com/mongodb-js/mongodb-core/blob/master/lib/uri_parser.js).\n\n## Installation\n\n```\nnpm install --save mongodb-connection-model\n```\n\n## Usage\n\n### Building URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\nconst c = new Connection({ appname: 'My App Name' });\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://localhost:27017/?readPreference=primary&appname=My%20App&ssl=false'\n```\n\n### Parsing URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\n\nConnection.from(\n  'mongodb://someUsername:testPassword@localhost',\n  (error, result) => {\n    console.log(result);\n    >>> `{\n      hosts: [{ host: 'localhost', port: 27017 }],\n      hostname: 'localhost',\n      port: 27017,\n      auth: {\n        username: 'someUsername',\n        password: 'testPassword',\n        db: 'admin'\n      },\n      isSrvRecord: false,\n      authStrategy: 'MONGODB',\n      mongodbUsername: 'someUsername',\n      mongodbPassword: 'testPassword',\n      mongodbDatabaseName: 'admin',\n      extraOptions: {},\n      connectionType: 'NODE_DRIVER',\n      readPreference: 'primary',\n      kerberosCanonicalizeHostname: false,\n      sslMethod: 'NONE',\n      sshTunnel: 'NONE',\n      sshTunnelPort: 22\n    }`\n  }\n);\n```\n\n## Properties\n\nMongoDB connection model is based on Ampersand.js framework and consist of [props](https://ampersandjs.com/docs/#ampersand-state-props) and [derived props](https://ampersandjs.com/docs/#ampersand-state-derived). The props object describes the observable properties that MongoDB connection model gets from the Node.js Driver API.\n\n```javascript\nconst с = new Connection();\nconst props = с.getAttributes({ props: true });\n```\n\n#### See Also\n\n- [URI Generic Syntax](https://tools.ietf.org/html/rfc3986)\n- [URI Options Specification](https://github.com/mongodb/specifications/blob/master/source/uri-options/uri-options.rst)\n\n### General Properties\n\n```javascript\nconst c = new Connection({ isSrvRecord: true });\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ns` | String | A valid [ns][ns] the user can read from | `undefined` |\n| `isSrvRecord` | Boolean | Indicates SRV record | `false` |\n| `auth` | Object | Authentication from driver (username, user, db, password) | `undefined` |\n| `hostname` | String | Hostname of a MongoDB Instance. In case of the replica set the first host and port will be taken | `localhost` |\n| `port` | Number | TCP port of a MongoDB Instance | `27017` |\n| `hosts` | Array | Contains all hosts and ports for replica set | `[{ host: 'localhost', port: 27017 }]` |\n| `extraOptions` | Object | Extra options passed to the node driver as part of `driverOptions` | `{}` |\n| `connectionType` | String | The desired connection type. Possible values: `NODE_DRIVER`, `STITCH_ON_PREM`, `STITCH_ATLAS` | `NODE_DRIVER` |\n| `authStrategy` | String | The desired authentication strategy. Possible values: `NONE`, `MONGODB`, `X509`, `KERBEROS`, `LDAP`, `SCRAM-SHA-256` | `NONE` |\n\n### Connection string options\n\n```javascript\nconst c = new Connection({ appname: 'My App', replicaSet: 'testing' });\n```\n\n#### General connection string options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `replicaSet` | String | Specifies the name of the replica set, if the mongod is a member of a replica set | `undefined` |\n| `connectTimeoutMS` | Number | The time in milliseconds to attempt a connection before timing out | `undefined` |\n| `socketTimeoutMS` | Number | The time in milliseconds to attempt a send or receive on a socket before the attempt times out | `undefined` |\n| `compression` | Object | Object includes compressors and a compression level. The following compressors can be specified: `snappy`, `zlib` (Available in MongoDB 3.6 or greater) | `undefined` |\n\n#### Connection Pool Option\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `maxPoolSize` | Number | The maximum number of connections in the connection pool | `undefined` |\n| `minPoolSize` | Number | The minimum number of connections in the connection pool | `undefined` |\n| `maxIdleTimeMS` | Number | The maximum number of milliseconds that a connection can remain idle in the pool before being removed and closed | `undefined` |\n| `waitQueueMultiple` | Number | A number that the driver multiples the maxPoolSize value to, to provide the maximum number of threads allowed to wait for a connection to become available from the pool | `undefined` |\n| `waitQueueTimeoutMS` | Number | The maximum time in milliseconds that a thread can wait for a connection to become available | `undefined` |\n\n#### Write Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `w` | Number/String | Corresponds to the write concern [w Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-w) | `undefined` |\n| `wTimeoutMS` | Number | Corresponds to the write concern [wtimeout](https://docs.mongodb.com/manual/reference/write-concern/#wc-wtimeout) | `undefined` |\n| `journal` | Boolean | Corresponds to the write concern [j Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-j) | `undefined` |\n\n#### Read Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readConcernLevel` | String | The level of isolation | `undefined` |\n\n#### Read Preference Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readPreference` | String | Specifies the read preferences for this connection. Possible values: `PRIMARY`, `PRIMARY_PREFERRED`, `SECONDARY`, `SECONDARY_PREFERRED`, `NEAREST` | `PRIMARY` |\n| `maxStalenessSeconds` | Number | Specifies, in seconds, how stale a secondary can be before the client stops using it for read operations | `undefined` |\n| `readPreferenceTags` | Object | Default read preference tags for the client | `undefined` |\n\n#### Authentication Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `authSource` | String | Specify the database name associated with the user’s credentials | `undefined` |\n| `authMechanism` | String | Specifies the authentication mechanism that MongoDB will use to authenticate the connection. Possible values: `DEFAULT`, `GSSAPI`, `MONGODB-X509`, `PLAIN`, `SCRAM-SHA-256` | `undefined` |\n| `authMechanismProperties` | Object | Additional options provided for authentication (e.g. to enable hostname canonicalization for GSSAPI) | `undefined` |\n| `gssapiServiceName` | String | Set the Kerberos service name when connecting to Kerberized MongoDB instances | `undefined` |\n| `gssapiServiceRealm` | String | Set the Realm service name | `undefined` |\n| `gssapiCanonicalizeHostName` | Boolean | Whether canonicalized hostname | `undefined` |\n\n#### Server Selection and Discovery Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `localThresholdMS` | Number | The size (in milliseconds) of the latency window for selecting among multiple suitable MongoDB instances | `undefined` |\n| `serverSelectionTimeoutMS` | Number | Specifies how long (in milliseconds) to block for server selection before throwing an exception | `undefined` |\n| `serverSelectionTryOnce` | Boolean | Instructs the driver to scan the MongoDB deployment exactly once after server selection fails and then either select a server or raise an error | `undefined` |\n| `heartbeatFrequencyMS` | Number | Controls when the driver checks the state of the MongoDB deployment | `undefined` |\n\n#### Miscellaneous Configuration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `appname` | String | An application name passed to server as client metadata | `undefined` |\n| `retryWrites` | Boolean | Enable retryable writes | `undefined` |\n| `uuidRepresentation` | String | The legacy representation of UUID. Possible values: `standard`, `csharpLegacy`, `javaLegacy`, `pythonLegacy` | `undefined` |\n| `loadBalanced` | Boolean | Whether or not the server is running in load balanced mode | `undefined` |\n\n### Stitch attributes\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `stitchServiceName` | String | Stitch service name | `undefined` |\n| `stitchClientAppId` | String | Stitch сlient app ID | `undefined` |\n| `stitchGroupId` | String | Stitch group ID | `undefined` |\n| `stitchBaseUrl` | String | Stitch base Url | `undefined` |\n\n### MONGODB authentication\n\n```javascript\nconst c = new Connection({\n  mongodbUsername: 'arlo',\n  mongodbPassword: 'w@of'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/?slaveOk=true&authSource=admin'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `mongodbUsername` | String | MongoDB username | `undefined` |\n| `mongodbPassword` | String | MongoDB password | `undefined` |\n| `mongodbDatabaseName` | String | The database name associated with the user's credentials | `undefined` |\n| `promoteValues` | Boolean | Whether BSON values should be promoted to their JS type counterparts | `undefined` |\n\n### KERBEROS authentication\n\n```javascript\nconst c = new Connection({\n  kerberosServiceName: 'mongodb',\n  kerberosPrincipal: 'arlo/dog@krb5.mongodb.parts',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo%252Fdog%2540krb5.mongodb.parts@localhost:27017/toys?authMechanism=GSSAPI'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n> @note (imlucas): Kerberos on Windows is broken out as it's own state for UX consideration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `kerberosServiceName` | String | Any program or computer you access over a network | `undefined` |\n| `kerberosPrincipal` | String | The format of a typical Kerberos V5 principal is `primary/instance@REALM` | `undefined` |\n| `kerberosCanonicalizeHostname` | Boolean | Whether canonicalized kerberos hostname | `undefined` |\n\n#### See Also\n\n- [node.js driver Kerberos reference](http://bit.ly/mongodb-node-driver-kerberos)\n- [node.js driver Kerberos functional test][kerberos-functional]\n\n### LDAP authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  ldapUsername: 'arlo',\n  ldapPassword: 'w@of',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/toys?slaveOk=true&authMechanism=PLAIN'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ldapUsername` | String | LDAP username | `undefined` |\n| `ldapPassword` | String | LDAP password | `undefined` |\n\n#### See Also\n\n- [node.js driver LDAP reference](http://bit.ly/mongodb-node-driver-ldap)\n- [node.js driver X509 functional test][ldap-functional]\n\n### X509 authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  x509Username: 'CN=client,OU=arlo,O=MongoDB,L=Philadelphia,ST=Pennsylvania,C=US'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://CN%253Dclient%252COU%253Darlo%252CO%253DMongoDB%252CL%253DPhiladelphia%252CST%253DPennsylvania%252CC%253DUS@localhost:27017?slaveOk=true&authMechanism=MONGODB-X509'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `x509Username` | String | The x.509 certificate derived user name, e.g. `CN=user,OU=OrgUnit,O=myOrg,...` | `undefined` |\n\n#### See Also\n\n- [node.js driver X509 reference](http://bit.ly/mongodb-node-driver-x509)\n- [node.js driver X509 functional test][x509-functional]\n\n### SSL\n\n> **Note**: Not to be confused with `authentication=X509`\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ssl` | Number/String | A boolean to enable or disables TLS/SSL for the connection | `undefined` |\n| `sslMethod` | String | The desired ssl method. Possible values: `NONE`, `SYSTEMCA`, `IFAVAILABLE`, `UNVALIDATED`, `SERVER`, `ALL` | `NONE` |\n| `sslCA` | Buffer/String | Array of valid certificates | `undefined` |\n| `sslCert` | Buffer/String | The certificate | `undefined` |\n| `sslKey` | Buffer/String | The certificate private key | `undefined` |\n| `sslPass` | Buffer/String | The certificate password | `undefined` |\n\nDescription of `sslMethod` values:\n\n- `SYSTEMCA` - SSL required, validate using System CA, with host verification.\n- `IFAVAILABLE` - The driver should try SSL first, fall back to no SSL if unavailable, and use the system's Certificate Authority.\n- `SERVER` - The driver should validate the server certificate and fail to connect if validation fails. See also [node.js driver \"Validate Server Certificate\" docs][driver-ssl-server].\n- `ALL` - The driver must present a valid certificate and validate the server certificate. See also [node.js driver \"Validate Server Certificate and Present Valid Certificate\" docs][driver-ssl-all].\n- `NONE` - No SSL (Not recommended).\n- `UNVALIDATED` - Use SSL but do not perform any validation of the certificate chain. See also [node.js driver \"No Certificate Validation\" docs][driver-ssl-none]. **Very** not recommended and likely to be deprecated in future releases because it exposes potential Man-In-The-Middle attack vectors.\n\n#### See also\n\n- [node.js driver SSL implementation][driver-ssl-impl]\n- [node.js driver SSL tutorial][driver-ssl-tutorial]\n\n### SSH TUNNEL\n\n> New in mongodb-connection-model@5.0.0\n\nBecause [authentication](#authentication) is quite difficult for operators to migrate to, the most common method of securing a MongoDB deployment is to use an [SSH tunnel][sf-ssh-tunnel].  This allows operators to leverage their existing SSH security infrastructure to also provide secure access to MongoDB.  For a standard deployment of MongoDB on AWS, this is almost always to strategy.  Because of this, we now support creating SSH tunnels automatically when connecting to MongoDB.\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options, (connectionError, client) => {\n  if (connectionError) {\n    return console.log(connectionError);\n  }\n\n  client.db('mongodb').collection('fanclub').count((countingError, count) => {\n    console.log('counted:', countingError, count);\n    client.close();\n  });\n});\n```\n\nThe above provides the same functionality as creating the tunnel using the bash\ncommand below and connecting to MongoDB via another terminal. Notice that\nconnection-model uses a random local port each time it creates a tunnel.\nUsing the command line, you'd have to replace `<random port>` with an actual\nport number.\n\n```bash\nssh -i ~/.ssh/my-key-aws-pair.pem -L <random port>:localhost:27017 ubuntu@ec2-11-111-111-111.compute-1.amazonaws.com\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `sshTunnel` | String | The desired SSH tunnel strategy. Possible values: `NONE`, `USER_PASSWORD`, `IDENTITY_FILE` | `undefined` |\n| `sshTunnelHostname` | String | The hostname of the SSH remote host | `undefined` |\n| `sshTunnelPort` | Port | The SSH port of the remote host | `22` |\n| `sshTunnelBindToLocalPort` | Port | Bind the localhost endpoint of the SSH Tunnel to this port | `undefined` |\n| `sshTunnelUsername` | String | The optional SSH username for the remote host | `undefined` |\n| `sshTunnelPassword` | String | The optional SSH password for the remote host | `undefined` |\n| `sshTunnelIdentityFile` | String/Array | The optional path to the SSH identity file for the remote host | `undefined` |\n| `sshTunnelPassphrase` | String | The optional passphrase for `sshTunnelIdentityFile` | `undefined` |\n\nDescription of `sshTunnel` values:\n\n- `NONE` - Do not use SSH tunneling.\n- `USER_PASSWORD` - The tunnel is created with SSH username and password only.\n- `IDENTITY_FILE` - The tunnel is created using an identity file.\n\n## Derived Properties\n\nDerived properties (also known as computed properties) are properties of the state object that depend on other properties to determine their value.\n\n```javascript\nconst c = new Connection();\nconst derivedProps = c.getAttributes({ derived: true });\n```\n\n| Derived Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `instanceId` | String | The mongoscope | `localhost:27017` |\n| `driverAuthMechanism` | String | Converts the value of `authStrategy` for humans into the `authMechanism` value for the driver | `undefined` |\n| `safeUrl` | String | The URL where a password is replaced with stars | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrl` | String | Use this URL in order to connect via DataService | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrlWithSsh` | String | Use this URL in order to connect via connection model itself | `mongodb://localhost:29201/?readPreference=primary&ssl=false` |\n| `driverOptions` | String | The second argument `mongoscope-server` passes to `mongodb.connect` | `{}` |\n\n## Events\n\n> New in mongodb-connection-model@5.0.0\n\n#### Example: SSH Tunnel\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', skipped: true,\n  reason: 'The selected SSL mode does not need to load any files.' }\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', complete: true}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n#### Example: SSL\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  ssl: 'ALL',\n  sslCA: '~/.ssl/my-ca.pem',\n  sslCert: '~/.ssl/my-server.pem',\n  sslKey: '~/.ssl/my-server.pem'\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', complete: true}\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', skipped: true,\n  reason: 'The selected SSH Tunnel mode is NONE.'}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n[workflow_img]: https://github.com/mongodb-js/connection-model/workflows/Check%20and%20Test/badge.svg?event=push\n[workflow_url]: https://github.com/mongodb-js/connection-model/actions?query=workflow%3A%22Check+and+Test%22\n[npm_img]: https://img.shields.io/npm/v/mongodb-connection-model.svg?style=flat-square\n[npm_url]: https://www.npmjs.org/package/mongodb-connection-model\n[gitter_img]: https://badges.gitter.im/Join%20Chat.svg\n[gitter_url]: http://gitter.im/mongodb-js/mongodb-js\n[enterprise_img]: https://img.shields.io/badge/MongoDB-Enterprise-blue.svg?style=flat-square\n[coming_soon_img]: https://img.shields.io/badge/-Coming%20Soon-ff69b4.svg?style=flat-square\n[kerberos-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/kerberos_tests.js\n[ldap-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ldap_tests.js\n[x509-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ssl_x509_tests.js\n[ns]: https://github.com/mongodb-js/ns\n[sf-ssh-tunnel]: http://serverfault.com/questions/597765/how-to-connect-to-mongodb-server-via-ssh-tunnel\n[ec2-key-pairs]: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html\n[driver-ssl-impl]: https://github.com/christkv/mongodb-core/blob/c3d21cb636d74d7a68134ecd3b9f6af536311279/lib/connection/connection.js#L365-L407\n[driver-ssl-tutorial]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/\n[driver-ssl-none]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#no-certificate-validation\n[driver-ssl-server]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate\n[driver-ssl-all]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate-and-present-valid-certificate\n","gitHead":"112bf8f8b20d7181824478f76e627ee32d6e03d7","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","test":"mocha","check":"npm run lint && npm run depcheck","pretest":"mongodb-runner install && mongodb-runner start --port=27018","test-ci":"npm run test","depcheck":"depcheck","posttest":"mongodb-runner stop --port=27018","posttest-ci":"node ../../scripts/killall-mongo.js","test-check-ci":"npm run check && npm test"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.17.0+x64 (linux)","description":"MongoDB connection model.","directories":{},"_nodeVersion":"16.17.0","compass:main":"index.js","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","debug":"^4.2.0","lodash":"^4.17.15","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.2.0","storage-mixin":"0.0.0-next-112bf8f8b20d7181824478f76e627ee32d6e03d7","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.2","@mongodb-js/ssh-tunnel":"0.0.0-next-112bf8f8b20d7181824478f76e627ee32d6e03d7","@mongodb-js/compass-utils":"0.0.0-next-112bf8f8b20d7181824478f76e627ee32d6e03d7","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.5.4"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"^4.10.0","depcheck":"^1.4.1","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.9.0","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^4.10.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_0.0.0-next-112bf8f8b20d7181824478f76e627ee32d6e03d7_1668890555892_0.4671314875994954","host":"s3://npm-registry-packages"}},"0.0.0-next-19de7da29c34177349014132e37b723c1cb16ebd":{"name":"mongodb-connection-model","version":"0.0.0-next-19de7da29c34177349014132e37b723c1cb16ebd","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@0.0.0-next-19de7da29c34177349014132e37b723c1cb16ebd","maintainers":[{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"iteng@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"b3779b418e135292e275626f8f37c16eeb6169e9","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-0.0.0-next-19de7da29c34177349014132e37b723c1cb16ebd.tgz","fileCount":20,"integrity":"sha512-u8XitYFGqiMG82JQGCkJ9Lw0/eAa3LpRoOEIh6upNgboaCchCSxln5kDCyMQWLkTeFCG93bn+ImQ9DF3SLIqFQ==","signatures":[{"sig":"MEUCIQCjwYIOZKne63T8GHAC36L4I24/PCmWMoj4AM9FQRXaOgIgCGz4mi65mZ8eVyDhMHSAakWEkTMDi25eD4/VaiYv8kc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":108152,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjeVXZACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpA1Q//dVOn8xoylGooECldoKDzMLlrljDA8URNy8SGPuWm7wJWgF3h\r\nCpOyyMCNoVpl1JWHi6SUNyWmpxj+ZyWmOYCLrHsuQLSC0oTGoTz/csDrrSng\r\nms0jJ3h0Q75sH/An8Bw6DqlKgjrNuBype0nnyeHXssnKZUAGF+22pKciCVZ/\r\nbqEeh7hXnqfm8oTTSo923kiuJgKZOAyfuJKEu0EJihdyPGLQgCtRNQazUhU7\r\nKTAO9vyPQm2byUf7JfxeObMZWVDwpLhYZFvLp8XywrPClw1pEddg2b+vUJN6\r\nj8/1hpSgi9WCw+GLifVfLZqCmltwsJlbgjf6CWUZcwTQ4wkGey5jO6SJzawj\r\nIH2yHetqpuiPYjOykSkm7zI9EK2peyB62qnGCStB1a48Jim7t5cSmjuRnzNt\r\nCZ7srYbzqtpBdumjhjNheLg161xJI4rMd6e0EK49Pm6eOh3nEy4ymZRwQ3O3\r\n9CBSPCt8qSvyOevX+R65OuutLta4Ye4fmVTuAVpvn91mjrJjuv4Sv0n8RPhL\r\n0da7XUFNdikjw0e+TizmKivJNSCAaRK/fdu+lx+43uKLbtwOYwASzvmy8X2f\r\nrMU1BNQcqpj6fnenogOwYUzBU2+h9vuE7q8vTNvL51g5RH3lbw7SBi1JXsL7\r\n9iGN1cO5m6WrbT8lVabgmakELfxy+aqeQZU=\r\n=kqny\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","readme":"# mongodb-connection-model [![][workflow_img]][workflow_url] [![][npm_img]][npm_url]\n\n> MongoDB connection model\n\nThe main purpose of the MongoDB connection model is to be a domain model around a MongoDB connection. It encapsulates generating a [Connection String URI](https://docs.mongodb.com/manual/reference/connection-string/) from a group of attributes and parses URI using the [MongoDB Node.JS Driver URI Parser](https://github.com/mongodb-js/mongodb-core/blob/master/lib/uri_parser.js).\n\n## Installation\n\n```\nnpm install --save mongodb-connection-model\n```\n\n## Usage\n\n### Building URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\nconst c = new Connection({ appname: 'My App Name' });\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://localhost:27017/?readPreference=primary&appname=My%20App&ssl=false'\n```\n\n### Parsing URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\n\nConnection.from(\n  'mongodb://someUsername:testPassword@localhost',\n  (error, result) => {\n    console.log(result);\n    >>> `{\n      hosts: [{ host: 'localhost', port: 27017 }],\n      hostname: 'localhost',\n      port: 27017,\n      auth: {\n        username: 'someUsername',\n        password: 'testPassword',\n        db: 'admin'\n      },\n      isSrvRecord: false,\n      authStrategy: 'MONGODB',\n      mongodbUsername: 'someUsername',\n      mongodbPassword: 'testPassword',\n      mongodbDatabaseName: 'admin',\n      extraOptions: {},\n      connectionType: 'NODE_DRIVER',\n      readPreference: 'primary',\n      kerberosCanonicalizeHostname: false,\n      sslMethod: 'NONE',\n      sshTunnel: 'NONE',\n      sshTunnelPort: 22\n    }`\n  }\n);\n```\n\n## Properties\n\nMongoDB connection model is based on Ampersand.js framework and consist of [props](https://ampersandjs.com/docs/#ampersand-state-props) and [derived props](https://ampersandjs.com/docs/#ampersand-state-derived). The props object describes the observable properties that MongoDB connection model gets from the Node.js Driver API.\n\n```javascript\nconst с = new Connection();\nconst props = с.getAttributes({ props: true });\n```\n\n#### See Also\n\n- [URI Generic Syntax](https://tools.ietf.org/html/rfc3986)\n- [URI Options Specification](https://github.com/mongodb/specifications/blob/master/source/uri-options/uri-options.rst)\n\n### General Properties\n\n```javascript\nconst c = new Connection({ isSrvRecord: true });\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ns` | String | A valid [ns][ns] the user can read from | `undefined` |\n| `isSrvRecord` | Boolean | Indicates SRV record | `false` |\n| `auth` | Object | Authentication from driver (username, user, db, password) | `undefined` |\n| `hostname` | String | Hostname of a MongoDB Instance. In case of the replica set the first host and port will be taken | `localhost` |\n| `port` | Number | TCP port of a MongoDB Instance | `27017` |\n| `hosts` | Array | Contains all hosts and ports for replica set | `[{ host: 'localhost', port: 27017 }]` |\n| `extraOptions` | Object | Extra options passed to the node driver as part of `driverOptions` | `{}` |\n| `connectionType` | String | The desired connection type. Possible values: `NODE_DRIVER`, `STITCH_ON_PREM`, `STITCH_ATLAS` | `NODE_DRIVER` |\n| `authStrategy` | String | The desired authentication strategy. Possible values: `NONE`, `MONGODB`, `X509`, `KERBEROS`, `LDAP`, `SCRAM-SHA-256` | `NONE` |\n\n### Connection string options\n\n```javascript\nconst c = new Connection({ appname: 'My App', replicaSet: 'testing' });\n```\n\n#### General connection string options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `replicaSet` | String | Specifies the name of the replica set, if the mongod is a member of a replica set | `undefined` |\n| `connectTimeoutMS` | Number | The time in milliseconds to attempt a connection before timing out | `undefined` |\n| `socketTimeoutMS` | Number | The time in milliseconds to attempt a send or receive on a socket before the attempt times out | `undefined` |\n| `compression` | Object | Object includes compressors and a compression level. The following compressors can be specified: `snappy`, `zlib` (Available in MongoDB 3.6 or greater) | `undefined` |\n\n#### Connection Pool Option\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `maxPoolSize` | Number | The maximum number of connections in the connection pool | `undefined` |\n| `minPoolSize` | Number | The minimum number of connections in the connection pool | `undefined` |\n| `maxIdleTimeMS` | Number | The maximum number of milliseconds that a connection can remain idle in the pool before being removed and closed | `undefined` |\n| `waitQueueMultiple` | Number | A number that the driver multiples the maxPoolSize value to, to provide the maximum number of threads allowed to wait for a connection to become available from the pool | `undefined` |\n| `waitQueueTimeoutMS` | Number | The maximum time in milliseconds that a thread can wait for a connection to become available | `undefined` |\n\n#### Write Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `w` | Number/String | Corresponds to the write concern [w Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-w) | `undefined` |\n| `wTimeoutMS` | Number | Corresponds to the write concern [wtimeout](https://docs.mongodb.com/manual/reference/write-concern/#wc-wtimeout) | `undefined` |\n| `journal` | Boolean | Corresponds to the write concern [j Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-j) | `undefined` |\n\n#### Read Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readConcernLevel` | String | The level of isolation | `undefined` |\n\n#### Read Preference Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readPreference` | String | Specifies the read preferences for this connection. Possible values: `PRIMARY`, `PRIMARY_PREFERRED`, `SECONDARY`, `SECONDARY_PREFERRED`, `NEAREST` | `PRIMARY` |\n| `maxStalenessSeconds` | Number | Specifies, in seconds, how stale a secondary can be before the client stops using it for read operations | `undefined` |\n| `readPreferenceTags` | Object | Default read preference tags for the client | `undefined` |\n\n#### Authentication Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `authSource` | String | Specify the database name associated with the user’s credentials | `undefined` |\n| `authMechanism` | String | Specifies the authentication mechanism that MongoDB will use to authenticate the connection. Possible values: `DEFAULT`, `GSSAPI`, `MONGODB-X509`, `PLAIN`, `SCRAM-SHA-256` | `undefined` |\n| `authMechanismProperties` | Object | Additional options provided for authentication (e.g. to enable hostname canonicalization for GSSAPI) | `undefined` |\n| `gssapiServiceName` | String | Set the Kerberos service name when connecting to Kerberized MongoDB instances | `undefined` |\n| `gssapiServiceRealm` | String | Set the Realm service name | `undefined` |\n| `gssapiCanonicalizeHostName` | Boolean | Whether canonicalized hostname | `undefined` |\n\n#### Server Selection and Discovery Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `localThresholdMS` | Number | The size (in milliseconds) of the latency window for selecting among multiple suitable MongoDB instances | `undefined` |\n| `serverSelectionTimeoutMS` | Number | Specifies how long (in milliseconds) to block for server selection before throwing an exception | `undefined` |\n| `serverSelectionTryOnce` | Boolean | Instructs the driver to scan the MongoDB deployment exactly once after server selection fails and then either select a server or raise an error | `undefined` |\n| `heartbeatFrequencyMS` | Number | Controls when the driver checks the state of the MongoDB deployment | `undefined` |\n\n#### Miscellaneous Configuration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `appname` | String | An application name passed to server as client metadata | `undefined` |\n| `retryWrites` | Boolean | Enable retryable writes | `undefined` |\n| `uuidRepresentation` | String | The legacy representation of UUID. Possible values: `standard`, `csharpLegacy`, `javaLegacy`, `pythonLegacy` | `undefined` |\n| `loadBalanced` | Boolean | Whether or not the server is running in load balanced mode | `undefined` |\n\n### Stitch attributes\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `stitchServiceName` | String | Stitch service name | `undefined` |\n| `stitchClientAppId` | String | Stitch сlient app ID | `undefined` |\n| `stitchGroupId` | String | Stitch group ID | `undefined` |\n| `stitchBaseUrl` | String | Stitch base Url | `undefined` |\n\n### MONGODB authentication\n\n```javascript\nconst c = new Connection({\n  mongodbUsername: 'arlo',\n  mongodbPassword: 'w@of'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/?slaveOk=true&authSource=admin'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `mongodbUsername` | String | MongoDB username | `undefined` |\n| `mongodbPassword` | String | MongoDB password | `undefined` |\n| `mongodbDatabaseName` | String | The database name associated with the user's credentials | `undefined` |\n| `promoteValues` | Boolean | Whether BSON values should be promoted to their JS type counterparts | `undefined` |\n\n### KERBEROS authentication\n\n```javascript\nconst c = new Connection({\n  kerberosServiceName: 'mongodb',\n  kerberosPrincipal: 'arlo/dog@krb5.mongodb.parts',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo%252Fdog%2540krb5.mongodb.parts@localhost:27017/toys?authMechanism=GSSAPI'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n> @note (imlucas): Kerberos on Windows is broken out as it's own state for UX consideration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `kerberosServiceName` | String | Any program or computer you access over a network | `undefined` |\n| `kerberosPrincipal` | String | The format of a typical Kerberos V5 principal is `primary/instance@REALM` | `undefined` |\n| `kerberosCanonicalizeHostname` | Boolean | Whether canonicalized kerberos hostname | `undefined` |\n\n#### See Also\n\n- [node.js driver Kerberos reference](http://bit.ly/mongodb-node-driver-kerberos)\n- [node.js driver Kerberos functional test][kerberos-functional]\n\n### LDAP authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  ldapUsername: 'arlo',\n  ldapPassword: 'w@of',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/toys?slaveOk=true&authMechanism=PLAIN'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ldapUsername` | String | LDAP username | `undefined` |\n| `ldapPassword` | String | LDAP password | `undefined` |\n\n#### See Also\n\n- [node.js driver LDAP reference](http://bit.ly/mongodb-node-driver-ldap)\n- [node.js driver X509 functional test][ldap-functional]\n\n### X509 authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  x509Username: 'CN=client,OU=arlo,O=MongoDB,L=Philadelphia,ST=Pennsylvania,C=US'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://CN%253Dclient%252COU%253Darlo%252CO%253DMongoDB%252CL%253DPhiladelphia%252CST%253DPennsylvania%252CC%253DUS@localhost:27017?slaveOk=true&authMechanism=MONGODB-X509'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `x509Username` | String | The x.509 certificate derived user name, e.g. `CN=user,OU=OrgUnit,O=myOrg,...` | `undefined` |\n\n#### See Also\n\n- [node.js driver X509 reference](http://bit.ly/mongodb-node-driver-x509)\n- [node.js driver X509 functional test][x509-functional]\n\n### SSL\n\n> **Note**: Not to be confused with `authentication=X509`\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ssl` | Number/String | A boolean to enable or disables TLS/SSL for the connection | `undefined` |\n| `sslMethod` | String | The desired ssl method. Possible values: `NONE`, `SYSTEMCA`, `IFAVAILABLE`, `UNVALIDATED`, `SERVER`, `ALL` | `NONE` |\n| `sslCA` | Buffer/String | Array of valid certificates | `undefined` |\n| `sslCert` | Buffer/String | The certificate | `undefined` |\n| `sslKey` | Buffer/String | The certificate private key | `undefined` |\n| `sslPass` | Buffer/String | The certificate password | `undefined` |\n\nDescription of `sslMethod` values:\n\n- `SYSTEMCA` - SSL required, validate using System CA, with host verification.\n- `IFAVAILABLE` - The driver should try SSL first, fall back to no SSL if unavailable, and use the system's Certificate Authority.\n- `SERVER` - The driver should validate the server certificate and fail to connect if validation fails. See also [node.js driver \"Validate Server Certificate\" docs][driver-ssl-server].\n- `ALL` - The driver must present a valid certificate and validate the server certificate. See also [node.js driver \"Validate Server Certificate and Present Valid Certificate\" docs][driver-ssl-all].\n- `NONE` - No SSL (Not recommended).\n- `UNVALIDATED` - Use SSL but do not perform any validation of the certificate chain. See also [node.js driver \"No Certificate Validation\" docs][driver-ssl-none]. **Very** not recommended and likely to be deprecated in future releases because it exposes potential Man-In-The-Middle attack vectors.\n\n#### See also\n\n- [node.js driver SSL implementation][driver-ssl-impl]\n- [node.js driver SSL tutorial][driver-ssl-tutorial]\n\n### SSH TUNNEL\n\n> New in mongodb-connection-model@5.0.0\n\nBecause [authentication](#authentication) is quite difficult for operators to migrate to, the most common method of securing a MongoDB deployment is to use an [SSH tunnel][sf-ssh-tunnel].  This allows operators to leverage their existing SSH security infrastructure to also provide secure access to MongoDB.  For a standard deployment of MongoDB on AWS, this is almost always to strategy.  Because of this, we now support creating SSH tunnels automatically when connecting to MongoDB.\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options, (connectionError, client) => {\n  if (connectionError) {\n    return console.log(connectionError);\n  }\n\n  client.db('mongodb').collection('fanclub').count((countingError, count) => {\n    console.log('counted:', countingError, count);\n    client.close();\n  });\n});\n```\n\nThe above provides the same functionality as creating the tunnel using the bash\ncommand below and connecting to MongoDB via another terminal. Notice that\nconnection-model uses a random local port each time it creates a tunnel.\nUsing the command line, you'd have to replace `<random port>` with an actual\nport number.\n\n```bash\nssh -i ~/.ssh/my-key-aws-pair.pem -L <random port>:localhost:27017 ubuntu@ec2-11-111-111-111.compute-1.amazonaws.com\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `sshTunnel` | String | The desired SSH tunnel strategy. Possible values: `NONE`, `USER_PASSWORD`, `IDENTITY_FILE` | `undefined` |\n| `sshTunnelHostname` | String | The hostname of the SSH remote host | `undefined` |\n| `sshTunnelPort` | Port | The SSH port of the remote host | `22` |\n| `sshTunnelBindToLocalPort` | Port | Bind the localhost endpoint of the SSH Tunnel to this port | `undefined` |\n| `sshTunnelUsername` | String | The optional SSH username for the remote host | `undefined` |\n| `sshTunnelPassword` | String | The optional SSH password for the remote host | `undefined` |\n| `sshTunnelIdentityFile` | String/Array | The optional path to the SSH identity file for the remote host | `undefined` |\n| `sshTunnelPassphrase` | String | The optional passphrase for `sshTunnelIdentityFile` | `undefined` |\n\nDescription of `sshTunnel` values:\n\n- `NONE` - Do not use SSH tunneling.\n- `USER_PASSWORD` - The tunnel is created with SSH username and password only.\n- `IDENTITY_FILE` - The tunnel is created using an identity file.\n\n## Derived Properties\n\nDerived properties (also known as computed properties) are properties of the state object that depend on other properties to determine their value.\n\n```javascript\nconst c = new Connection();\nconst derivedProps = c.getAttributes({ derived: true });\n```\n\n| Derived Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `instanceId` | String | The mongoscope | `localhost:27017` |\n| `driverAuthMechanism` | String | Converts the value of `authStrategy` for humans into the `authMechanism` value for the driver | `undefined` |\n| `safeUrl` | String | The URL where a password is replaced with stars | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrl` | String | Use this URL in order to connect via DataService | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrlWithSsh` | String | Use this URL in order to connect via connection model itself | `mongodb://localhost:29201/?readPreference=primary&ssl=false` |\n| `driverOptions` | String | The second argument `mongoscope-server` passes to `mongodb.connect` | `{}` |\n\n## Events\n\n> New in mongodb-connection-model@5.0.0\n\n#### Example: SSH Tunnel\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', skipped: true,\n  reason: 'The selected SSL mode does not need to load any files.' }\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', complete: true}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n#### Example: SSL\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  ssl: 'ALL',\n  sslCA: '~/.ssl/my-ca.pem',\n  sslCert: '~/.ssl/my-server.pem',\n  sslKey: '~/.ssl/my-server.pem'\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', complete: true}\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', skipped: true,\n  reason: 'The selected SSH Tunnel mode is NONE.'}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n[workflow_img]: https://github.com/mongodb-js/connection-model/workflows/Check%20and%20Test/badge.svg?event=push\n[workflow_url]: https://github.com/mongodb-js/connection-model/actions?query=workflow%3A%22Check+and+Test%22\n[npm_img]: https://img.shields.io/npm/v/mongodb-connection-model.svg?style=flat-square\n[npm_url]: https://www.npmjs.org/package/mongodb-connection-model\n[gitter_img]: https://badges.gitter.im/Join%20Chat.svg\n[gitter_url]: http://gitter.im/mongodb-js/mongodb-js\n[enterprise_img]: https://img.shields.io/badge/MongoDB-Enterprise-blue.svg?style=flat-square\n[coming_soon_img]: https://img.shields.io/badge/-Coming%20Soon-ff69b4.svg?style=flat-square\n[kerberos-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/kerberos_tests.js\n[ldap-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ldap_tests.js\n[x509-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ssl_x509_tests.js\n[ns]: https://github.com/mongodb-js/ns\n[sf-ssh-tunnel]: http://serverfault.com/questions/597765/how-to-connect-to-mongodb-server-via-ssh-tunnel\n[ec2-key-pairs]: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html\n[driver-ssl-impl]: https://github.com/christkv/mongodb-core/blob/c3d21cb636d74d7a68134ecd3b9f6af536311279/lib/connection/connection.js#L365-L407\n[driver-ssl-tutorial]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/\n[driver-ssl-none]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#no-certificate-validation\n[driver-ssl-server]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate\n[driver-ssl-all]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate-and-present-valid-certificate\n","gitHead":"19de7da29c34177349014132e37b723c1cb16ebd","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","test":"mocha","check":"npm run lint && npm run depcheck","pretest":"mongodb-runner install && mongodb-runner start --port=27018","test-ci":"npm run test","depcheck":"depcheck","posttest":"mongodb-runner stop --port=27018","posttest-ci":"node ../../scripts/killall-mongo.js","test-check-ci":"npm run check && npm test"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.17.0+x64 (linux)","description":"MongoDB connection model.","directories":{},"_nodeVersion":"16.17.0","compass:main":"index.js","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","debug":"^4.2.0","lodash":"^4.17.15","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.2.0","storage-mixin":"0.0.0-next-19de7da29c34177349014132e37b723c1cb16ebd","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.2","@mongodb-js/ssh-tunnel":"0.0.0-next-19de7da29c34177349014132e37b723c1cb16ebd","@mongodb-js/compass-utils":"0.0.0-next-19de7da29c34177349014132e37b723c1cb16ebd","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.5.4"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"^4.10.0","depcheck":"^1.4.1","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.9.0","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^4.10.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_0.0.0-next-19de7da29c34177349014132e37b723c1cb16ebd_1668896217524_0.10641512102206252","host":"s3://npm-registry-packages"}},"0.0.0-next-6e34a0d07479c665cdfa3bddb6bfd864365f6b8a":{"name":"mongodb-connection-model","version":"0.0.0-next-6e34a0d07479c665cdfa3bddb6bfd864365f6b8a","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@0.0.0-next-6e34a0d07479c665cdfa3bddb6bfd864365f6b8a","maintainers":[{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"iteng@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"d610fe1735021852300e80f20f41f5808b0452b7","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-0.0.0-next-6e34a0d07479c665cdfa3bddb6bfd864365f6b8a.tgz","fileCount":20,"integrity":"sha512-0iw0yQRIrR67Ci9N8iq9ccTUpOvdX0aJWzMGlidUUJPnftB0Ck8w6XaDWg8NIZzWZuink0eP2ivZKDFopj4skg==","signatures":[{"sig":"MEUCIHeLoQN+49y5Yes/kGLPmApPTuLq9sn9+CmV5yjTVOf/AiEA3SPiy3Bf/pZuMvkxzgg3Y5AmHrxCDXplO/BhVWWcrb8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":108152,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjfDbgACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq8Hg//baP/pMT2zQz9/hmLqcUa0pNbK5FEbrpO49/PsJy1Su+14Ik1\r\nHIKtKy9aj3olT0Yt8J8Iw9vBFFjSvx0lQgepLXztGLVr3JmVZjt6/OL83s7i\r\nABAdDAp5OXM8ideHjgVjJxzn5p/rbfCjT5l5H3m2Jy1r4Ak1cArFhFfe3vTt\r\nOWHP4WhnrfZG2BYwLJXRjA3CEh34/ZtEciT8QGLjzhNY3B2z/1/OwzSd/OAL\r\nCTSCjnjGEgATzo99SbY2jOSN1RvvCXtx+lrD6Dhyft71zRDbAqmvT8TEVYiI\r\ndGd1x2ICXNndFql1qXu/NILIPLcZHjWRxc7VRB/Pb8Iut0ttqNaevKsWYkBb\r\n7ebID6S2fgZUcftTPkvdAD/Gdyz0y20ihpZ+EwXcxoDJg2bfyok0eg16yjn5\r\nbHrUayNTrJMkA0geMJ99L++6Fe6r+vIkaZU3K5yW5TjUTSpnReVQir5KlRNN\r\nwWScm6g3yXbajMxGPw5UtrI72ynHBSrDUVufu7HXZxm0haedzNKZ/6mqHCEq\r\nwqHCSKOUtrMlfDNKJWE9uZJfqnVZ/mb9TZuRxXW6mTDL2okHidlkFxMKlrNl\r\nW96AsBebCE+G8lm/je3L/Tpe2ahPTSITW/s6+v/9ImAWMg33+2OnW1ik3nam\r\n7+xFEv/YNvtvx12nxdAFrz0aYPDl7x6dc0Q=\r\n=kt4U\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","readme":"# mongodb-connection-model [![][workflow_img]][workflow_url] [![][npm_img]][npm_url]\n\n> MongoDB connection model\n\nThe main purpose of the MongoDB connection model is to be a domain model around a MongoDB connection. It encapsulates generating a [Connection String URI](https://docs.mongodb.com/manual/reference/connection-string/) from a group of attributes and parses URI using the [MongoDB Node.JS Driver URI Parser](https://github.com/mongodb-js/mongodb-core/blob/master/lib/uri_parser.js).\n\n## Installation\n\n```\nnpm install --save mongodb-connection-model\n```\n\n## Usage\n\n### Building URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\nconst c = new Connection({ appname: 'My App Name' });\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://localhost:27017/?readPreference=primary&appname=My%20App&ssl=false'\n```\n\n### Parsing URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\n\nConnection.from(\n  'mongodb://someUsername:testPassword@localhost',\n  (error, result) => {\n    console.log(result);\n    >>> `{\n      hosts: [{ host: 'localhost', port: 27017 }],\n      hostname: 'localhost',\n      port: 27017,\n      auth: {\n        username: 'someUsername',\n        password: 'testPassword',\n        db: 'admin'\n      },\n      isSrvRecord: false,\n      authStrategy: 'MONGODB',\n      mongodbUsername: 'someUsername',\n      mongodbPassword: 'testPassword',\n      mongodbDatabaseName: 'admin',\n      extraOptions: {},\n      connectionType: 'NODE_DRIVER',\n      readPreference: 'primary',\n      kerberosCanonicalizeHostname: false,\n      sslMethod: 'NONE',\n      sshTunnel: 'NONE',\n      sshTunnelPort: 22\n    }`\n  }\n);\n```\n\n## Properties\n\nMongoDB connection model is based on Ampersand.js framework and consist of [props](https://ampersandjs.com/docs/#ampersand-state-props) and [derived props](https://ampersandjs.com/docs/#ampersand-state-derived). The props object describes the observable properties that MongoDB connection model gets from the Node.js Driver API.\n\n```javascript\nconst с = new Connection();\nconst props = с.getAttributes({ props: true });\n```\n\n#### See Also\n\n- [URI Generic Syntax](https://tools.ietf.org/html/rfc3986)\n- [URI Options Specification](https://github.com/mongodb/specifications/blob/master/source/uri-options/uri-options.rst)\n\n### General Properties\n\n```javascript\nconst c = new Connection({ isSrvRecord: true });\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ns` | String | A valid [ns][ns] the user can read from | `undefined` |\n| `isSrvRecord` | Boolean | Indicates SRV record | `false` |\n| `auth` | Object | Authentication from driver (username, user, db, password) | `undefined` |\n| `hostname` | String | Hostname of a MongoDB Instance. In case of the replica set the first host and port will be taken | `localhost` |\n| `port` | Number | TCP port of a MongoDB Instance | `27017` |\n| `hosts` | Array | Contains all hosts and ports for replica set | `[{ host: 'localhost', port: 27017 }]` |\n| `extraOptions` | Object | Extra options passed to the node driver as part of `driverOptions` | `{}` |\n| `connectionType` | String | The desired connection type. Possible values: `NODE_DRIVER`, `STITCH_ON_PREM`, `STITCH_ATLAS` | `NODE_DRIVER` |\n| `authStrategy` | String | The desired authentication strategy. Possible values: `NONE`, `MONGODB`, `X509`, `KERBEROS`, `LDAP`, `SCRAM-SHA-256` | `NONE` |\n\n### Connection string options\n\n```javascript\nconst c = new Connection({ appname: 'My App', replicaSet: 'testing' });\n```\n\n#### General connection string options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `replicaSet` | String | Specifies the name of the replica set, if the mongod is a member of a replica set | `undefined` |\n| `connectTimeoutMS` | Number | The time in milliseconds to attempt a connection before timing out | `undefined` |\n| `socketTimeoutMS` | Number | The time in milliseconds to attempt a send or receive on a socket before the attempt times out | `undefined` |\n| `compression` | Object | Object includes compressors and a compression level. The following compressors can be specified: `snappy`, `zlib` (Available in MongoDB 3.6 or greater) | `undefined` |\n\n#### Connection Pool Option\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `maxPoolSize` | Number | The maximum number of connections in the connection pool | `undefined` |\n| `minPoolSize` | Number | The minimum number of connections in the connection pool | `undefined` |\n| `maxIdleTimeMS` | Number | The maximum number of milliseconds that a connection can remain idle in the pool before being removed and closed | `undefined` |\n| `waitQueueMultiple` | Number | A number that the driver multiples the maxPoolSize value to, to provide the maximum number of threads allowed to wait for a connection to become available from the pool | `undefined` |\n| `waitQueueTimeoutMS` | Number | The maximum time in milliseconds that a thread can wait for a connection to become available | `undefined` |\n\n#### Write Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `w` | Number/String | Corresponds to the write concern [w Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-w) | `undefined` |\n| `wTimeoutMS` | Number | Corresponds to the write concern [wtimeout](https://docs.mongodb.com/manual/reference/write-concern/#wc-wtimeout) | `undefined` |\n| `journal` | Boolean | Corresponds to the write concern [j Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-j) | `undefined` |\n\n#### Read Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readConcernLevel` | String | The level of isolation | `undefined` |\n\n#### Read Preference Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readPreference` | String | Specifies the read preferences for this connection. Possible values: `PRIMARY`, `PRIMARY_PREFERRED`, `SECONDARY`, `SECONDARY_PREFERRED`, `NEAREST` | `PRIMARY` |\n| `maxStalenessSeconds` | Number | Specifies, in seconds, how stale a secondary can be before the client stops using it for read operations | `undefined` |\n| `readPreferenceTags` | Object | Default read preference tags for the client | `undefined` |\n\n#### Authentication Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `authSource` | String | Specify the database name associated with the user’s credentials | `undefined` |\n| `authMechanism` | String | Specifies the authentication mechanism that MongoDB will use to authenticate the connection. Possible values: `DEFAULT`, `GSSAPI`, `MONGODB-X509`, `PLAIN`, `SCRAM-SHA-256` | `undefined` |\n| `authMechanismProperties` | Object | Additional options provided for authentication (e.g. to enable hostname canonicalization for GSSAPI) | `undefined` |\n| `gssapiServiceName` | String | Set the Kerberos service name when connecting to Kerberized MongoDB instances | `undefined` |\n| `gssapiServiceRealm` | String | Set the Realm service name | `undefined` |\n| `gssapiCanonicalizeHostName` | Boolean | Whether canonicalized hostname | `undefined` |\n\n#### Server Selection and Discovery Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `localThresholdMS` | Number | The size (in milliseconds) of the latency window for selecting among multiple suitable MongoDB instances | `undefined` |\n| `serverSelectionTimeoutMS` | Number | Specifies how long (in milliseconds) to block for server selection before throwing an exception | `undefined` |\n| `serverSelectionTryOnce` | Boolean | Instructs the driver to scan the MongoDB deployment exactly once after server selection fails and then either select a server or raise an error | `undefined` |\n| `heartbeatFrequencyMS` | Number | Controls when the driver checks the state of the MongoDB deployment | `undefined` |\n\n#### Miscellaneous Configuration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `appname` | String | An application name passed to server as client metadata | `undefined` |\n| `retryWrites` | Boolean | Enable retryable writes | `undefined` |\n| `uuidRepresentation` | String | The legacy representation of UUID. Possible values: `standard`, `csharpLegacy`, `javaLegacy`, `pythonLegacy` | `undefined` |\n| `loadBalanced` | Boolean | Whether or not the server is running in load balanced mode | `undefined` |\n\n### Stitch attributes\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `stitchServiceName` | String | Stitch service name | `undefined` |\n| `stitchClientAppId` | String | Stitch сlient app ID | `undefined` |\n| `stitchGroupId` | String | Stitch group ID | `undefined` |\n| `stitchBaseUrl` | String | Stitch base Url | `undefined` |\n\n### MONGODB authentication\n\n```javascript\nconst c = new Connection({\n  mongodbUsername: 'arlo',\n  mongodbPassword: 'w@of'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/?slaveOk=true&authSource=admin'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `mongodbUsername` | String | MongoDB username | `undefined` |\n| `mongodbPassword` | String | MongoDB password | `undefined` |\n| `mongodbDatabaseName` | String | The database name associated with the user's credentials | `undefined` |\n| `promoteValues` | Boolean | Whether BSON values should be promoted to their JS type counterparts | `undefined` |\n\n### KERBEROS authentication\n\n```javascript\nconst c = new Connection({\n  kerberosServiceName: 'mongodb',\n  kerberosPrincipal: 'arlo/dog@krb5.mongodb.parts',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo%252Fdog%2540krb5.mongodb.parts@localhost:27017/toys?authMechanism=GSSAPI'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n> @note (imlucas): Kerberos on Windows is broken out as it's own state for UX consideration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `kerberosServiceName` | String | Any program or computer you access over a network | `undefined` |\n| `kerberosPrincipal` | String | The format of a typical Kerberos V5 principal is `primary/instance@REALM` | `undefined` |\n| `kerberosCanonicalizeHostname` | Boolean | Whether canonicalized kerberos hostname | `undefined` |\n\n#### See Also\n\n- [node.js driver Kerberos reference](http://bit.ly/mongodb-node-driver-kerberos)\n- [node.js driver Kerberos functional test][kerberos-functional]\n\n### LDAP authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  ldapUsername: 'arlo',\n  ldapPassword: 'w@of',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/toys?slaveOk=true&authMechanism=PLAIN'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ldapUsername` | String | LDAP username | `undefined` |\n| `ldapPassword` | String | LDAP password | `undefined` |\n\n#### See Also\n\n- [node.js driver LDAP reference](http://bit.ly/mongodb-node-driver-ldap)\n- [node.js driver X509 functional test][ldap-functional]\n\n### X509 authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  x509Username: 'CN=client,OU=arlo,O=MongoDB,L=Philadelphia,ST=Pennsylvania,C=US'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://CN%253Dclient%252COU%253Darlo%252CO%253DMongoDB%252CL%253DPhiladelphia%252CST%253DPennsylvania%252CC%253DUS@localhost:27017?slaveOk=true&authMechanism=MONGODB-X509'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `x509Username` | String | The x.509 certificate derived user name, e.g. `CN=user,OU=OrgUnit,O=myOrg,...` | `undefined` |\n\n#### See Also\n\n- [node.js driver X509 reference](http://bit.ly/mongodb-node-driver-x509)\n- [node.js driver X509 functional test][x509-functional]\n\n### SSL\n\n> **Note**: Not to be confused with `authentication=X509`\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ssl` | Number/String | A boolean to enable or disables TLS/SSL for the connection | `undefined` |\n| `sslMethod` | String | The desired ssl method. Possible values: `NONE`, `SYSTEMCA`, `IFAVAILABLE`, `UNVALIDATED`, `SERVER`, `ALL` | `NONE` |\n| `sslCA` | Buffer/String | Array of valid certificates | `undefined` |\n| `sslCert` | Buffer/String | The certificate | `undefined` |\n| `sslKey` | Buffer/String | The certificate private key | `undefined` |\n| `sslPass` | Buffer/String | The certificate password | `undefined` |\n\nDescription of `sslMethod` values:\n\n- `SYSTEMCA` - SSL required, validate using System CA, with host verification.\n- `IFAVAILABLE` - The driver should try SSL first, fall back to no SSL if unavailable, and use the system's Certificate Authority.\n- `SERVER` - The driver should validate the server certificate and fail to connect if validation fails. See also [node.js driver \"Validate Server Certificate\" docs][driver-ssl-server].\n- `ALL` - The driver must present a valid certificate and validate the server certificate. See also [node.js driver \"Validate Server Certificate and Present Valid Certificate\" docs][driver-ssl-all].\n- `NONE` - No SSL (Not recommended).\n- `UNVALIDATED` - Use SSL but do not perform any validation of the certificate chain. See also [node.js driver \"No Certificate Validation\" docs][driver-ssl-none]. **Very** not recommended and likely to be deprecated in future releases because it exposes potential Man-In-The-Middle attack vectors.\n\n#### See also\n\n- [node.js driver SSL implementation][driver-ssl-impl]\n- [node.js driver SSL tutorial][driver-ssl-tutorial]\n\n### SSH TUNNEL\n\n> New in mongodb-connection-model@5.0.0\n\nBecause [authentication](#authentication) is quite difficult for operators to migrate to, the most common method of securing a MongoDB deployment is to use an [SSH tunnel][sf-ssh-tunnel].  This allows operators to leverage their existing SSH security infrastructure to also provide secure access to MongoDB.  For a standard deployment of MongoDB on AWS, this is almost always to strategy.  Because of this, we now support creating SSH tunnels automatically when connecting to MongoDB.\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options, (connectionError, client) => {\n  if (connectionError) {\n    return console.log(connectionError);\n  }\n\n  client.db('mongodb').collection('fanclub').count((countingError, count) => {\n    console.log('counted:', countingError, count);\n    client.close();\n  });\n});\n```\n\nThe above provides the same functionality as creating the tunnel using the bash\ncommand below and connecting to MongoDB via another terminal. Notice that\nconnection-model uses a random local port each time it creates a tunnel.\nUsing the command line, you'd have to replace `<random port>` with an actual\nport number.\n\n```bash\nssh -i ~/.ssh/my-key-aws-pair.pem -L <random port>:localhost:27017 ubuntu@ec2-11-111-111-111.compute-1.amazonaws.com\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `sshTunnel` | String | The desired SSH tunnel strategy. Possible values: `NONE`, `USER_PASSWORD`, `IDENTITY_FILE` | `undefined` |\n| `sshTunnelHostname` | String | The hostname of the SSH remote host | `undefined` |\n| `sshTunnelPort` | Port | The SSH port of the remote host | `22` |\n| `sshTunnelBindToLocalPort` | Port | Bind the localhost endpoint of the SSH Tunnel to this port | `undefined` |\n| `sshTunnelUsername` | String | The optional SSH username for the remote host | `undefined` |\n| `sshTunnelPassword` | String | The optional SSH password for the remote host | `undefined` |\n| `sshTunnelIdentityFile` | String/Array | The optional path to the SSH identity file for the remote host | `undefined` |\n| `sshTunnelPassphrase` | String | The optional passphrase for `sshTunnelIdentityFile` | `undefined` |\n\nDescription of `sshTunnel` values:\n\n- `NONE` - Do not use SSH tunneling.\n- `USER_PASSWORD` - The tunnel is created with SSH username and password only.\n- `IDENTITY_FILE` - The tunnel is created using an identity file.\n\n## Derived Properties\n\nDerived properties (also known as computed properties) are properties of the state object that depend on other properties to determine their value.\n\n```javascript\nconst c = new Connection();\nconst derivedProps = c.getAttributes({ derived: true });\n```\n\n| Derived Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `instanceId` | String | The mongoscope | `localhost:27017` |\n| `driverAuthMechanism` | String | Converts the value of `authStrategy` for humans into the `authMechanism` value for the driver | `undefined` |\n| `safeUrl` | String | The URL where a password is replaced with stars | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrl` | String | Use this URL in order to connect via DataService | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrlWithSsh` | String | Use this URL in order to connect via connection model itself | `mongodb://localhost:29201/?readPreference=primary&ssl=false` |\n| `driverOptions` | String | The second argument `mongoscope-server` passes to `mongodb.connect` | `{}` |\n\n## Events\n\n> New in mongodb-connection-model@5.0.0\n\n#### Example: SSH Tunnel\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', skipped: true,\n  reason: 'The selected SSL mode does not need to load any files.' }\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', complete: true}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n#### Example: SSL\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  ssl: 'ALL',\n  sslCA: '~/.ssl/my-ca.pem',\n  sslCert: '~/.ssl/my-server.pem',\n  sslKey: '~/.ssl/my-server.pem'\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', complete: true}\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', skipped: true,\n  reason: 'The selected SSH Tunnel mode is NONE.'}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n[workflow_img]: https://github.com/mongodb-js/connection-model/workflows/Check%20and%20Test/badge.svg?event=push\n[workflow_url]: https://github.com/mongodb-js/connection-model/actions?query=workflow%3A%22Check+and+Test%22\n[npm_img]: https://img.shields.io/npm/v/mongodb-connection-model.svg?style=flat-square\n[npm_url]: https://www.npmjs.org/package/mongodb-connection-model\n[gitter_img]: https://badges.gitter.im/Join%20Chat.svg\n[gitter_url]: http://gitter.im/mongodb-js/mongodb-js\n[enterprise_img]: https://img.shields.io/badge/MongoDB-Enterprise-blue.svg?style=flat-square\n[coming_soon_img]: https://img.shields.io/badge/-Coming%20Soon-ff69b4.svg?style=flat-square\n[kerberos-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/kerberos_tests.js\n[ldap-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ldap_tests.js\n[x509-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ssl_x509_tests.js\n[ns]: https://github.com/mongodb-js/ns\n[sf-ssh-tunnel]: http://serverfault.com/questions/597765/how-to-connect-to-mongodb-server-via-ssh-tunnel\n[ec2-key-pairs]: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html\n[driver-ssl-impl]: https://github.com/christkv/mongodb-core/blob/c3d21cb636d74d7a68134ecd3b9f6af536311279/lib/connection/connection.js#L365-L407\n[driver-ssl-tutorial]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/\n[driver-ssl-none]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#no-certificate-validation\n[driver-ssl-server]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate\n[driver-ssl-all]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate-and-present-valid-certificate\n","gitHead":"6e34a0d07479c665cdfa3bddb6bfd864365f6b8a","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","test":"mocha","check":"npm run lint && npm run depcheck","pretest":"mongodb-runner install && mongodb-runner start --port=27018","test-ci":"npm run test","depcheck":"depcheck","posttest":"mongodb-runner stop --port=27018","posttest-ci":"node ../../scripts/killall-mongo.js","test-check-ci":"npm run check && npm test"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.17.0+x64 (linux)","description":"MongoDB connection model.","directories":{},"_nodeVersion":"16.17.0","compass:main":"index.js","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","debug":"^4.2.0","lodash":"^4.17.15","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.2.0","storage-mixin":"0.0.0-next-6e34a0d07479c665cdfa3bddb6bfd864365f6b8a","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.2","@mongodb-js/ssh-tunnel":"0.0.0-next-6e34a0d07479c665cdfa3bddb6bfd864365f6b8a","@mongodb-js/compass-utils":"0.0.0-next-6e34a0d07479c665cdfa3bddb6bfd864365f6b8a","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.5.4"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"^4.10.0","depcheck":"^1.4.1","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.9.0","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^4.10.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_0.0.0-next-6e34a0d07479c665cdfa3bddb6bfd864365f6b8a_1669084896585_0.7413556418271061","host":"s3://npm-registry-packages"}},"0.0.0-next-31a3fe49cf0eba4c3afe85c4a4139ce198cb0e51":{"name":"mongodb-connection-model","version":"0.0.0-next-31a3fe49cf0eba4c3afe85c4a4139ce198cb0e51","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@0.0.0-next-31a3fe49cf0eba4c3afe85c4a4139ce198cb0e51","maintainers":[{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"iteng@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"2e3820602a7c672ddfae6b3509c2ba329351beb4","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-0.0.0-next-31a3fe49cf0eba4c3afe85c4a4139ce198cb0e51.tgz","fileCount":20,"integrity":"sha512-ksFf6VXUBkjimozvpEgD1I8Qzve6GXrXzkT+Wyde4dVcx1yVJR3bUj/k8aAvnWA/vdimUt/lHFMEeoKLQ1LcYA==","signatures":[{"sig":"MEUCIBSbZJdyR7c23htsMZNaVUK02f+AtlFjWmmruRhfoygVAiEAwCDBaMu4QOR1/LkomOVSgQc+VU9JAsW0HA84Napx8Io=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":108152,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjfDeQACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqlaQ/9FkfF/BihURD/BwPMFBYoFLEG3zDJGPdITQ+D6Nr2wGOZ8bb8\r\nr3sFogFGBwcU2g/SJ7sy2ntSUEa8Q0FiZ2VDPsfC2L+xOjsDTU/537WRp8gK\r\n/G01zLSoIh9dU7iNzizNIiGjWpRdpKuGXHH5THnY41B05SA1exU7LnrOBITU\r\n2CjCQ1sZHC1Z7tB0rymOi9Oqu7o/+i0o1jg9WQ7w7kQ3L3qXvlL7bp2bs1R2\r\nJ2jeaYNrzm/yZKGGPp/8I9A4svNkKC6RImgGiWaDcI5G9j6Y3qPpRVt6LW6S\r\nCyKF55QlKOtxPzXdQ8E6FiPLSpkTAOUurVecXYUe60eMzTjUll5TpOTNuIEj\r\nyFNdCfsF4OqeG9dRjb+n+nXhDqb1/pUbD9ubzkbKkMxcqDJ491R1QuVs5bZB\r\n5W6l6RZMrf33ICWjKwE7WJNQu84AtloOX8XUM0E+YhD63JXNCOksN5/9EZC0\r\nBIrJOzBvaZf+U0zHWqciqmL1Y4hdHHb7L6rpp3mXbqibvk7PdPGMiUF+37rB\r\nBBl4T9cTgCdK8anWL3eLYZPeAafhAizhm2xE+m+6cDeZGCw3lOa74OBc0VOA\r\nNWhF5IVvZ6t0iuhyKKUNBKY9MdFx4G5VMqKivyioufN2dEfSNGpHA+NMZ4i4\r\niNGOIKbXBCupDvaPOV9ITEI79i7nbiZ+IEw=\r\n=n7aV\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","readme":"# mongodb-connection-model [![][workflow_img]][workflow_url] [![][npm_img]][npm_url]\n\n> MongoDB connection model\n\nThe main purpose of the MongoDB connection model is to be a domain model around a MongoDB connection. It encapsulates generating a [Connection String URI](https://docs.mongodb.com/manual/reference/connection-string/) from a group of attributes and parses URI using the [MongoDB Node.JS Driver URI Parser](https://github.com/mongodb-js/mongodb-core/blob/master/lib/uri_parser.js).\n\n## Installation\n\n```\nnpm install --save mongodb-connection-model\n```\n\n## Usage\n\n### Building URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\nconst c = new Connection({ appname: 'My App Name' });\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://localhost:27017/?readPreference=primary&appname=My%20App&ssl=false'\n```\n\n### Parsing URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\n\nConnection.from(\n  'mongodb://someUsername:testPassword@localhost',\n  (error, result) => {\n    console.log(result);\n    >>> `{\n      hosts: [{ host: 'localhost', port: 27017 }],\n      hostname: 'localhost',\n      port: 27017,\n      auth: {\n        username: 'someUsername',\n        password: 'testPassword',\n        db: 'admin'\n      },\n      isSrvRecord: false,\n      authStrategy: 'MONGODB',\n      mongodbUsername: 'someUsername',\n      mongodbPassword: 'testPassword',\n      mongodbDatabaseName: 'admin',\n      extraOptions: {},\n      connectionType: 'NODE_DRIVER',\n      readPreference: 'primary',\n      kerberosCanonicalizeHostname: false,\n      sslMethod: 'NONE',\n      sshTunnel: 'NONE',\n      sshTunnelPort: 22\n    }`\n  }\n);\n```\n\n## Properties\n\nMongoDB connection model is based on Ampersand.js framework and consist of [props](https://ampersandjs.com/docs/#ampersand-state-props) and [derived props](https://ampersandjs.com/docs/#ampersand-state-derived). The props object describes the observable properties that MongoDB connection model gets from the Node.js Driver API.\n\n```javascript\nconst с = new Connection();\nconst props = с.getAttributes({ props: true });\n```\n\n#### See Also\n\n- [URI Generic Syntax](https://tools.ietf.org/html/rfc3986)\n- [URI Options Specification](https://github.com/mongodb/specifications/blob/master/source/uri-options/uri-options.rst)\n\n### General Properties\n\n```javascript\nconst c = new Connection({ isSrvRecord: true });\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ns` | String | A valid [ns][ns] the user can read from | `undefined` |\n| `isSrvRecord` | Boolean | Indicates SRV record | `false` |\n| `auth` | Object | Authentication from driver (username, user, db, password) | `undefined` |\n| `hostname` | String | Hostname of a MongoDB Instance. In case of the replica set the first host and port will be taken | `localhost` |\n| `port` | Number | TCP port of a MongoDB Instance | `27017` |\n| `hosts` | Array | Contains all hosts and ports for replica set | `[{ host: 'localhost', port: 27017 }]` |\n| `extraOptions` | Object | Extra options passed to the node driver as part of `driverOptions` | `{}` |\n| `connectionType` | String | The desired connection type. Possible values: `NODE_DRIVER`, `STITCH_ON_PREM`, `STITCH_ATLAS` | `NODE_DRIVER` |\n| `authStrategy` | String | The desired authentication strategy. Possible values: `NONE`, `MONGODB`, `X509`, `KERBEROS`, `LDAP`, `SCRAM-SHA-256` | `NONE` |\n\n### Connection string options\n\n```javascript\nconst c = new Connection({ appname: 'My App', replicaSet: 'testing' });\n```\n\n#### General connection string options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `replicaSet` | String | Specifies the name of the replica set, if the mongod is a member of a replica set | `undefined` |\n| `connectTimeoutMS` | Number | The time in milliseconds to attempt a connection before timing out | `undefined` |\n| `socketTimeoutMS` | Number | The time in milliseconds to attempt a send or receive on a socket before the attempt times out | `undefined` |\n| `compression` | Object | Object includes compressors and a compression level. The following compressors can be specified: `snappy`, `zlib` (Available in MongoDB 3.6 or greater) | `undefined` |\n\n#### Connection Pool Option\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `maxPoolSize` | Number | The maximum number of connections in the connection pool | `undefined` |\n| `minPoolSize` | Number | The minimum number of connections in the connection pool | `undefined` |\n| `maxIdleTimeMS` | Number | The maximum number of milliseconds that a connection can remain idle in the pool before being removed and closed | `undefined` |\n| `waitQueueMultiple` | Number | A number that the driver multiples the maxPoolSize value to, to provide the maximum number of threads allowed to wait for a connection to become available from the pool | `undefined` |\n| `waitQueueTimeoutMS` | Number | The maximum time in milliseconds that a thread can wait for a connection to become available | `undefined` |\n\n#### Write Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `w` | Number/String | Corresponds to the write concern [w Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-w) | `undefined` |\n| `wTimeoutMS` | Number | Corresponds to the write concern [wtimeout](https://docs.mongodb.com/manual/reference/write-concern/#wc-wtimeout) | `undefined` |\n| `journal` | Boolean | Corresponds to the write concern [j Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-j) | `undefined` |\n\n#### Read Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readConcernLevel` | String | The level of isolation | `undefined` |\n\n#### Read Preference Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readPreference` | String | Specifies the read preferences for this connection. Possible values: `PRIMARY`, `PRIMARY_PREFERRED`, `SECONDARY`, `SECONDARY_PREFERRED`, `NEAREST` | `PRIMARY` |\n| `maxStalenessSeconds` | Number | Specifies, in seconds, how stale a secondary can be before the client stops using it for read operations | `undefined` |\n| `readPreferenceTags` | Object | Default read preference tags for the client | `undefined` |\n\n#### Authentication Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `authSource` | String | Specify the database name associated with the user’s credentials | `undefined` |\n| `authMechanism` | String | Specifies the authentication mechanism that MongoDB will use to authenticate the connection. Possible values: `DEFAULT`, `GSSAPI`, `MONGODB-X509`, `PLAIN`, `SCRAM-SHA-256` | `undefined` |\n| `authMechanismProperties` | Object | Additional options provided for authentication (e.g. to enable hostname canonicalization for GSSAPI) | `undefined` |\n| `gssapiServiceName` | String | Set the Kerberos service name when connecting to Kerberized MongoDB instances | `undefined` |\n| `gssapiServiceRealm` | String | Set the Realm service name | `undefined` |\n| `gssapiCanonicalizeHostName` | Boolean | Whether canonicalized hostname | `undefined` |\n\n#### Server Selection and Discovery Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `localThresholdMS` | Number | The size (in milliseconds) of the latency window for selecting among multiple suitable MongoDB instances | `undefined` |\n| `serverSelectionTimeoutMS` | Number | Specifies how long (in milliseconds) to block for server selection before throwing an exception | `undefined` |\n| `serverSelectionTryOnce` | Boolean | Instructs the driver to scan the MongoDB deployment exactly once after server selection fails and then either select a server or raise an error | `undefined` |\n| `heartbeatFrequencyMS` | Number | Controls when the driver checks the state of the MongoDB deployment | `undefined` |\n\n#### Miscellaneous Configuration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `appname` | String | An application name passed to server as client metadata | `undefined` |\n| `retryWrites` | Boolean | Enable retryable writes | `undefined` |\n| `uuidRepresentation` | String | The legacy representation of UUID. Possible values: `standard`, `csharpLegacy`, `javaLegacy`, `pythonLegacy` | `undefined` |\n| `loadBalanced` | Boolean | Whether or not the server is running in load balanced mode | `undefined` |\n\n### Stitch attributes\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `stitchServiceName` | String | Stitch service name | `undefined` |\n| `stitchClientAppId` | String | Stitch сlient app ID | `undefined` |\n| `stitchGroupId` | String | Stitch group ID | `undefined` |\n| `stitchBaseUrl` | String | Stitch base Url | `undefined` |\n\n### MONGODB authentication\n\n```javascript\nconst c = new Connection({\n  mongodbUsername: 'arlo',\n  mongodbPassword: 'w@of'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/?slaveOk=true&authSource=admin'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `mongodbUsername` | String | MongoDB username | `undefined` |\n| `mongodbPassword` | String | MongoDB password | `undefined` |\n| `mongodbDatabaseName` | String | The database name associated with the user's credentials | `undefined` |\n| `promoteValues` | Boolean | Whether BSON values should be promoted to their JS type counterparts | `undefined` |\n\n### KERBEROS authentication\n\n```javascript\nconst c = new Connection({\n  kerberosServiceName: 'mongodb',\n  kerberosPrincipal: 'arlo/dog@krb5.mongodb.parts',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo%252Fdog%2540krb5.mongodb.parts@localhost:27017/toys?authMechanism=GSSAPI'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n> @note (imlucas): Kerberos on Windows is broken out as it's own state for UX consideration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `kerberosServiceName` | String | Any program or computer you access over a network | `undefined` |\n| `kerberosPrincipal` | String | The format of a typical Kerberos V5 principal is `primary/instance@REALM` | `undefined` |\n| `kerberosCanonicalizeHostname` | Boolean | Whether canonicalized kerberos hostname | `undefined` |\n\n#### See Also\n\n- [node.js driver Kerberos reference](http://bit.ly/mongodb-node-driver-kerberos)\n- [node.js driver Kerberos functional test][kerberos-functional]\n\n### LDAP authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  ldapUsername: 'arlo',\n  ldapPassword: 'w@of',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/toys?slaveOk=true&authMechanism=PLAIN'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ldapUsername` | String | LDAP username | `undefined` |\n| `ldapPassword` | String | LDAP password | `undefined` |\n\n#### See Also\n\n- [node.js driver LDAP reference](http://bit.ly/mongodb-node-driver-ldap)\n- [node.js driver X509 functional test][ldap-functional]\n\n### X509 authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  x509Username: 'CN=client,OU=arlo,O=MongoDB,L=Philadelphia,ST=Pennsylvania,C=US'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://CN%253Dclient%252COU%253Darlo%252CO%253DMongoDB%252CL%253DPhiladelphia%252CST%253DPennsylvania%252CC%253DUS@localhost:27017?slaveOk=true&authMechanism=MONGODB-X509'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `x509Username` | String | The x.509 certificate derived user name, e.g. `CN=user,OU=OrgUnit,O=myOrg,...` | `undefined` |\n\n#### See Also\n\n- [node.js driver X509 reference](http://bit.ly/mongodb-node-driver-x509)\n- [node.js driver X509 functional test][x509-functional]\n\n### SSL\n\n> **Note**: Not to be confused with `authentication=X509`\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ssl` | Number/String | A boolean to enable or disables TLS/SSL for the connection | `undefined` |\n| `sslMethod` | String | The desired ssl method. Possible values: `NONE`, `SYSTEMCA`, `IFAVAILABLE`, `UNVALIDATED`, `SERVER`, `ALL` | `NONE` |\n| `sslCA` | Buffer/String | Array of valid certificates | `undefined` |\n| `sslCert` | Buffer/String | The certificate | `undefined` |\n| `sslKey` | Buffer/String | The certificate private key | `undefined` |\n| `sslPass` | Buffer/String | The certificate password | `undefined` |\n\nDescription of `sslMethod` values:\n\n- `SYSTEMCA` - SSL required, validate using System CA, with host verification.\n- `IFAVAILABLE` - The driver should try SSL first, fall back to no SSL if unavailable, and use the system's Certificate Authority.\n- `SERVER` - The driver should validate the server certificate and fail to connect if validation fails. See also [node.js driver \"Validate Server Certificate\" docs][driver-ssl-server].\n- `ALL` - The driver must present a valid certificate and validate the server certificate. See also [node.js driver \"Validate Server Certificate and Present Valid Certificate\" docs][driver-ssl-all].\n- `NONE` - No SSL (Not recommended).\n- `UNVALIDATED` - Use SSL but do not perform any validation of the certificate chain. See also [node.js driver \"No Certificate Validation\" docs][driver-ssl-none]. **Very** not recommended and likely to be deprecated in future releases because it exposes potential Man-In-The-Middle attack vectors.\n\n#### See also\n\n- [node.js driver SSL implementation][driver-ssl-impl]\n- [node.js driver SSL tutorial][driver-ssl-tutorial]\n\n### SSH TUNNEL\n\n> New in mongodb-connection-model@5.0.0\n\nBecause [authentication](#authentication) is quite difficult for operators to migrate to, the most common method of securing a MongoDB deployment is to use an [SSH tunnel][sf-ssh-tunnel].  This allows operators to leverage their existing SSH security infrastructure to also provide secure access to MongoDB.  For a standard deployment of MongoDB on AWS, this is almost always to strategy.  Because of this, we now support creating SSH tunnels automatically when connecting to MongoDB.\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options, (connectionError, client) => {\n  if (connectionError) {\n    return console.log(connectionError);\n  }\n\n  client.db('mongodb').collection('fanclub').count((countingError, count) => {\n    console.log('counted:', countingError, count);\n    client.close();\n  });\n});\n```\n\nThe above provides the same functionality as creating the tunnel using the bash\ncommand below and connecting to MongoDB via another terminal. Notice that\nconnection-model uses a random local port each time it creates a tunnel.\nUsing the command line, you'd have to replace `<random port>` with an actual\nport number.\n\n```bash\nssh -i ~/.ssh/my-key-aws-pair.pem -L <random port>:localhost:27017 ubuntu@ec2-11-111-111-111.compute-1.amazonaws.com\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `sshTunnel` | String | The desired SSH tunnel strategy. Possible values: `NONE`, `USER_PASSWORD`, `IDENTITY_FILE` | `undefined` |\n| `sshTunnelHostname` | String | The hostname of the SSH remote host | `undefined` |\n| `sshTunnelPort` | Port | The SSH port of the remote host | `22` |\n| `sshTunnelBindToLocalPort` | Port | Bind the localhost endpoint of the SSH Tunnel to this port | `undefined` |\n| `sshTunnelUsername` | String | The optional SSH username for the remote host | `undefined` |\n| `sshTunnelPassword` | String | The optional SSH password for the remote host | `undefined` |\n| `sshTunnelIdentityFile` | String/Array | The optional path to the SSH identity file for the remote host | `undefined` |\n| `sshTunnelPassphrase` | String | The optional passphrase for `sshTunnelIdentityFile` | `undefined` |\n\nDescription of `sshTunnel` values:\n\n- `NONE` - Do not use SSH tunneling.\n- `USER_PASSWORD` - The tunnel is created with SSH username and password only.\n- `IDENTITY_FILE` - The tunnel is created using an identity file.\n\n## Derived Properties\n\nDerived properties (also known as computed properties) are properties of the state object that depend on other properties to determine their value.\n\n```javascript\nconst c = new Connection();\nconst derivedProps = c.getAttributes({ derived: true });\n```\n\n| Derived Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `instanceId` | String | The mongoscope | `localhost:27017` |\n| `driverAuthMechanism` | String | Converts the value of `authStrategy` for humans into the `authMechanism` value for the driver | `undefined` |\n| `safeUrl` | String | The URL where a password is replaced with stars | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrl` | String | Use this URL in order to connect via DataService | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrlWithSsh` | String | Use this URL in order to connect via connection model itself | `mongodb://localhost:29201/?readPreference=primary&ssl=false` |\n| `driverOptions` | String | The second argument `mongoscope-server` passes to `mongodb.connect` | `{}` |\n\n## Events\n\n> New in mongodb-connection-model@5.0.0\n\n#### Example: SSH Tunnel\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', skipped: true,\n  reason: 'The selected SSL mode does not need to load any files.' }\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', complete: true}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n#### Example: SSL\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  ssl: 'ALL',\n  sslCA: '~/.ssl/my-ca.pem',\n  sslCert: '~/.ssl/my-server.pem',\n  sslKey: '~/.ssl/my-server.pem'\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', complete: true}\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', skipped: true,\n  reason: 'The selected SSH Tunnel mode is NONE.'}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n[workflow_img]: https://github.com/mongodb-js/connection-model/workflows/Check%20and%20Test/badge.svg?event=push\n[workflow_url]: https://github.com/mongodb-js/connection-model/actions?query=workflow%3A%22Check+and+Test%22\n[npm_img]: https://img.shields.io/npm/v/mongodb-connection-model.svg?style=flat-square\n[npm_url]: https://www.npmjs.org/package/mongodb-connection-model\n[gitter_img]: https://badges.gitter.im/Join%20Chat.svg\n[gitter_url]: http://gitter.im/mongodb-js/mongodb-js\n[enterprise_img]: https://img.shields.io/badge/MongoDB-Enterprise-blue.svg?style=flat-square\n[coming_soon_img]: https://img.shields.io/badge/-Coming%20Soon-ff69b4.svg?style=flat-square\n[kerberos-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/kerberos_tests.js\n[ldap-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ldap_tests.js\n[x509-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ssl_x509_tests.js\n[ns]: https://github.com/mongodb-js/ns\n[sf-ssh-tunnel]: http://serverfault.com/questions/597765/how-to-connect-to-mongodb-server-via-ssh-tunnel\n[ec2-key-pairs]: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html\n[driver-ssl-impl]: https://github.com/christkv/mongodb-core/blob/c3d21cb636d74d7a68134ecd3b9f6af536311279/lib/connection/connection.js#L365-L407\n[driver-ssl-tutorial]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/\n[driver-ssl-none]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#no-certificate-validation\n[driver-ssl-server]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate\n[driver-ssl-all]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate-and-present-valid-certificate\n","gitHead":"31a3fe49cf0eba4c3afe85c4a4139ce198cb0e51","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","test":"mocha","check":"npm run lint && npm run depcheck","pretest":"mongodb-runner install && mongodb-runner start --port=27018","test-ci":"npm run test","depcheck":"depcheck","posttest":"mongodb-runner stop --port=27018","posttest-ci":"node ../../scripts/killall-mongo.js","test-check-ci":"npm run check && npm test"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.17.0+x64 (linux)","description":"MongoDB connection model.","directories":{},"_nodeVersion":"16.17.0","compass:main":"index.js","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","debug":"^4.2.0","lodash":"^4.17.15","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.2.0","storage-mixin":"0.0.0-next-31a3fe49cf0eba4c3afe85c4a4139ce198cb0e51","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.2","@mongodb-js/ssh-tunnel":"0.0.0-next-31a3fe49cf0eba4c3afe85c4a4139ce198cb0e51","@mongodb-js/compass-utils":"0.0.0-next-31a3fe49cf0eba4c3afe85c4a4139ce198cb0e51","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.5.4"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"^4.10.0","depcheck":"^1.4.1","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.9.0","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^4.10.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_0.0.0-next-31a3fe49cf0eba4c3afe85c4a4139ce198cb0e51_1669085072163_0.504021227187144","host":"s3://npm-registry-packages"}},"0.0.0-next-bb1a39e78c30cda5ef910174e54d2c9708186388":{"name":"mongodb-connection-model","version":"0.0.0-next-bb1a39e78c30cda5ef910174e54d2c9708186388","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@0.0.0-next-bb1a39e78c30cda5ef910174e54d2c9708186388","maintainers":[{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"iteng@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"ee3f78da376128e04dc1ee90916bfc8b6d540f4a","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-0.0.0-next-bb1a39e78c30cda5ef910174e54d2c9708186388.tgz","fileCount":20,"integrity":"sha512-Z8Sovo9Sa8xVvxH1yEOJ+DzEZQl0m2gWytvEfcmLQJEjVo7bnFSdP0jKMW1ZM8YAsr4u5PTjTjmwAI1O6mGEHQ==","signatures":[{"sig":"MEYCIQD1Eq9jMZ1HeuWgAXqWLh/3O5oo6S3k0wBgSIbdK8JCigIhAIlRDN3xGebF4MzBNqVLQvHpjtnxhboj6fPtjgGDEXNb","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":108152,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjfDjeACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqhrw/9GHgaVC5MsiQ7PjDR8y7BnmMctdETHpMmFuiLlO+jSzznTR/U\r\n1ZAbubo0Mb6lkHW181Cbf70VyyogwL4At9udYcBJ22ovOP6PgE5iniaGdyFZ\r\nv9tUNO9pI6WCW8l0JZd5syfTzcRYYgyl5VGG7OgiBbH88WbhL0egAao6xR9s\r\nCbDtN35AH3rBDfTaLJ2m4EcdNLoDqGQbcuSrrmNuH5A663HXjs//DuQecpEY\r\nlZd2Y3XkNgWLCdCD5OUT8h9l6XfbI19xcCxeGGYGdQo/1il9Mq6zAyAIE30i\r\ngz3ojiTAoSMIfi5eye5XvMvfSi5GR7Sp9Eq7anSKwx3gK+Dr6/i5H5cv2Aea\r\nWt8k0HXzw6SDOgGSNmjFWnOtvtPutpHgO4J3ZUolj3KVlfdFMQlko2A2vZkE\r\ntuvCyKdPm/XKZDwlJhvQkadtarSoimOPu9cWDwwldZPsZOy90RuHfkGd2n2F\r\n6SdVBkXvtQfNnBay9eZygZ+nP+QyZ+XMW8XQfLiaxWa4DN3A8+X26Y6ko2B5\r\nr2u9bt8GE1/sIzk1jxRIaDzVSdL8+02zCPjHEtmOSmt3USM/uCndbLZGnVMW\r\nXEcDhpwXT0IQ6scuFYPakcj5JCNFgFB7+mOrAiVa61xgEC6KBPIcmM5GHstD\r\n2740OkKoiBK8XwkJg+BRqAnhS8OhD5gXh5o=\r\n=Y+ot\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","readme":"# mongodb-connection-model [![][workflow_img]][workflow_url] [![][npm_img]][npm_url]\n\n> MongoDB connection model\n\nThe main purpose of the MongoDB connection model is to be a domain model around a MongoDB connection. It encapsulates generating a [Connection String URI](https://docs.mongodb.com/manual/reference/connection-string/) from a group of attributes and parses URI using the [MongoDB Node.JS Driver URI Parser](https://github.com/mongodb-js/mongodb-core/blob/master/lib/uri_parser.js).\n\n## Installation\n\n```\nnpm install --save mongodb-connection-model\n```\n\n## Usage\n\n### Building URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\nconst c = new Connection({ appname: 'My App Name' });\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://localhost:27017/?readPreference=primary&appname=My%20App&ssl=false'\n```\n\n### Parsing URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\n\nConnection.from(\n  'mongodb://someUsername:testPassword@localhost',\n  (error, result) => {\n    console.log(result);\n    >>> `{\n      hosts: [{ host: 'localhost', port: 27017 }],\n      hostname: 'localhost',\n      port: 27017,\n      auth: {\n        username: 'someUsername',\n        password: 'testPassword',\n        db: 'admin'\n      },\n      isSrvRecord: false,\n      authStrategy: 'MONGODB',\n      mongodbUsername: 'someUsername',\n      mongodbPassword: 'testPassword',\n      mongodbDatabaseName: 'admin',\n      extraOptions: {},\n      connectionType: 'NODE_DRIVER',\n      readPreference: 'primary',\n      kerberosCanonicalizeHostname: false,\n      sslMethod: 'NONE',\n      sshTunnel: 'NONE',\n      sshTunnelPort: 22\n    }`\n  }\n);\n```\n\n## Properties\n\nMongoDB connection model is based on Ampersand.js framework and consist of [props](https://ampersandjs.com/docs/#ampersand-state-props) and [derived props](https://ampersandjs.com/docs/#ampersand-state-derived). The props object describes the observable properties that MongoDB connection model gets from the Node.js Driver API.\n\n```javascript\nconst с = new Connection();\nconst props = с.getAttributes({ props: true });\n```\n\n#### See Also\n\n- [URI Generic Syntax](https://tools.ietf.org/html/rfc3986)\n- [URI Options Specification](https://github.com/mongodb/specifications/blob/master/source/uri-options/uri-options.rst)\n\n### General Properties\n\n```javascript\nconst c = new Connection({ isSrvRecord: true });\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ns` | String | A valid [ns][ns] the user can read from | `undefined` |\n| `isSrvRecord` | Boolean | Indicates SRV record | `false` |\n| `auth` | Object | Authentication from driver (username, user, db, password) | `undefined` |\n| `hostname` | String | Hostname of a MongoDB Instance. In case of the replica set the first host and port will be taken | `localhost` |\n| `port` | Number | TCP port of a MongoDB Instance | `27017` |\n| `hosts` | Array | Contains all hosts and ports for replica set | `[{ host: 'localhost', port: 27017 }]` |\n| `extraOptions` | Object | Extra options passed to the node driver as part of `driverOptions` | `{}` |\n| `connectionType` | String | The desired connection type. Possible values: `NODE_DRIVER`, `STITCH_ON_PREM`, `STITCH_ATLAS` | `NODE_DRIVER` |\n| `authStrategy` | String | The desired authentication strategy. Possible values: `NONE`, `MONGODB`, `X509`, `KERBEROS`, `LDAP`, `SCRAM-SHA-256` | `NONE` |\n\n### Connection string options\n\n```javascript\nconst c = new Connection({ appname: 'My App', replicaSet: 'testing' });\n```\n\n#### General connection string options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `replicaSet` | String | Specifies the name of the replica set, if the mongod is a member of a replica set | `undefined` |\n| `connectTimeoutMS` | Number | The time in milliseconds to attempt a connection before timing out | `undefined` |\n| `socketTimeoutMS` | Number | The time in milliseconds to attempt a send or receive on a socket before the attempt times out | `undefined` |\n| `compression` | Object | Object includes compressors and a compression level. The following compressors can be specified: `snappy`, `zlib` (Available in MongoDB 3.6 or greater) | `undefined` |\n\n#### Connection Pool Option\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `maxPoolSize` | Number | The maximum number of connections in the connection pool | `undefined` |\n| `minPoolSize` | Number | The minimum number of connections in the connection pool | `undefined` |\n| `maxIdleTimeMS` | Number | The maximum number of milliseconds that a connection can remain idle in the pool before being removed and closed | `undefined` |\n| `waitQueueMultiple` | Number | A number that the driver multiples the maxPoolSize value to, to provide the maximum number of threads allowed to wait for a connection to become available from the pool | `undefined` |\n| `waitQueueTimeoutMS` | Number | The maximum time in milliseconds that a thread can wait for a connection to become available | `undefined` |\n\n#### Write Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `w` | Number/String | Corresponds to the write concern [w Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-w) | `undefined` |\n| `wTimeoutMS` | Number | Corresponds to the write concern [wtimeout](https://docs.mongodb.com/manual/reference/write-concern/#wc-wtimeout) | `undefined` |\n| `journal` | Boolean | Corresponds to the write concern [j Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-j) | `undefined` |\n\n#### Read Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readConcernLevel` | String | The level of isolation | `undefined` |\n\n#### Read Preference Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readPreference` | String | Specifies the read preferences for this connection. Possible values: `PRIMARY`, `PRIMARY_PREFERRED`, `SECONDARY`, `SECONDARY_PREFERRED`, `NEAREST` | `PRIMARY` |\n| `maxStalenessSeconds` | Number | Specifies, in seconds, how stale a secondary can be before the client stops using it for read operations | `undefined` |\n| `readPreferenceTags` | Object | Default read preference tags for the client | `undefined` |\n\n#### Authentication Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `authSource` | String | Specify the database name associated with the user’s credentials | `undefined` |\n| `authMechanism` | String | Specifies the authentication mechanism that MongoDB will use to authenticate the connection. Possible values: `DEFAULT`, `GSSAPI`, `MONGODB-X509`, `PLAIN`, `SCRAM-SHA-256` | `undefined` |\n| `authMechanismProperties` | Object | Additional options provided for authentication (e.g. to enable hostname canonicalization for GSSAPI) | `undefined` |\n| `gssapiServiceName` | String | Set the Kerberos service name when connecting to Kerberized MongoDB instances | `undefined` |\n| `gssapiServiceRealm` | String | Set the Realm service name | `undefined` |\n| `gssapiCanonicalizeHostName` | Boolean | Whether canonicalized hostname | `undefined` |\n\n#### Server Selection and Discovery Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `localThresholdMS` | Number | The size (in milliseconds) of the latency window for selecting among multiple suitable MongoDB instances | `undefined` |\n| `serverSelectionTimeoutMS` | Number | Specifies how long (in milliseconds) to block for server selection before throwing an exception | `undefined` |\n| `serverSelectionTryOnce` | Boolean | Instructs the driver to scan the MongoDB deployment exactly once after server selection fails and then either select a server or raise an error | `undefined` |\n| `heartbeatFrequencyMS` | Number | Controls when the driver checks the state of the MongoDB deployment | `undefined` |\n\n#### Miscellaneous Configuration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `appname` | String | An application name passed to server as client metadata | `undefined` |\n| `retryWrites` | Boolean | Enable retryable writes | `undefined` |\n| `uuidRepresentation` | String | The legacy representation of UUID. Possible values: `standard`, `csharpLegacy`, `javaLegacy`, `pythonLegacy` | `undefined` |\n| `loadBalanced` | Boolean | Whether or not the server is running in load balanced mode | `undefined` |\n\n### Stitch attributes\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `stitchServiceName` | String | Stitch service name | `undefined` |\n| `stitchClientAppId` | String | Stitch сlient app ID | `undefined` |\n| `stitchGroupId` | String | Stitch group ID | `undefined` |\n| `stitchBaseUrl` | String | Stitch base Url | `undefined` |\n\n### MONGODB authentication\n\n```javascript\nconst c = new Connection({\n  mongodbUsername: 'arlo',\n  mongodbPassword: 'w@of'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/?slaveOk=true&authSource=admin'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `mongodbUsername` | String | MongoDB username | `undefined` |\n| `mongodbPassword` | String | MongoDB password | `undefined` |\n| `mongodbDatabaseName` | String | The database name associated with the user's credentials | `undefined` |\n| `promoteValues` | Boolean | Whether BSON values should be promoted to their JS type counterparts | `undefined` |\n\n### KERBEROS authentication\n\n```javascript\nconst c = new Connection({\n  kerberosServiceName: 'mongodb',\n  kerberosPrincipal: 'arlo/dog@krb5.mongodb.parts',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo%252Fdog%2540krb5.mongodb.parts@localhost:27017/toys?authMechanism=GSSAPI'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n> @note (imlucas): Kerberos on Windows is broken out as it's own state for UX consideration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `kerberosServiceName` | String | Any program or computer you access over a network | `undefined` |\n| `kerberosPrincipal` | String | The format of a typical Kerberos V5 principal is `primary/instance@REALM` | `undefined` |\n| `kerberosCanonicalizeHostname` | Boolean | Whether canonicalized kerberos hostname | `undefined` |\n\n#### See Also\n\n- [node.js driver Kerberos reference](http://bit.ly/mongodb-node-driver-kerberos)\n- [node.js driver Kerberos functional test][kerberos-functional]\n\n### LDAP authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  ldapUsername: 'arlo',\n  ldapPassword: 'w@of',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/toys?slaveOk=true&authMechanism=PLAIN'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ldapUsername` | String | LDAP username | `undefined` |\n| `ldapPassword` | String | LDAP password | `undefined` |\n\n#### See Also\n\n- [node.js driver LDAP reference](http://bit.ly/mongodb-node-driver-ldap)\n- [node.js driver X509 functional test][ldap-functional]\n\n### X509 authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  x509Username: 'CN=client,OU=arlo,O=MongoDB,L=Philadelphia,ST=Pennsylvania,C=US'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://CN%253Dclient%252COU%253Darlo%252CO%253DMongoDB%252CL%253DPhiladelphia%252CST%253DPennsylvania%252CC%253DUS@localhost:27017?slaveOk=true&authMechanism=MONGODB-X509'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `x509Username` | String | The x.509 certificate derived user name, e.g. `CN=user,OU=OrgUnit,O=myOrg,...` | `undefined` |\n\n#### See Also\n\n- [node.js driver X509 reference](http://bit.ly/mongodb-node-driver-x509)\n- [node.js driver X509 functional test][x509-functional]\n\n### SSL\n\n> **Note**: Not to be confused with `authentication=X509`\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ssl` | Number/String | A boolean to enable or disables TLS/SSL for the connection | `undefined` |\n| `sslMethod` | String | The desired ssl method. Possible values: `NONE`, `SYSTEMCA`, `IFAVAILABLE`, `UNVALIDATED`, `SERVER`, `ALL` | `NONE` |\n| `sslCA` | Buffer/String | Array of valid certificates | `undefined` |\n| `sslCert` | Buffer/String | The certificate | `undefined` |\n| `sslKey` | Buffer/String | The certificate private key | `undefined` |\n| `sslPass` | Buffer/String | The certificate password | `undefined` |\n\nDescription of `sslMethod` values:\n\n- `SYSTEMCA` - SSL required, validate using System CA, with host verification.\n- `IFAVAILABLE` - The driver should try SSL first, fall back to no SSL if unavailable, and use the system's Certificate Authority.\n- `SERVER` - The driver should validate the server certificate and fail to connect if validation fails. See also [node.js driver \"Validate Server Certificate\" docs][driver-ssl-server].\n- `ALL` - The driver must present a valid certificate and validate the server certificate. See also [node.js driver \"Validate Server Certificate and Present Valid Certificate\" docs][driver-ssl-all].\n- `NONE` - No SSL (Not recommended).\n- `UNVALIDATED` - Use SSL but do not perform any validation of the certificate chain. See also [node.js driver \"No Certificate Validation\" docs][driver-ssl-none]. **Very** not recommended and likely to be deprecated in future releases because it exposes potential Man-In-The-Middle attack vectors.\n\n#### See also\n\n- [node.js driver SSL implementation][driver-ssl-impl]\n- [node.js driver SSL tutorial][driver-ssl-tutorial]\n\n### SSH TUNNEL\n\n> New in mongodb-connection-model@5.0.0\n\nBecause [authentication](#authentication) is quite difficult for operators to migrate to, the most common method of securing a MongoDB deployment is to use an [SSH tunnel][sf-ssh-tunnel].  This allows operators to leverage their existing SSH security infrastructure to also provide secure access to MongoDB.  For a standard deployment of MongoDB on AWS, this is almost always to strategy.  Because of this, we now support creating SSH tunnels automatically when connecting to MongoDB.\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options, (connectionError, client) => {\n  if (connectionError) {\n    return console.log(connectionError);\n  }\n\n  client.db('mongodb').collection('fanclub').count((countingError, count) => {\n    console.log('counted:', countingError, count);\n    client.close();\n  });\n});\n```\n\nThe above provides the same functionality as creating the tunnel using the bash\ncommand below and connecting to MongoDB via another terminal. Notice that\nconnection-model uses a random local port each time it creates a tunnel.\nUsing the command line, you'd have to replace `<random port>` with an actual\nport number.\n\n```bash\nssh -i ~/.ssh/my-key-aws-pair.pem -L <random port>:localhost:27017 ubuntu@ec2-11-111-111-111.compute-1.amazonaws.com\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `sshTunnel` | String | The desired SSH tunnel strategy. Possible values: `NONE`, `USER_PASSWORD`, `IDENTITY_FILE` | `undefined` |\n| `sshTunnelHostname` | String | The hostname of the SSH remote host | `undefined` |\n| `sshTunnelPort` | Port | The SSH port of the remote host | `22` |\n| `sshTunnelBindToLocalPort` | Port | Bind the localhost endpoint of the SSH Tunnel to this port | `undefined` |\n| `sshTunnelUsername` | String | The optional SSH username for the remote host | `undefined` |\n| `sshTunnelPassword` | String | The optional SSH password for the remote host | `undefined` |\n| `sshTunnelIdentityFile` | String/Array | The optional path to the SSH identity file for the remote host | `undefined` |\n| `sshTunnelPassphrase` | String | The optional passphrase for `sshTunnelIdentityFile` | `undefined` |\n\nDescription of `sshTunnel` values:\n\n- `NONE` - Do not use SSH tunneling.\n- `USER_PASSWORD` - The tunnel is created with SSH username and password only.\n- `IDENTITY_FILE` - The tunnel is created using an identity file.\n\n## Derived Properties\n\nDerived properties (also known as computed properties) are properties of the state object that depend on other properties to determine their value.\n\n```javascript\nconst c = new Connection();\nconst derivedProps = c.getAttributes({ derived: true });\n```\n\n| Derived Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `instanceId` | String | The mongoscope | `localhost:27017` |\n| `driverAuthMechanism` | String | Converts the value of `authStrategy` for humans into the `authMechanism` value for the driver | `undefined` |\n| `safeUrl` | String | The URL where a password is replaced with stars | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrl` | String | Use this URL in order to connect via DataService | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrlWithSsh` | String | Use this URL in order to connect via connection model itself | `mongodb://localhost:29201/?readPreference=primary&ssl=false` |\n| `driverOptions` | String | The second argument `mongoscope-server` passes to `mongodb.connect` | `{}` |\n\n## Events\n\n> New in mongodb-connection-model@5.0.0\n\n#### Example: SSH Tunnel\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', skipped: true,\n  reason: 'The selected SSL mode does not need to load any files.' }\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', complete: true}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n#### Example: SSL\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  ssl: 'ALL',\n  sslCA: '~/.ssl/my-ca.pem',\n  sslCert: '~/.ssl/my-server.pem',\n  sslKey: '~/.ssl/my-server.pem'\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', complete: true}\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', skipped: true,\n  reason: 'The selected SSH Tunnel mode is NONE.'}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n[workflow_img]: https://github.com/mongodb-js/connection-model/workflows/Check%20and%20Test/badge.svg?event=push\n[workflow_url]: https://github.com/mongodb-js/connection-model/actions?query=workflow%3A%22Check+and+Test%22\n[npm_img]: https://img.shields.io/npm/v/mongodb-connection-model.svg?style=flat-square\n[npm_url]: https://www.npmjs.org/package/mongodb-connection-model\n[gitter_img]: https://badges.gitter.im/Join%20Chat.svg\n[gitter_url]: http://gitter.im/mongodb-js/mongodb-js\n[enterprise_img]: https://img.shields.io/badge/MongoDB-Enterprise-blue.svg?style=flat-square\n[coming_soon_img]: https://img.shields.io/badge/-Coming%20Soon-ff69b4.svg?style=flat-square\n[kerberos-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/kerberos_tests.js\n[ldap-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ldap_tests.js\n[x509-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ssl_x509_tests.js\n[ns]: https://github.com/mongodb-js/ns\n[sf-ssh-tunnel]: http://serverfault.com/questions/597765/how-to-connect-to-mongodb-server-via-ssh-tunnel\n[ec2-key-pairs]: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html\n[driver-ssl-impl]: https://github.com/christkv/mongodb-core/blob/c3d21cb636d74d7a68134ecd3b9f6af536311279/lib/connection/connection.js#L365-L407\n[driver-ssl-tutorial]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/\n[driver-ssl-none]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#no-certificate-validation\n[driver-ssl-server]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate\n[driver-ssl-all]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate-and-present-valid-certificate\n","gitHead":"bb1a39e78c30cda5ef910174e54d2c9708186388","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","test":"mocha","check":"npm run lint && npm run depcheck","pretest":"mongodb-runner install && mongodb-runner start --port=27018","test-ci":"npm run test","depcheck":"depcheck","posttest":"mongodb-runner stop --port=27018","posttest-ci":"node ../../scripts/killall-mongo.js","test-check-ci":"npm run check && npm test"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.17.0+x64 (linux)","description":"MongoDB connection model.","directories":{},"_nodeVersion":"16.17.0","compass:main":"index.js","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","debug":"^4.2.0","lodash":"^4.17.15","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.2.0","storage-mixin":"0.0.0-next-bb1a39e78c30cda5ef910174e54d2c9708186388","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.2","@mongodb-js/ssh-tunnel":"0.0.0-next-bb1a39e78c30cda5ef910174e54d2c9708186388","@mongodb-js/compass-utils":"0.0.0-next-bb1a39e78c30cda5ef910174e54d2c9708186388","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.5.4"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"^4.10.0","depcheck":"^1.4.1","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.9.0","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^4.10.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_0.0.0-next-bb1a39e78c30cda5ef910174e54d2c9708186388_1669085406565_0.8931087384431093","host":"s3://npm-registry-packages"}},"0.0.0-next-b5a88ca5d89936f4997a6df7c6e08614f25de0a1":{"name":"mongodb-connection-model","version":"0.0.0-next-b5a88ca5d89936f4997a6df7c6e08614f25de0a1","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@0.0.0-next-b5a88ca5d89936f4997a6df7c6e08614f25de0a1","maintainers":[{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"iteng@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"0f3981e997055152cea529b73241a36e6eb53a57","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-0.0.0-next-b5a88ca5d89936f4997a6df7c6e08614f25de0a1.tgz","fileCount":20,"integrity":"sha512-zU2OS7nQPF9335qW6KgLiFA43KsqzyaOeIopXlcf6Ujqx3UsmrWsCOJxg4hgqy43uyHRb8htGiGuu9QPZs2X/g==","signatures":[{"sig":"MEQCIEiWIMsHKzOFXI8lmS2LAxT9qEcjG5ch6HiZjF8JD+0pAiBBZJLxkzmGRpmiwC5Thgm8Q3Z80tBThkk/pAiYumhjQQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":108152,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjfDleACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp1kw//c8QC2nIUpTFcwpcVQ3N0rzhpV/AHAw/3+9SUQ10D2/h3fvKH\r\nZeqGzgOPBb/t5dOwVryMAqxR5o8i712x2M1kAoi9eTkIBB5fuO2mPppj/q78\r\nT2uG4FkfXePjUyv6FACoKm6Wr6Db9vbJ/FeBKYYWUqEUTY08VMVbXorz/R7e\r\njAFG9+A71z+Y/TtpoCcoSk5R2HFXHOdnkW4ZBMl4vrlKPnIIhzsdZV0dVRkU\r\nwf5Dxlze+NSW65Bcj25wt7YGlKsSwW2oFdU/JlmG7XfvO4wJIvJBRC4x2aP8\r\nQm2tGZ5QbfQhoVOOT4lveXpomenK36qma91Rhjzyag6R/wi+xpkOCKcz7BDx\r\nAYGpmOwGHvbXgqidoJSRWvEp1erHZO27k7BlE+ViNYlb8zd9VqqIIInFuFZp\r\ncZPMGvsZuj03dK7W0y0r+Evz4fvHtbvSWbNGm3qZWVWWthvkqPTwndNUE7Js\r\n7yMnsSXui30ueKwViv5pRumaT8jU8wApOqxQ4NMKdEsetGTyUQ38kIwavTW1\r\nbAw1339CUyH/t7/8H/zTVht2CHAMavLJ9WJHb1nb8CP9RADaQufFNcnnc+yC\r\nt8cimZYtyc3xixR3XEqmBLiA3A02Cwk63w1hNraBkzvNy16lcKML5KPFw1nr\r\nidltyajCwzNAqdSpAffYODMnD1CYIx/M8yg=\r\n=Ilnu\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","readme":"# mongodb-connection-model [![][workflow_img]][workflow_url] [![][npm_img]][npm_url]\n\n> MongoDB connection model\n\nThe main purpose of the MongoDB connection model is to be a domain model around a MongoDB connection. It encapsulates generating a [Connection String URI](https://docs.mongodb.com/manual/reference/connection-string/) from a group of attributes and parses URI using the [MongoDB Node.JS Driver URI Parser](https://github.com/mongodb-js/mongodb-core/blob/master/lib/uri_parser.js).\n\n## Installation\n\n```\nnpm install --save mongodb-connection-model\n```\n\n## Usage\n\n### Building URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\nconst c = new Connection({ appname: 'My App Name' });\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://localhost:27017/?readPreference=primary&appname=My%20App&ssl=false'\n```\n\n### Parsing URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\n\nConnection.from(\n  'mongodb://someUsername:testPassword@localhost',\n  (error, result) => {\n    console.log(result);\n    >>> `{\n      hosts: [{ host: 'localhost', port: 27017 }],\n      hostname: 'localhost',\n      port: 27017,\n      auth: {\n        username: 'someUsername',\n        password: 'testPassword',\n        db: 'admin'\n      },\n      isSrvRecord: false,\n      authStrategy: 'MONGODB',\n      mongodbUsername: 'someUsername',\n      mongodbPassword: 'testPassword',\n      mongodbDatabaseName: 'admin',\n      extraOptions: {},\n      connectionType: 'NODE_DRIVER',\n      readPreference: 'primary',\n      kerberosCanonicalizeHostname: false,\n      sslMethod: 'NONE',\n      sshTunnel: 'NONE',\n      sshTunnelPort: 22\n    }`\n  }\n);\n```\n\n## Properties\n\nMongoDB connection model is based on Ampersand.js framework and consist of [props](https://ampersandjs.com/docs/#ampersand-state-props) and [derived props](https://ampersandjs.com/docs/#ampersand-state-derived). The props object describes the observable properties that MongoDB connection model gets from the Node.js Driver API.\n\n```javascript\nconst с = new Connection();\nconst props = с.getAttributes({ props: true });\n```\n\n#### See Also\n\n- [URI Generic Syntax](https://tools.ietf.org/html/rfc3986)\n- [URI Options Specification](https://github.com/mongodb/specifications/blob/master/source/uri-options/uri-options.rst)\n\n### General Properties\n\n```javascript\nconst c = new Connection({ isSrvRecord: true });\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ns` | String | A valid [ns][ns] the user can read from | `undefined` |\n| `isSrvRecord` | Boolean | Indicates SRV record | `false` |\n| `auth` | Object | Authentication from driver (username, user, db, password) | `undefined` |\n| `hostname` | String | Hostname of a MongoDB Instance. In case of the replica set the first host and port will be taken | `localhost` |\n| `port` | Number | TCP port of a MongoDB Instance | `27017` |\n| `hosts` | Array | Contains all hosts and ports for replica set | `[{ host: 'localhost', port: 27017 }]` |\n| `extraOptions` | Object | Extra options passed to the node driver as part of `driverOptions` | `{}` |\n| `connectionType` | String | The desired connection type. Possible values: `NODE_DRIVER`, `STITCH_ON_PREM`, `STITCH_ATLAS` | `NODE_DRIVER` |\n| `authStrategy` | String | The desired authentication strategy. Possible values: `NONE`, `MONGODB`, `X509`, `KERBEROS`, `LDAP`, `SCRAM-SHA-256` | `NONE` |\n\n### Connection string options\n\n```javascript\nconst c = new Connection({ appname: 'My App', replicaSet: 'testing' });\n```\n\n#### General connection string options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `replicaSet` | String | Specifies the name of the replica set, if the mongod is a member of a replica set | `undefined` |\n| `connectTimeoutMS` | Number | The time in milliseconds to attempt a connection before timing out | `undefined` |\n| `socketTimeoutMS` | Number | The time in milliseconds to attempt a send or receive on a socket before the attempt times out | `undefined` |\n| `compression` | Object | Object includes compressors and a compression level. The following compressors can be specified: `snappy`, `zlib` (Available in MongoDB 3.6 or greater) | `undefined` |\n\n#### Connection Pool Option\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `maxPoolSize` | Number | The maximum number of connections in the connection pool | `undefined` |\n| `minPoolSize` | Number | The minimum number of connections in the connection pool | `undefined` |\n| `maxIdleTimeMS` | Number | The maximum number of milliseconds that a connection can remain idle in the pool before being removed and closed | `undefined` |\n| `waitQueueMultiple` | Number | A number that the driver multiples the maxPoolSize value to, to provide the maximum number of threads allowed to wait for a connection to become available from the pool | `undefined` |\n| `waitQueueTimeoutMS` | Number | The maximum time in milliseconds that a thread can wait for a connection to become available | `undefined` |\n\n#### Write Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `w` | Number/String | Corresponds to the write concern [w Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-w) | `undefined` |\n| `wTimeoutMS` | Number | Corresponds to the write concern [wtimeout](https://docs.mongodb.com/manual/reference/write-concern/#wc-wtimeout) | `undefined` |\n| `journal` | Boolean | Corresponds to the write concern [j Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-j) | `undefined` |\n\n#### Read Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readConcernLevel` | String | The level of isolation | `undefined` |\n\n#### Read Preference Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readPreference` | String | Specifies the read preferences for this connection. Possible values: `PRIMARY`, `PRIMARY_PREFERRED`, `SECONDARY`, `SECONDARY_PREFERRED`, `NEAREST` | `PRIMARY` |\n| `maxStalenessSeconds` | Number | Specifies, in seconds, how stale a secondary can be before the client stops using it for read operations | `undefined` |\n| `readPreferenceTags` | Object | Default read preference tags for the client | `undefined` |\n\n#### Authentication Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `authSource` | String | Specify the database name associated with the user’s credentials | `undefined` |\n| `authMechanism` | String | Specifies the authentication mechanism that MongoDB will use to authenticate the connection. Possible values: `DEFAULT`, `GSSAPI`, `MONGODB-X509`, `PLAIN`, `SCRAM-SHA-256` | `undefined` |\n| `authMechanismProperties` | Object | Additional options provided for authentication (e.g. to enable hostname canonicalization for GSSAPI) | `undefined` |\n| `gssapiServiceName` | String | Set the Kerberos service name when connecting to Kerberized MongoDB instances | `undefined` |\n| `gssapiServiceRealm` | String | Set the Realm service name | `undefined` |\n| `gssapiCanonicalizeHostName` | Boolean | Whether canonicalized hostname | `undefined` |\n\n#### Server Selection and Discovery Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `localThresholdMS` | Number | The size (in milliseconds) of the latency window for selecting among multiple suitable MongoDB instances | `undefined` |\n| `serverSelectionTimeoutMS` | Number | Specifies how long (in milliseconds) to block for server selection before throwing an exception | `undefined` |\n| `serverSelectionTryOnce` | Boolean | Instructs the driver to scan the MongoDB deployment exactly once after server selection fails and then either select a server or raise an error | `undefined` |\n| `heartbeatFrequencyMS` | Number | Controls when the driver checks the state of the MongoDB deployment | `undefined` |\n\n#### Miscellaneous Configuration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `appname` | String | An application name passed to server as client metadata | `undefined` |\n| `retryWrites` | Boolean | Enable retryable writes | `undefined` |\n| `uuidRepresentation` | String | The legacy representation of UUID. Possible values: `standard`, `csharpLegacy`, `javaLegacy`, `pythonLegacy` | `undefined` |\n| `loadBalanced` | Boolean | Whether or not the server is running in load balanced mode | `undefined` |\n\n### Stitch attributes\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `stitchServiceName` | String | Stitch service name | `undefined` |\n| `stitchClientAppId` | String | Stitch сlient app ID | `undefined` |\n| `stitchGroupId` | String | Stitch group ID | `undefined` |\n| `stitchBaseUrl` | String | Stitch base Url | `undefined` |\n\n### MONGODB authentication\n\n```javascript\nconst c = new Connection({\n  mongodbUsername: 'arlo',\n  mongodbPassword: 'w@of'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/?slaveOk=true&authSource=admin'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `mongodbUsername` | String | MongoDB username | `undefined` |\n| `mongodbPassword` | String | MongoDB password | `undefined` |\n| `mongodbDatabaseName` | String | The database name associated with the user's credentials | `undefined` |\n| `promoteValues` | Boolean | Whether BSON values should be promoted to their JS type counterparts | `undefined` |\n\n### KERBEROS authentication\n\n```javascript\nconst c = new Connection({\n  kerberosServiceName: 'mongodb',\n  kerberosPrincipal: 'arlo/dog@krb5.mongodb.parts',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo%252Fdog%2540krb5.mongodb.parts@localhost:27017/toys?authMechanism=GSSAPI'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n> @note (imlucas): Kerberos on Windows is broken out as it's own state for UX consideration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `kerberosServiceName` | String | Any program or computer you access over a network | `undefined` |\n| `kerberosPrincipal` | String | The format of a typical Kerberos V5 principal is `primary/instance@REALM` | `undefined` |\n| `kerberosCanonicalizeHostname` | Boolean | Whether canonicalized kerberos hostname | `undefined` |\n\n#### See Also\n\n- [node.js driver Kerberos reference](http://bit.ly/mongodb-node-driver-kerberos)\n- [node.js driver Kerberos functional test][kerberos-functional]\n\n### LDAP authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  ldapUsername: 'arlo',\n  ldapPassword: 'w@of',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/toys?slaveOk=true&authMechanism=PLAIN'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ldapUsername` | String | LDAP username | `undefined` |\n| `ldapPassword` | String | LDAP password | `undefined` |\n\n#### See Also\n\n- [node.js driver LDAP reference](http://bit.ly/mongodb-node-driver-ldap)\n- [node.js driver X509 functional test][ldap-functional]\n\n### X509 authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  x509Username: 'CN=client,OU=arlo,O=MongoDB,L=Philadelphia,ST=Pennsylvania,C=US'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://CN%253Dclient%252COU%253Darlo%252CO%253DMongoDB%252CL%253DPhiladelphia%252CST%253DPennsylvania%252CC%253DUS@localhost:27017?slaveOk=true&authMechanism=MONGODB-X509'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `x509Username` | String | The x.509 certificate derived user name, e.g. `CN=user,OU=OrgUnit,O=myOrg,...` | `undefined` |\n\n#### See Also\n\n- [node.js driver X509 reference](http://bit.ly/mongodb-node-driver-x509)\n- [node.js driver X509 functional test][x509-functional]\n\n### SSL\n\n> **Note**: Not to be confused with `authentication=X509`\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ssl` | Number/String | A boolean to enable or disables TLS/SSL for the connection | `undefined` |\n| `sslMethod` | String | The desired ssl method. Possible values: `NONE`, `SYSTEMCA`, `IFAVAILABLE`, `UNVALIDATED`, `SERVER`, `ALL` | `NONE` |\n| `sslCA` | Buffer/String | Array of valid certificates | `undefined` |\n| `sslCert` | Buffer/String | The certificate | `undefined` |\n| `sslKey` | Buffer/String | The certificate private key | `undefined` |\n| `sslPass` | Buffer/String | The certificate password | `undefined` |\n\nDescription of `sslMethod` values:\n\n- `SYSTEMCA` - SSL required, validate using System CA, with host verification.\n- `IFAVAILABLE` - The driver should try SSL first, fall back to no SSL if unavailable, and use the system's Certificate Authority.\n- `SERVER` - The driver should validate the server certificate and fail to connect if validation fails. See also [node.js driver \"Validate Server Certificate\" docs][driver-ssl-server].\n- `ALL` - The driver must present a valid certificate and validate the server certificate. See also [node.js driver \"Validate Server Certificate and Present Valid Certificate\" docs][driver-ssl-all].\n- `NONE` - No SSL (Not recommended).\n- `UNVALIDATED` - Use SSL but do not perform any validation of the certificate chain. See also [node.js driver \"No Certificate Validation\" docs][driver-ssl-none]. **Very** not recommended and likely to be deprecated in future releases because it exposes potential Man-In-The-Middle attack vectors.\n\n#### See also\n\n- [node.js driver SSL implementation][driver-ssl-impl]\n- [node.js driver SSL tutorial][driver-ssl-tutorial]\n\n### SSH TUNNEL\n\n> New in mongodb-connection-model@5.0.0\n\nBecause [authentication](#authentication) is quite difficult for operators to migrate to, the most common method of securing a MongoDB deployment is to use an [SSH tunnel][sf-ssh-tunnel].  This allows operators to leverage their existing SSH security infrastructure to also provide secure access to MongoDB.  For a standard deployment of MongoDB on AWS, this is almost always to strategy.  Because of this, we now support creating SSH tunnels automatically when connecting to MongoDB.\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options, (connectionError, client) => {\n  if (connectionError) {\n    return console.log(connectionError);\n  }\n\n  client.db('mongodb').collection('fanclub').count((countingError, count) => {\n    console.log('counted:', countingError, count);\n    client.close();\n  });\n});\n```\n\nThe above provides the same functionality as creating the tunnel using the bash\ncommand below and connecting to MongoDB via another terminal. Notice that\nconnection-model uses a random local port each time it creates a tunnel.\nUsing the command line, you'd have to replace `<random port>` with an actual\nport number.\n\n```bash\nssh -i ~/.ssh/my-key-aws-pair.pem -L <random port>:localhost:27017 ubuntu@ec2-11-111-111-111.compute-1.amazonaws.com\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `sshTunnel` | String | The desired SSH tunnel strategy. Possible values: `NONE`, `USER_PASSWORD`, `IDENTITY_FILE` | `undefined` |\n| `sshTunnelHostname` | String | The hostname of the SSH remote host | `undefined` |\n| `sshTunnelPort` | Port | The SSH port of the remote host | `22` |\n| `sshTunnelBindToLocalPort` | Port | Bind the localhost endpoint of the SSH Tunnel to this port | `undefined` |\n| `sshTunnelUsername` | String | The optional SSH username for the remote host | `undefined` |\n| `sshTunnelPassword` | String | The optional SSH password for the remote host | `undefined` |\n| `sshTunnelIdentityFile` | String/Array | The optional path to the SSH identity file for the remote host | `undefined` |\n| `sshTunnelPassphrase` | String | The optional passphrase for `sshTunnelIdentityFile` | `undefined` |\n\nDescription of `sshTunnel` values:\n\n- `NONE` - Do not use SSH tunneling.\n- `USER_PASSWORD` - The tunnel is created with SSH username and password only.\n- `IDENTITY_FILE` - The tunnel is created using an identity file.\n\n## Derived Properties\n\nDerived properties (also known as computed properties) are properties of the state object that depend on other properties to determine their value.\n\n```javascript\nconst c = new Connection();\nconst derivedProps = c.getAttributes({ derived: true });\n```\n\n| Derived Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `instanceId` | String | The mongoscope | `localhost:27017` |\n| `driverAuthMechanism` | String | Converts the value of `authStrategy` for humans into the `authMechanism` value for the driver | `undefined` |\n| `safeUrl` | String | The URL where a password is replaced with stars | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrl` | String | Use this URL in order to connect via DataService | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrlWithSsh` | String | Use this URL in order to connect via connection model itself | `mongodb://localhost:29201/?readPreference=primary&ssl=false` |\n| `driverOptions` | String | The second argument `mongoscope-server` passes to `mongodb.connect` | `{}` |\n\n## Events\n\n> New in mongodb-connection-model@5.0.0\n\n#### Example: SSH Tunnel\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', skipped: true,\n  reason: 'The selected SSL mode does not need to load any files.' }\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', complete: true}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n#### Example: SSL\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  ssl: 'ALL',\n  sslCA: '~/.ssl/my-ca.pem',\n  sslCert: '~/.ssl/my-server.pem',\n  sslKey: '~/.ssl/my-server.pem'\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', complete: true}\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', skipped: true,\n  reason: 'The selected SSH Tunnel mode is NONE.'}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n[workflow_img]: https://github.com/mongodb-js/connection-model/workflows/Check%20and%20Test/badge.svg?event=push\n[workflow_url]: https://github.com/mongodb-js/connection-model/actions?query=workflow%3A%22Check+and+Test%22\n[npm_img]: https://img.shields.io/npm/v/mongodb-connection-model.svg?style=flat-square\n[npm_url]: https://www.npmjs.org/package/mongodb-connection-model\n[gitter_img]: https://badges.gitter.im/Join%20Chat.svg\n[gitter_url]: http://gitter.im/mongodb-js/mongodb-js\n[enterprise_img]: https://img.shields.io/badge/MongoDB-Enterprise-blue.svg?style=flat-square\n[coming_soon_img]: https://img.shields.io/badge/-Coming%20Soon-ff69b4.svg?style=flat-square\n[kerberos-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/kerberos_tests.js\n[ldap-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ldap_tests.js\n[x509-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ssl_x509_tests.js\n[ns]: https://github.com/mongodb-js/ns\n[sf-ssh-tunnel]: http://serverfault.com/questions/597765/how-to-connect-to-mongodb-server-via-ssh-tunnel\n[ec2-key-pairs]: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html\n[driver-ssl-impl]: https://github.com/christkv/mongodb-core/blob/c3d21cb636d74d7a68134ecd3b9f6af536311279/lib/connection/connection.js#L365-L407\n[driver-ssl-tutorial]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/\n[driver-ssl-none]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#no-certificate-validation\n[driver-ssl-server]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate\n[driver-ssl-all]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate-and-present-valid-certificate\n","gitHead":"b5a88ca5d89936f4997a6df7c6e08614f25de0a1","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","test":"mocha","check":"npm run lint && npm run depcheck","pretest":"mongodb-runner install && mongodb-runner start --port=27018","test-ci":"npm run test","depcheck":"depcheck","posttest":"mongodb-runner stop --port=27018","posttest-ci":"node ../../scripts/killall-mongo.js","test-check-ci":"npm run check && npm test"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.17.0+x64 (linux)","description":"MongoDB connection model.","directories":{},"_nodeVersion":"16.17.0","compass:main":"index.js","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","debug":"^4.2.0","lodash":"^4.17.15","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.2.0","storage-mixin":"0.0.0-next-b5a88ca5d89936f4997a6df7c6e08614f25de0a1","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.2","@mongodb-js/ssh-tunnel":"0.0.0-next-b5a88ca5d89936f4997a6df7c6e08614f25de0a1","@mongodb-js/compass-utils":"0.0.0-next-b5a88ca5d89936f4997a6df7c6e08614f25de0a1","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.5.4"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"^4.10.0","depcheck":"^1.4.1","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.9.0","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^4.10.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_0.0.0-next-b5a88ca5d89936f4997a6df7c6e08614f25de0a1_1669085534252_0.6631811750846657","host":"s3://npm-registry-packages"}},"0.0.0-next-9a3af5fc8cc6a9ccc96866e1b71d0a33c14d7c08":{"name":"mongodb-connection-model","version":"0.0.0-next-9a3af5fc8cc6a9ccc96866e1b71d0a33c14d7c08","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@0.0.0-next-9a3af5fc8cc6a9ccc96866e1b71d0a33c14d7c08","maintainers":[{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"iteng@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"d24a4e642b56c49832c118eaba5768d2f1e148a8","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-0.0.0-next-9a3af5fc8cc6a9ccc96866e1b71d0a33c14d7c08.tgz","fileCount":20,"integrity":"sha512-A8dyIsP+peYEdKGhKdLznI+cdf06uxLYy4vAI1oXPe/TBrSlMLkKkVE5tBGxEkfoez/n9kc8lPQgeDLH8HA3SQ==","signatures":[{"sig":"MEUCIBusyTZb11Ef/k2GV+OJOXZLnYJRwY5Mu2jTIfkz7tUfAiEAqKTnxkO0TZEyUos/W45W+dQPgp+tbl8AG8x8GQkpxlc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":108152,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjfDskACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrsHBAAhEgSxOTm+dXslhF+a/rHfXXYoxzS0YeEGXwD9H7ljm4EHYeW\r\nrgNGxv7ikowJOBPURrKWoqtD5BGUXA1eyAOD/MAgxS1SRV/2PCDGm18nzX8W\r\n06KwpVV1mf4adyx+XriyfXBahcSXVov5pdcywl4V51ltBXO5EfRAJemXOr6C\r\n00LU7QxTs7vh55UJeKfL99C3ALKyMMYU8KoJJurV8HXh7USrgsHu5y9SiSil\r\nNXM7Pyi0GwfwNDpYgOhA/LZxWHTQ+5LeGpk/KTvTblMDN+kJhPXNbGtspqXF\r\nT+Ou0iVmhDs6i1+EIr71C2G6JUmxGf1LQpxS+yoSUZuHk2kU0BfhUQRGrWkg\r\nM8nYQKdL8WWh3TCggR8rtHeJ7eS9Zi/wRmPlXA8MueirKBvey4o6b1bkDGxg\r\nTCWNuKMTI9MQfJ+Q6xNqu7HoG7466inkl/DN1+0+s9pg0qxmKzeLtROqRjNR\r\nHZYfDaSHWjENPS7D1DNHjsZs063CSUsiujdtcnNnb7f1gmGRFhvd1UVGs2VW\r\no9dG4Rwh0R4sJ+znHJW9h4PGIdaLQyGSPvFLPZdD/SXseaR+kN9jrwrY05zi\r\nzY4COjlk8rc4yAET6dbTvbKJf5xKJj8S5pXvkeGu1TQ1T/J4L9Rs7nIDKxG0\r\nj/RpUss2NDDFUqpJwhRgL+jtfcyo8+kSVNs=\r\n=BnDt\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","readme":"# mongodb-connection-model [![][workflow_img]][workflow_url] [![][npm_img]][npm_url]\n\n> MongoDB connection model\n\nThe main purpose of the MongoDB connection model is to be a domain model around a MongoDB connection. It encapsulates generating a [Connection String URI](https://docs.mongodb.com/manual/reference/connection-string/) from a group of attributes and parses URI using the [MongoDB Node.JS Driver URI Parser](https://github.com/mongodb-js/mongodb-core/blob/master/lib/uri_parser.js).\n\n## Installation\n\n```\nnpm install --save mongodb-connection-model\n```\n\n## Usage\n\n### Building URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\nconst c = new Connection({ appname: 'My App Name' });\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://localhost:27017/?readPreference=primary&appname=My%20App&ssl=false'\n```\n\n### Parsing URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\n\nConnection.from(\n  'mongodb://someUsername:testPassword@localhost',\n  (error, result) => {\n    console.log(result);\n    >>> `{\n      hosts: [{ host: 'localhost', port: 27017 }],\n      hostname: 'localhost',\n      port: 27017,\n      auth: {\n        username: 'someUsername',\n        password: 'testPassword',\n        db: 'admin'\n      },\n      isSrvRecord: false,\n      authStrategy: 'MONGODB',\n      mongodbUsername: 'someUsername',\n      mongodbPassword: 'testPassword',\n      mongodbDatabaseName: 'admin',\n      extraOptions: {},\n      connectionType: 'NODE_DRIVER',\n      readPreference: 'primary',\n      kerberosCanonicalizeHostname: false,\n      sslMethod: 'NONE',\n      sshTunnel: 'NONE',\n      sshTunnelPort: 22\n    }`\n  }\n);\n```\n\n## Properties\n\nMongoDB connection model is based on Ampersand.js framework and consist of [props](https://ampersandjs.com/docs/#ampersand-state-props) and [derived props](https://ampersandjs.com/docs/#ampersand-state-derived). The props object describes the observable properties that MongoDB connection model gets from the Node.js Driver API.\n\n```javascript\nconst с = new Connection();\nconst props = с.getAttributes({ props: true });\n```\n\n#### See Also\n\n- [URI Generic Syntax](https://tools.ietf.org/html/rfc3986)\n- [URI Options Specification](https://github.com/mongodb/specifications/blob/master/source/uri-options/uri-options.rst)\n\n### General Properties\n\n```javascript\nconst c = new Connection({ isSrvRecord: true });\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ns` | String | A valid [ns][ns] the user can read from | `undefined` |\n| `isSrvRecord` | Boolean | Indicates SRV record | `false` |\n| `auth` | Object | Authentication from driver (username, user, db, password) | `undefined` |\n| `hostname` | String | Hostname of a MongoDB Instance. In case of the replica set the first host and port will be taken | `localhost` |\n| `port` | Number | TCP port of a MongoDB Instance | `27017` |\n| `hosts` | Array | Contains all hosts and ports for replica set | `[{ host: 'localhost', port: 27017 }]` |\n| `extraOptions` | Object | Extra options passed to the node driver as part of `driverOptions` | `{}` |\n| `connectionType` | String | The desired connection type. Possible values: `NODE_DRIVER`, `STITCH_ON_PREM`, `STITCH_ATLAS` | `NODE_DRIVER` |\n| `authStrategy` | String | The desired authentication strategy. Possible values: `NONE`, `MONGODB`, `X509`, `KERBEROS`, `LDAP`, `SCRAM-SHA-256` | `NONE` |\n\n### Connection string options\n\n```javascript\nconst c = new Connection({ appname: 'My App', replicaSet: 'testing' });\n```\n\n#### General connection string options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `replicaSet` | String | Specifies the name of the replica set, if the mongod is a member of a replica set | `undefined` |\n| `connectTimeoutMS` | Number | The time in milliseconds to attempt a connection before timing out | `undefined` |\n| `socketTimeoutMS` | Number | The time in milliseconds to attempt a send or receive on a socket before the attempt times out | `undefined` |\n| `compression` | Object | Object includes compressors and a compression level. The following compressors can be specified: `snappy`, `zlib` (Available in MongoDB 3.6 or greater) | `undefined` |\n\n#### Connection Pool Option\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `maxPoolSize` | Number | The maximum number of connections in the connection pool | `undefined` |\n| `minPoolSize` | Number | The minimum number of connections in the connection pool | `undefined` |\n| `maxIdleTimeMS` | Number | The maximum number of milliseconds that a connection can remain idle in the pool before being removed and closed | `undefined` |\n| `waitQueueMultiple` | Number | A number that the driver multiples the maxPoolSize value to, to provide the maximum number of threads allowed to wait for a connection to become available from the pool | `undefined` |\n| `waitQueueTimeoutMS` | Number | The maximum time in milliseconds that a thread can wait for a connection to become available | `undefined` |\n\n#### Write Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `w` | Number/String | Corresponds to the write concern [w Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-w) | `undefined` |\n| `wTimeoutMS` | Number | Corresponds to the write concern [wtimeout](https://docs.mongodb.com/manual/reference/write-concern/#wc-wtimeout) | `undefined` |\n| `journal` | Boolean | Corresponds to the write concern [j Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-j) | `undefined` |\n\n#### Read Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readConcernLevel` | String | The level of isolation | `undefined` |\n\n#### Read Preference Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readPreference` | String | Specifies the read preferences for this connection. Possible values: `PRIMARY`, `PRIMARY_PREFERRED`, `SECONDARY`, `SECONDARY_PREFERRED`, `NEAREST` | `PRIMARY` |\n| `maxStalenessSeconds` | Number | Specifies, in seconds, how stale a secondary can be before the client stops using it for read operations | `undefined` |\n| `readPreferenceTags` | Object | Default read preference tags for the client | `undefined` |\n\n#### Authentication Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `authSource` | String | Specify the database name associated with the user’s credentials | `undefined` |\n| `authMechanism` | String | Specifies the authentication mechanism that MongoDB will use to authenticate the connection. Possible values: `DEFAULT`, `GSSAPI`, `MONGODB-X509`, `PLAIN`, `SCRAM-SHA-256` | `undefined` |\n| `authMechanismProperties` | Object | Additional options provided for authentication (e.g. to enable hostname canonicalization for GSSAPI) | `undefined` |\n| `gssapiServiceName` | String | Set the Kerberos service name when connecting to Kerberized MongoDB instances | `undefined` |\n| `gssapiServiceRealm` | String | Set the Realm service name | `undefined` |\n| `gssapiCanonicalizeHostName` | Boolean | Whether canonicalized hostname | `undefined` |\n\n#### Server Selection and Discovery Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `localThresholdMS` | Number | The size (in milliseconds) of the latency window for selecting among multiple suitable MongoDB instances | `undefined` |\n| `serverSelectionTimeoutMS` | Number | Specifies how long (in milliseconds) to block for server selection before throwing an exception | `undefined` |\n| `serverSelectionTryOnce` | Boolean | Instructs the driver to scan the MongoDB deployment exactly once after server selection fails and then either select a server or raise an error | `undefined` |\n| `heartbeatFrequencyMS` | Number | Controls when the driver checks the state of the MongoDB deployment | `undefined` |\n\n#### Miscellaneous Configuration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `appname` | String | An application name passed to server as client metadata | `undefined` |\n| `retryWrites` | Boolean | Enable retryable writes | `undefined` |\n| `uuidRepresentation` | String | The legacy representation of UUID. Possible values: `standard`, `csharpLegacy`, `javaLegacy`, `pythonLegacy` | `undefined` |\n| `loadBalanced` | Boolean | Whether or not the server is running in load balanced mode | `undefined` |\n\n### Stitch attributes\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `stitchServiceName` | String | Stitch service name | `undefined` |\n| `stitchClientAppId` | String | Stitch сlient app ID | `undefined` |\n| `stitchGroupId` | String | Stitch group ID | `undefined` |\n| `stitchBaseUrl` | String | Stitch base Url | `undefined` |\n\n### MONGODB authentication\n\n```javascript\nconst c = new Connection({\n  mongodbUsername: 'arlo',\n  mongodbPassword: 'w@of'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/?slaveOk=true&authSource=admin'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `mongodbUsername` | String | MongoDB username | `undefined` |\n| `mongodbPassword` | String | MongoDB password | `undefined` |\n| `mongodbDatabaseName` | String | The database name associated with the user's credentials | `undefined` |\n| `promoteValues` | Boolean | Whether BSON values should be promoted to their JS type counterparts | `undefined` |\n\n### KERBEROS authentication\n\n```javascript\nconst c = new Connection({\n  kerberosServiceName: 'mongodb',\n  kerberosPrincipal: 'arlo/dog@krb5.mongodb.parts',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo%252Fdog%2540krb5.mongodb.parts@localhost:27017/toys?authMechanism=GSSAPI'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n> @note (imlucas): Kerberos on Windows is broken out as it's own state for UX consideration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `kerberosServiceName` | String | Any program or computer you access over a network | `undefined` |\n| `kerberosPrincipal` | String | The format of a typical Kerberos V5 principal is `primary/instance@REALM` | `undefined` |\n| `kerberosCanonicalizeHostname` | Boolean | Whether canonicalized kerberos hostname | `undefined` |\n\n#### See Also\n\n- [node.js driver Kerberos reference](http://bit.ly/mongodb-node-driver-kerberos)\n- [node.js driver Kerberos functional test][kerberos-functional]\n\n### LDAP authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  ldapUsername: 'arlo',\n  ldapPassword: 'w@of',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/toys?slaveOk=true&authMechanism=PLAIN'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ldapUsername` | String | LDAP username | `undefined` |\n| `ldapPassword` | String | LDAP password | `undefined` |\n\n#### See Also\n\n- [node.js driver LDAP reference](http://bit.ly/mongodb-node-driver-ldap)\n- [node.js driver X509 functional test][ldap-functional]\n\n### X509 authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  x509Username: 'CN=client,OU=arlo,O=MongoDB,L=Philadelphia,ST=Pennsylvania,C=US'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://CN%253Dclient%252COU%253Darlo%252CO%253DMongoDB%252CL%253DPhiladelphia%252CST%253DPennsylvania%252CC%253DUS@localhost:27017?slaveOk=true&authMechanism=MONGODB-X509'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `x509Username` | String | The x.509 certificate derived user name, e.g. `CN=user,OU=OrgUnit,O=myOrg,...` | `undefined` |\n\n#### See Also\n\n- [node.js driver X509 reference](http://bit.ly/mongodb-node-driver-x509)\n- [node.js driver X509 functional test][x509-functional]\n\n### SSL\n\n> **Note**: Not to be confused with `authentication=X509`\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ssl` | Number/String | A boolean to enable or disables TLS/SSL for the connection | `undefined` |\n| `sslMethod` | String | The desired ssl method. Possible values: `NONE`, `SYSTEMCA`, `IFAVAILABLE`, `UNVALIDATED`, `SERVER`, `ALL` | `NONE` |\n| `sslCA` | Buffer/String | Array of valid certificates | `undefined` |\n| `sslCert` | Buffer/String | The certificate | `undefined` |\n| `sslKey` | Buffer/String | The certificate private key | `undefined` |\n| `sslPass` | Buffer/String | The certificate password | `undefined` |\n\nDescription of `sslMethod` values:\n\n- `SYSTEMCA` - SSL required, validate using System CA, with host verification.\n- `IFAVAILABLE` - The driver should try SSL first, fall back to no SSL if unavailable, and use the system's Certificate Authority.\n- `SERVER` - The driver should validate the server certificate and fail to connect if validation fails. See also [node.js driver \"Validate Server Certificate\" docs][driver-ssl-server].\n- `ALL` - The driver must present a valid certificate and validate the server certificate. See also [node.js driver \"Validate Server Certificate and Present Valid Certificate\" docs][driver-ssl-all].\n- `NONE` - No SSL (Not recommended).\n- `UNVALIDATED` - Use SSL but do not perform any validation of the certificate chain. See also [node.js driver \"No Certificate Validation\" docs][driver-ssl-none]. **Very** not recommended and likely to be deprecated in future releases because it exposes potential Man-In-The-Middle attack vectors.\n\n#### See also\n\n- [node.js driver SSL implementation][driver-ssl-impl]\n- [node.js driver SSL tutorial][driver-ssl-tutorial]\n\n### SSH TUNNEL\n\n> New in mongodb-connection-model@5.0.0\n\nBecause [authentication](#authentication) is quite difficult for operators to migrate to, the most common method of securing a MongoDB deployment is to use an [SSH tunnel][sf-ssh-tunnel].  This allows operators to leverage their existing SSH security infrastructure to also provide secure access to MongoDB.  For a standard deployment of MongoDB on AWS, this is almost always to strategy.  Because of this, we now support creating SSH tunnels automatically when connecting to MongoDB.\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options, (connectionError, client) => {\n  if (connectionError) {\n    return console.log(connectionError);\n  }\n\n  client.db('mongodb').collection('fanclub').count((countingError, count) => {\n    console.log('counted:', countingError, count);\n    client.close();\n  });\n});\n```\n\nThe above provides the same functionality as creating the tunnel using the bash\ncommand below and connecting to MongoDB via another terminal. Notice that\nconnection-model uses a random local port each time it creates a tunnel.\nUsing the command line, you'd have to replace `<random port>` with an actual\nport number.\n\n```bash\nssh -i ~/.ssh/my-key-aws-pair.pem -L <random port>:localhost:27017 ubuntu@ec2-11-111-111-111.compute-1.amazonaws.com\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `sshTunnel` | String | The desired SSH tunnel strategy. Possible values: `NONE`, `USER_PASSWORD`, `IDENTITY_FILE` | `undefined` |\n| `sshTunnelHostname` | String | The hostname of the SSH remote host | `undefined` |\n| `sshTunnelPort` | Port | The SSH port of the remote host | `22` |\n| `sshTunnelBindToLocalPort` | Port | Bind the localhost endpoint of the SSH Tunnel to this port | `undefined` |\n| `sshTunnelUsername` | String | The optional SSH username for the remote host | `undefined` |\n| `sshTunnelPassword` | String | The optional SSH password for the remote host | `undefined` |\n| `sshTunnelIdentityFile` | String/Array | The optional path to the SSH identity file for the remote host | `undefined` |\n| `sshTunnelPassphrase` | String | The optional passphrase for `sshTunnelIdentityFile` | `undefined` |\n\nDescription of `sshTunnel` values:\n\n- `NONE` - Do not use SSH tunneling.\n- `USER_PASSWORD` - The tunnel is created with SSH username and password only.\n- `IDENTITY_FILE` - The tunnel is created using an identity file.\n\n## Derived Properties\n\nDerived properties (also known as computed properties) are properties of the state object that depend on other properties to determine their value.\n\n```javascript\nconst c = new Connection();\nconst derivedProps = c.getAttributes({ derived: true });\n```\n\n| Derived Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `instanceId` | String | The mongoscope | `localhost:27017` |\n| `driverAuthMechanism` | String | Converts the value of `authStrategy` for humans into the `authMechanism` value for the driver | `undefined` |\n| `safeUrl` | String | The URL where a password is replaced with stars | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrl` | String | Use this URL in order to connect via DataService | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrlWithSsh` | String | Use this URL in order to connect via connection model itself | `mongodb://localhost:29201/?readPreference=primary&ssl=false` |\n| `driverOptions` | String | The second argument `mongoscope-server` passes to `mongodb.connect` | `{}` |\n\n## Events\n\n> New in mongodb-connection-model@5.0.0\n\n#### Example: SSH Tunnel\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', skipped: true,\n  reason: 'The selected SSL mode does not need to load any files.' }\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', complete: true}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n#### Example: SSL\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  ssl: 'ALL',\n  sslCA: '~/.ssl/my-ca.pem',\n  sslCert: '~/.ssl/my-server.pem',\n  sslKey: '~/.ssl/my-server.pem'\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', complete: true}\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', skipped: true,\n  reason: 'The selected SSH Tunnel mode is NONE.'}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n[workflow_img]: https://github.com/mongodb-js/connection-model/workflows/Check%20and%20Test/badge.svg?event=push\n[workflow_url]: https://github.com/mongodb-js/connection-model/actions?query=workflow%3A%22Check+and+Test%22\n[npm_img]: https://img.shields.io/npm/v/mongodb-connection-model.svg?style=flat-square\n[npm_url]: https://www.npmjs.org/package/mongodb-connection-model\n[gitter_img]: https://badges.gitter.im/Join%20Chat.svg\n[gitter_url]: http://gitter.im/mongodb-js/mongodb-js\n[enterprise_img]: https://img.shields.io/badge/MongoDB-Enterprise-blue.svg?style=flat-square\n[coming_soon_img]: https://img.shields.io/badge/-Coming%20Soon-ff69b4.svg?style=flat-square\n[kerberos-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/kerberos_tests.js\n[ldap-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ldap_tests.js\n[x509-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ssl_x509_tests.js\n[ns]: https://github.com/mongodb-js/ns\n[sf-ssh-tunnel]: http://serverfault.com/questions/597765/how-to-connect-to-mongodb-server-via-ssh-tunnel\n[ec2-key-pairs]: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html\n[driver-ssl-impl]: https://github.com/christkv/mongodb-core/blob/c3d21cb636d74d7a68134ecd3b9f6af536311279/lib/connection/connection.js#L365-L407\n[driver-ssl-tutorial]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/\n[driver-ssl-none]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#no-certificate-validation\n[driver-ssl-server]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate\n[driver-ssl-all]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate-and-present-valid-certificate\n","gitHead":"9a3af5fc8cc6a9ccc96866e1b71d0a33c14d7c08","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","test":"mocha","check":"npm run lint && npm run depcheck","pretest":"mongodb-runner install && mongodb-runner start --port=27018","test-ci":"npm run test","depcheck":"depcheck","posttest":"mongodb-runner stop --port=27018","posttest-ci":"node ../../scripts/killall-mongo.js","test-check-ci":"npm run check && npm test"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.17.0+x64 (linux)","description":"MongoDB connection model.","directories":{},"_nodeVersion":"16.17.0","compass:main":"index.js","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","debug":"^4.2.0","lodash":"^4.17.15","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.2.0","storage-mixin":"0.0.0-next-9a3af5fc8cc6a9ccc96866e1b71d0a33c14d7c08","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.2","@mongodb-js/ssh-tunnel":"0.0.0-next-9a3af5fc8cc6a9ccc96866e1b71d0a33c14d7c08","@mongodb-js/compass-utils":"0.0.0-next-9a3af5fc8cc6a9ccc96866e1b71d0a33c14d7c08","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.5.4"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"^4.10.0","depcheck":"^1.4.1","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.9.0","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^4.10.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_0.0.0-next-9a3af5fc8cc6a9ccc96866e1b71d0a33c14d7c08_1669085988641_0.28144387605627275","host":"s3://npm-registry-packages"}},"0.0.0-next-2cde0fe836b81baa0f68d274840a5f97b8dae0c6":{"name":"mongodb-connection-model","version":"0.0.0-next-2cde0fe836b81baa0f68d274840a5f97b8dae0c6","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@0.0.0-next-2cde0fe836b81baa0f68d274840a5f97b8dae0c6","maintainers":[{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"iteng@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"736157d1b9139372a4837f97b51c386764614453","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-0.0.0-next-2cde0fe836b81baa0f68d274840a5f97b8dae0c6.tgz","fileCount":20,"integrity":"sha512-wVR5bmtX26bdG7qSPUNy4mR3EzIoCjOdZMsXkWCQEuBWT1n4BmX509Yf3O2Unx0V0fgrXRKKut94Jr6A/f6tvA==","signatures":[{"sig":"MEYCIQDCP9aR6p6vc4oCToEI5lB74nz/ZDdn4FZwB/CPITKmsAIhAK7Hn5hCK/1zL76w8uc7CSr7RhME9Au2bd9k7VE1AM8q","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":108152,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjfDxdACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpn9A/+PZ1TJPHQqTS7VcfUVR99cyF8FY4eKDWcIkLGtFTvyo0x9y8U\r\nwt2cOnTO9sC2zUy/H5Z76TuUYcOm5lmjj+LaRHMUoOAWNVwCmYd+Fm5VZnFO\r\n8nh78uzUrS4mWen9YZMPnEKzVBBDxOFYzcbN/41A4vwzi+ylG2kWvvqHQ3U1\r\n72CQxdRN7Ma1gIKDmLsX1qXTd0azlCDUr8fXlPvzFNRzxjiYGshhZH4oXJmf\r\nuLgMoKfX2Ftx7A6ueqnmQnI0JDNdw1rjmsT4CcL8DJ/2GzoJp/PEzKn26/+6\r\nvmUy0y1Qgrx3qLoQAU1+6ZYXHRsbYr+L95MiNYfgErW340WFAr73mTPqFXyy\r\nT04cXevFZNpwB3T9JWekad+POa7/SzmAriJhB3wP2Za/anPqiwMuwbJLd8GX\r\nMvnpYoDeDRBQKP3P3z/k6qCD3Ca+jD0IA7Cpgy4PhbswwJQsz6RcNSeNSZ/b\r\n2PgqA5TgdNM15NFi/PiedhUhQDAsrrPIFVITzsxzFBhDqaPggBl250IJjU8p\r\nPjW6ekCJjgDplEi345+F/zOgdh33XAjO8/XTjGbgA834jfyZG9n2efo+QTcZ\r\nHCVszeTut8CSGJ1YqzhGZ1tl9xNfpZXwl3NRfwk5GQlfr7nojC/9CbqQCVc9\r\niMTQbFjvis+B/nFAO4Dfeyw9RlDTHA3xHdc=\r\n=9MXk\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","readme":"# mongodb-connection-model [![][workflow_img]][workflow_url] [![][npm_img]][npm_url]\n\n> MongoDB connection model\n\nThe main purpose of the MongoDB connection model is to be a domain model around a MongoDB connection. It encapsulates generating a [Connection String URI](https://docs.mongodb.com/manual/reference/connection-string/) from a group of attributes and parses URI using the [MongoDB Node.JS Driver URI Parser](https://github.com/mongodb-js/mongodb-core/blob/master/lib/uri_parser.js).\n\n## Installation\n\n```\nnpm install --save mongodb-connection-model\n```\n\n## Usage\n\n### Building URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\nconst c = new Connection({ appname: 'My App Name' });\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://localhost:27017/?readPreference=primary&appname=My%20App&ssl=false'\n```\n\n### Parsing URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\n\nConnection.from(\n  'mongodb://someUsername:testPassword@localhost',\n  (error, result) => {\n    console.log(result);\n    >>> `{\n      hosts: [{ host: 'localhost', port: 27017 }],\n      hostname: 'localhost',\n      port: 27017,\n      auth: {\n        username: 'someUsername',\n        password: 'testPassword',\n        db: 'admin'\n      },\n      isSrvRecord: false,\n      authStrategy: 'MONGODB',\n      mongodbUsername: 'someUsername',\n      mongodbPassword: 'testPassword',\n      mongodbDatabaseName: 'admin',\n      extraOptions: {},\n      connectionType: 'NODE_DRIVER',\n      readPreference: 'primary',\n      kerberosCanonicalizeHostname: false,\n      sslMethod: 'NONE',\n      sshTunnel: 'NONE',\n      sshTunnelPort: 22\n    }`\n  }\n);\n```\n\n## Properties\n\nMongoDB connection model is based on Ampersand.js framework and consist of [props](https://ampersandjs.com/docs/#ampersand-state-props) and [derived props](https://ampersandjs.com/docs/#ampersand-state-derived). The props object describes the observable properties that MongoDB connection model gets from the Node.js Driver API.\n\n```javascript\nconst с = new Connection();\nconst props = с.getAttributes({ props: true });\n```\n\n#### See Also\n\n- [URI Generic Syntax](https://tools.ietf.org/html/rfc3986)\n- [URI Options Specification](https://github.com/mongodb/specifications/blob/master/source/uri-options/uri-options.rst)\n\n### General Properties\n\n```javascript\nconst c = new Connection({ isSrvRecord: true });\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ns` | String | A valid [ns][ns] the user can read from | `undefined` |\n| `isSrvRecord` | Boolean | Indicates SRV record | `false` |\n| `auth` | Object | Authentication from driver (username, user, db, password) | `undefined` |\n| `hostname` | String | Hostname of a MongoDB Instance. In case of the replica set the first host and port will be taken | `localhost` |\n| `port` | Number | TCP port of a MongoDB Instance | `27017` |\n| `hosts` | Array | Contains all hosts and ports for replica set | `[{ host: 'localhost', port: 27017 }]` |\n| `extraOptions` | Object | Extra options passed to the node driver as part of `driverOptions` | `{}` |\n| `connectionType` | String | The desired connection type. Possible values: `NODE_DRIVER`, `STITCH_ON_PREM`, `STITCH_ATLAS` | `NODE_DRIVER` |\n| `authStrategy` | String | The desired authentication strategy. Possible values: `NONE`, `MONGODB`, `X509`, `KERBEROS`, `LDAP`, `SCRAM-SHA-256` | `NONE` |\n\n### Connection string options\n\n```javascript\nconst c = new Connection({ appname: 'My App', replicaSet: 'testing' });\n```\n\n#### General connection string options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `replicaSet` | String | Specifies the name of the replica set, if the mongod is a member of a replica set | `undefined` |\n| `connectTimeoutMS` | Number | The time in milliseconds to attempt a connection before timing out | `undefined` |\n| `socketTimeoutMS` | Number | The time in milliseconds to attempt a send or receive on a socket before the attempt times out | `undefined` |\n| `compression` | Object | Object includes compressors and a compression level. The following compressors can be specified: `snappy`, `zlib` (Available in MongoDB 3.6 or greater) | `undefined` |\n\n#### Connection Pool Option\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `maxPoolSize` | Number | The maximum number of connections in the connection pool | `undefined` |\n| `minPoolSize` | Number | The minimum number of connections in the connection pool | `undefined` |\n| `maxIdleTimeMS` | Number | The maximum number of milliseconds that a connection can remain idle in the pool before being removed and closed | `undefined` |\n| `waitQueueMultiple` | Number | A number that the driver multiples the maxPoolSize value to, to provide the maximum number of threads allowed to wait for a connection to become available from the pool | `undefined` |\n| `waitQueueTimeoutMS` | Number | The maximum time in milliseconds that a thread can wait for a connection to become available | `undefined` |\n\n#### Write Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `w` | Number/String | Corresponds to the write concern [w Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-w) | `undefined` |\n| `wTimeoutMS` | Number | Corresponds to the write concern [wtimeout](https://docs.mongodb.com/manual/reference/write-concern/#wc-wtimeout) | `undefined` |\n| `journal` | Boolean | Corresponds to the write concern [j Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-j) | `undefined` |\n\n#### Read Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readConcernLevel` | String | The level of isolation | `undefined` |\n\n#### Read Preference Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readPreference` | String | Specifies the read preferences for this connection. Possible values: `PRIMARY`, `PRIMARY_PREFERRED`, `SECONDARY`, `SECONDARY_PREFERRED`, `NEAREST` | `PRIMARY` |\n| `maxStalenessSeconds` | Number | Specifies, in seconds, how stale a secondary can be before the client stops using it for read operations | `undefined` |\n| `readPreferenceTags` | Object | Default read preference tags for the client | `undefined` |\n\n#### Authentication Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `authSource` | String | Specify the database name associated with the user’s credentials | `undefined` |\n| `authMechanism` | String | Specifies the authentication mechanism that MongoDB will use to authenticate the connection. Possible values: `DEFAULT`, `GSSAPI`, `MONGODB-X509`, `PLAIN`, `SCRAM-SHA-256` | `undefined` |\n| `authMechanismProperties` | Object | Additional options provided for authentication (e.g. to enable hostname canonicalization for GSSAPI) | `undefined` |\n| `gssapiServiceName` | String | Set the Kerberos service name when connecting to Kerberized MongoDB instances | `undefined` |\n| `gssapiServiceRealm` | String | Set the Realm service name | `undefined` |\n| `gssapiCanonicalizeHostName` | Boolean | Whether canonicalized hostname | `undefined` |\n\n#### Server Selection and Discovery Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `localThresholdMS` | Number | The size (in milliseconds) of the latency window for selecting among multiple suitable MongoDB instances | `undefined` |\n| `serverSelectionTimeoutMS` | Number | Specifies how long (in milliseconds) to block for server selection before throwing an exception | `undefined` |\n| `serverSelectionTryOnce` | Boolean | Instructs the driver to scan the MongoDB deployment exactly once after server selection fails and then either select a server or raise an error | `undefined` |\n| `heartbeatFrequencyMS` | Number | Controls when the driver checks the state of the MongoDB deployment | `undefined` |\n\n#### Miscellaneous Configuration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `appname` | String | An application name passed to server as client metadata | `undefined` |\n| `retryWrites` | Boolean | Enable retryable writes | `undefined` |\n| `uuidRepresentation` | String | The legacy representation of UUID. Possible values: `standard`, `csharpLegacy`, `javaLegacy`, `pythonLegacy` | `undefined` |\n| `loadBalanced` | Boolean | Whether or not the server is running in load balanced mode | `undefined` |\n\n### Stitch attributes\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `stitchServiceName` | String | Stitch service name | `undefined` |\n| `stitchClientAppId` | String | Stitch сlient app ID | `undefined` |\n| `stitchGroupId` | String | Stitch group ID | `undefined` |\n| `stitchBaseUrl` | String | Stitch base Url | `undefined` |\n\n### MONGODB authentication\n\n```javascript\nconst c = new Connection({\n  mongodbUsername: 'arlo',\n  mongodbPassword: 'w@of'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/?slaveOk=true&authSource=admin'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `mongodbUsername` | String | MongoDB username | `undefined` |\n| `mongodbPassword` | String | MongoDB password | `undefined` |\n| `mongodbDatabaseName` | String | The database name associated with the user's credentials | `undefined` |\n| `promoteValues` | Boolean | Whether BSON values should be promoted to their JS type counterparts | `undefined` |\n\n### KERBEROS authentication\n\n```javascript\nconst c = new Connection({\n  kerberosServiceName: 'mongodb',\n  kerberosPrincipal: 'arlo/dog@krb5.mongodb.parts',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo%252Fdog%2540krb5.mongodb.parts@localhost:27017/toys?authMechanism=GSSAPI'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n> @note (imlucas): Kerberos on Windows is broken out as it's own state for UX consideration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `kerberosServiceName` | String | Any program or computer you access over a network | `undefined` |\n| `kerberosPrincipal` | String | The format of a typical Kerberos V5 principal is `primary/instance@REALM` | `undefined` |\n| `kerberosCanonicalizeHostname` | Boolean | Whether canonicalized kerberos hostname | `undefined` |\n\n#### See Also\n\n- [node.js driver Kerberos reference](http://bit.ly/mongodb-node-driver-kerberos)\n- [node.js driver Kerberos functional test][kerberos-functional]\n\n### LDAP authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  ldapUsername: 'arlo',\n  ldapPassword: 'w@of',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/toys?slaveOk=true&authMechanism=PLAIN'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ldapUsername` | String | LDAP username | `undefined` |\n| `ldapPassword` | String | LDAP password | `undefined` |\n\n#### See Also\n\n- [node.js driver LDAP reference](http://bit.ly/mongodb-node-driver-ldap)\n- [node.js driver X509 functional test][ldap-functional]\n\n### X509 authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  x509Username: 'CN=client,OU=arlo,O=MongoDB,L=Philadelphia,ST=Pennsylvania,C=US'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://CN%253Dclient%252COU%253Darlo%252CO%253DMongoDB%252CL%253DPhiladelphia%252CST%253DPennsylvania%252CC%253DUS@localhost:27017?slaveOk=true&authMechanism=MONGODB-X509'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `x509Username` | String | The x.509 certificate derived user name, e.g. `CN=user,OU=OrgUnit,O=myOrg,...` | `undefined` |\n\n#### See Also\n\n- [node.js driver X509 reference](http://bit.ly/mongodb-node-driver-x509)\n- [node.js driver X509 functional test][x509-functional]\n\n### SSL\n\n> **Note**: Not to be confused with `authentication=X509`\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ssl` | Number/String | A boolean to enable or disables TLS/SSL for the connection | `undefined` |\n| `sslMethod` | String | The desired ssl method. Possible values: `NONE`, `SYSTEMCA`, `IFAVAILABLE`, `UNVALIDATED`, `SERVER`, `ALL` | `NONE` |\n| `sslCA` | Buffer/String | Array of valid certificates | `undefined` |\n| `sslCert` | Buffer/String | The certificate | `undefined` |\n| `sslKey` | Buffer/String | The certificate private key | `undefined` |\n| `sslPass` | Buffer/String | The certificate password | `undefined` |\n\nDescription of `sslMethod` values:\n\n- `SYSTEMCA` - SSL required, validate using System CA, with host verification.\n- `IFAVAILABLE` - The driver should try SSL first, fall back to no SSL if unavailable, and use the system's Certificate Authority.\n- `SERVER` - The driver should validate the server certificate and fail to connect if validation fails. See also [node.js driver \"Validate Server Certificate\" docs][driver-ssl-server].\n- `ALL` - The driver must present a valid certificate and validate the server certificate. See also [node.js driver \"Validate Server Certificate and Present Valid Certificate\" docs][driver-ssl-all].\n- `NONE` - No SSL (Not recommended).\n- `UNVALIDATED` - Use SSL but do not perform any validation of the certificate chain. See also [node.js driver \"No Certificate Validation\" docs][driver-ssl-none]. **Very** not recommended and likely to be deprecated in future releases because it exposes potential Man-In-The-Middle attack vectors.\n\n#### See also\n\n- [node.js driver SSL implementation][driver-ssl-impl]\n- [node.js driver SSL tutorial][driver-ssl-tutorial]\n\n### SSH TUNNEL\n\n> New in mongodb-connection-model@5.0.0\n\nBecause [authentication](#authentication) is quite difficult for operators to migrate to, the most common method of securing a MongoDB deployment is to use an [SSH tunnel][sf-ssh-tunnel].  This allows operators to leverage their existing SSH security infrastructure to also provide secure access to MongoDB.  For a standard deployment of MongoDB on AWS, this is almost always to strategy.  Because of this, we now support creating SSH tunnels automatically when connecting to MongoDB.\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options, (connectionError, client) => {\n  if (connectionError) {\n    return console.log(connectionError);\n  }\n\n  client.db('mongodb').collection('fanclub').count((countingError, count) => {\n    console.log('counted:', countingError, count);\n    client.close();\n  });\n});\n```\n\nThe above provides the same functionality as creating the tunnel using the bash\ncommand below and connecting to MongoDB via another terminal. Notice that\nconnection-model uses a random local port each time it creates a tunnel.\nUsing the command line, you'd have to replace `<random port>` with an actual\nport number.\n\n```bash\nssh -i ~/.ssh/my-key-aws-pair.pem -L <random port>:localhost:27017 ubuntu@ec2-11-111-111-111.compute-1.amazonaws.com\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `sshTunnel` | String | The desired SSH tunnel strategy. Possible values: `NONE`, `USER_PASSWORD`, `IDENTITY_FILE` | `undefined` |\n| `sshTunnelHostname` | String | The hostname of the SSH remote host | `undefined` |\n| `sshTunnelPort` | Port | The SSH port of the remote host | `22` |\n| `sshTunnelBindToLocalPort` | Port | Bind the localhost endpoint of the SSH Tunnel to this port | `undefined` |\n| `sshTunnelUsername` | String | The optional SSH username for the remote host | `undefined` |\n| `sshTunnelPassword` | String | The optional SSH password for the remote host | `undefined` |\n| `sshTunnelIdentityFile` | String/Array | The optional path to the SSH identity file for the remote host | `undefined` |\n| `sshTunnelPassphrase` | String | The optional passphrase for `sshTunnelIdentityFile` | `undefined` |\n\nDescription of `sshTunnel` values:\n\n- `NONE` - Do not use SSH tunneling.\n- `USER_PASSWORD` - The tunnel is created with SSH username and password only.\n- `IDENTITY_FILE` - The tunnel is created using an identity file.\n\n## Derived Properties\n\nDerived properties (also known as computed properties) are properties of the state object that depend on other properties to determine their value.\n\n```javascript\nconst c = new Connection();\nconst derivedProps = c.getAttributes({ derived: true });\n```\n\n| Derived Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `instanceId` | String | The mongoscope | `localhost:27017` |\n| `driverAuthMechanism` | String | Converts the value of `authStrategy` for humans into the `authMechanism` value for the driver | `undefined` |\n| `safeUrl` | String | The URL where a password is replaced with stars | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrl` | String | Use this URL in order to connect via DataService | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrlWithSsh` | String | Use this URL in order to connect via connection model itself | `mongodb://localhost:29201/?readPreference=primary&ssl=false` |\n| `driverOptions` | String | The second argument `mongoscope-server` passes to `mongodb.connect` | `{}` |\n\n## Events\n\n> New in mongodb-connection-model@5.0.0\n\n#### Example: SSH Tunnel\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', skipped: true,\n  reason: 'The selected SSL mode does not need to load any files.' }\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', complete: true}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n#### Example: SSL\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  ssl: 'ALL',\n  sslCA: '~/.ssl/my-ca.pem',\n  sslCert: '~/.ssl/my-server.pem',\n  sslKey: '~/.ssl/my-server.pem'\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', complete: true}\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', skipped: true,\n  reason: 'The selected SSH Tunnel mode is NONE.'}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n[workflow_img]: https://github.com/mongodb-js/connection-model/workflows/Check%20and%20Test/badge.svg?event=push\n[workflow_url]: https://github.com/mongodb-js/connection-model/actions?query=workflow%3A%22Check+and+Test%22\n[npm_img]: https://img.shields.io/npm/v/mongodb-connection-model.svg?style=flat-square\n[npm_url]: https://www.npmjs.org/package/mongodb-connection-model\n[gitter_img]: https://badges.gitter.im/Join%20Chat.svg\n[gitter_url]: http://gitter.im/mongodb-js/mongodb-js\n[enterprise_img]: https://img.shields.io/badge/MongoDB-Enterprise-blue.svg?style=flat-square\n[coming_soon_img]: https://img.shields.io/badge/-Coming%20Soon-ff69b4.svg?style=flat-square\n[kerberos-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/kerberos_tests.js\n[ldap-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ldap_tests.js\n[x509-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ssl_x509_tests.js\n[ns]: https://github.com/mongodb-js/ns\n[sf-ssh-tunnel]: http://serverfault.com/questions/597765/how-to-connect-to-mongodb-server-via-ssh-tunnel\n[ec2-key-pairs]: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html\n[driver-ssl-impl]: https://github.com/christkv/mongodb-core/blob/c3d21cb636d74d7a68134ecd3b9f6af536311279/lib/connection/connection.js#L365-L407\n[driver-ssl-tutorial]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/\n[driver-ssl-none]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#no-certificate-validation\n[driver-ssl-server]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate\n[driver-ssl-all]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate-and-present-valid-certificate\n","gitHead":"2cde0fe836b81baa0f68d274840a5f97b8dae0c6","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","test":"mocha","check":"npm run lint && npm run depcheck","pretest":"mongodb-runner install && mongodb-runner start --port=27018","test-ci":"npm run test","depcheck":"depcheck","posttest":"mongodb-runner stop --port=27018","posttest-ci":"node ../../scripts/killall-mongo.js","test-check-ci":"npm run check && npm test"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.17.0+x64 (linux)","description":"MongoDB connection model.","directories":{},"_nodeVersion":"16.17.0","compass:main":"index.js","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","debug":"^4.2.0","lodash":"^4.17.15","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.2.0","storage-mixin":"0.0.0-next-2cde0fe836b81baa0f68d274840a5f97b8dae0c6","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.2","@mongodb-js/ssh-tunnel":"0.0.0-next-2cde0fe836b81baa0f68d274840a5f97b8dae0c6","@mongodb-js/compass-utils":"0.0.0-next-2cde0fe836b81baa0f68d274840a5f97b8dae0c6","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.5.4"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"^4.10.0","depcheck":"^1.4.1","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.9.0","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^4.10.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_0.0.0-next-2cde0fe836b81baa0f68d274840a5f97b8dae0c6_1669086301400_0.9764617469576624","host":"s3://npm-registry-packages"}},"0.0.0-next-feb0121be4234a831e6bce640173de34ce95dd7a":{"name":"mongodb-connection-model","version":"0.0.0-next-feb0121be4234a831e6bce640173de34ce95dd7a","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@0.0.0-next-feb0121be4234a831e6bce640173de34ce95dd7a","maintainers":[{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"iteng@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"1aa0ce586ce89ae0b4cb911818246dd2bde9b8fc","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-0.0.0-next-feb0121be4234a831e6bce640173de34ce95dd7a.tgz","fileCount":20,"integrity":"sha512-ud5oeAlC7zicqgfOCYkW1mDrmbNH6Ppt6xA/aqlqlFaEYHokcKioqhZchobwBN/ThZOkTWW6EuMW+G+aAomm4Q==","signatures":[{"sig":"MEYCIQDljev7xXgDGFHN8IJn9W/VQO09p5GRtUS5niZBdY5IYgIhAJesyl6JCRZXF9QtUSlNFF36J2axtRR9A+krLQMiai9f","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":108152,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjfXnCACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqlLRAAmyw/YZwQvHdBwoWL1zSoGlSqcpkxV7wPJpFp30BuI7XiSRX+\r\nPkQQqVs5ChKjrF5Oup8o4nOE6ptCwgZT1j2oY7Rc9F5BTKcIWzXeGGB1wzZF\r\nuWWcaKS/Dxu1sARixVqvUh2/LlkNsB4VOXE4NJRng/jwiuKuQmxJ/ZrGNIuD\r\nYepFw7aMfh4gkrZv/+EoDYP5k5tIu0dyxvs/dmQXk3uU/OKAwQ8ZwUobO7p3\r\nK07aYv3HGwPLBbLSMfBu+UzP5cM+AXwldKyX/pP5RV0mnVyj6Gjx9JHlXnVH\r\nOl1JNVactKJcwBjaK+aU1LMy5D5Ousk5K0PU8niAoJxoQFcZBT4/Ln3WGYES\r\nqgUb58cgeXvMh/Ahj+wX3R8PzQfETanR/8Hds2KNWyWurv16AcQGXuMHvdkp\r\np5CQPFBwAP0CnFDRUEtRM61KKUOtiNOnDYAFaCXk8zf24qpKPn7Ug8TPU18y\r\nd+GK3E7JE0FapWdK8jiOhHLO9iJHKhcS3249BJI4C6aGIPG+4YZKbUDH9ilY\r\nv4KaHAZLNIGuBD3SPyvKVcX0pMfc2NsH3zojCqb8/1nRjc5A9fEGODeqX8uS\r\nhLcQDbbczQ6rJdoQO00VAAsaP2BIzdfY6CuzhSi4TXmEEX//+coD1sYXB7lo\r\n+t8Vth1TfbSxJwMPg05PoL/s1R7iWGnUa/I=\r\n=Eud7\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","readme":"# mongodb-connection-model [![][workflow_img]][workflow_url] [![][npm_img]][npm_url]\n\n> MongoDB connection model\n\nThe main purpose of the MongoDB connection model is to be a domain model around a MongoDB connection. It encapsulates generating a [Connection String URI](https://docs.mongodb.com/manual/reference/connection-string/) from a group of attributes and parses URI using the [MongoDB Node.JS Driver URI Parser](https://github.com/mongodb-js/mongodb-core/blob/master/lib/uri_parser.js).\n\n## Installation\n\n```\nnpm install --save mongodb-connection-model\n```\n\n## Usage\n\n### Building URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\nconst c = new Connection({ appname: 'My App Name' });\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://localhost:27017/?readPreference=primary&appname=My%20App&ssl=false'\n```\n\n### Parsing URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\n\nConnection.from(\n  'mongodb://someUsername:testPassword@localhost',\n  (error, result) => {\n    console.log(result);\n    >>> `{\n      hosts: [{ host: 'localhost', port: 27017 }],\n      hostname: 'localhost',\n      port: 27017,\n      auth: {\n        username: 'someUsername',\n        password: 'testPassword',\n        db: 'admin'\n      },\n      isSrvRecord: false,\n      authStrategy: 'MONGODB',\n      mongodbUsername: 'someUsername',\n      mongodbPassword: 'testPassword',\n      mongodbDatabaseName: 'admin',\n      extraOptions: {},\n      connectionType: 'NODE_DRIVER',\n      readPreference: 'primary',\n      kerberosCanonicalizeHostname: false,\n      sslMethod: 'NONE',\n      sshTunnel: 'NONE',\n      sshTunnelPort: 22\n    }`\n  }\n);\n```\n\n## Properties\n\nMongoDB connection model is based on Ampersand.js framework and consist of [props](https://ampersandjs.com/docs/#ampersand-state-props) and [derived props](https://ampersandjs.com/docs/#ampersand-state-derived). The props object describes the observable properties that MongoDB connection model gets from the Node.js Driver API.\n\n```javascript\nconst с = new Connection();\nconst props = с.getAttributes({ props: true });\n```\n\n#### See Also\n\n- [URI Generic Syntax](https://tools.ietf.org/html/rfc3986)\n- [URI Options Specification](https://github.com/mongodb/specifications/blob/master/source/uri-options/uri-options.rst)\n\n### General Properties\n\n```javascript\nconst c = new Connection({ isSrvRecord: true });\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ns` | String | A valid [ns][ns] the user can read from | `undefined` |\n| `isSrvRecord` | Boolean | Indicates SRV record | `false` |\n| `auth` | Object | Authentication from driver (username, user, db, password) | `undefined` |\n| `hostname` | String | Hostname of a MongoDB Instance. In case of the replica set the first host and port will be taken | `localhost` |\n| `port` | Number | TCP port of a MongoDB Instance | `27017` |\n| `hosts` | Array | Contains all hosts and ports for replica set | `[{ host: 'localhost', port: 27017 }]` |\n| `extraOptions` | Object | Extra options passed to the node driver as part of `driverOptions` | `{}` |\n| `connectionType` | String | The desired connection type. Possible values: `NODE_DRIVER`, `STITCH_ON_PREM`, `STITCH_ATLAS` | `NODE_DRIVER` |\n| `authStrategy` | String | The desired authentication strategy. Possible values: `NONE`, `MONGODB`, `X509`, `KERBEROS`, `LDAP`, `SCRAM-SHA-256` | `NONE` |\n\n### Connection string options\n\n```javascript\nconst c = new Connection({ appname: 'My App', replicaSet: 'testing' });\n```\n\n#### General connection string options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `replicaSet` | String | Specifies the name of the replica set, if the mongod is a member of a replica set | `undefined` |\n| `connectTimeoutMS` | Number | The time in milliseconds to attempt a connection before timing out | `undefined` |\n| `socketTimeoutMS` | Number | The time in milliseconds to attempt a send or receive on a socket before the attempt times out | `undefined` |\n| `compression` | Object | Object includes compressors and a compression level. The following compressors can be specified: `snappy`, `zlib` (Available in MongoDB 3.6 or greater) | `undefined` |\n\n#### Connection Pool Option\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `maxPoolSize` | Number | The maximum number of connections in the connection pool | `undefined` |\n| `minPoolSize` | Number | The minimum number of connections in the connection pool | `undefined` |\n| `maxIdleTimeMS` | Number | The maximum number of milliseconds that a connection can remain idle in the pool before being removed and closed | `undefined` |\n| `waitQueueMultiple` | Number | A number that the driver multiples the maxPoolSize value to, to provide the maximum number of threads allowed to wait for a connection to become available from the pool | `undefined` |\n| `waitQueueTimeoutMS` | Number | The maximum time in milliseconds that a thread can wait for a connection to become available | `undefined` |\n\n#### Write Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `w` | Number/String | Corresponds to the write concern [w Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-w) | `undefined` |\n| `wTimeoutMS` | Number | Corresponds to the write concern [wtimeout](https://docs.mongodb.com/manual/reference/write-concern/#wc-wtimeout) | `undefined` |\n| `journal` | Boolean | Corresponds to the write concern [j Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-j) | `undefined` |\n\n#### Read Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readConcernLevel` | String | The level of isolation | `undefined` |\n\n#### Read Preference Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readPreference` | String | Specifies the read preferences for this connection. Possible values: `PRIMARY`, `PRIMARY_PREFERRED`, `SECONDARY`, `SECONDARY_PREFERRED`, `NEAREST` | `PRIMARY` |\n| `maxStalenessSeconds` | Number | Specifies, in seconds, how stale a secondary can be before the client stops using it for read operations | `undefined` |\n| `readPreferenceTags` | Object | Default read preference tags for the client | `undefined` |\n\n#### Authentication Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `authSource` | String | Specify the database name associated with the user’s credentials | `undefined` |\n| `authMechanism` | String | Specifies the authentication mechanism that MongoDB will use to authenticate the connection. Possible values: `DEFAULT`, `GSSAPI`, `MONGODB-X509`, `PLAIN`, `SCRAM-SHA-256` | `undefined` |\n| `authMechanismProperties` | Object | Additional options provided for authentication (e.g. to enable hostname canonicalization for GSSAPI) | `undefined` |\n| `gssapiServiceName` | String | Set the Kerberos service name when connecting to Kerberized MongoDB instances | `undefined` |\n| `gssapiServiceRealm` | String | Set the Realm service name | `undefined` |\n| `gssapiCanonicalizeHostName` | Boolean | Whether canonicalized hostname | `undefined` |\n\n#### Server Selection and Discovery Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `localThresholdMS` | Number | The size (in milliseconds) of the latency window for selecting among multiple suitable MongoDB instances | `undefined` |\n| `serverSelectionTimeoutMS` | Number | Specifies how long (in milliseconds) to block for server selection before throwing an exception | `undefined` |\n| `serverSelectionTryOnce` | Boolean | Instructs the driver to scan the MongoDB deployment exactly once after server selection fails and then either select a server or raise an error | `undefined` |\n| `heartbeatFrequencyMS` | Number | Controls when the driver checks the state of the MongoDB deployment | `undefined` |\n\n#### Miscellaneous Configuration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `appname` | String | An application name passed to server as client metadata | `undefined` |\n| `retryWrites` | Boolean | Enable retryable writes | `undefined` |\n| `uuidRepresentation` | String | The legacy representation of UUID. Possible values: `standard`, `csharpLegacy`, `javaLegacy`, `pythonLegacy` | `undefined` |\n| `loadBalanced` | Boolean | Whether or not the server is running in load balanced mode | `undefined` |\n\n### Stitch attributes\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `stitchServiceName` | String | Stitch service name | `undefined` |\n| `stitchClientAppId` | String | Stitch сlient app ID | `undefined` |\n| `stitchGroupId` | String | Stitch group ID | `undefined` |\n| `stitchBaseUrl` | String | Stitch base Url | `undefined` |\n\n### MONGODB authentication\n\n```javascript\nconst c = new Connection({\n  mongodbUsername: 'arlo',\n  mongodbPassword: 'w@of'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/?slaveOk=true&authSource=admin'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `mongodbUsername` | String | MongoDB username | `undefined` |\n| `mongodbPassword` | String | MongoDB password | `undefined` |\n| `mongodbDatabaseName` | String | The database name associated with the user's credentials | `undefined` |\n| `promoteValues` | Boolean | Whether BSON values should be promoted to their JS type counterparts | `undefined` |\n\n### KERBEROS authentication\n\n```javascript\nconst c = new Connection({\n  kerberosServiceName: 'mongodb',\n  kerberosPrincipal: 'arlo/dog@krb5.mongodb.parts',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo%252Fdog%2540krb5.mongodb.parts@localhost:27017/toys?authMechanism=GSSAPI'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n> @note (imlucas): Kerberos on Windows is broken out as it's own state for UX consideration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `kerberosServiceName` | String | Any program or computer you access over a network | `undefined` |\n| `kerberosPrincipal` | String | The format of a typical Kerberos V5 principal is `primary/instance@REALM` | `undefined` |\n| `kerberosCanonicalizeHostname` | Boolean | Whether canonicalized kerberos hostname | `undefined` |\n\n#### See Also\n\n- [node.js driver Kerberos reference](http://bit.ly/mongodb-node-driver-kerberos)\n- [node.js driver Kerberos functional test][kerberos-functional]\n\n### LDAP authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  ldapUsername: 'arlo',\n  ldapPassword: 'w@of',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/toys?slaveOk=true&authMechanism=PLAIN'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ldapUsername` | String | LDAP username | `undefined` |\n| `ldapPassword` | String | LDAP password | `undefined` |\n\n#### See Also\n\n- [node.js driver LDAP reference](http://bit.ly/mongodb-node-driver-ldap)\n- [node.js driver X509 functional test][ldap-functional]\n\n### X509 authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  x509Username: 'CN=client,OU=arlo,O=MongoDB,L=Philadelphia,ST=Pennsylvania,C=US'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://CN%253Dclient%252COU%253Darlo%252CO%253DMongoDB%252CL%253DPhiladelphia%252CST%253DPennsylvania%252CC%253DUS@localhost:27017?slaveOk=true&authMechanism=MONGODB-X509'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `x509Username` | String | The x.509 certificate derived user name, e.g. `CN=user,OU=OrgUnit,O=myOrg,...` | `undefined` |\n\n#### See Also\n\n- [node.js driver X509 reference](http://bit.ly/mongodb-node-driver-x509)\n- [node.js driver X509 functional test][x509-functional]\n\n### SSL\n\n> **Note**: Not to be confused with `authentication=X509`\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ssl` | Number/String | A boolean to enable or disables TLS/SSL for the connection | `undefined` |\n| `sslMethod` | String | The desired ssl method. Possible values: `NONE`, `SYSTEMCA`, `IFAVAILABLE`, `UNVALIDATED`, `SERVER`, `ALL` | `NONE` |\n| `sslCA` | Buffer/String | Array of valid certificates | `undefined` |\n| `sslCert` | Buffer/String | The certificate | `undefined` |\n| `sslKey` | Buffer/String | The certificate private key | `undefined` |\n| `sslPass` | Buffer/String | The certificate password | `undefined` |\n\nDescription of `sslMethod` values:\n\n- `SYSTEMCA` - SSL required, validate using System CA, with host verification.\n- `IFAVAILABLE` - The driver should try SSL first, fall back to no SSL if unavailable, and use the system's Certificate Authority.\n- `SERVER` - The driver should validate the server certificate and fail to connect if validation fails. See also [node.js driver \"Validate Server Certificate\" docs][driver-ssl-server].\n- `ALL` - The driver must present a valid certificate and validate the server certificate. See also [node.js driver \"Validate Server Certificate and Present Valid Certificate\" docs][driver-ssl-all].\n- `NONE` - No SSL (Not recommended).\n- `UNVALIDATED` - Use SSL but do not perform any validation of the certificate chain. See also [node.js driver \"No Certificate Validation\" docs][driver-ssl-none]. **Very** not recommended and likely to be deprecated in future releases because it exposes potential Man-In-The-Middle attack vectors.\n\n#### See also\n\n- [node.js driver SSL implementation][driver-ssl-impl]\n- [node.js driver SSL tutorial][driver-ssl-tutorial]\n\n### SSH TUNNEL\n\n> New in mongodb-connection-model@5.0.0\n\nBecause [authentication](#authentication) is quite difficult for operators to migrate to, the most common method of securing a MongoDB deployment is to use an [SSH tunnel][sf-ssh-tunnel].  This allows operators to leverage their existing SSH security infrastructure to also provide secure access to MongoDB.  For a standard deployment of MongoDB on AWS, this is almost always to strategy.  Because of this, we now support creating SSH tunnels automatically when connecting to MongoDB.\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options, (connectionError, client) => {\n  if (connectionError) {\n    return console.log(connectionError);\n  }\n\n  client.db('mongodb').collection('fanclub').count((countingError, count) => {\n    console.log('counted:', countingError, count);\n    client.close();\n  });\n});\n```\n\nThe above provides the same functionality as creating the tunnel using the bash\ncommand below and connecting to MongoDB via another terminal. Notice that\nconnection-model uses a random local port each time it creates a tunnel.\nUsing the command line, you'd have to replace `<random port>` with an actual\nport number.\n\n```bash\nssh -i ~/.ssh/my-key-aws-pair.pem -L <random port>:localhost:27017 ubuntu@ec2-11-111-111-111.compute-1.amazonaws.com\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `sshTunnel` | String | The desired SSH tunnel strategy. Possible values: `NONE`, `USER_PASSWORD`, `IDENTITY_FILE` | `undefined` |\n| `sshTunnelHostname` | String | The hostname of the SSH remote host | `undefined` |\n| `sshTunnelPort` | Port | The SSH port of the remote host | `22` |\n| `sshTunnelBindToLocalPort` | Port | Bind the localhost endpoint of the SSH Tunnel to this port | `undefined` |\n| `sshTunnelUsername` | String | The optional SSH username for the remote host | `undefined` |\n| `sshTunnelPassword` | String | The optional SSH password for the remote host | `undefined` |\n| `sshTunnelIdentityFile` | String/Array | The optional path to the SSH identity file for the remote host | `undefined` |\n| `sshTunnelPassphrase` | String | The optional passphrase for `sshTunnelIdentityFile` | `undefined` |\n\nDescription of `sshTunnel` values:\n\n- `NONE` - Do not use SSH tunneling.\n- `USER_PASSWORD` - The tunnel is created with SSH username and password only.\n- `IDENTITY_FILE` - The tunnel is created using an identity file.\n\n## Derived Properties\n\nDerived properties (also known as computed properties) are properties of the state object that depend on other properties to determine their value.\n\n```javascript\nconst c = new Connection();\nconst derivedProps = c.getAttributes({ derived: true });\n```\n\n| Derived Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `instanceId` | String | The mongoscope | `localhost:27017` |\n| `driverAuthMechanism` | String | Converts the value of `authStrategy` for humans into the `authMechanism` value for the driver | `undefined` |\n| `safeUrl` | String | The URL where a password is replaced with stars | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrl` | String | Use this URL in order to connect via DataService | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrlWithSsh` | String | Use this URL in order to connect via connection model itself | `mongodb://localhost:29201/?readPreference=primary&ssl=false` |\n| `driverOptions` | String | The second argument `mongoscope-server` passes to `mongodb.connect` | `{}` |\n\n## Events\n\n> New in mongodb-connection-model@5.0.0\n\n#### Example: SSH Tunnel\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', skipped: true,\n  reason: 'The selected SSL mode does not need to load any files.' }\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', complete: true}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n#### Example: SSL\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  ssl: 'ALL',\n  sslCA: '~/.ssl/my-ca.pem',\n  sslCert: '~/.ssl/my-server.pem',\n  sslKey: '~/.ssl/my-server.pem'\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', complete: true}\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', skipped: true,\n  reason: 'The selected SSH Tunnel mode is NONE.'}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n[workflow_img]: https://github.com/mongodb-js/connection-model/workflows/Check%20and%20Test/badge.svg?event=push\n[workflow_url]: https://github.com/mongodb-js/connection-model/actions?query=workflow%3A%22Check+and+Test%22\n[npm_img]: https://img.shields.io/npm/v/mongodb-connection-model.svg?style=flat-square\n[npm_url]: https://www.npmjs.org/package/mongodb-connection-model\n[gitter_img]: https://badges.gitter.im/Join%20Chat.svg\n[gitter_url]: http://gitter.im/mongodb-js/mongodb-js\n[enterprise_img]: https://img.shields.io/badge/MongoDB-Enterprise-blue.svg?style=flat-square\n[coming_soon_img]: https://img.shields.io/badge/-Coming%20Soon-ff69b4.svg?style=flat-square\n[kerberos-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/kerberos_tests.js\n[ldap-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ldap_tests.js\n[x509-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ssl_x509_tests.js\n[ns]: https://github.com/mongodb-js/ns\n[sf-ssh-tunnel]: http://serverfault.com/questions/597765/how-to-connect-to-mongodb-server-via-ssh-tunnel\n[ec2-key-pairs]: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html\n[driver-ssl-impl]: https://github.com/christkv/mongodb-core/blob/c3d21cb636d74d7a68134ecd3b9f6af536311279/lib/connection/connection.js#L365-L407\n[driver-ssl-tutorial]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/\n[driver-ssl-none]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#no-certificate-validation\n[driver-ssl-server]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate\n[driver-ssl-all]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate-and-present-valid-certificate\n","gitHead":"feb0121be4234a831e6bce640173de34ce95dd7a","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","test":"mocha","check":"npm run lint && npm run depcheck","pretest":"mongodb-runner install && mongodb-runner start --port=27018","test-ci":"npm run test","depcheck":"depcheck","posttest":"mongodb-runner stop --port=27018","posttest-ci":"node ../../scripts/killall-mongo.js","test-check-ci":"npm run check && npm test"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.17.0+x64 (linux)","description":"MongoDB connection model.","directories":{},"_nodeVersion":"16.17.0","compass:main":"index.js","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","debug":"^4.2.0","lodash":"^4.17.15","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.2.0","storage-mixin":"0.0.0-next-feb0121be4234a831e6bce640173de34ce95dd7a","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.2","@mongodb-js/ssh-tunnel":"0.0.0-next-feb0121be4234a831e6bce640173de34ce95dd7a","@mongodb-js/compass-utils":"0.0.0-next-feb0121be4234a831e6bce640173de34ce95dd7a","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.5.4"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"^4.10.0","depcheck":"^1.4.1","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.9.0","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^4.10.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_0.0.0-next-feb0121be4234a831e6bce640173de34ce95dd7a_1669167554525_0.5841329759489451","host":"s3://npm-registry-packages"}},"0.0.0-next-64ed9e6634006598c90fc79f71c554ec401bfc8e":{"name":"mongodb-connection-model","version":"0.0.0-next-64ed9e6634006598c90fc79f71c554ec401bfc8e","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@0.0.0-next-64ed9e6634006598c90fc79f71c554ec401bfc8e","maintainers":[{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"iteng@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"d2bfc897f39bda6b22516952e3d4f5964a559ade","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-0.0.0-next-64ed9e6634006598c90fc79f71c554ec401bfc8e.tgz","fileCount":20,"integrity":"sha512-PhCShlI6HWuqiKVwt5048CHqPWZ0g8Axzj9U7nZ3iSQFfaPjjHGxo4X4Zyu8kBDD8HiqcLvtuwLZeI7KVP3XGA==","signatures":[{"sig":"MEUCIQDAFH7ihD51yo+iDtGyxE4rcQ/bJ1+6sE5zAdWmJE+eggIgS5wUbW4/QWBN1Pnxiv36rd8+R4Op7omYO9ab8drnu28=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":108152,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjfYJbACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpiXQ//Z1FVwTkzu3ynv5RjZiO8JWhnCXOG81ZaPQc90DQQz0ABPTli\r\n5BIg6OdMDR3msqyO4OclHrvUHtIBspR7TaYL9URs5lBVuaO6h7HBjciC0sm8\r\nbknj6FEuyYyr2HiSdBIuvsaqFLMUAiDVqQJwUbUCNGySqZQWNilHt09lenXd\r\ntKAd0GNoehDR4ziXixrY8RPeHLij+OP8+S6Lkl/XDV/ECh4F0nUfjWQMHT0N\r\ns1Dv9cOgcNI+7oNzNTEZAUpIWcOutXzD9oCM1ULNccvNn0kNMFVTlnN9WIDV\r\nmd+40LvAxmlztO90hpB39bLy5NDWPSx2AJqnnwd9MyMf3l9zVW7NfIsjt/dB\r\nh7SGgdyVjwwIqm48S6nb2jxfVFwbcfvi5s6+kdsiu/8bMOF8QTWubwHKvwhk\r\nbgkpl+KCLl3pnwXIadkc+akejwrGLjNZMK0pK1av++k7sodgV7jjWJpCISGR\r\nm8uNZH+4Kkm/ebdJB+HnIXOA3/ZGzkSvPm40/3MJcv+mN4sqTGccDPmCc51u\r\nuVL0bqjlau2cDPR+Ftcjh6ti8X6LHdtjJwx8IbZJen6yut7tmZM2QAvpuR8f\r\neNVWaMevooR/84MGKaGO6pxiaZ55+E/vtexyMXeegAcO+i22BpOz/MOyqPok\r\nih3yTEUeVA5mY4fVSuyH2vUHlzRCYIm8G84=\r\n=JEd7\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","readme":"# mongodb-connection-model [![][workflow_img]][workflow_url] [![][npm_img]][npm_url]\n\n> MongoDB connection model\n\nThe main purpose of the MongoDB connection model is to be a domain model around a MongoDB connection. It encapsulates generating a [Connection String URI](https://docs.mongodb.com/manual/reference/connection-string/) from a group of attributes and parses URI using the [MongoDB Node.JS Driver URI Parser](https://github.com/mongodb-js/mongodb-core/blob/master/lib/uri_parser.js).\n\n## Installation\n\n```\nnpm install --save mongodb-connection-model\n```\n\n## Usage\n\n### Building URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\nconst c = new Connection({ appname: 'My App Name' });\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://localhost:27017/?readPreference=primary&appname=My%20App&ssl=false'\n```\n\n### Parsing URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\n\nConnection.from(\n  'mongodb://someUsername:testPassword@localhost',\n  (error, result) => {\n    console.log(result);\n    >>> `{\n      hosts: [{ host: 'localhost', port: 27017 }],\n      hostname: 'localhost',\n      port: 27017,\n      auth: {\n        username: 'someUsername',\n        password: 'testPassword',\n        db: 'admin'\n      },\n      isSrvRecord: false,\n      authStrategy: 'MONGODB',\n      mongodbUsername: 'someUsername',\n      mongodbPassword: 'testPassword',\n      mongodbDatabaseName: 'admin',\n      extraOptions: {},\n      connectionType: 'NODE_DRIVER',\n      readPreference: 'primary',\n      kerberosCanonicalizeHostname: false,\n      sslMethod: 'NONE',\n      sshTunnel: 'NONE',\n      sshTunnelPort: 22\n    }`\n  }\n);\n```\n\n## Properties\n\nMongoDB connection model is based on Ampersand.js framework and consist of [props](https://ampersandjs.com/docs/#ampersand-state-props) and [derived props](https://ampersandjs.com/docs/#ampersand-state-derived). The props object describes the observable properties that MongoDB connection model gets from the Node.js Driver API.\n\n```javascript\nconst с = new Connection();\nconst props = с.getAttributes({ props: true });\n```\n\n#### See Also\n\n- [URI Generic Syntax](https://tools.ietf.org/html/rfc3986)\n- [URI Options Specification](https://github.com/mongodb/specifications/blob/master/source/uri-options/uri-options.rst)\n\n### General Properties\n\n```javascript\nconst c = new Connection({ isSrvRecord: true });\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ns` | String | A valid [ns][ns] the user can read from | `undefined` |\n| `isSrvRecord` | Boolean | Indicates SRV record | `false` |\n| `auth` | Object | Authentication from driver (username, user, db, password) | `undefined` |\n| `hostname` | String | Hostname of a MongoDB Instance. In case of the replica set the first host and port will be taken | `localhost` |\n| `port` | Number | TCP port of a MongoDB Instance | `27017` |\n| `hosts` | Array | Contains all hosts and ports for replica set | `[{ host: 'localhost', port: 27017 }]` |\n| `extraOptions` | Object | Extra options passed to the node driver as part of `driverOptions` | `{}` |\n| `connectionType` | String | The desired connection type. Possible values: `NODE_DRIVER`, `STITCH_ON_PREM`, `STITCH_ATLAS` | `NODE_DRIVER` |\n| `authStrategy` | String | The desired authentication strategy. Possible values: `NONE`, `MONGODB`, `X509`, `KERBEROS`, `LDAP`, `SCRAM-SHA-256` | `NONE` |\n\n### Connection string options\n\n```javascript\nconst c = new Connection({ appname: 'My App', replicaSet: 'testing' });\n```\n\n#### General connection string options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `replicaSet` | String | Specifies the name of the replica set, if the mongod is a member of a replica set | `undefined` |\n| `connectTimeoutMS` | Number | The time in milliseconds to attempt a connection before timing out | `undefined` |\n| `socketTimeoutMS` | Number | The time in milliseconds to attempt a send or receive on a socket before the attempt times out | `undefined` |\n| `compression` | Object | Object includes compressors and a compression level. The following compressors can be specified: `snappy`, `zlib` (Available in MongoDB 3.6 or greater) | `undefined` |\n\n#### Connection Pool Option\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `maxPoolSize` | Number | The maximum number of connections in the connection pool | `undefined` |\n| `minPoolSize` | Number | The minimum number of connections in the connection pool | `undefined` |\n| `maxIdleTimeMS` | Number | The maximum number of milliseconds that a connection can remain idle in the pool before being removed and closed | `undefined` |\n| `waitQueueMultiple` | Number | A number that the driver multiples the maxPoolSize value to, to provide the maximum number of threads allowed to wait for a connection to become available from the pool | `undefined` |\n| `waitQueueTimeoutMS` | Number | The maximum time in milliseconds that a thread can wait for a connection to become available | `undefined` |\n\n#### Write Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `w` | Number/String | Corresponds to the write concern [w Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-w) | `undefined` |\n| `wTimeoutMS` | Number | Corresponds to the write concern [wtimeout](https://docs.mongodb.com/manual/reference/write-concern/#wc-wtimeout) | `undefined` |\n| `journal` | Boolean | Corresponds to the write concern [j Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-j) | `undefined` |\n\n#### Read Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readConcernLevel` | String | The level of isolation | `undefined` |\n\n#### Read Preference Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readPreference` | String | Specifies the read preferences for this connection. Possible values: `PRIMARY`, `PRIMARY_PREFERRED`, `SECONDARY`, `SECONDARY_PREFERRED`, `NEAREST` | `PRIMARY` |\n| `maxStalenessSeconds` | Number | Specifies, in seconds, how stale a secondary can be before the client stops using it for read operations | `undefined` |\n| `readPreferenceTags` | Object | Default read preference tags for the client | `undefined` |\n\n#### Authentication Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `authSource` | String | Specify the database name associated with the user’s credentials | `undefined` |\n| `authMechanism` | String | Specifies the authentication mechanism that MongoDB will use to authenticate the connection. Possible values: `DEFAULT`, `GSSAPI`, `MONGODB-X509`, `PLAIN`, `SCRAM-SHA-256` | `undefined` |\n| `authMechanismProperties` | Object | Additional options provided for authentication (e.g. to enable hostname canonicalization for GSSAPI) | `undefined` |\n| `gssapiServiceName` | String | Set the Kerberos service name when connecting to Kerberized MongoDB instances | `undefined` |\n| `gssapiServiceRealm` | String | Set the Realm service name | `undefined` |\n| `gssapiCanonicalizeHostName` | Boolean | Whether canonicalized hostname | `undefined` |\n\n#### Server Selection and Discovery Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `localThresholdMS` | Number | The size (in milliseconds) of the latency window for selecting among multiple suitable MongoDB instances | `undefined` |\n| `serverSelectionTimeoutMS` | Number | Specifies how long (in milliseconds) to block for server selection before throwing an exception | `undefined` |\n| `serverSelectionTryOnce` | Boolean | Instructs the driver to scan the MongoDB deployment exactly once after server selection fails and then either select a server or raise an error | `undefined` |\n| `heartbeatFrequencyMS` | Number | Controls when the driver checks the state of the MongoDB deployment | `undefined` |\n\n#### Miscellaneous Configuration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `appname` | String | An application name passed to server as client metadata | `undefined` |\n| `retryWrites` | Boolean | Enable retryable writes | `undefined` |\n| `uuidRepresentation` | String | The legacy representation of UUID. Possible values: `standard`, `csharpLegacy`, `javaLegacy`, `pythonLegacy` | `undefined` |\n| `loadBalanced` | Boolean | Whether or not the server is running in load balanced mode | `undefined` |\n\n### Stitch attributes\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `stitchServiceName` | String | Stitch service name | `undefined` |\n| `stitchClientAppId` | String | Stitch сlient app ID | `undefined` |\n| `stitchGroupId` | String | Stitch group ID | `undefined` |\n| `stitchBaseUrl` | String | Stitch base Url | `undefined` |\n\n### MONGODB authentication\n\n```javascript\nconst c = new Connection({\n  mongodbUsername: 'arlo',\n  mongodbPassword: 'w@of'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/?slaveOk=true&authSource=admin'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `mongodbUsername` | String | MongoDB username | `undefined` |\n| `mongodbPassword` | String | MongoDB password | `undefined` |\n| `mongodbDatabaseName` | String | The database name associated with the user's credentials | `undefined` |\n| `promoteValues` | Boolean | Whether BSON values should be promoted to their JS type counterparts | `undefined` |\n\n### KERBEROS authentication\n\n```javascript\nconst c = new Connection({\n  kerberosServiceName: 'mongodb',\n  kerberosPrincipal: 'arlo/dog@krb5.mongodb.parts',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo%252Fdog%2540krb5.mongodb.parts@localhost:27017/toys?authMechanism=GSSAPI'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n> @note (imlucas): Kerberos on Windows is broken out as it's own state for UX consideration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `kerberosServiceName` | String | Any program or computer you access over a network | `undefined` |\n| `kerberosPrincipal` | String | The format of a typical Kerberos V5 principal is `primary/instance@REALM` | `undefined` |\n| `kerberosCanonicalizeHostname` | Boolean | Whether canonicalized kerberos hostname | `undefined` |\n\n#### See Also\n\n- [node.js driver Kerberos reference](http://bit.ly/mongodb-node-driver-kerberos)\n- [node.js driver Kerberos functional test][kerberos-functional]\n\n### LDAP authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  ldapUsername: 'arlo',\n  ldapPassword: 'w@of',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/toys?slaveOk=true&authMechanism=PLAIN'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ldapUsername` | String | LDAP username | `undefined` |\n| `ldapPassword` | String | LDAP password | `undefined` |\n\n#### See Also\n\n- [node.js driver LDAP reference](http://bit.ly/mongodb-node-driver-ldap)\n- [node.js driver X509 functional test][ldap-functional]\n\n### X509 authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  x509Username: 'CN=client,OU=arlo,O=MongoDB,L=Philadelphia,ST=Pennsylvania,C=US'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://CN%253Dclient%252COU%253Darlo%252CO%253DMongoDB%252CL%253DPhiladelphia%252CST%253DPennsylvania%252CC%253DUS@localhost:27017?slaveOk=true&authMechanism=MONGODB-X509'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `x509Username` | String | The x.509 certificate derived user name, e.g. `CN=user,OU=OrgUnit,O=myOrg,...` | `undefined` |\n\n#### See Also\n\n- [node.js driver X509 reference](http://bit.ly/mongodb-node-driver-x509)\n- [node.js driver X509 functional test][x509-functional]\n\n### SSL\n\n> **Note**: Not to be confused with `authentication=X509`\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ssl` | Number/String | A boolean to enable or disables TLS/SSL for the connection | `undefined` |\n| `sslMethod` | String | The desired ssl method. Possible values: `NONE`, `SYSTEMCA`, `IFAVAILABLE`, `UNVALIDATED`, `SERVER`, `ALL` | `NONE` |\n| `sslCA` | Buffer/String | Array of valid certificates | `undefined` |\n| `sslCert` | Buffer/String | The certificate | `undefined` |\n| `sslKey` | Buffer/String | The certificate private key | `undefined` |\n| `sslPass` | Buffer/String | The certificate password | `undefined` |\n\nDescription of `sslMethod` values:\n\n- `SYSTEMCA` - SSL required, validate using System CA, with host verification.\n- `IFAVAILABLE` - The driver should try SSL first, fall back to no SSL if unavailable, and use the system's Certificate Authority.\n- `SERVER` - The driver should validate the server certificate and fail to connect if validation fails. See also [node.js driver \"Validate Server Certificate\" docs][driver-ssl-server].\n- `ALL` - The driver must present a valid certificate and validate the server certificate. See also [node.js driver \"Validate Server Certificate and Present Valid Certificate\" docs][driver-ssl-all].\n- `NONE` - No SSL (Not recommended).\n- `UNVALIDATED` - Use SSL but do not perform any validation of the certificate chain. See also [node.js driver \"No Certificate Validation\" docs][driver-ssl-none]. **Very** not recommended and likely to be deprecated in future releases because it exposes potential Man-In-The-Middle attack vectors.\n\n#### See also\n\n- [node.js driver SSL implementation][driver-ssl-impl]\n- [node.js driver SSL tutorial][driver-ssl-tutorial]\n\n### SSH TUNNEL\n\n> New in mongodb-connection-model@5.0.0\n\nBecause [authentication](#authentication) is quite difficult for operators to migrate to, the most common method of securing a MongoDB deployment is to use an [SSH tunnel][sf-ssh-tunnel].  This allows operators to leverage their existing SSH security infrastructure to also provide secure access to MongoDB.  For a standard deployment of MongoDB on AWS, this is almost always to strategy.  Because of this, we now support creating SSH tunnels automatically when connecting to MongoDB.\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options, (connectionError, client) => {\n  if (connectionError) {\n    return console.log(connectionError);\n  }\n\n  client.db('mongodb').collection('fanclub').count((countingError, count) => {\n    console.log('counted:', countingError, count);\n    client.close();\n  });\n});\n```\n\nThe above provides the same functionality as creating the tunnel using the bash\ncommand below and connecting to MongoDB via another terminal. Notice that\nconnection-model uses a random local port each time it creates a tunnel.\nUsing the command line, you'd have to replace `<random port>` with an actual\nport number.\n\n```bash\nssh -i ~/.ssh/my-key-aws-pair.pem -L <random port>:localhost:27017 ubuntu@ec2-11-111-111-111.compute-1.amazonaws.com\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `sshTunnel` | String | The desired SSH tunnel strategy. Possible values: `NONE`, `USER_PASSWORD`, `IDENTITY_FILE` | `undefined` |\n| `sshTunnelHostname` | String | The hostname of the SSH remote host | `undefined` |\n| `sshTunnelPort` | Port | The SSH port of the remote host | `22` |\n| `sshTunnelBindToLocalPort` | Port | Bind the localhost endpoint of the SSH Tunnel to this port | `undefined` |\n| `sshTunnelUsername` | String | The optional SSH username for the remote host | `undefined` |\n| `sshTunnelPassword` | String | The optional SSH password for the remote host | `undefined` |\n| `sshTunnelIdentityFile` | String/Array | The optional path to the SSH identity file for the remote host | `undefined` |\n| `sshTunnelPassphrase` | String | The optional passphrase for `sshTunnelIdentityFile` | `undefined` |\n\nDescription of `sshTunnel` values:\n\n- `NONE` - Do not use SSH tunneling.\n- `USER_PASSWORD` - The tunnel is created with SSH username and password only.\n- `IDENTITY_FILE` - The tunnel is created using an identity file.\n\n## Derived Properties\n\nDerived properties (also known as computed properties) are properties of the state object that depend on other properties to determine their value.\n\n```javascript\nconst c = new Connection();\nconst derivedProps = c.getAttributes({ derived: true });\n```\n\n| Derived Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `instanceId` | String | The mongoscope | `localhost:27017` |\n| `driverAuthMechanism` | String | Converts the value of `authStrategy` for humans into the `authMechanism` value for the driver | `undefined` |\n| `safeUrl` | String | The URL where a password is replaced with stars | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrl` | String | Use this URL in order to connect via DataService | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrlWithSsh` | String | Use this URL in order to connect via connection model itself | `mongodb://localhost:29201/?readPreference=primary&ssl=false` |\n| `driverOptions` | String | The second argument `mongoscope-server` passes to `mongodb.connect` | `{}` |\n\n## Events\n\n> New in mongodb-connection-model@5.0.0\n\n#### Example: SSH Tunnel\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', skipped: true,\n  reason: 'The selected SSL mode does not need to load any files.' }\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', complete: true}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n#### Example: SSL\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  ssl: 'ALL',\n  sslCA: '~/.ssl/my-ca.pem',\n  sslCert: '~/.ssl/my-server.pem',\n  sslKey: '~/.ssl/my-server.pem'\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', complete: true}\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', skipped: true,\n  reason: 'The selected SSH Tunnel mode is NONE.'}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n[workflow_img]: https://github.com/mongodb-js/connection-model/workflows/Check%20and%20Test/badge.svg?event=push\n[workflow_url]: https://github.com/mongodb-js/connection-model/actions?query=workflow%3A%22Check+and+Test%22\n[npm_img]: https://img.shields.io/npm/v/mongodb-connection-model.svg?style=flat-square\n[npm_url]: https://www.npmjs.org/package/mongodb-connection-model\n[gitter_img]: https://badges.gitter.im/Join%20Chat.svg\n[gitter_url]: http://gitter.im/mongodb-js/mongodb-js\n[enterprise_img]: https://img.shields.io/badge/MongoDB-Enterprise-blue.svg?style=flat-square\n[coming_soon_img]: https://img.shields.io/badge/-Coming%20Soon-ff69b4.svg?style=flat-square\n[kerberos-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/kerberos_tests.js\n[ldap-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ldap_tests.js\n[x509-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ssl_x509_tests.js\n[ns]: https://github.com/mongodb-js/ns\n[sf-ssh-tunnel]: http://serverfault.com/questions/597765/how-to-connect-to-mongodb-server-via-ssh-tunnel\n[ec2-key-pairs]: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html\n[driver-ssl-impl]: https://github.com/christkv/mongodb-core/blob/c3d21cb636d74d7a68134ecd3b9f6af536311279/lib/connection/connection.js#L365-L407\n[driver-ssl-tutorial]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/\n[driver-ssl-none]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#no-certificate-validation\n[driver-ssl-server]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate\n[driver-ssl-all]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate-and-present-valid-certificate\n","gitHead":"64ed9e6634006598c90fc79f71c554ec401bfc8e","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","test":"mocha","check":"npm run lint && npm run depcheck","pretest":"mongodb-runner install && mongodb-runner start --port=27018","test-ci":"npm run test","depcheck":"depcheck","posttest":"mongodb-runner stop --port=27018","posttest-ci":"node ../../scripts/killall-mongo.js","test-check-ci":"npm run check && npm test"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.17.0+x64 (linux)","description":"MongoDB connection model.","directories":{},"_nodeVersion":"16.17.0","compass:main":"index.js","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","debug":"^4.2.0","lodash":"^4.17.15","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.2.0","storage-mixin":"0.0.0-next-64ed9e6634006598c90fc79f71c554ec401bfc8e","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.2","@mongodb-js/ssh-tunnel":"0.0.0-next-64ed9e6634006598c90fc79f71c554ec401bfc8e","@mongodb-js/compass-utils":"0.0.0-next-64ed9e6634006598c90fc79f71c554ec401bfc8e","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.5.4"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"^4.10.0","depcheck":"^1.4.1","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.9.0","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^4.10.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_0.0.0-next-64ed9e6634006598c90fc79f71c554ec401bfc8e_1669169755262_0.7997533321554813","host":"s3://npm-registry-packages"}},"0.0.0-next-a005ee4428ffd61a00127102fa0c29212a52fc83":{"name":"mongodb-connection-model","version":"0.0.0-next-a005ee4428ffd61a00127102fa0c29212a52fc83","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@0.0.0-next-a005ee4428ffd61a00127102fa0c29212a52fc83","maintainers":[{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"iteng@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"3f84d562830c43a4695eb4fb8c353c6b71a0930c","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-0.0.0-next-a005ee4428ffd61a00127102fa0c29212a52fc83.tgz","fileCount":20,"integrity":"sha512-zAFXfOAxCcMrBwWc8c4h6bui7P6cAA3e8VPjJs2AR7Brge+aLt2SVPcDEQoY/XW51yS+rnif2IB5UH3a7ZybIg==","signatures":[{"sig":"MEYCIQC/a/MIYUk9NAr3BqEFu+N96lE+IG5QZlxemm+BnXQXCwIhAJrPB/h+n/fWPaSl1ozqKUIgdWYN9juYq2kA1afPX5lG","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":108152,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjfuNWACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpTJw/+ITOfDi6SEsLBAvhOxqw+ZBxDDJb9SDnLRbUzVp0EwLBf8qaj\r\n8S6SNWiS2F3YygmKOI/txcAkythvLjP4U5xEvsE6DrTPEZiH0wia7tPL0pEX\r\ntq8txJGhgYr9T9Ht2hi2AWXJBDdfLhdvGb16Xou6kfE+MbXreR5v9DPLDivY\r\ni1kHnWrf4SJrdUPMz8gwsHV5DLhWwKLxBwEKRMQSM5Sw3UkQP+n1g/vbeDdY\r\nV/Bq/iaa0hbQN6lLRc81jX6v679TVhMIk5LvBjUwSvblPUGQhZ42hCdq8BCJ\r\nt+Wm0RJ/ie4UnAIsfHLJWIpv96Hf+SwM8GqGsrcSicpMNT+n79qsrU0OpTwp\r\ndlFOhz9RdY7qlnNjAk1NrI2LLtUU+FLlgKOhT60HtVKwAlk039XlPWUwLcH5\r\nPMGJCcrFR2LzQciKB8KzUU/Iw1UQXAfaWsTFiN3x/Hi7mpdgmjFCaY0Gq3Va\r\nuyUpPjCfncSCEBcaQsq0+BPuH3Llj34vBt31dGqL/YIuaJWncTpkcGAnbjrJ\r\n60AyT2fdTU0Vmr4h4MUUhx7jygPku/JlCc848TEMhdUj05J0jyeTBPxpMG2W\r\nFoG63DTJSoiP5DY8S6GDm5tZUeQaqmcZeSWJZoBFyyAxRDCYRsc+qyoUvVeh\r\nxmOr3LMphNg22u/R3aqEuy5GGawIwVmGxZQ=\r\n=05zD\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","readme":"# mongodb-connection-model [![][workflow_img]][workflow_url] [![][npm_img]][npm_url]\n\n> MongoDB connection model\n\nThe main purpose of the MongoDB connection model is to be a domain model around a MongoDB connection. It encapsulates generating a [Connection String URI](https://docs.mongodb.com/manual/reference/connection-string/) from a group of attributes and parses URI using the [MongoDB Node.JS Driver URI Parser](https://github.com/mongodb-js/mongodb-core/blob/master/lib/uri_parser.js).\n\n## Installation\n\n```\nnpm install --save mongodb-connection-model\n```\n\n## Usage\n\n### Building URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\nconst c = new Connection({ appname: 'My App Name' });\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://localhost:27017/?readPreference=primary&appname=My%20App&ssl=false'\n```\n\n### Parsing URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\n\nConnection.from(\n  'mongodb://someUsername:testPassword@localhost',\n  (error, result) => {\n    console.log(result);\n    >>> `{\n      hosts: [{ host: 'localhost', port: 27017 }],\n      hostname: 'localhost',\n      port: 27017,\n      auth: {\n        username: 'someUsername',\n        password: 'testPassword',\n        db: 'admin'\n      },\n      isSrvRecord: false,\n      authStrategy: 'MONGODB',\n      mongodbUsername: 'someUsername',\n      mongodbPassword: 'testPassword',\n      mongodbDatabaseName: 'admin',\n      extraOptions: {},\n      connectionType: 'NODE_DRIVER',\n      readPreference: 'primary',\n      kerberosCanonicalizeHostname: false,\n      sslMethod: 'NONE',\n      sshTunnel: 'NONE',\n      sshTunnelPort: 22\n    }`\n  }\n);\n```\n\n## Properties\n\nMongoDB connection model is based on Ampersand.js framework and consist of [props](https://ampersandjs.com/docs/#ampersand-state-props) and [derived props](https://ampersandjs.com/docs/#ampersand-state-derived). The props object describes the observable properties that MongoDB connection model gets from the Node.js Driver API.\n\n```javascript\nconst с = new Connection();\nconst props = с.getAttributes({ props: true });\n```\n\n#### See Also\n\n- [URI Generic Syntax](https://tools.ietf.org/html/rfc3986)\n- [URI Options Specification](https://github.com/mongodb/specifications/blob/master/source/uri-options/uri-options.rst)\n\n### General Properties\n\n```javascript\nconst c = new Connection({ isSrvRecord: true });\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ns` | String | A valid [ns][ns] the user can read from | `undefined` |\n| `isSrvRecord` | Boolean | Indicates SRV record | `false` |\n| `auth` | Object | Authentication from driver (username, user, db, password) | `undefined` |\n| `hostname` | String | Hostname of a MongoDB Instance. In case of the replica set the first host and port will be taken | `localhost` |\n| `port` | Number | TCP port of a MongoDB Instance | `27017` |\n| `hosts` | Array | Contains all hosts and ports for replica set | `[{ host: 'localhost', port: 27017 }]` |\n| `extraOptions` | Object | Extra options passed to the node driver as part of `driverOptions` | `{}` |\n| `connectionType` | String | The desired connection type. Possible values: `NODE_DRIVER`, `STITCH_ON_PREM`, `STITCH_ATLAS` | `NODE_DRIVER` |\n| `authStrategy` | String | The desired authentication strategy. Possible values: `NONE`, `MONGODB`, `X509`, `KERBEROS`, `LDAP`, `SCRAM-SHA-256` | `NONE` |\n\n### Connection string options\n\n```javascript\nconst c = new Connection({ appname: 'My App', replicaSet: 'testing' });\n```\n\n#### General connection string options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `replicaSet` | String | Specifies the name of the replica set, if the mongod is a member of a replica set | `undefined` |\n| `connectTimeoutMS` | Number | The time in milliseconds to attempt a connection before timing out | `undefined` |\n| `socketTimeoutMS` | Number | The time in milliseconds to attempt a send or receive on a socket before the attempt times out | `undefined` |\n| `compression` | Object | Object includes compressors and a compression level. The following compressors can be specified: `snappy`, `zlib` (Available in MongoDB 3.6 or greater) | `undefined` |\n\n#### Connection Pool Option\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `maxPoolSize` | Number | The maximum number of connections in the connection pool | `undefined` |\n| `minPoolSize` | Number | The minimum number of connections in the connection pool | `undefined` |\n| `maxIdleTimeMS` | Number | The maximum number of milliseconds that a connection can remain idle in the pool before being removed and closed | `undefined` |\n| `waitQueueMultiple` | Number | A number that the driver multiples the maxPoolSize value to, to provide the maximum number of threads allowed to wait for a connection to become available from the pool | `undefined` |\n| `waitQueueTimeoutMS` | Number | The maximum time in milliseconds that a thread can wait for a connection to become available | `undefined` |\n\n#### Write Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `w` | Number/String | Corresponds to the write concern [w Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-w) | `undefined` |\n| `wTimeoutMS` | Number | Corresponds to the write concern [wtimeout](https://docs.mongodb.com/manual/reference/write-concern/#wc-wtimeout) | `undefined` |\n| `journal` | Boolean | Corresponds to the write concern [j Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-j) | `undefined` |\n\n#### Read Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readConcernLevel` | String | The level of isolation | `undefined` |\n\n#### Read Preference Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readPreference` | String | Specifies the read preferences for this connection. Possible values: `PRIMARY`, `PRIMARY_PREFERRED`, `SECONDARY`, `SECONDARY_PREFERRED`, `NEAREST` | `PRIMARY` |\n| `maxStalenessSeconds` | Number | Specifies, in seconds, how stale a secondary can be before the client stops using it for read operations | `undefined` |\n| `readPreferenceTags` | Object | Default read preference tags for the client | `undefined` |\n\n#### Authentication Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `authSource` | String | Specify the database name associated with the user’s credentials | `undefined` |\n| `authMechanism` | String | Specifies the authentication mechanism that MongoDB will use to authenticate the connection. Possible values: `DEFAULT`, `GSSAPI`, `MONGODB-X509`, `PLAIN`, `SCRAM-SHA-256` | `undefined` |\n| `authMechanismProperties` | Object | Additional options provided for authentication (e.g. to enable hostname canonicalization for GSSAPI) | `undefined` |\n| `gssapiServiceName` | String | Set the Kerberos service name when connecting to Kerberized MongoDB instances | `undefined` |\n| `gssapiServiceRealm` | String | Set the Realm service name | `undefined` |\n| `gssapiCanonicalizeHostName` | Boolean | Whether canonicalized hostname | `undefined` |\n\n#### Server Selection and Discovery Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `localThresholdMS` | Number | The size (in milliseconds) of the latency window for selecting among multiple suitable MongoDB instances | `undefined` |\n| `serverSelectionTimeoutMS` | Number | Specifies how long (in milliseconds) to block for server selection before throwing an exception | `undefined` |\n| `serverSelectionTryOnce` | Boolean | Instructs the driver to scan the MongoDB deployment exactly once after server selection fails and then either select a server or raise an error | `undefined` |\n| `heartbeatFrequencyMS` | Number | Controls when the driver checks the state of the MongoDB deployment | `undefined` |\n\n#### Miscellaneous Configuration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `appname` | String | An application name passed to server as client metadata | `undefined` |\n| `retryWrites` | Boolean | Enable retryable writes | `undefined` |\n| `uuidRepresentation` | String | The legacy representation of UUID. Possible values: `standard`, `csharpLegacy`, `javaLegacy`, `pythonLegacy` | `undefined` |\n| `loadBalanced` | Boolean | Whether or not the server is running in load balanced mode | `undefined` |\n\n### Stitch attributes\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `stitchServiceName` | String | Stitch service name | `undefined` |\n| `stitchClientAppId` | String | Stitch сlient app ID | `undefined` |\n| `stitchGroupId` | String | Stitch group ID | `undefined` |\n| `stitchBaseUrl` | String | Stitch base Url | `undefined` |\n\n### MONGODB authentication\n\n```javascript\nconst c = new Connection({\n  mongodbUsername: 'arlo',\n  mongodbPassword: 'w@of'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/?slaveOk=true&authSource=admin'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `mongodbUsername` | String | MongoDB username | `undefined` |\n| `mongodbPassword` | String | MongoDB password | `undefined` |\n| `mongodbDatabaseName` | String | The database name associated with the user's credentials | `undefined` |\n| `promoteValues` | Boolean | Whether BSON values should be promoted to their JS type counterparts | `undefined` |\n\n### KERBEROS authentication\n\n```javascript\nconst c = new Connection({\n  kerberosServiceName: 'mongodb',\n  kerberosPrincipal: 'arlo/dog@krb5.mongodb.parts',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo%252Fdog%2540krb5.mongodb.parts@localhost:27017/toys?authMechanism=GSSAPI'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n> @note (imlucas): Kerberos on Windows is broken out as it's own state for UX consideration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `kerberosServiceName` | String | Any program or computer you access over a network | `undefined` |\n| `kerberosPrincipal` | String | The format of a typical Kerberos V5 principal is `primary/instance@REALM` | `undefined` |\n| `kerberosCanonicalizeHostname` | Boolean | Whether canonicalized kerberos hostname | `undefined` |\n\n#### See Also\n\n- [node.js driver Kerberos reference](http://bit.ly/mongodb-node-driver-kerberos)\n- [node.js driver Kerberos functional test][kerberos-functional]\n\n### LDAP authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  ldapUsername: 'arlo',\n  ldapPassword: 'w@of',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/toys?slaveOk=true&authMechanism=PLAIN'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ldapUsername` | String | LDAP username | `undefined` |\n| `ldapPassword` | String | LDAP password | `undefined` |\n\n#### See Also\n\n- [node.js driver LDAP reference](http://bit.ly/mongodb-node-driver-ldap)\n- [node.js driver X509 functional test][ldap-functional]\n\n### X509 authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  x509Username: 'CN=client,OU=arlo,O=MongoDB,L=Philadelphia,ST=Pennsylvania,C=US'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://CN%253Dclient%252COU%253Darlo%252CO%253DMongoDB%252CL%253DPhiladelphia%252CST%253DPennsylvania%252CC%253DUS@localhost:27017?slaveOk=true&authMechanism=MONGODB-X509'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `x509Username` | String | The x.509 certificate derived user name, e.g. `CN=user,OU=OrgUnit,O=myOrg,...` | `undefined` |\n\n#### See Also\n\n- [node.js driver X509 reference](http://bit.ly/mongodb-node-driver-x509)\n- [node.js driver X509 functional test][x509-functional]\n\n### SSL\n\n> **Note**: Not to be confused with `authentication=X509`\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ssl` | Number/String | A boolean to enable or disables TLS/SSL for the connection | `undefined` |\n| `sslMethod` | String | The desired ssl method. Possible values: `NONE`, `SYSTEMCA`, `IFAVAILABLE`, `UNVALIDATED`, `SERVER`, `ALL` | `NONE` |\n| `sslCA` | Buffer/String | Array of valid certificates | `undefined` |\n| `sslCert` | Buffer/String | The certificate | `undefined` |\n| `sslKey` | Buffer/String | The certificate private key | `undefined` |\n| `sslPass` | Buffer/String | The certificate password | `undefined` |\n\nDescription of `sslMethod` values:\n\n- `SYSTEMCA` - SSL required, validate using System CA, with host verification.\n- `IFAVAILABLE` - The driver should try SSL first, fall back to no SSL if unavailable, and use the system's Certificate Authority.\n- `SERVER` - The driver should validate the server certificate and fail to connect if validation fails. See also [node.js driver \"Validate Server Certificate\" docs][driver-ssl-server].\n- `ALL` - The driver must present a valid certificate and validate the server certificate. See also [node.js driver \"Validate Server Certificate and Present Valid Certificate\" docs][driver-ssl-all].\n- `NONE` - No SSL (Not recommended).\n- `UNVALIDATED` - Use SSL but do not perform any validation of the certificate chain. See also [node.js driver \"No Certificate Validation\" docs][driver-ssl-none]. **Very** not recommended and likely to be deprecated in future releases because it exposes potential Man-In-The-Middle attack vectors.\n\n#### See also\n\n- [node.js driver SSL implementation][driver-ssl-impl]\n- [node.js driver SSL tutorial][driver-ssl-tutorial]\n\n### SSH TUNNEL\n\n> New in mongodb-connection-model@5.0.0\n\nBecause [authentication](#authentication) is quite difficult for operators to migrate to, the most common method of securing a MongoDB deployment is to use an [SSH tunnel][sf-ssh-tunnel].  This allows operators to leverage their existing SSH security infrastructure to also provide secure access to MongoDB.  For a standard deployment of MongoDB on AWS, this is almost always to strategy.  Because of this, we now support creating SSH tunnels automatically when connecting to MongoDB.\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options, (connectionError, client) => {\n  if (connectionError) {\n    return console.log(connectionError);\n  }\n\n  client.db('mongodb').collection('fanclub').count((countingError, count) => {\n    console.log('counted:', countingError, count);\n    client.close();\n  });\n});\n```\n\nThe above provides the same functionality as creating the tunnel using the bash\ncommand below and connecting to MongoDB via another terminal. Notice that\nconnection-model uses a random local port each time it creates a tunnel.\nUsing the command line, you'd have to replace `<random port>` with an actual\nport number.\n\n```bash\nssh -i ~/.ssh/my-key-aws-pair.pem -L <random port>:localhost:27017 ubuntu@ec2-11-111-111-111.compute-1.amazonaws.com\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `sshTunnel` | String | The desired SSH tunnel strategy. Possible values: `NONE`, `USER_PASSWORD`, `IDENTITY_FILE` | `undefined` |\n| `sshTunnelHostname` | String | The hostname of the SSH remote host | `undefined` |\n| `sshTunnelPort` | Port | The SSH port of the remote host | `22` |\n| `sshTunnelBindToLocalPort` | Port | Bind the localhost endpoint of the SSH Tunnel to this port | `undefined` |\n| `sshTunnelUsername` | String | The optional SSH username for the remote host | `undefined` |\n| `sshTunnelPassword` | String | The optional SSH password for the remote host | `undefined` |\n| `sshTunnelIdentityFile` | String/Array | The optional path to the SSH identity file for the remote host | `undefined` |\n| `sshTunnelPassphrase` | String | The optional passphrase for `sshTunnelIdentityFile` | `undefined` |\n\nDescription of `sshTunnel` values:\n\n- `NONE` - Do not use SSH tunneling.\n- `USER_PASSWORD` - The tunnel is created with SSH username and password only.\n- `IDENTITY_FILE` - The tunnel is created using an identity file.\n\n## Derived Properties\n\nDerived properties (also known as computed properties) are properties of the state object that depend on other properties to determine their value.\n\n```javascript\nconst c = new Connection();\nconst derivedProps = c.getAttributes({ derived: true });\n```\n\n| Derived Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `instanceId` | String | The mongoscope | `localhost:27017` |\n| `driverAuthMechanism` | String | Converts the value of `authStrategy` for humans into the `authMechanism` value for the driver | `undefined` |\n| `safeUrl` | String | The URL where a password is replaced with stars | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrl` | String | Use this URL in order to connect via DataService | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrlWithSsh` | String | Use this URL in order to connect via connection model itself | `mongodb://localhost:29201/?readPreference=primary&ssl=false` |\n| `driverOptions` | String | The second argument `mongoscope-server` passes to `mongodb.connect` | `{}` |\n\n## Events\n\n> New in mongodb-connection-model@5.0.0\n\n#### Example: SSH Tunnel\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', skipped: true,\n  reason: 'The selected SSL mode does not need to load any files.' }\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', complete: true}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n#### Example: SSL\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  ssl: 'ALL',\n  sslCA: '~/.ssl/my-ca.pem',\n  sslCert: '~/.ssl/my-server.pem',\n  sslKey: '~/.ssl/my-server.pem'\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', complete: true}\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', skipped: true,\n  reason: 'The selected SSH Tunnel mode is NONE.'}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n[workflow_img]: https://github.com/mongodb-js/connection-model/workflows/Check%20and%20Test/badge.svg?event=push\n[workflow_url]: https://github.com/mongodb-js/connection-model/actions?query=workflow%3A%22Check+and+Test%22\n[npm_img]: https://img.shields.io/npm/v/mongodb-connection-model.svg?style=flat-square\n[npm_url]: https://www.npmjs.org/package/mongodb-connection-model\n[gitter_img]: https://badges.gitter.im/Join%20Chat.svg\n[gitter_url]: http://gitter.im/mongodb-js/mongodb-js\n[enterprise_img]: https://img.shields.io/badge/MongoDB-Enterprise-blue.svg?style=flat-square\n[coming_soon_img]: https://img.shields.io/badge/-Coming%20Soon-ff69b4.svg?style=flat-square\n[kerberos-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/kerberos_tests.js\n[ldap-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ldap_tests.js\n[x509-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ssl_x509_tests.js\n[ns]: https://github.com/mongodb-js/ns\n[sf-ssh-tunnel]: http://serverfault.com/questions/597765/how-to-connect-to-mongodb-server-via-ssh-tunnel\n[ec2-key-pairs]: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html\n[driver-ssl-impl]: https://github.com/christkv/mongodb-core/blob/c3d21cb636d74d7a68134ecd3b9f6af536311279/lib/connection/connection.js#L365-L407\n[driver-ssl-tutorial]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/\n[driver-ssl-none]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#no-certificate-validation\n[driver-ssl-server]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate\n[driver-ssl-all]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate-and-present-valid-certificate\n","gitHead":"a005ee4428ffd61a00127102fa0c29212a52fc83","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","test":"mocha","check":"npm run lint && npm run depcheck","pretest":"mongodb-runner install && mongodb-runner start --port=27018","test-ci":"npm run test","depcheck":"depcheck","posttest":"mongodb-runner stop --port=27018","posttest-ci":"node ../../scripts/killall-mongo.js","test-check-ci":"npm run check && npm test"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.17.0+x64 (linux)","description":"MongoDB connection model.","directories":{},"_nodeVersion":"16.17.0","compass:main":"index.js","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","debug":"^4.2.0","lodash":"^4.17.15","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.2.0","storage-mixin":"0.0.0-next-a005ee4428ffd61a00127102fa0c29212a52fc83","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.2","@mongodb-js/ssh-tunnel":"0.0.0-next-a005ee4428ffd61a00127102fa0c29212a52fc83","@mongodb-js/compass-utils":"0.0.0-next-a005ee4428ffd61a00127102fa0c29212a52fc83","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.5.4"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"^4.10.0","depcheck":"^1.4.1","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.9.0","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^4.10.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_0.0.0-next-a005ee4428ffd61a00127102fa0c29212a52fc83_1669260118128_0.006459795138792801","host":"s3://npm-registry-packages"}},"0.0.0-next-e06434c386fd387cc5650fc9c0906b46cb4d6c34":{"name":"mongodb-connection-model","version":"0.0.0-next-e06434c386fd387cc5650fc9c0906b46cb4d6c34","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@0.0.0-next-e06434c386fd387cc5650fc9c0906b46cb4d6c34","maintainers":[{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"iteng@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"648ef605538c17dd34aed07604417125fed242d2","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-0.0.0-next-e06434c386fd387cc5650fc9c0906b46cb4d6c34.tgz","fileCount":20,"integrity":"sha512-uxRTIAQv9+OvKvpjpS4kM+ZgYnj3WoXl5FKW/7F9sDaomzpZkOTluIFUOUmEbH1bmjpsjiGuDfjziXbpdrQFfw==","signatures":[{"sig":"MEQCIGuEMGNb/MXHesKl76NxFhYIyXPSGX4tZPhY5Nn3ODBgAiAAxLUNverial2jEUcs2J7n0forNnBpsElzDw51HiCAjw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":108152,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjfuaPACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpE2xAAo/iHOSTkM0MUHFLKBYdx3hUEefQMQehWNQZ9XclNus16SxQm\r\nvZ5awFw7tU34bU/vr0hfVagQJyXfG0NeUvKXVG78fgSCqoO/PN91WfPr57h6\r\nGeUsz+IJ/fdpoOFW/2AjzbPsoOjMCcA7ixwlgbRxuoeg04ECuT+VWHyPSuOy\r\nOrzmW5yA5jBnofdh2hS3l4zzat31DMxy91Zi5GgxX1jX4weOzupdlsaow+GD\r\nj60zZmUx/K2klAKpsEK8I8smCCoFJTLPwGh/EoIqGXXXWOJ1CFdyEpGpvNW9\r\nIKqWyEpu+g61dAMom1fG6DLdbd9KeRMBR1OooHseMr6GFBpmYrNktQxTVQpc\r\nhRBAxjGIHRizIV7cjSU2tldlySyMJMY7bpDpnhg0OsU90ZUetGmHABA/QdsB\r\nw2kO6ROA4oPmyzjybeRS0tjQwEx1Ok7GSqOmvRq8eGxu5hnsUUcUc/Dd9gHZ\r\nv+34cBDqdSc73JOSm8SUIRyLmdfmTpbRRPnE7MJ/1OL0lRTVf+K4SQDGT3ah\r\nlITZWFn359pgey6oLoxtejAcJRnJK3BQB3gUiNUHeBsHMnA7W5iElA0woL6B\r\nFTT4NYHbhSvtU5xOuV59ujg3j0vTePqM5j4d7kWO+QTglnUofVpQ2Dlo88Cw\r\n3eD220t+7xgPClrrrficFLavaN519LggX+Q=\r\n=Zoqr\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","readme":"# mongodb-connection-model [![][workflow_img]][workflow_url] [![][npm_img]][npm_url]\n\n> MongoDB connection model\n\nThe main purpose of the MongoDB connection model is to be a domain model around a MongoDB connection. It encapsulates generating a [Connection String URI](https://docs.mongodb.com/manual/reference/connection-string/) from a group of attributes and parses URI using the [MongoDB Node.JS Driver URI Parser](https://github.com/mongodb-js/mongodb-core/blob/master/lib/uri_parser.js).\n\n## Installation\n\n```\nnpm install --save mongodb-connection-model\n```\n\n## Usage\n\n### Building URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\nconst c = new Connection({ appname: 'My App Name' });\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://localhost:27017/?readPreference=primary&appname=My%20App&ssl=false'\n```\n\n### Parsing URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\n\nConnection.from(\n  'mongodb://someUsername:testPassword@localhost',\n  (error, result) => {\n    console.log(result);\n    >>> `{\n      hosts: [{ host: 'localhost', port: 27017 }],\n      hostname: 'localhost',\n      port: 27017,\n      auth: {\n        username: 'someUsername',\n        password: 'testPassword',\n        db: 'admin'\n      },\n      isSrvRecord: false,\n      authStrategy: 'MONGODB',\n      mongodbUsername: 'someUsername',\n      mongodbPassword: 'testPassword',\n      mongodbDatabaseName: 'admin',\n      extraOptions: {},\n      connectionType: 'NODE_DRIVER',\n      readPreference: 'primary',\n      kerberosCanonicalizeHostname: false,\n      sslMethod: 'NONE',\n      sshTunnel: 'NONE',\n      sshTunnelPort: 22\n    }`\n  }\n);\n```\n\n## Properties\n\nMongoDB connection model is based on Ampersand.js framework and consist of [props](https://ampersandjs.com/docs/#ampersand-state-props) and [derived props](https://ampersandjs.com/docs/#ampersand-state-derived). The props object describes the observable properties that MongoDB connection model gets from the Node.js Driver API.\n\n```javascript\nconst с = new Connection();\nconst props = с.getAttributes({ props: true });\n```\n\n#### See Also\n\n- [URI Generic Syntax](https://tools.ietf.org/html/rfc3986)\n- [URI Options Specification](https://github.com/mongodb/specifications/blob/master/source/uri-options/uri-options.rst)\n\n### General Properties\n\n```javascript\nconst c = new Connection({ isSrvRecord: true });\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ns` | String | A valid [ns][ns] the user can read from | `undefined` |\n| `isSrvRecord` | Boolean | Indicates SRV record | `false` |\n| `auth` | Object | Authentication from driver (username, user, db, password) | `undefined` |\n| `hostname` | String | Hostname of a MongoDB Instance. In case of the replica set the first host and port will be taken | `localhost` |\n| `port` | Number | TCP port of a MongoDB Instance | `27017` |\n| `hosts` | Array | Contains all hosts and ports for replica set | `[{ host: 'localhost', port: 27017 }]` |\n| `extraOptions` | Object | Extra options passed to the node driver as part of `driverOptions` | `{}` |\n| `connectionType` | String | The desired connection type. Possible values: `NODE_DRIVER`, `STITCH_ON_PREM`, `STITCH_ATLAS` | `NODE_DRIVER` |\n| `authStrategy` | String | The desired authentication strategy. Possible values: `NONE`, `MONGODB`, `X509`, `KERBEROS`, `LDAP`, `SCRAM-SHA-256` | `NONE` |\n\n### Connection string options\n\n```javascript\nconst c = new Connection({ appname: 'My App', replicaSet: 'testing' });\n```\n\n#### General connection string options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `replicaSet` | String | Specifies the name of the replica set, if the mongod is a member of a replica set | `undefined` |\n| `connectTimeoutMS` | Number | The time in milliseconds to attempt a connection before timing out | `undefined` |\n| `socketTimeoutMS` | Number | The time in milliseconds to attempt a send or receive on a socket before the attempt times out | `undefined` |\n| `compression` | Object | Object includes compressors and a compression level. The following compressors can be specified: `snappy`, `zlib` (Available in MongoDB 3.6 or greater) | `undefined` |\n\n#### Connection Pool Option\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `maxPoolSize` | Number | The maximum number of connections in the connection pool | `undefined` |\n| `minPoolSize` | Number | The minimum number of connections in the connection pool | `undefined` |\n| `maxIdleTimeMS` | Number | The maximum number of milliseconds that a connection can remain idle in the pool before being removed and closed | `undefined` |\n| `waitQueueMultiple` | Number | A number that the driver multiples the maxPoolSize value to, to provide the maximum number of threads allowed to wait for a connection to become available from the pool | `undefined` |\n| `waitQueueTimeoutMS` | Number | The maximum time in milliseconds that a thread can wait for a connection to become available | `undefined` |\n\n#### Write Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `w` | Number/String | Corresponds to the write concern [w Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-w) | `undefined` |\n| `wTimeoutMS` | Number | Corresponds to the write concern [wtimeout](https://docs.mongodb.com/manual/reference/write-concern/#wc-wtimeout) | `undefined` |\n| `journal` | Boolean | Corresponds to the write concern [j Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-j) | `undefined` |\n\n#### Read Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readConcernLevel` | String | The level of isolation | `undefined` |\n\n#### Read Preference Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readPreference` | String | Specifies the read preferences for this connection. Possible values: `PRIMARY`, `PRIMARY_PREFERRED`, `SECONDARY`, `SECONDARY_PREFERRED`, `NEAREST` | `PRIMARY` |\n| `maxStalenessSeconds` | Number | Specifies, in seconds, how stale a secondary can be before the client stops using it for read operations | `undefined` |\n| `readPreferenceTags` | Object | Default read preference tags for the client | `undefined` |\n\n#### Authentication Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `authSource` | String | Specify the database name associated with the user’s credentials | `undefined` |\n| `authMechanism` | String | Specifies the authentication mechanism that MongoDB will use to authenticate the connection. Possible values: `DEFAULT`, `GSSAPI`, `MONGODB-X509`, `PLAIN`, `SCRAM-SHA-256` | `undefined` |\n| `authMechanismProperties` | Object | Additional options provided for authentication (e.g. to enable hostname canonicalization for GSSAPI) | `undefined` |\n| `gssapiServiceName` | String | Set the Kerberos service name when connecting to Kerberized MongoDB instances | `undefined` |\n| `gssapiServiceRealm` | String | Set the Realm service name | `undefined` |\n| `gssapiCanonicalizeHostName` | Boolean | Whether canonicalized hostname | `undefined` |\n\n#### Server Selection and Discovery Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `localThresholdMS` | Number | The size (in milliseconds) of the latency window for selecting among multiple suitable MongoDB instances | `undefined` |\n| `serverSelectionTimeoutMS` | Number | Specifies how long (in milliseconds) to block for server selection before throwing an exception | `undefined` |\n| `serverSelectionTryOnce` | Boolean | Instructs the driver to scan the MongoDB deployment exactly once after server selection fails and then either select a server or raise an error | `undefined` |\n| `heartbeatFrequencyMS` | Number | Controls when the driver checks the state of the MongoDB deployment | `undefined` |\n\n#### Miscellaneous Configuration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `appname` | String | An application name passed to server as client metadata | `undefined` |\n| `retryWrites` | Boolean | Enable retryable writes | `undefined` |\n| `uuidRepresentation` | String | The legacy representation of UUID. Possible values: `standard`, `csharpLegacy`, `javaLegacy`, `pythonLegacy` | `undefined` |\n| `loadBalanced` | Boolean | Whether or not the server is running in load balanced mode | `undefined` |\n\n### Stitch attributes\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `stitchServiceName` | String | Stitch service name | `undefined` |\n| `stitchClientAppId` | String | Stitch сlient app ID | `undefined` |\n| `stitchGroupId` | String | Stitch group ID | `undefined` |\n| `stitchBaseUrl` | String | Stitch base Url | `undefined` |\n\n### MONGODB authentication\n\n```javascript\nconst c = new Connection({\n  mongodbUsername: 'arlo',\n  mongodbPassword: 'w@of'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/?slaveOk=true&authSource=admin'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `mongodbUsername` | String | MongoDB username | `undefined` |\n| `mongodbPassword` | String | MongoDB password | `undefined` |\n| `mongodbDatabaseName` | String | The database name associated with the user's credentials | `undefined` |\n| `promoteValues` | Boolean | Whether BSON values should be promoted to their JS type counterparts | `undefined` |\n\n### KERBEROS authentication\n\n```javascript\nconst c = new Connection({\n  kerberosServiceName: 'mongodb',\n  kerberosPrincipal: 'arlo/dog@krb5.mongodb.parts',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo%252Fdog%2540krb5.mongodb.parts@localhost:27017/toys?authMechanism=GSSAPI'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n> @note (imlucas): Kerberos on Windows is broken out as it's own state for UX consideration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `kerberosServiceName` | String | Any program or computer you access over a network | `undefined` |\n| `kerberosPrincipal` | String | The format of a typical Kerberos V5 principal is `primary/instance@REALM` | `undefined` |\n| `kerberosCanonicalizeHostname` | Boolean | Whether canonicalized kerberos hostname | `undefined` |\n\n#### See Also\n\n- [node.js driver Kerberos reference](http://bit.ly/mongodb-node-driver-kerberos)\n- [node.js driver Kerberos functional test][kerberos-functional]\n\n### LDAP authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  ldapUsername: 'arlo',\n  ldapPassword: 'w@of',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/toys?slaveOk=true&authMechanism=PLAIN'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ldapUsername` | String | LDAP username | `undefined` |\n| `ldapPassword` | String | LDAP password | `undefined` |\n\n#### See Also\n\n- [node.js driver LDAP reference](http://bit.ly/mongodb-node-driver-ldap)\n- [node.js driver X509 functional test][ldap-functional]\n\n### X509 authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  x509Username: 'CN=client,OU=arlo,O=MongoDB,L=Philadelphia,ST=Pennsylvania,C=US'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://CN%253Dclient%252COU%253Darlo%252CO%253DMongoDB%252CL%253DPhiladelphia%252CST%253DPennsylvania%252CC%253DUS@localhost:27017?slaveOk=true&authMechanism=MONGODB-X509'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `x509Username` | String | The x.509 certificate derived user name, e.g. `CN=user,OU=OrgUnit,O=myOrg,...` | `undefined` |\n\n#### See Also\n\n- [node.js driver X509 reference](http://bit.ly/mongodb-node-driver-x509)\n- [node.js driver X509 functional test][x509-functional]\n\n### SSL\n\n> **Note**: Not to be confused with `authentication=X509`\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ssl` | Number/String | A boolean to enable or disables TLS/SSL for the connection | `undefined` |\n| `sslMethod` | String | The desired ssl method. Possible values: `NONE`, `SYSTEMCA`, `IFAVAILABLE`, `UNVALIDATED`, `SERVER`, `ALL` | `NONE` |\n| `sslCA` | Buffer/String | Array of valid certificates | `undefined` |\n| `sslCert` | Buffer/String | The certificate | `undefined` |\n| `sslKey` | Buffer/String | The certificate private key | `undefined` |\n| `sslPass` | Buffer/String | The certificate password | `undefined` |\n\nDescription of `sslMethod` values:\n\n- `SYSTEMCA` - SSL required, validate using System CA, with host verification.\n- `IFAVAILABLE` - The driver should try SSL first, fall back to no SSL if unavailable, and use the system's Certificate Authority.\n- `SERVER` - The driver should validate the server certificate and fail to connect if validation fails. See also [node.js driver \"Validate Server Certificate\" docs][driver-ssl-server].\n- `ALL` - The driver must present a valid certificate and validate the server certificate. See also [node.js driver \"Validate Server Certificate and Present Valid Certificate\" docs][driver-ssl-all].\n- `NONE` - No SSL (Not recommended).\n- `UNVALIDATED` - Use SSL but do not perform any validation of the certificate chain. See also [node.js driver \"No Certificate Validation\" docs][driver-ssl-none]. **Very** not recommended and likely to be deprecated in future releases because it exposes potential Man-In-The-Middle attack vectors.\n\n#### See also\n\n- [node.js driver SSL implementation][driver-ssl-impl]\n- [node.js driver SSL tutorial][driver-ssl-tutorial]\n\n### SSH TUNNEL\n\n> New in mongodb-connection-model@5.0.0\n\nBecause [authentication](#authentication) is quite difficult for operators to migrate to, the most common method of securing a MongoDB deployment is to use an [SSH tunnel][sf-ssh-tunnel].  This allows operators to leverage their existing SSH security infrastructure to also provide secure access to MongoDB.  For a standard deployment of MongoDB on AWS, this is almost always to strategy.  Because of this, we now support creating SSH tunnels automatically when connecting to MongoDB.\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options, (connectionError, client) => {\n  if (connectionError) {\n    return console.log(connectionError);\n  }\n\n  client.db('mongodb').collection('fanclub').count((countingError, count) => {\n    console.log('counted:', countingError, count);\n    client.close();\n  });\n});\n```\n\nThe above provides the same functionality as creating the tunnel using the bash\ncommand below and connecting to MongoDB via another terminal. Notice that\nconnection-model uses a random local port each time it creates a tunnel.\nUsing the command line, you'd have to replace `<random port>` with an actual\nport number.\n\n```bash\nssh -i ~/.ssh/my-key-aws-pair.pem -L <random port>:localhost:27017 ubuntu@ec2-11-111-111-111.compute-1.amazonaws.com\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `sshTunnel` | String | The desired SSH tunnel strategy. Possible values: `NONE`, `USER_PASSWORD`, `IDENTITY_FILE` | `undefined` |\n| `sshTunnelHostname` | String | The hostname of the SSH remote host | `undefined` |\n| `sshTunnelPort` | Port | The SSH port of the remote host | `22` |\n| `sshTunnelBindToLocalPort` | Port | Bind the localhost endpoint of the SSH Tunnel to this port | `undefined` |\n| `sshTunnelUsername` | String | The optional SSH username for the remote host | `undefined` |\n| `sshTunnelPassword` | String | The optional SSH password for the remote host | `undefined` |\n| `sshTunnelIdentityFile` | String/Array | The optional path to the SSH identity file for the remote host | `undefined` |\n| `sshTunnelPassphrase` | String | The optional passphrase for `sshTunnelIdentityFile` | `undefined` |\n\nDescription of `sshTunnel` values:\n\n- `NONE` - Do not use SSH tunneling.\n- `USER_PASSWORD` - The tunnel is created with SSH username and password only.\n- `IDENTITY_FILE` - The tunnel is created using an identity file.\n\n## Derived Properties\n\nDerived properties (also known as computed properties) are properties of the state object that depend on other properties to determine their value.\n\n```javascript\nconst c = new Connection();\nconst derivedProps = c.getAttributes({ derived: true });\n```\n\n| Derived Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `instanceId` | String | The mongoscope | `localhost:27017` |\n| `driverAuthMechanism` | String | Converts the value of `authStrategy` for humans into the `authMechanism` value for the driver | `undefined` |\n| `safeUrl` | String | The URL where a password is replaced with stars | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrl` | String | Use this URL in order to connect via DataService | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrlWithSsh` | String | Use this URL in order to connect via connection model itself | `mongodb://localhost:29201/?readPreference=primary&ssl=false` |\n| `driverOptions` | String | The second argument `mongoscope-server` passes to `mongodb.connect` | `{}` |\n\n## Events\n\n> New in mongodb-connection-model@5.0.0\n\n#### Example: SSH Tunnel\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', skipped: true,\n  reason: 'The selected SSL mode does not need to load any files.' }\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', complete: true}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n#### Example: SSL\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  ssl: 'ALL',\n  sslCA: '~/.ssl/my-ca.pem',\n  sslCert: '~/.ssl/my-server.pem',\n  sslKey: '~/.ssl/my-server.pem'\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', complete: true}\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', skipped: true,\n  reason: 'The selected SSH Tunnel mode is NONE.'}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n[workflow_img]: https://github.com/mongodb-js/connection-model/workflows/Check%20and%20Test/badge.svg?event=push\n[workflow_url]: https://github.com/mongodb-js/connection-model/actions?query=workflow%3A%22Check+and+Test%22\n[npm_img]: https://img.shields.io/npm/v/mongodb-connection-model.svg?style=flat-square\n[npm_url]: https://www.npmjs.org/package/mongodb-connection-model\n[gitter_img]: https://badges.gitter.im/Join%20Chat.svg\n[gitter_url]: http://gitter.im/mongodb-js/mongodb-js\n[enterprise_img]: https://img.shields.io/badge/MongoDB-Enterprise-blue.svg?style=flat-square\n[coming_soon_img]: https://img.shields.io/badge/-Coming%20Soon-ff69b4.svg?style=flat-square\n[kerberos-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/kerberos_tests.js\n[ldap-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ldap_tests.js\n[x509-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ssl_x509_tests.js\n[ns]: https://github.com/mongodb-js/ns\n[sf-ssh-tunnel]: http://serverfault.com/questions/597765/how-to-connect-to-mongodb-server-via-ssh-tunnel\n[ec2-key-pairs]: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html\n[driver-ssl-impl]: https://github.com/christkv/mongodb-core/blob/c3d21cb636d74d7a68134ecd3b9f6af536311279/lib/connection/connection.js#L365-L407\n[driver-ssl-tutorial]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/\n[driver-ssl-none]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#no-certificate-validation\n[driver-ssl-server]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate\n[driver-ssl-all]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate-and-present-valid-certificate\n","gitHead":"e06434c386fd387cc5650fc9c0906b46cb4d6c34","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","test":"mocha","check":"npm run lint && npm run depcheck","pretest":"mongodb-runner install && mongodb-runner start --port=27018","test-ci":"npm run test","depcheck":"depcheck","posttest":"mongodb-runner stop --port=27018","posttest-ci":"node ../../scripts/killall-mongo.js","test-check-ci":"npm run check && npm test"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.17.0+x64 (linux)","description":"MongoDB connection model.","directories":{},"_nodeVersion":"16.17.0","compass:main":"index.js","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","debug":"^4.2.0","lodash":"^4.17.15","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.2.0","storage-mixin":"0.0.0-next-e06434c386fd387cc5650fc9c0906b46cb4d6c34","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.2","@mongodb-js/ssh-tunnel":"0.0.0-next-e06434c386fd387cc5650fc9c0906b46cb4d6c34","@mongodb-js/compass-utils":"0.0.0-next-e06434c386fd387cc5650fc9c0906b46cb4d6c34","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.5.4"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"^4.10.0","depcheck":"^1.4.1","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.9.0","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^4.10.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_0.0.0-next-e06434c386fd387cc5650fc9c0906b46cb4d6c34_1669260943727_0.33227419361441113","host":"s3://npm-registry-packages"}},"0.0.0-next-8d44ba9084fbf5b834ca7df8b77135d3c8fc6896":{"name":"mongodb-connection-model","version":"0.0.0-next-8d44ba9084fbf5b834ca7df8b77135d3c8fc6896","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@0.0.0-next-8d44ba9084fbf5b834ca7df8b77135d3c8fc6896","maintainers":[{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"iteng@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"e4cdc6ee2d4019802c101035c087703521543b45","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-0.0.0-next-8d44ba9084fbf5b834ca7df8b77135d3c8fc6896.tgz","fileCount":20,"integrity":"sha512-XwrB56KsLdwXGi6yTOzJzp+64OmqeT70tumGnZjv72BwwzIwLzHDLZuSzXZEdmCmMSUNXELnmGTRosRq48hm6Q==","signatures":[{"sig":"MEQCID0fUU6QLyj7mWHvgLdcB1bRYMG/jvXxIA7JOit5mIrpAiBhYqcVuq2EH4+X9evnV/AGVDZ3PmcgqKmcHuR2HCE83w==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":108152,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjf9HvACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmofshAAmavPm+VeImt/uGGphs6HksZtyIJepcV89KNWW8qG5QeflUUI\r\nIt06aPnk1y55fWFPP1WleNSrms8Cka5WxToGD5VkZ7cp/pwqfMZa1knMQYgs\r\nwZr1iK4TJB4rTgy45lrHxpOQIF9/4cLrc8ulck5KR6O7BL4YuRivSg2A/JCc\r\nDwMCop4whbMZa3ss6ZJMzff9Ac0Hr7CH8nYxx0ZAIDWnenKYkiT/yqcYAXff\r\nA3dX4CfxQJxvHUl2jpybTxgtOBJb/TZCTzj7VmnK7DqaQ1Mb2k5mC8DbJI/i\r\nlnc1SIUNFrrg000pF7n6Y01E7JTq8t9Khn09/zdp8qwD0nwwEmeC2XTSD22+\r\npC2W/+9kbYd+fMmcOy5NFlyn1MQopio5cb3c8vhRc/7unQAD10+1LyCJCONE\r\nkfbqzWICA6ZdjLsDIBKP1N2Oj30g/mNDU6Jr75FS5kInsUfucP2NgInrwEH5\r\nHmVr/eoVePg2qv1Zho1pw6TNqqZWKo58bEVjoVuGFP86JnJC9Dr27RqBh73q\r\nnE1TySg1302rPq3OrwPoCRi0TOCJj8d82/5tUgT7fqpGhZo4K3qkDwrXyuGj\r\nNoCx5UYETyY5lOooENiMkb1WYg+9dYjnuXz6YxPRIe6iZuPFwQTotWjcUTFB\r\nDPIE3WJ18rl3eSUjkFThkgJgHI8CoM9w/u4=\r\n=ii3M\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","readme":"# mongodb-connection-model [![][workflow_img]][workflow_url] [![][npm_img]][npm_url]\n\n> MongoDB connection model\n\nThe main purpose of the MongoDB connection model is to be a domain model around a MongoDB connection. It encapsulates generating a [Connection String URI](https://docs.mongodb.com/manual/reference/connection-string/) from a group of attributes and parses URI using the [MongoDB Node.JS Driver URI Parser](https://github.com/mongodb-js/mongodb-core/blob/master/lib/uri_parser.js).\n\n## Installation\n\n```\nnpm install --save mongodb-connection-model\n```\n\n## Usage\n\n### Building URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\nconst c = new Connection({ appname: 'My App Name' });\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://localhost:27017/?readPreference=primary&appname=My%20App&ssl=false'\n```\n\n### Parsing URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\n\nConnection.from(\n  'mongodb://someUsername:testPassword@localhost',\n  (error, result) => {\n    console.log(result);\n    >>> `{\n      hosts: [{ host: 'localhost', port: 27017 }],\n      hostname: 'localhost',\n      port: 27017,\n      auth: {\n        username: 'someUsername',\n        password: 'testPassword',\n        db: 'admin'\n      },\n      isSrvRecord: false,\n      authStrategy: 'MONGODB',\n      mongodbUsername: 'someUsername',\n      mongodbPassword: 'testPassword',\n      mongodbDatabaseName: 'admin',\n      extraOptions: {},\n      connectionType: 'NODE_DRIVER',\n      readPreference: 'primary',\n      kerberosCanonicalizeHostname: false,\n      sslMethod: 'NONE',\n      sshTunnel: 'NONE',\n      sshTunnelPort: 22\n    }`\n  }\n);\n```\n\n## Properties\n\nMongoDB connection model is based on Ampersand.js framework and consist of [props](https://ampersandjs.com/docs/#ampersand-state-props) and [derived props](https://ampersandjs.com/docs/#ampersand-state-derived). The props object describes the observable properties that MongoDB connection model gets from the Node.js Driver API.\n\n```javascript\nconst с = new Connection();\nconst props = с.getAttributes({ props: true });\n```\n\n#### See Also\n\n- [URI Generic Syntax](https://tools.ietf.org/html/rfc3986)\n- [URI Options Specification](https://github.com/mongodb/specifications/blob/master/source/uri-options/uri-options.rst)\n\n### General Properties\n\n```javascript\nconst c = new Connection({ isSrvRecord: true });\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ns` | String | A valid [ns][ns] the user can read from | `undefined` |\n| `isSrvRecord` | Boolean | Indicates SRV record | `false` |\n| `auth` | Object | Authentication from driver (username, user, db, password) | `undefined` |\n| `hostname` | String | Hostname of a MongoDB Instance. In case of the replica set the first host and port will be taken | `localhost` |\n| `port` | Number | TCP port of a MongoDB Instance | `27017` |\n| `hosts` | Array | Contains all hosts and ports for replica set | `[{ host: 'localhost', port: 27017 }]` |\n| `extraOptions` | Object | Extra options passed to the node driver as part of `driverOptions` | `{}` |\n| `connectionType` | String | The desired connection type. Possible values: `NODE_DRIVER`, `STITCH_ON_PREM`, `STITCH_ATLAS` | `NODE_DRIVER` |\n| `authStrategy` | String | The desired authentication strategy. Possible values: `NONE`, `MONGODB`, `X509`, `KERBEROS`, `LDAP`, `SCRAM-SHA-256` | `NONE` |\n\n### Connection string options\n\n```javascript\nconst c = new Connection({ appname: 'My App', replicaSet: 'testing' });\n```\n\n#### General connection string options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `replicaSet` | String | Specifies the name of the replica set, if the mongod is a member of a replica set | `undefined` |\n| `connectTimeoutMS` | Number | The time in milliseconds to attempt a connection before timing out | `undefined` |\n| `socketTimeoutMS` | Number | The time in milliseconds to attempt a send or receive on a socket before the attempt times out | `undefined` |\n| `compression` | Object | Object includes compressors and a compression level. The following compressors can be specified: `snappy`, `zlib` (Available in MongoDB 3.6 or greater) | `undefined` |\n\n#### Connection Pool Option\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `maxPoolSize` | Number | The maximum number of connections in the connection pool | `undefined` |\n| `minPoolSize` | Number | The minimum number of connections in the connection pool | `undefined` |\n| `maxIdleTimeMS` | Number | The maximum number of milliseconds that a connection can remain idle in the pool before being removed and closed | `undefined` |\n| `waitQueueMultiple` | Number | A number that the driver multiples the maxPoolSize value to, to provide the maximum number of threads allowed to wait for a connection to become available from the pool | `undefined` |\n| `waitQueueTimeoutMS` | Number | The maximum time in milliseconds that a thread can wait for a connection to become available | `undefined` |\n\n#### Write Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `w` | Number/String | Corresponds to the write concern [w Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-w) | `undefined` |\n| `wTimeoutMS` | Number | Corresponds to the write concern [wtimeout](https://docs.mongodb.com/manual/reference/write-concern/#wc-wtimeout) | `undefined` |\n| `journal` | Boolean | Corresponds to the write concern [j Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-j) | `undefined` |\n\n#### Read Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readConcernLevel` | String | The level of isolation | `undefined` |\n\n#### Read Preference Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readPreference` | String | Specifies the read preferences for this connection. Possible values: `PRIMARY`, `PRIMARY_PREFERRED`, `SECONDARY`, `SECONDARY_PREFERRED`, `NEAREST` | `PRIMARY` |\n| `maxStalenessSeconds` | Number | Specifies, in seconds, how stale a secondary can be before the client stops using it for read operations | `undefined` |\n| `readPreferenceTags` | Object | Default read preference tags for the client | `undefined` |\n\n#### Authentication Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `authSource` | String | Specify the database name associated with the user’s credentials | `undefined` |\n| `authMechanism` | String | Specifies the authentication mechanism that MongoDB will use to authenticate the connection. Possible values: `DEFAULT`, `GSSAPI`, `MONGODB-X509`, `PLAIN`, `SCRAM-SHA-256` | `undefined` |\n| `authMechanismProperties` | Object | Additional options provided for authentication (e.g. to enable hostname canonicalization for GSSAPI) | `undefined` |\n| `gssapiServiceName` | String | Set the Kerberos service name when connecting to Kerberized MongoDB instances | `undefined` |\n| `gssapiServiceRealm` | String | Set the Realm service name | `undefined` |\n| `gssapiCanonicalizeHostName` | Boolean | Whether canonicalized hostname | `undefined` |\n\n#### Server Selection and Discovery Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `localThresholdMS` | Number | The size (in milliseconds) of the latency window for selecting among multiple suitable MongoDB instances | `undefined` |\n| `serverSelectionTimeoutMS` | Number | Specifies how long (in milliseconds) to block for server selection before throwing an exception | `undefined` |\n| `serverSelectionTryOnce` | Boolean | Instructs the driver to scan the MongoDB deployment exactly once after server selection fails and then either select a server or raise an error | `undefined` |\n| `heartbeatFrequencyMS` | Number | Controls when the driver checks the state of the MongoDB deployment | `undefined` |\n\n#### Miscellaneous Configuration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `appname` | String | An application name passed to server as client metadata | `undefined` |\n| `retryWrites` | Boolean | Enable retryable writes | `undefined` |\n| `uuidRepresentation` | String | The legacy representation of UUID. Possible values: `standard`, `csharpLegacy`, `javaLegacy`, `pythonLegacy` | `undefined` |\n| `loadBalanced` | Boolean | Whether or not the server is running in load balanced mode | `undefined` |\n\n### Stitch attributes\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `stitchServiceName` | String | Stitch service name | `undefined` |\n| `stitchClientAppId` | String | Stitch сlient app ID | `undefined` |\n| `stitchGroupId` | String | Stitch group ID | `undefined` |\n| `stitchBaseUrl` | String | Stitch base Url | `undefined` |\n\n### MONGODB authentication\n\n```javascript\nconst c = new Connection({\n  mongodbUsername: 'arlo',\n  mongodbPassword: 'w@of'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/?slaveOk=true&authSource=admin'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `mongodbUsername` | String | MongoDB username | `undefined` |\n| `mongodbPassword` | String | MongoDB password | `undefined` |\n| `mongodbDatabaseName` | String | The database name associated with the user's credentials | `undefined` |\n| `promoteValues` | Boolean | Whether BSON values should be promoted to their JS type counterparts | `undefined` |\n\n### KERBEROS authentication\n\n```javascript\nconst c = new Connection({\n  kerberosServiceName: 'mongodb',\n  kerberosPrincipal: 'arlo/dog@krb5.mongodb.parts',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo%252Fdog%2540krb5.mongodb.parts@localhost:27017/toys?authMechanism=GSSAPI'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n> @note (imlucas): Kerberos on Windows is broken out as it's own state for UX consideration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `kerberosServiceName` | String | Any program or computer you access over a network | `undefined` |\n| `kerberosPrincipal` | String | The format of a typical Kerberos V5 principal is `primary/instance@REALM` | `undefined` |\n| `kerberosCanonicalizeHostname` | Boolean | Whether canonicalized kerberos hostname | `undefined` |\n\n#### See Also\n\n- [node.js driver Kerberos reference](http://bit.ly/mongodb-node-driver-kerberos)\n- [node.js driver Kerberos functional test][kerberos-functional]\n\n### LDAP authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  ldapUsername: 'arlo',\n  ldapPassword: 'w@of',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/toys?slaveOk=true&authMechanism=PLAIN'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ldapUsername` | String | LDAP username | `undefined` |\n| `ldapPassword` | String | LDAP password | `undefined` |\n\n#### See Also\n\n- [node.js driver LDAP reference](http://bit.ly/mongodb-node-driver-ldap)\n- [node.js driver X509 functional test][ldap-functional]\n\n### X509 authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  x509Username: 'CN=client,OU=arlo,O=MongoDB,L=Philadelphia,ST=Pennsylvania,C=US'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://CN%253Dclient%252COU%253Darlo%252CO%253DMongoDB%252CL%253DPhiladelphia%252CST%253DPennsylvania%252CC%253DUS@localhost:27017?slaveOk=true&authMechanism=MONGODB-X509'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `x509Username` | String | The x.509 certificate derived user name, e.g. `CN=user,OU=OrgUnit,O=myOrg,...` | `undefined` |\n\n#### See Also\n\n- [node.js driver X509 reference](http://bit.ly/mongodb-node-driver-x509)\n- [node.js driver X509 functional test][x509-functional]\n\n### SSL\n\n> **Note**: Not to be confused with `authentication=X509`\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ssl` | Number/String | A boolean to enable or disables TLS/SSL for the connection | `undefined` |\n| `sslMethod` | String | The desired ssl method. Possible values: `NONE`, `SYSTEMCA`, `IFAVAILABLE`, `UNVALIDATED`, `SERVER`, `ALL` | `NONE` |\n| `sslCA` | Buffer/String | Array of valid certificates | `undefined` |\n| `sslCert` | Buffer/String | The certificate | `undefined` |\n| `sslKey` | Buffer/String | The certificate private key | `undefined` |\n| `sslPass` | Buffer/String | The certificate password | `undefined` |\n\nDescription of `sslMethod` values:\n\n- `SYSTEMCA` - SSL required, validate using System CA, with host verification.\n- `IFAVAILABLE` - The driver should try SSL first, fall back to no SSL if unavailable, and use the system's Certificate Authority.\n- `SERVER` - The driver should validate the server certificate and fail to connect if validation fails. See also [node.js driver \"Validate Server Certificate\" docs][driver-ssl-server].\n- `ALL` - The driver must present a valid certificate and validate the server certificate. See also [node.js driver \"Validate Server Certificate and Present Valid Certificate\" docs][driver-ssl-all].\n- `NONE` - No SSL (Not recommended).\n- `UNVALIDATED` - Use SSL but do not perform any validation of the certificate chain. See also [node.js driver \"No Certificate Validation\" docs][driver-ssl-none]. **Very** not recommended and likely to be deprecated in future releases because it exposes potential Man-In-The-Middle attack vectors.\n\n#### See also\n\n- [node.js driver SSL implementation][driver-ssl-impl]\n- [node.js driver SSL tutorial][driver-ssl-tutorial]\n\n### SSH TUNNEL\n\n> New in mongodb-connection-model@5.0.0\n\nBecause [authentication](#authentication) is quite difficult for operators to migrate to, the most common method of securing a MongoDB deployment is to use an [SSH tunnel][sf-ssh-tunnel].  This allows operators to leverage their existing SSH security infrastructure to also provide secure access to MongoDB.  For a standard deployment of MongoDB on AWS, this is almost always to strategy.  Because of this, we now support creating SSH tunnels automatically when connecting to MongoDB.\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options, (connectionError, client) => {\n  if (connectionError) {\n    return console.log(connectionError);\n  }\n\n  client.db('mongodb').collection('fanclub').count((countingError, count) => {\n    console.log('counted:', countingError, count);\n    client.close();\n  });\n});\n```\n\nThe above provides the same functionality as creating the tunnel using the bash\ncommand below and connecting to MongoDB via another terminal. Notice that\nconnection-model uses a random local port each time it creates a tunnel.\nUsing the command line, you'd have to replace `<random port>` with an actual\nport number.\n\n```bash\nssh -i ~/.ssh/my-key-aws-pair.pem -L <random port>:localhost:27017 ubuntu@ec2-11-111-111-111.compute-1.amazonaws.com\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `sshTunnel` | String | The desired SSH tunnel strategy. Possible values: `NONE`, `USER_PASSWORD`, `IDENTITY_FILE` | `undefined` |\n| `sshTunnelHostname` | String | The hostname of the SSH remote host | `undefined` |\n| `sshTunnelPort` | Port | The SSH port of the remote host | `22` |\n| `sshTunnelBindToLocalPort` | Port | Bind the localhost endpoint of the SSH Tunnel to this port | `undefined` |\n| `sshTunnelUsername` | String | The optional SSH username for the remote host | `undefined` |\n| `sshTunnelPassword` | String | The optional SSH password for the remote host | `undefined` |\n| `sshTunnelIdentityFile` | String/Array | The optional path to the SSH identity file for the remote host | `undefined` |\n| `sshTunnelPassphrase` | String | The optional passphrase for `sshTunnelIdentityFile` | `undefined` |\n\nDescription of `sshTunnel` values:\n\n- `NONE` - Do not use SSH tunneling.\n- `USER_PASSWORD` - The tunnel is created with SSH username and password only.\n- `IDENTITY_FILE` - The tunnel is created using an identity file.\n\n## Derived Properties\n\nDerived properties (also known as computed properties) are properties of the state object that depend on other properties to determine their value.\n\n```javascript\nconst c = new Connection();\nconst derivedProps = c.getAttributes({ derived: true });\n```\n\n| Derived Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `instanceId` | String | The mongoscope | `localhost:27017` |\n| `driverAuthMechanism` | String | Converts the value of `authStrategy` for humans into the `authMechanism` value for the driver | `undefined` |\n| `safeUrl` | String | The URL where a password is replaced with stars | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrl` | String | Use this URL in order to connect via DataService | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrlWithSsh` | String | Use this URL in order to connect via connection model itself | `mongodb://localhost:29201/?readPreference=primary&ssl=false` |\n| `driverOptions` | String | The second argument `mongoscope-server` passes to `mongodb.connect` | `{}` |\n\n## Events\n\n> New in mongodb-connection-model@5.0.0\n\n#### Example: SSH Tunnel\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', skipped: true,\n  reason: 'The selected SSL mode does not need to load any files.' }\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', complete: true}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n#### Example: SSL\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  ssl: 'ALL',\n  sslCA: '~/.ssl/my-ca.pem',\n  sslCert: '~/.ssl/my-server.pem',\n  sslKey: '~/.ssl/my-server.pem'\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', complete: true}\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', skipped: true,\n  reason: 'The selected SSH Tunnel mode is NONE.'}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n[workflow_img]: https://github.com/mongodb-js/connection-model/workflows/Check%20and%20Test/badge.svg?event=push\n[workflow_url]: https://github.com/mongodb-js/connection-model/actions?query=workflow%3A%22Check+and+Test%22\n[npm_img]: https://img.shields.io/npm/v/mongodb-connection-model.svg?style=flat-square\n[npm_url]: https://www.npmjs.org/package/mongodb-connection-model\n[gitter_img]: https://badges.gitter.im/Join%20Chat.svg\n[gitter_url]: http://gitter.im/mongodb-js/mongodb-js\n[enterprise_img]: https://img.shields.io/badge/MongoDB-Enterprise-blue.svg?style=flat-square\n[coming_soon_img]: https://img.shields.io/badge/-Coming%20Soon-ff69b4.svg?style=flat-square\n[kerberos-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/kerberos_tests.js\n[ldap-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ldap_tests.js\n[x509-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ssl_x509_tests.js\n[ns]: https://github.com/mongodb-js/ns\n[sf-ssh-tunnel]: http://serverfault.com/questions/597765/how-to-connect-to-mongodb-server-via-ssh-tunnel\n[ec2-key-pairs]: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html\n[driver-ssl-impl]: https://github.com/christkv/mongodb-core/blob/c3d21cb636d74d7a68134ecd3b9f6af536311279/lib/connection/connection.js#L365-L407\n[driver-ssl-tutorial]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/\n[driver-ssl-none]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#no-certificate-validation\n[driver-ssl-server]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate\n[driver-ssl-all]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate-and-present-valid-certificate\n","gitHead":"8d44ba9084fbf5b834ca7df8b77135d3c8fc6896","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","test":"mocha","check":"npm run lint && npm run depcheck","pretest":"mongodb-runner install && mongodb-runner start --port=27018","test-ci":"npm run test","depcheck":"depcheck","posttest":"mongodb-runner stop --port=27018","posttest-ci":"node ../../scripts/killall-mongo.js","test-check-ci":"npm run check && npm test"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.17.0+x64 (linux)","description":"MongoDB connection model.","directories":{},"_nodeVersion":"16.17.0","compass:main":"index.js","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","debug":"^4.2.0","lodash":"^4.17.15","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.2.0","storage-mixin":"0.0.0-next-8d44ba9084fbf5b834ca7df8b77135d3c8fc6896","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.2","@mongodb-js/ssh-tunnel":"0.0.0-next-8d44ba9084fbf5b834ca7df8b77135d3c8fc6896","@mongodb-js/compass-utils":"0.0.0-next-8d44ba9084fbf5b834ca7df8b77135d3c8fc6896","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.5.4"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"^4.10.0","depcheck":"^1.4.1","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.9.0","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^4.10.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_0.0.0-next-8d44ba9084fbf5b834ca7df8b77135d3c8fc6896_1669321199013_0.3662756451743354","host":"s3://npm-registry-packages"}},"0.0.0-next-74685ebe9d7b81dd4a870c8ffd51152622741526":{"name":"mongodb-connection-model","version":"0.0.0-next-74685ebe9d7b81dd4a870c8ffd51152622741526","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@0.0.0-next-74685ebe9d7b81dd4a870c8ffd51152622741526","maintainers":[{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"iteng@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"263eb2dbba1f25dbc4bdf19845dc648bd802f57c","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-0.0.0-next-74685ebe9d7b81dd4a870c8ffd51152622741526.tgz","fileCount":20,"integrity":"sha512-03Lb0XYuTxBoVsWJ4ACpInKB0pwQGycsHGvdAleNTSukM7YF+lYRGSmPXnvioct67+ym4b2E2+nsMqmvqwToSw==","signatures":[{"sig":"MEQCIDV+9o5dcmykjGLoeGLygFvFpHIIYU/x6SKtf/1ii5gZAiAx/H0qr4DG0GaAapO4u/jwFwClpOjrMfCfHSwG6Tjm/A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":108152,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjf9NyACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpaBQ/+K7O4h9kTxo04jbW9CsoCFsIWaMHD+Lrj5tQBM1t1A6067p3+\r\nHnnjXEDre4+jRzxAB0HvMUEjtUuZhdE9hy0EL12pYv18sx4ZFxoPHrQG1B4b\r\nkYM2EaGHImDXYBGp+wKGRfdahsFq1g2u9Rsav2aEZg8LzJgh+Pb+E5aoNKP1\r\nWBsqwqfJTWXtLTaz5rdfvCXNOj459hBPE0x13QV52LOuedTp08/taG8b9R7t\r\nMZWHeZHHMvaYQ2dpmYXk1eRRZ8UrhMY8YPM2BJX9IqNmx4sqcLq8Uj1K80+q\r\nXFyZ2zAhB/PHYbsY81VSsP7u8Fx/12ZfUqR21jT1sO7AK41hwQKRxN3Em4/B\r\n8/+AFZv9LzIgeBcYzHhMJC4fUYpO0kvoyKV3dPlFDzTcMVT3TVp53q+RF1vD\r\n837971JUL4R7vf/JDR9rvwrkE7TH9VYk9f1HSLCIdALtBBOdlRpsJQCFpsLc\r\n7X+QYbMWaZg7/sm5BP23EkP+3FDd1A19zRXgNl4upT29Ks3xBisNtkft1CQA\r\noCL2Tmt6aXoI4jDKbF5Ny3Bj7I5iP/ipuhFhfC610Zjd6o8gPy5bR7w818jA\r\nVnaT9N+LNGjl7ThD9AwLpE3x5QfLoPpznSkLPvyADKcAJwYmtvz9GnxSG56K\r\nv+5g4jiW71KDaJLA1y+bpDM4oFg8CMeYIz4=\r\n=9ItM\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","readme":"# mongodb-connection-model [![][workflow_img]][workflow_url] [![][npm_img]][npm_url]\n\n> MongoDB connection model\n\nThe main purpose of the MongoDB connection model is to be a domain model around a MongoDB connection. It encapsulates generating a [Connection String URI](https://docs.mongodb.com/manual/reference/connection-string/) from a group of attributes and parses URI using the [MongoDB Node.JS Driver URI Parser](https://github.com/mongodb-js/mongodb-core/blob/master/lib/uri_parser.js).\n\n## Installation\n\n```\nnpm install --save mongodb-connection-model\n```\n\n## Usage\n\n### Building URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\nconst c = new Connection({ appname: 'My App Name' });\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://localhost:27017/?readPreference=primary&appname=My%20App&ssl=false'\n```\n\n### Parsing URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\n\nConnection.from(\n  'mongodb://someUsername:testPassword@localhost',\n  (error, result) => {\n    console.log(result);\n    >>> `{\n      hosts: [{ host: 'localhost', port: 27017 }],\n      hostname: 'localhost',\n      port: 27017,\n      auth: {\n        username: 'someUsername',\n        password: 'testPassword',\n        db: 'admin'\n      },\n      isSrvRecord: false,\n      authStrategy: 'MONGODB',\n      mongodbUsername: 'someUsername',\n      mongodbPassword: 'testPassword',\n      mongodbDatabaseName: 'admin',\n      extraOptions: {},\n      connectionType: 'NODE_DRIVER',\n      readPreference: 'primary',\n      kerberosCanonicalizeHostname: false,\n      sslMethod: 'NONE',\n      sshTunnel: 'NONE',\n      sshTunnelPort: 22\n    }`\n  }\n);\n```\n\n## Properties\n\nMongoDB connection model is based on Ampersand.js framework and consist of [props](https://ampersandjs.com/docs/#ampersand-state-props) and [derived props](https://ampersandjs.com/docs/#ampersand-state-derived). The props object describes the observable properties that MongoDB connection model gets from the Node.js Driver API.\n\n```javascript\nconst с = new Connection();\nconst props = с.getAttributes({ props: true });\n```\n\n#### See Also\n\n- [URI Generic Syntax](https://tools.ietf.org/html/rfc3986)\n- [URI Options Specification](https://github.com/mongodb/specifications/blob/master/source/uri-options/uri-options.rst)\n\n### General Properties\n\n```javascript\nconst c = new Connection({ isSrvRecord: true });\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ns` | String | A valid [ns][ns] the user can read from | `undefined` |\n| `isSrvRecord` | Boolean | Indicates SRV record | `false` |\n| `auth` | Object | Authentication from driver (username, user, db, password) | `undefined` |\n| `hostname` | String | Hostname of a MongoDB Instance. In case of the replica set the first host and port will be taken | `localhost` |\n| `port` | Number | TCP port of a MongoDB Instance | `27017` |\n| `hosts` | Array | Contains all hosts and ports for replica set | `[{ host: 'localhost', port: 27017 }]` |\n| `extraOptions` | Object | Extra options passed to the node driver as part of `driverOptions` | `{}` |\n| `connectionType` | String | The desired connection type. Possible values: `NODE_DRIVER`, `STITCH_ON_PREM`, `STITCH_ATLAS` | `NODE_DRIVER` |\n| `authStrategy` | String | The desired authentication strategy. Possible values: `NONE`, `MONGODB`, `X509`, `KERBEROS`, `LDAP`, `SCRAM-SHA-256` | `NONE` |\n\n### Connection string options\n\n```javascript\nconst c = new Connection({ appname: 'My App', replicaSet: 'testing' });\n```\n\n#### General connection string options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `replicaSet` | String | Specifies the name of the replica set, if the mongod is a member of a replica set | `undefined` |\n| `connectTimeoutMS` | Number | The time in milliseconds to attempt a connection before timing out | `undefined` |\n| `socketTimeoutMS` | Number | The time in milliseconds to attempt a send or receive on a socket before the attempt times out | `undefined` |\n| `compression` | Object | Object includes compressors and a compression level. The following compressors can be specified: `snappy`, `zlib` (Available in MongoDB 3.6 or greater) | `undefined` |\n\n#### Connection Pool Option\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `maxPoolSize` | Number | The maximum number of connections in the connection pool | `undefined` |\n| `minPoolSize` | Number | The minimum number of connections in the connection pool | `undefined` |\n| `maxIdleTimeMS` | Number | The maximum number of milliseconds that a connection can remain idle in the pool before being removed and closed | `undefined` |\n| `waitQueueMultiple` | Number | A number that the driver multiples the maxPoolSize value to, to provide the maximum number of threads allowed to wait for a connection to become available from the pool | `undefined` |\n| `waitQueueTimeoutMS` | Number | The maximum time in milliseconds that a thread can wait for a connection to become available | `undefined` |\n\n#### Write Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `w` | Number/String | Corresponds to the write concern [w Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-w) | `undefined` |\n| `wTimeoutMS` | Number | Corresponds to the write concern [wtimeout](https://docs.mongodb.com/manual/reference/write-concern/#wc-wtimeout) | `undefined` |\n| `journal` | Boolean | Corresponds to the write concern [j Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-j) | `undefined` |\n\n#### Read Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readConcernLevel` | String | The level of isolation | `undefined` |\n\n#### Read Preference Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readPreference` | String | Specifies the read preferences for this connection. Possible values: `PRIMARY`, `PRIMARY_PREFERRED`, `SECONDARY`, `SECONDARY_PREFERRED`, `NEAREST` | `PRIMARY` |\n| `maxStalenessSeconds` | Number | Specifies, in seconds, how stale a secondary can be before the client stops using it for read operations | `undefined` |\n| `readPreferenceTags` | Object | Default read preference tags for the client | `undefined` |\n\n#### Authentication Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `authSource` | String | Specify the database name associated with the user’s credentials | `undefined` |\n| `authMechanism` | String | Specifies the authentication mechanism that MongoDB will use to authenticate the connection. Possible values: `DEFAULT`, `GSSAPI`, `MONGODB-X509`, `PLAIN`, `SCRAM-SHA-256` | `undefined` |\n| `authMechanismProperties` | Object | Additional options provided for authentication (e.g. to enable hostname canonicalization for GSSAPI) | `undefined` |\n| `gssapiServiceName` | String | Set the Kerberos service name when connecting to Kerberized MongoDB instances | `undefined` |\n| `gssapiServiceRealm` | String | Set the Realm service name | `undefined` |\n| `gssapiCanonicalizeHostName` | Boolean | Whether canonicalized hostname | `undefined` |\n\n#### Server Selection and Discovery Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `localThresholdMS` | Number | The size (in milliseconds) of the latency window for selecting among multiple suitable MongoDB instances | `undefined` |\n| `serverSelectionTimeoutMS` | Number | Specifies how long (in milliseconds) to block for server selection before throwing an exception | `undefined` |\n| `serverSelectionTryOnce` | Boolean | Instructs the driver to scan the MongoDB deployment exactly once after server selection fails and then either select a server or raise an error | `undefined` |\n| `heartbeatFrequencyMS` | Number | Controls when the driver checks the state of the MongoDB deployment | `undefined` |\n\n#### Miscellaneous Configuration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `appname` | String | An application name passed to server as client metadata | `undefined` |\n| `retryWrites` | Boolean | Enable retryable writes | `undefined` |\n| `uuidRepresentation` | String | The legacy representation of UUID. Possible values: `standard`, `csharpLegacy`, `javaLegacy`, `pythonLegacy` | `undefined` |\n| `loadBalanced` | Boolean | Whether or not the server is running in load balanced mode | `undefined` |\n\n### Stitch attributes\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `stitchServiceName` | String | Stitch service name | `undefined` |\n| `stitchClientAppId` | String | Stitch сlient app ID | `undefined` |\n| `stitchGroupId` | String | Stitch group ID | `undefined` |\n| `stitchBaseUrl` | String | Stitch base Url | `undefined` |\n\n### MONGODB authentication\n\n```javascript\nconst c = new Connection({\n  mongodbUsername: 'arlo',\n  mongodbPassword: 'w@of'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/?slaveOk=true&authSource=admin'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `mongodbUsername` | String | MongoDB username | `undefined` |\n| `mongodbPassword` | String | MongoDB password | `undefined` |\n| `mongodbDatabaseName` | String | The database name associated with the user's credentials | `undefined` |\n| `promoteValues` | Boolean | Whether BSON values should be promoted to their JS type counterparts | `undefined` |\n\n### KERBEROS authentication\n\n```javascript\nconst c = new Connection({\n  kerberosServiceName: 'mongodb',\n  kerberosPrincipal: 'arlo/dog@krb5.mongodb.parts',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo%252Fdog%2540krb5.mongodb.parts@localhost:27017/toys?authMechanism=GSSAPI'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n> @note (imlucas): Kerberos on Windows is broken out as it's own state for UX consideration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `kerberosServiceName` | String | Any program or computer you access over a network | `undefined` |\n| `kerberosPrincipal` | String | The format of a typical Kerberos V5 principal is `primary/instance@REALM` | `undefined` |\n| `kerberosCanonicalizeHostname` | Boolean | Whether canonicalized kerberos hostname | `undefined` |\n\n#### See Also\n\n- [node.js driver Kerberos reference](http://bit.ly/mongodb-node-driver-kerberos)\n- [node.js driver Kerberos functional test][kerberos-functional]\n\n### LDAP authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  ldapUsername: 'arlo',\n  ldapPassword: 'w@of',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/toys?slaveOk=true&authMechanism=PLAIN'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ldapUsername` | String | LDAP username | `undefined` |\n| `ldapPassword` | String | LDAP password | `undefined` |\n\n#### See Also\n\n- [node.js driver LDAP reference](http://bit.ly/mongodb-node-driver-ldap)\n- [node.js driver X509 functional test][ldap-functional]\n\n### X509 authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  x509Username: 'CN=client,OU=arlo,O=MongoDB,L=Philadelphia,ST=Pennsylvania,C=US'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://CN%253Dclient%252COU%253Darlo%252CO%253DMongoDB%252CL%253DPhiladelphia%252CST%253DPennsylvania%252CC%253DUS@localhost:27017?slaveOk=true&authMechanism=MONGODB-X509'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `x509Username` | String | The x.509 certificate derived user name, e.g. `CN=user,OU=OrgUnit,O=myOrg,...` | `undefined` |\n\n#### See Also\n\n- [node.js driver X509 reference](http://bit.ly/mongodb-node-driver-x509)\n- [node.js driver X509 functional test][x509-functional]\n\n### SSL\n\n> **Note**: Not to be confused with `authentication=X509`\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ssl` | Number/String | A boolean to enable or disables TLS/SSL for the connection | `undefined` |\n| `sslMethod` | String | The desired ssl method. Possible values: `NONE`, `SYSTEMCA`, `IFAVAILABLE`, `UNVALIDATED`, `SERVER`, `ALL` | `NONE` |\n| `sslCA` | Buffer/String | Array of valid certificates | `undefined` |\n| `sslCert` | Buffer/String | The certificate | `undefined` |\n| `sslKey` | Buffer/String | The certificate private key | `undefined` |\n| `sslPass` | Buffer/String | The certificate password | `undefined` |\n\nDescription of `sslMethod` values:\n\n- `SYSTEMCA` - SSL required, validate using System CA, with host verification.\n- `IFAVAILABLE` - The driver should try SSL first, fall back to no SSL if unavailable, and use the system's Certificate Authority.\n- `SERVER` - The driver should validate the server certificate and fail to connect if validation fails. See also [node.js driver \"Validate Server Certificate\" docs][driver-ssl-server].\n- `ALL` - The driver must present a valid certificate and validate the server certificate. See also [node.js driver \"Validate Server Certificate and Present Valid Certificate\" docs][driver-ssl-all].\n- `NONE` - No SSL (Not recommended).\n- `UNVALIDATED` - Use SSL but do not perform any validation of the certificate chain. See also [node.js driver \"No Certificate Validation\" docs][driver-ssl-none]. **Very** not recommended and likely to be deprecated in future releases because it exposes potential Man-In-The-Middle attack vectors.\n\n#### See also\n\n- [node.js driver SSL implementation][driver-ssl-impl]\n- [node.js driver SSL tutorial][driver-ssl-tutorial]\n\n### SSH TUNNEL\n\n> New in mongodb-connection-model@5.0.0\n\nBecause [authentication](#authentication) is quite difficult for operators to migrate to, the most common method of securing a MongoDB deployment is to use an [SSH tunnel][sf-ssh-tunnel].  This allows operators to leverage their existing SSH security infrastructure to also provide secure access to MongoDB.  For a standard deployment of MongoDB on AWS, this is almost always to strategy.  Because of this, we now support creating SSH tunnels automatically when connecting to MongoDB.\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options, (connectionError, client) => {\n  if (connectionError) {\n    return console.log(connectionError);\n  }\n\n  client.db('mongodb').collection('fanclub').count((countingError, count) => {\n    console.log('counted:', countingError, count);\n    client.close();\n  });\n});\n```\n\nThe above provides the same functionality as creating the tunnel using the bash\ncommand below and connecting to MongoDB via another terminal. Notice that\nconnection-model uses a random local port each time it creates a tunnel.\nUsing the command line, you'd have to replace `<random port>` with an actual\nport number.\n\n```bash\nssh -i ~/.ssh/my-key-aws-pair.pem -L <random port>:localhost:27017 ubuntu@ec2-11-111-111-111.compute-1.amazonaws.com\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `sshTunnel` | String | The desired SSH tunnel strategy. Possible values: `NONE`, `USER_PASSWORD`, `IDENTITY_FILE` | `undefined` |\n| `sshTunnelHostname` | String | The hostname of the SSH remote host | `undefined` |\n| `sshTunnelPort` | Port | The SSH port of the remote host | `22` |\n| `sshTunnelBindToLocalPort` | Port | Bind the localhost endpoint of the SSH Tunnel to this port | `undefined` |\n| `sshTunnelUsername` | String | The optional SSH username for the remote host | `undefined` |\n| `sshTunnelPassword` | String | The optional SSH password for the remote host | `undefined` |\n| `sshTunnelIdentityFile` | String/Array | The optional path to the SSH identity file for the remote host | `undefined` |\n| `sshTunnelPassphrase` | String | The optional passphrase for `sshTunnelIdentityFile` | `undefined` |\n\nDescription of `sshTunnel` values:\n\n- `NONE` - Do not use SSH tunneling.\n- `USER_PASSWORD` - The tunnel is created with SSH username and password only.\n- `IDENTITY_FILE` - The tunnel is created using an identity file.\n\n## Derived Properties\n\nDerived properties (also known as computed properties) are properties of the state object that depend on other properties to determine their value.\n\n```javascript\nconst c = new Connection();\nconst derivedProps = c.getAttributes({ derived: true });\n```\n\n| Derived Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `instanceId` | String | The mongoscope | `localhost:27017` |\n| `driverAuthMechanism` | String | Converts the value of `authStrategy` for humans into the `authMechanism` value for the driver | `undefined` |\n| `safeUrl` | String | The URL where a password is replaced with stars | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrl` | String | Use this URL in order to connect via DataService | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrlWithSsh` | String | Use this URL in order to connect via connection model itself | `mongodb://localhost:29201/?readPreference=primary&ssl=false` |\n| `driverOptions` | String | The second argument `mongoscope-server` passes to `mongodb.connect` | `{}` |\n\n## Events\n\n> New in mongodb-connection-model@5.0.0\n\n#### Example: SSH Tunnel\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', skipped: true,\n  reason: 'The selected SSL mode does not need to load any files.' }\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', complete: true}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n#### Example: SSL\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  ssl: 'ALL',\n  sslCA: '~/.ssl/my-ca.pem',\n  sslCert: '~/.ssl/my-server.pem',\n  sslKey: '~/.ssl/my-server.pem'\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', complete: true}\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', skipped: true,\n  reason: 'The selected SSH Tunnel mode is NONE.'}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n[workflow_img]: https://github.com/mongodb-js/connection-model/workflows/Check%20and%20Test/badge.svg?event=push\n[workflow_url]: https://github.com/mongodb-js/connection-model/actions?query=workflow%3A%22Check+and+Test%22\n[npm_img]: https://img.shields.io/npm/v/mongodb-connection-model.svg?style=flat-square\n[npm_url]: https://www.npmjs.org/package/mongodb-connection-model\n[gitter_img]: https://badges.gitter.im/Join%20Chat.svg\n[gitter_url]: http://gitter.im/mongodb-js/mongodb-js\n[enterprise_img]: https://img.shields.io/badge/MongoDB-Enterprise-blue.svg?style=flat-square\n[coming_soon_img]: https://img.shields.io/badge/-Coming%20Soon-ff69b4.svg?style=flat-square\n[kerberos-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/kerberos_tests.js\n[ldap-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ldap_tests.js\n[x509-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ssl_x509_tests.js\n[ns]: https://github.com/mongodb-js/ns\n[sf-ssh-tunnel]: http://serverfault.com/questions/597765/how-to-connect-to-mongodb-server-via-ssh-tunnel\n[ec2-key-pairs]: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html\n[driver-ssl-impl]: https://github.com/christkv/mongodb-core/blob/c3d21cb636d74d7a68134ecd3b9f6af536311279/lib/connection/connection.js#L365-L407\n[driver-ssl-tutorial]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/\n[driver-ssl-none]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#no-certificate-validation\n[driver-ssl-server]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate\n[driver-ssl-all]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate-and-present-valid-certificate\n","gitHead":"74685ebe9d7b81dd4a870c8ffd51152622741526","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","test":"mocha","check":"npm run lint && npm run depcheck","pretest":"mongodb-runner install && mongodb-runner start --port=27018","test-ci":"npm run test","depcheck":"depcheck","posttest":"mongodb-runner stop --port=27018","posttest-ci":"node ../../scripts/killall-mongo.js","test-check-ci":"npm run check && npm test"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.17.0+x64 (linux)","description":"MongoDB connection model.","directories":{},"_nodeVersion":"16.17.0","compass:main":"index.js","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","debug":"^4.2.0","lodash":"^4.17.15","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.2.0","storage-mixin":"0.0.0-next-74685ebe9d7b81dd4a870c8ffd51152622741526","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.2","@mongodb-js/ssh-tunnel":"0.0.0-next-74685ebe9d7b81dd4a870c8ffd51152622741526","@mongodb-js/compass-utils":"0.0.0-next-74685ebe9d7b81dd4a870c8ffd51152622741526","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.5.4"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"^4.10.0","depcheck":"^1.4.1","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.9.0","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^4.10.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_0.0.0-next-74685ebe9d7b81dd4a870c8ffd51152622741526_1669321585890_0.728222761352183","host":"s3://npm-registry-packages"}},"0.0.0-next-92270b35885e90f6eb7b153275848f7a2be21278":{"name":"mongodb-connection-model","version":"0.0.0-next-92270b35885e90f6eb7b153275848f7a2be21278","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@0.0.0-next-92270b35885e90f6eb7b153275848f7a2be21278","maintainers":[{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"iteng@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"7472f25822362b466032fc51211dfc7fc7f84538","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-0.0.0-next-92270b35885e90f6eb7b153275848f7a2be21278.tgz","fileCount":20,"integrity":"sha512-6EEPKUXjSOvEHbgxX7UzJH88R/Rx6wnCUzkEk1JNmZVDfihysqkCcRS5xeITnmtbD65Xqs0R6gRuvIGf4uuOPg==","signatures":[{"sig":"MEQCICiGDw44kj+X8RqxYxLEKKtOB1C5Ua3pE9KWatZC0D5mAiBCq1YpFTOZF3NXTrFGmr2hCBt/eunvJptF6xXqGn0wWQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":108152,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjgJJ7ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpoaw//cJ/Gbqy/Xj6m3cwSEXHcnQqdwCxhs5oZB2REXHBSIKLl7S5j\r\nDKsmYOVT+5OUK3f6mhkqKJSW4c8qC4qxUUVFnSeY772R3B5uG6u+4xbulrVt\r\nWNT8mORfl0gV5fv3rqW9h5x+kKH39+JHvQOh7huBYanKA49FVTeZ/WCo9a6+\r\nZXydrfqVvLBX7OuGKcxv65SdjPhiF8T/wzsEY0JjIgyAgNszg7p+cDlcTxsa\r\n3mzvZei5noAX95F14iYe6kU9i1YCuOK9CVd4vTXvEFEt7Ok0F7efHwjEKhHX\r\nUhV9WVZPaUi9kxp097Sr8gHmW40buTb3NgoA/VuK/udFvr26L2KEZxDHuV30\r\n3CowYr3Y3d3s4aaTPU/AIbiEc0zPff2bak8Oxn6tfbyIRu6gwkUMlEL+4S6x\r\nSNeuLCD6D6T/8GHrKMc66m60MByw8A2PCVDEm7hS+euwwv4SK8qBXeJUL5OH\r\nolHLaKQjYZ3pM8MFP+mb0VbfMQ3qqfLXD5x6Jyx3MV5dZFHycgzIzAaHHjm4\r\nNL0fItg6bWgzKCOwmuwRbKxFQSLAXXL3DMm00fR18t/QIevAoB2dEsWac8UF\r\nKhwbIQ3r3mA26Xnefy5oL6uZL27BKFqKEnUpN5Jqm00AixsS+T0BgH/kZq/C\r\nVohhBH4kN2yB0k7GvjFMVF1vZCOOzM/70Gk=\r\n=Xk4w\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","readme":"# mongodb-connection-model [![][workflow_img]][workflow_url] [![][npm_img]][npm_url]\n\n> MongoDB connection model\n\nThe main purpose of the MongoDB connection model is to be a domain model around a MongoDB connection. It encapsulates generating a [Connection String URI](https://docs.mongodb.com/manual/reference/connection-string/) from a group of attributes and parses URI using the [MongoDB Node.JS Driver URI Parser](https://github.com/mongodb-js/mongodb-core/blob/master/lib/uri_parser.js).\n\n## Installation\n\n```\nnpm install --save mongodb-connection-model\n```\n\n## Usage\n\n### Building URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\nconst c = new Connection({ appname: 'My App Name' });\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://localhost:27017/?readPreference=primary&appname=My%20App&ssl=false'\n```\n\n### Parsing URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\n\nConnection.from(\n  'mongodb://someUsername:testPassword@localhost',\n  (error, result) => {\n    console.log(result);\n    >>> `{\n      hosts: [{ host: 'localhost', port: 27017 }],\n      hostname: 'localhost',\n      port: 27017,\n      auth: {\n        username: 'someUsername',\n        password: 'testPassword',\n        db: 'admin'\n      },\n      isSrvRecord: false,\n      authStrategy: 'MONGODB',\n      mongodbUsername: 'someUsername',\n      mongodbPassword: 'testPassword',\n      mongodbDatabaseName: 'admin',\n      extraOptions: {},\n      connectionType: 'NODE_DRIVER',\n      readPreference: 'primary',\n      kerberosCanonicalizeHostname: false,\n      sslMethod: 'NONE',\n      sshTunnel: 'NONE',\n      sshTunnelPort: 22\n    }`\n  }\n);\n```\n\n## Properties\n\nMongoDB connection model is based on Ampersand.js framework and consist of [props](https://ampersandjs.com/docs/#ampersand-state-props) and [derived props](https://ampersandjs.com/docs/#ampersand-state-derived). The props object describes the observable properties that MongoDB connection model gets from the Node.js Driver API.\n\n```javascript\nconst с = new Connection();\nconst props = с.getAttributes({ props: true });\n```\n\n#### See Also\n\n- [URI Generic Syntax](https://tools.ietf.org/html/rfc3986)\n- [URI Options Specification](https://github.com/mongodb/specifications/blob/master/source/uri-options/uri-options.rst)\n\n### General Properties\n\n```javascript\nconst c = new Connection({ isSrvRecord: true });\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ns` | String | A valid [ns][ns] the user can read from | `undefined` |\n| `isSrvRecord` | Boolean | Indicates SRV record | `false` |\n| `auth` | Object | Authentication from driver (username, user, db, password) | `undefined` |\n| `hostname` | String | Hostname of a MongoDB Instance. In case of the replica set the first host and port will be taken | `localhost` |\n| `port` | Number | TCP port of a MongoDB Instance | `27017` |\n| `hosts` | Array | Contains all hosts and ports for replica set | `[{ host: 'localhost', port: 27017 }]` |\n| `extraOptions` | Object | Extra options passed to the node driver as part of `driverOptions` | `{}` |\n| `connectionType` | String | The desired connection type. Possible values: `NODE_DRIVER`, `STITCH_ON_PREM`, `STITCH_ATLAS` | `NODE_DRIVER` |\n| `authStrategy` | String | The desired authentication strategy. Possible values: `NONE`, `MONGODB`, `X509`, `KERBEROS`, `LDAP`, `SCRAM-SHA-256` | `NONE` |\n\n### Connection string options\n\n```javascript\nconst c = new Connection({ appname: 'My App', replicaSet: 'testing' });\n```\n\n#### General connection string options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `replicaSet` | String | Specifies the name of the replica set, if the mongod is a member of a replica set | `undefined` |\n| `connectTimeoutMS` | Number | The time in milliseconds to attempt a connection before timing out | `undefined` |\n| `socketTimeoutMS` | Number | The time in milliseconds to attempt a send or receive on a socket before the attempt times out | `undefined` |\n| `compression` | Object | Object includes compressors and a compression level. The following compressors can be specified: `snappy`, `zlib` (Available in MongoDB 3.6 or greater) | `undefined` |\n\n#### Connection Pool Option\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `maxPoolSize` | Number | The maximum number of connections in the connection pool | `undefined` |\n| `minPoolSize` | Number | The minimum number of connections in the connection pool | `undefined` |\n| `maxIdleTimeMS` | Number | The maximum number of milliseconds that a connection can remain idle in the pool before being removed and closed | `undefined` |\n| `waitQueueMultiple` | Number | A number that the driver multiples the maxPoolSize value to, to provide the maximum number of threads allowed to wait for a connection to become available from the pool | `undefined` |\n| `waitQueueTimeoutMS` | Number | The maximum time in milliseconds that a thread can wait for a connection to become available | `undefined` |\n\n#### Write Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `w` | Number/String | Corresponds to the write concern [w Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-w) | `undefined` |\n| `wTimeoutMS` | Number | Corresponds to the write concern [wtimeout](https://docs.mongodb.com/manual/reference/write-concern/#wc-wtimeout) | `undefined` |\n| `journal` | Boolean | Corresponds to the write concern [j Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-j) | `undefined` |\n\n#### Read Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readConcernLevel` | String | The level of isolation | `undefined` |\n\n#### Read Preference Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readPreference` | String | Specifies the read preferences for this connection. Possible values: `PRIMARY`, `PRIMARY_PREFERRED`, `SECONDARY`, `SECONDARY_PREFERRED`, `NEAREST` | `PRIMARY` |\n| `maxStalenessSeconds` | Number | Specifies, in seconds, how stale a secondary can be before the client stops using it for read operations | `undefined` |\n| `readPreferenceTags` | Object | Default read preference tags for the client | `undefined` |\n\n#### Authentication Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `authSource` | String | Specify the database name associated with the user’s credentials | `undefined` |\n| `authMechanism` | String | Specifies the authentication mechanism that MongoDB will use to authenticate the connection. Possible values: `DEFAULT`, `GSSAPI`, `MONGODB-X509`, `PLAIN`, `SCRAM-SHA-256` | `undefined` |\n| `authMechanismProperties` | Object | Additional options provided for authentication (e.g. to enable hostname canonicalization for GSSAPI) | `undefined` |\n| `gssapiServiceName` | String | Set the Kerberos service name when connecting to Kerberized MongoDB instances | `undefined` |\n| `gssapiServiceRealm` | String | Set the Realm service name | `undefined` |\n| `gssapiCanonicalizeHostName` | Boolean | Whether canonicalized hostname | `undefined` |\n\n#### Server Selection and Discovery Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `localThresholdMS` | Number | The size (in milliseconds) of the latency window for selecting among multiple suitable MongoDB instances | `undefined` |\n| `serverSelectionTimeoutMS` | Number | Specifies how long (in milliseconds) to block for server selection before throwing an exception | `undefined` |\n| `serverSelectionTryOnce` | Boolean | Instructs the driver to scan the MongoDB deployment exactly once after server selection fails and then either select a server or raise an error | `undefined` |\n| `heartbeatFrequencyMS` | Number | Controls when the driver checks the state of the MongoDB deployment | `undefined` |\n\n#### Miscellaneous Configuration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `appname` | String | An application name passed to server as client metadata | `undefined` |\n| `retryWrites` | Boolean | Enable retryable writes | `undefined` |\n| `uuidRepresentation` | String | The legacy representation of UUID. Possible values: `standard`, `csharpLegacy`, `javaLegacy`, `pythonLegacy` | `undefined` |\n| `loadBalanced` | Boolean | Whether or not the server is running in load balanced mode | `undefined` |\n\n### Stitch attributes\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `stitchServiceName` | String | Stitch service name | `undefined` |\n| `stitchClientAppId` | String | Stitch сlient app ID | `undefined` |\n| `stitchGroupId` | String | Stitch group ID | `undefined` |\n| `stitchBaseUrl` | String | Stitch base Url | `undefined` |\n\n### MONGODB authentication\n\n```javascript\nconst c = new Connection({\n  mongodbUsername: 'arlo',\n  mongodbPassword: 'w@of'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/?slaveOk=true&authSource=admin'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `mongodbUsername` | String | MongoDB username | `undefined` |\n| `mongodbPassword` | String | MongoDB password | `undefined` |\n| `mongodbDatabaseName` | String | The database name associated with the user's credentials | `undefined` |\n| `promoteValues` | Boolean | Whether BSON values should be promoted to their JS type counterparts | `undefined` |\n\n### KERBEROS authentication\n\n```javascript\nconst c = new Connection({\n  kerberosServiceName: 'mongodb',\n  kerberosPrincipal: 'arlo/dog@krb5.mongodb.parts',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo%252Fdog%2540krb5.mongodb.parts@localhost:27017/toys?authMechanism=GSSAPI'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n> @note (imlucas): Kerberos on Windows is broken out as it's own state for UX consideration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `kerberosServiceName` | String | Any program or computer you access over a network | `undefined` |\n| `kerberosPrincipal` | String | The format of a typical Kerberos V5 principal is `primary/instance@REALM` | `undefined` |\n| `kerberosCanonicalizeHostname` | Boolean | Whether canonicalized kerberos hostname | `undefined` |\n\n#### See Also\n\n- [node.js driver Kerberos reference](http://bit.ly/mongodb-node-driver-kerberos)\n- [node.js driver Kerberos functional test][kerberos-functional]\n\n### LDAP authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  ldapUsername: 'arlo',\n  ldapPassword: 'w@of',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/toys?slaveOk=true&authMechanism=PLAIN'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ldapUsername` | String | LDAP username | `undefined` |\n| `ldapPassword` | String | LDAP password | `undefined` |\n\n#### See Also\n\n- [node.js driver LDAP reference](http://bit.ly/mongodb-node-driver-ldap)\n- [node.js driver X509 functional test][ldap-functional]\n\n### X509 authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  x509Username: 'CN=client,OU=arlo,O=MongoDB,L=Philadelphia,ST=Pennsylvania,C=US'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://CN%253Dclient%252COU%253Darlo%252CO%253DMongoDB%252CL%253DPhiladelphia%252CST%253DPennsylvania%252CC%253DUS@localhost:27017?slaveOk=true&authMechanism=MONGODB-X509'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `x509Username` | String | The x.509 certificate derived user name, e.g. `CN=user,OU=OrgUnit,O=myOrg,...` | `undefined` |\n\n#### See Also\n\n- [node.js driver X509 reference](http://bit.ly/mongodb-node-driver-x509)\n- [node.js driver X509 functional test][x509-functional]\n\n### SSL\n\n> **Note**: Not to be confused with `authentication=X509`\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ssl` | Number/String | A boolean to enable or disables TLS/SSL for the connection | `undefined` |\n| `sslMethod` | String | The desired ssl method. Possible values: `NONE`, `SYSTEMCA`, `IFAVAILABLE`, `UNVALIDATED`, `SERVER`, `ALL` | `NONE` |\n| `sslCA` | Buffer/String | Array of valid certificates | `undefined` |\n| `sslCert` | Buffer/String | The certificate | `undefined` |\n| `sslKey` | Buffer/String | The certificate private key | `undefined` |\n| `sslPass` | Buffer/String | The certificate password | `undefined` |\n\nDescription of `sslMethod` values:\n\n- `SYSTEMCA` - SSL required, validate using System CA, with host verification.\n- `IFAVAILABLE` - The driver should try SSL first, fall back to no SSL if unavailable, and use the system's Certificate Authority.\n- `SERVER` - The driver should validate the server certificate and fail to connect if validation fails. See also [node.js driver \"Validate Server Certificate\" docs][driver-ssl-server].\n- `ALL` - The driver must present a valid certificate and validate the server certificate. See also [node.js driver \"Validate Server Certificate and Present Valid Certificate\" docs][driver-ssl-all].\n- `NONE` - No SSL (Not recommended).\n- `UNVALIDATED` - Use SSL but do not perform any validation of the certificate chain. See also [node.js driver \"No Certificate Validation\" docs][driver-ssl-none]. **Very** not recommended and likely to be deprecated in future releases because it exposes potential Man-In-The-Middle attack vectors.\n\n#### See also\n\n- [node.js driver SSL implementation][driver-ssl-impl]\n- [node.js driver SSL tutorial][driver-ssl-tutorial]\n\n### SSH TUNNEL\n\n> New in mongodb-connection-model@5.0.0\n\nBecause [authentication](#authentication) is quite difficult for operators to migrate to, the most common method of securing a MongoDB deployment is to use an [SSH tunnel][sf-ssh-tunnel].  This allows operators to leverage their existing SSH security infrastructure to also provide secure access to MongoDB.  For a standard deployment of MongoDB on AWS, this is almost always to strategy.  Because of this, we now support creating SSH tunnels automatically when connecting to MongoDB.\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options, (connectionError, client) => {\n  if (connectionError) {\n    return console.log(connectionError);\n  }\n\n  client.db('mongodb').collection('fanclub').count((countingError, count) => {\n    console.log('counted:', countingError, count);\n    client.close();\n  });\n});\n```\n\nThe above provides the same functionality as creating the tunnel using the bash\ncommand below and connecting to MongoDB via another terminal. Notice that\nconnection-model uses a random local port each time it creates a tunnel.\nUsing the command line, you'd have to replace `<random port>` with an actual\nport number.\n\n```bash\nssh -i ~/.ssh/my-key-aws-pair.pem -L <random port>:localhost:27017 ubuntu@ec2-11-111-111-111.compute-1.amazonaws.com\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `sshTunnel` | String | The desired SSH tunnel strategy. Possible values: `NONE`, `USER_PASSWORD`, `IDENTITY_FILE` | `undefined` |\n| `sshTunnelHostname` | String | The hostname of the SSH remote host | `undefined` |\n| `sshTunnelPort` | Port | The SSH port of the remote host | `22` |\n| `sshTunnelBindToLocalPort` | Port | Bind the localhost endpoint of the SSH Tunnel to this port | `undefined` |\n| `sshTunnelUsername` | String | The optional SSH username for the remote host | `undefined` |\n| `sshTunnelPassword` | String | The optional SSH password for the remote host | `undefined` |\n| `sshTunnelIdentityFile` | String/Array | The optional path to the SSH identity file for the remote host | `undefined` |\n| `sshTunnelPassphrase` | String | The optional passphrase for `sshTunnelIdentityFile` | `undefined` |\n\nDescription of `sshTunnel` values:\n\n- `NONE` - Do not use SSH tunneling.\n- `USER_PASSWORD` - The tunnel is created with SSH username and password only.\n- `IDENTITY_FILE` - The tunnel is created using an identity file.\n\n## Derived Properties\n\nDerived properties (also known as computed properties) are properties of the state object that depend on other properties to determine their value.\n\n```javascript\nconst c = new Connection();\nconst derivedProps = c.getAttributes({ derived: true });\n```\n\n| Derived Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `instanceId` | String | The mongoscope | `localhost:27017` |\n| `driverAuthMechanism` | String | Converts the value of `authStrategy` for humans into the `authMechanism` value for the driver | `undefined` |\n| `safeUrl` | String | The URL where a password is replaced with stars | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrl` | String | Use this URL in order to connect via DataService | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrlWithSsh` | String | Use this URL in order to connect via connection model itself | `mongodb://localhost:29201/?readPreference=primary&ssl=false` |\n| `driverOptions` | String | The second argument `mongoscope-server` passes to `mongodb.connect` | `{}` |\n\n## Events\n\n> New in mongodb-connection-model@5.0.0\n\n#### Example: SSH Tunnel\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', skipped: true,\n  reason: 'The selected SSL mode does not need to load any files.' }\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', complete: true}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n#### Example: SSL\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  ssl: 'ALL',\n  sslCA: '~/.ssl/my-ca.pem',\n  sslCert: '~/.ssl/my-server.pem',\n  sslKey: '~/.ssl/my-server.pem'\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', complete: true}\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', skipped: true,\n  reason: 'The selected SSH Tunnel mode is NONE.'}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n[workflow_img]: https://github.com/mongodb-js/connection-model/workflows/Check%20and%20Test/badge.svg?event=push\n[workflow_url]: https://github.com/mongodb-js/connection-model/actions?query=workflow%3A%22Check+and+Test%22\n[npm_img]: https://img.shields.io/npm/v/mongodb-connection-model.svg?style=flat-square\n[npm_url]: https://www.npmjs.org/package/mongodb-connection-model\n[gitter_img]: https://badges.gitter.im/Join%20Chat.svg\n[gitter_url]: http://gitter.im/mongodb-js/mongodb-js\n[enterprise_img]: https://img.shields.io/badge/MongoDB-Enterprise-blue.svg?style=flat-square\n[coming_soon_img]: https://img.shields.io/badge/-Coming%20Soon-ff69b4.svg?style=flat-square\n[kerberos-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/kerberos_tests.js\n[ldap-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ldap_tests.js\n[x509-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ssl_x509_tests.js\n[ns]: https://github.com/mongodb-js/ns\n[sf-ssh-tunnel]: http://serverfault.com/questions/597765/how-to-connect-to-mongodb-server-via-ssh-tunnel\n[ec2-key-pairs]: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html\n[driver-ssl-impl]: https://github.com/christkv/mongodb-core/blob/c3d21cb636d74d7a68134ecd3b9f6af536311279/lib/connection/connection.js#L365-L407\n[driver-ssl-tutorial]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/\n[driver-ssl-none]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#no-certificate-validation\n[driver-ssl-server]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate\n[driver-ssl-all]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate-and-present-valid-certificate\n","gitHead":"92270b35885e90f6eb7b153275848f7a2be21278","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","test":"mocha","check":"npm run lint && npm run depcheck","pretest":"mongodb-runner install && mongodb-runner start --port=27018","test-ci":"npm run test","depcheck":"depcheck","posttest":"mongodb-runner stop --port=27018","posttest-ci":"node ../../scripts/killall-mongo.js","test-check-ci":"npm run check && npm test"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.17.0+x64 (linux)","description":"MongoDB connection model.","directories":{},"_nodeVersion":"16.17.0","compass:main":"index.js","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","debug":"^4.2.0","lodash":"^4.17.15","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.2.0","storage-mixin":"0.0.0-next-92270b35885e90f6eb7b153275848f7a2be21278","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.2","@mongodb-js/ssh-tunnel":"0.0.0-next-92270b35885e90f6eb7b153275848f7a2be21278","@mongodb-js/compass-utils":"0.0.0-next-92270b35885e90f6eb7b153275848f7a2be21278","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.5.4"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"^4.10.0","depcheck":"^1.4.1","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.9.0","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^4.10.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_0.0.0-next-92270b35885e90f6eb7b153275848f7a2be21278_1669370491726_0.4406447084153131","host":"s3://npm-registry-packages"}},"0.0.0-next-f9347a106881d77aa4b1f7f37daed25d73c5f92c":{"name":"mongodb-connection-model","version":"0.0.0-next-f9347a106881d77aa4b1f7f37daed25d73c5f92c","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@0.0.0-next-f9347a106881d77aa4b1f7f37daed25d73c5f92c","maintainers":[{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"iteng@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"f3ef03a3d3ae35a1b01d23b62cb7f643d88e6866","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-0.0.0-next-f9347a106881d77aa4b1f7f37daed25d73c5f92c.tgz","fileCount":20,"integrity":"sha512-GgeYNMZtwvvxeIHjnsw4TYXKoZkZn9g6RQuInFqTqs48Pjlpf1XGj4IRmdO+2e9BUauHxDfn5byaLp1CPFv0wA==","signatures":[{"sig":"MEYCIQC+VxdXVBmOBnFxCs6O7/V0XXHt8rwjOPHwIRTgSQxV4gIhAJ6nTMa0RYNwHesTTIMhzXz9ZJT5V3BDUTl9kILfDjA8","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":108152,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjgUX5ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpg7g/+MWSfJgYigpSkY3NP3KSyrE9XjnzlQn9YDZmAtVLZnxFDlOhp\r\nsBXYDfg0qSaittWqQfu+CIBDISxsVcGWAGlOyHHUpianX97xpe+r7k/VNNQO\r\n03Dmmi+of1kOsRfgRKGaxuIB/AWf9NeCE91CDVZLp247BHseGM1Y/AYsdl8+\r\nGrjAr8dlWTbh3JI63vM5+eUFy0jukTl+kWnIARfwbfaulzwbKEB7YEMAuW8A\r\n5vuY5hh/sFpmF1m4sIfNVLwpDYEbxKPjpNpU9QmlJa8xttzFE+fY/2kbCyec\r\nyZk63GR58xsClfAuQdDQWohWoLXztif5UeWKpnlJUOBaorgxUCAleWcqfc/I\r\ne0pvSbHR1sybvsbkncY277ojeVo3QQflZL3IGHhXSpd5ffLPvuWsRDY/TNvP\r\nUAPCH474FMHV/7xeLjB9lcCv6KV+5cVb5LpvwwcU14btPHx4hCu4fU5rXB/U\r\nkUss9hv5WRjBLFLKFLZwZh4GdhECR3tBVKVYVJckHbju6uT7wAuEdKC0P5Ca\r\nGzkqDI9tVUb6cfQtjU+t6+/f54cFPAmt7gknp30SmJsCktUnUoDPe/i8w9Tm\r\nwuB2ZT5050Wiw7GnoHvTULJ3WEAxcTR+x3PY1BCYCCsK4HeBYEHKyhModq8B\r\n8GuXm2NnM7YNGhsznen9pNeNxrodjM1fuHs=\r\n=3T6c\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","readme":"# mongodb-connection-model [![][workflow_img]][workflow_url] [![][npm_img]][npm_url]\n\n> MongoDB connection model\n\nThe main purpose of the MongoDB connection model is to be a domain model around a MongoDB connection. It encapsulates generating a [Connection String URI](https://docs.mongodb.com/manual/reference/connection-string/) from a group of attributes and parses URI using the [MongoDB Node.JS Driver URI Parser](https://github.com/mongodb-js/mongodb-core/blob/master/lib/uri_parser.js).\n\n## Installation\n\n```\nnpm install --save mongodb-connection-model\n```\n\n## Usage\n\n### Building URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\nconst c = new Connection({ appname: 'My App Name' });\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://localhost:27017/?readPreference=primary&appname=My%20App&ssl=false'\n```\n\n### Parsing URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\n\nConnection.from(\n  'mongodb://someUsername:testPassword@localhost',\n  (error, result) => {\n    console.log(result);\n    >>> `{\n      hosts: [{ host: 'localhost', port: 27017 }],\n      hostname: 'localhost',\n      port: 27017,\n      auth: {\n        username: 'someUsername',\n        password: 'testPassword',\n        db: 'admin'\n      },\n      isSrvRecord: false,\n      authStrategy: 'MONGODB',\n      mongodbUsername: 'someUsername',\n      mongodbPassword: 'testPassword',\n      mongodbDatabaseName: 'admin',\n      extraOptions: {},\n      connectionType: 'NODE_DRIVER',\n      readPreference: 'primary',\n      kerberosCanonicalizeHostname: false,\n      sslMethod: 'NONE',\n      sshTunnel: 'NONE',\n      sshTunnelPort: 22\n    }`\n  }\n);\n```\n\n## Properties\n\nMongoDB connection model is based on Ampersand.js framework and consist of [props](https://ampersandjs.com/docs/#ampersand-state-props) and [derived props](https://ampersandjs.com/docs/#ampersand-state-derived). The props object describes the observable properties that MongoDB connection model gets from the Node.js Driver API.\n\n```javascript\nconst с = new Connection();\nconst props = с.getAttributes({ props: true });\n```\n\n#### See Also\n\n- [URI Generic Syntax](https://tools.ietf.org/html/rfc3986)\n- [URI Options Specification](https://github.com/mongodb/specifications/blob/master/source/uri-options/uri-options.rst)\n\n### General Properties\n\n```javascript\nconst c = new Connection({ isSrvRecord: true });\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ns` | String | A valid [ns][ns] the user can read from | `undefined` |\n| `isSrvRecord` | Boolean | Indicates SRV record | `false` |\n| `auth` | Object | Authentication from driver (username, user, db, password) | `undefined` |\n| `hostname` | String | Hostname of a MongoDB Instance. In case of the replica set the first host and port will be taken | `localhost` |\n| `port` | Number | TCP port of a MongoDB Instance | `27017` |\n| `hosts` | Array | Contains all hosts and ports for replica set | `[{ host: 'localhost', port: 27017 }]` |\n| `extraOptions` | Object | Extra options passed to the node driver as part of `driverOptions` | `{}` |\n| `connectionType` | String | The desired connection type. Possible values: `NODE_DRIVER`, `STITCH_ON_PREM`, `STITCH_ATLAS` | `NODE_DRIVER` |\n| `authStrategy` | String | The desired authentication strategy. Possible values: `NONE`, `MONGODB`, `X509`, `KERBEROS`, `LDAP`, `SCRAM-SHA-256` | `NONE` |\n\n### Connection string options\n\n```javascript\nconst c = new Connection({ appname: 'My App', replicaSet: 'testing' });\n```\n\n#### General connection string options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `replicaSet` | String | Specifies the name of the replica set, if the mongod is a member of a replica set | `undefined` |\n| `connectTimeoutMS` | Number | The time in milliseconds to attempt a connection before timing out | `undefined` |\n| `socketTimeoutMS` | Number | The time in milliseconds to attempt a send or receive on a socket before the attempt times out | `undefined` |\n| `compression` | Object | Object includes compressors and a compression level. The following compressors can be specified: `snappy`, `zlib` (Available in MongoDB 3.6 or greater) | `undefined` |\n\n#### Connection Pool Option\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `maxPoolSize` | Number | The maximum number of connections in the connection pool | `undefined` |\n| `minPoolSize` | Number | The minimum number of connections in the connection pool | `undefined` |\n| `maxIdleTimeMS` | Number | The maximum number of milliseconds that a connection can remain idle in the pool before being removed and closed | `undefined` |\n| `waitQueueMultiple` | Number | A number that the driver multiples the maxPoolSize value to, to provide the maximum number of threads allowed to wait for a connection to become available from the pool | `undefined` |\n| `waitQueueTimeoutMS` | Number | The maximum time in milliseconds that a thread can wait for a connection to become available | `undefined` |\n\n#### Write Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `w` | Number/String | Corresponds to the write concern [w Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-w) | `undefined` |\n| `wTimeoutMS` | Number | Corresponds to the write concern [wtimeout](https://docs.mongodb.com/manual/reference/write-concern/#wc-wtimeout) | `undefined` |\n| `journal` | Boolean | Corresponds to the write concern [j Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-j) | `undefined` |\n\n#### Read Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readConcernLevel` | String | The level of isolation | `undefined` |\n\n#### Read Preference Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readPreference` | String | Specifies the read preferences for this connection. Possible values: `PRIMARY`, `PRIMARY_PREFERRED`, `SECONDARY`, `SECONDARY_PREFERRED`, `NEAREST` | `PRIMARY` |\n| `maxStalenessSeconds` | Number | Specifies, in seconds, how stale a secondary can be before the client stops using it for read operations | `undefined` |\n| `readPreferenceTags` | Object | Default read preference tags for the client | `undefined` |\n\n#### Authentication Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `authSource` | String | Specify the database name associated with the user’s credentials | `undefined` |\n| `authMechanism` | String | Specifies the authentication mechanism that MongoDB will use to authenticate the connection. Possible values: `DEFAULT`, `GSSAPI`, `MONGODB-X509`, `PLAIN`, `SCRAM-SHA-256` | `undefined` |\n| `authMechanismProperties` | Object | Additional options provided for authentication (e.g. to enable hostname canonicalization for GSSAPI) | `undefined` |\n| `gssapiServiceName` | String | Set the Kerberos service name when connecting to Kerberized MongoDB instances | `undefined` |\n| `gssapiServiceRealm` | String | Set the Realm service name | `undefined` |\n| `gssapiCanonicalizeHostName` | Boolean | Whether canonicalized hostname | `undefined` |\n\n#### Server Selection and Discovery Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `localThresholdMS` | Number | The size (in milliseconds) of the latency window for selecting among multiple suitable MongoDB instances | `undefined` |\n| `serverSelectionTimeoutMS` | Number | Specifies how long (in milliseconds) to block for server selection before throwing an exception | `undefined` |\n| `serverSelectionTryOnce` | Boolean | Instructs the driver to scan the MongoDB deployment exactly once after server selection fails and then either select a server or raise an error | `undefined` |\n| `heartbeatFrequencyMS` | Number | Controls when the driver checks the state of the MongoDB deployment | `undefined` |\n\n#### Miscellaneous Configuration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `appname` | String | An application name passed to server as client metadata | `undefined` |\n| `retryWrites` | Boolean | Enable retryable writes | `undefined` |\n| `uuidRepresentation` | String | The legacy representation of UUID. Possible values: `standard`, `csharpLegacy`, `javaLegacy`, `pythonLegacy` | `undefined` |\n| `loadBalanced` | Boolean | Whether or not the server is running in load balanced mode | `undefined` |\n\n### Stitch attributes\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `stitchServiceName` | String | Stitch service name | `undefined` |\n| `stitchClientAppId` | String | Stitch сlient app ID | `undefined` |\n| `stitchGroupId` | String | Stitch group ID | `undefined` |\n| `stitchBaseUrl` | String | Stitch base Url | `undefined` |\n\n### MONGODB authentication\n\n```javascript\nconst c = new Connection({\n  mongodbUsername: 'arlo',\n  mongodbPassword: 'w@of'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/?slaveOk=true&authSource=admin'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `mongodbUsername` | String | MongoDB username | `undefined` |\n| `mongodbPassword` | String | MongoDB password | `undefined` |\n| `mongodbDatabaseName` | String | The database name associated with the user's credentials | `undefined` |\n| `promoteValues` | Boolean | Whether BSON values should be promoted to their JS type counterparts | `undefined` |\n\n### KERBEROS authentication\n\n```javascript\nconst c = new Connection({\n  kerberosServiceName: 'mongodb',\n  kerberosPrincipal: 'arlo/dog@krb5.mongodb.parts',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo%252Fdog%2540krb5.mongodb.parts@localhost:27017/toys?authMechanism=GSSAPI'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n> @note (imlucas): Kerberos on Windows is broken out as it's own state for UX consideration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `kerberosServiceName` | String | Any program or computer you access over a network | `undefined` |\n| `kerberosPrincipal` | String | The format of a typical Kerberos V5 principal is `primary/instance@REALM` | `undefined` |\n| `kerberosCanonicalizeHostname` | Boolean | Whether canonicalized kerberos hostname | `undefined` |\n\n#### See Also\n\n- [node.js driver Kerberos reference](http://bit.ly/mongodb-node-driver-kerberos)\n- [node.js driver Kerberos functional test][kerberos-functional]\n\n### LDAP authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  ldapUsername: 'arlo',\n  ldapPassword: 'w@of',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/toys?slaveOk=true&authMechanism=PLAIN'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ldapUsername` | String | LDAP username | `undefined` |\n| `ldapPassword` | String | LDAP password | `undefined` |\n\n#### See Also\n\n- [node.js driver LDAP reference](http://bit.ly/mongodb-node-driver-ldap)\n- [node.js driver X509 functional test][ldap-functional]\n\n### X509 authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  x509Username: 'CN=client,OU=arlo,O=MongoDB,L=Philadelphia,ST=Pennsylvania,C=US'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://CN%253Dclient%252COU%253Darlo%252CO%253DMongoDB%252CL%253DPhiladelphia%252CST%253DPennsylvania%252CC%253DUS@localhost:27017?slaveOk=true&authMechanism=MONGODB-X509'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `x509Username` | String | The x.509 certificate derived user name, e.g. `CN=user,OU=OrgUnit,O=myOrg,...` | `undefined` |\n\n#### See Also\n\n- [node.js driver X509 reference](http://bit.ly/mongodb-node-driver-x509)\n- [node.js driver X509 functional test][x509-functional]\n\n### SSL\n\n> **Note**: Not to be confused with `authentication=X509`\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ssl` | Number/String | A boolean to enable or disables TLS/SSL for the connection | `undefined` |\n| `sslMethod` | String | The desired ssl method. Possible values: `NONE`, `SYSTEMCA`, `IFAVAILABLE`, `UNVALIDATED`, `SERVER`, `ALL` | `NONE` |\n| `sslCA` | Buffer/String | Array of valid certificates | `undefined` |\n| `sslCert` | Buffer/String | The certificate | `undefined` |\n| `sslKey` | Buffer/String | The certificate private key | `undefined` |\n| `sslPass` | Buffer/String | The certificate password | `undefined` |\n\nDescription of `sslMethod` values:\n\n- `SYSTEMCA` - SSL required, validate using System CA, with host verification.\n- `IFAVAILABLE` - The driver should try SSL first, fall back to no SSL if unavailable, and use the system's Certificate Authority.\n- `SERVER` - The driver should validate the server certificate and fail to connect if validation fails. See also [node.js driver \"Validate Server Certificate\" docs][driver-ssl-server].\n- `ALL` - The driver must present a valid certificate and validate the server certificate. See also [node.js driver \"Validate Server Certificate and Present Valid Certificate\" docs][driver-ssl-all].\n- `NONE` - No SSL (Not recommended).\n- `UNVALIDATED` - Use SSL but do not perform any validation of the certificate chain. See also [node.js driver \"No Certificate Validation\" docs][driver-ssl-none]. **Very** not recommended and likely to be deprecated in future releases because it exposes potential Man-In-The-Middle attack vectors.\n\n#### See also\n\n- [node.js driver SSL implementation][driver-ssl-impl]\n- [node.js driver SSL tutorial][driver-ssl-tutorial]\n\n### SSH TUNNEL\n\n> New in mongodb-connection-model@5.0.0\n\nBecause [authentication](#authentication) is quite difficult for operators to migrate to, the most common method of securing a MongoDB deployment is to use an [SSH tunnel][sf-ssh-tunnel].  This allows operators to leverage their existing SSH security infrastructure to also provide secure access to MongoDB.  For a standard deployment of MongoDB on AWS, this is almost always to strategy.  Because of this, we now support creating SSH tunnels automatically when connecting to MongoDB.\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options, (connectionError, client) => {\n  if (connectionError) {\n    return console.log(connectionError);\n  }\n\n  client.db('mongodb').collection('fanclub').count((countingError, count) => {\n    console.log('counted:', countingError, count);\n    client.close();\n  });\n});\n```\n\nThe above provides the same functionality as creating the tunnel using the bash\ncommand below and connecting to MongoDB via another terminal. Notice that\nconnection-model uses a random local port each time it creates a tunnel.\nUsing the command line, you'd have to replace `<random port>` with an actual\nport number.\n\n```bash\nssh -i ~/.ssh/my-key-aws-pair.pem -L <random port>:localhost:27017 ubuntu@ec2-11-111-111-111.compute-1.amazonaws.com\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `sshTunnel` | String | The desired SSH tunnel strategy. Possible values: `NONE`, `USER_PASSWORD`, `IDENTITY_FILE` | `undefined` |\n| `sshTunnelHostname` | String | The hostname of the SSH remote host | `undefined` |\n| `sshTunnelPort` | Port | The SSH port of the remote host | `22` |\n| `sshTunnelBindToLocalPort` | Port | Bind the localhost endpoint of the SSH Tunnel to this port | `undefined` |\n| `sshTunnelUsername` | String | The optional SSH username for the remote host | `undefined` |\n| `sshTunnelPassword` | String | The optional SSH password for the remote host | `undefined` |\n| `sshTunnelIdentityFile` | String/Array | The optional path to the SSH identity file for the remote host | `undefined` |\n| `sshTunnelPassphrase` | String | The optional passphrase for `sshTunnelIdentityFile` | `undefined` |\n\nDescription of `sshTunnel` values:\n\n- `NONE` - Do not use SSH tunneling.\n- `USER_PASSWORD` - The tunnel is created with SSH username and password only.\n- `IDENTITY_FILE` - The tunnel is created using an identity file.\n\n## Derived Properties\n\nDerived properties (also known as computed properties) are properties of the state object that depend on other properties to determine their value.\n\n```javascript\nconst c = new Connection();\nconst derivedProps = c.getAttributes({ derived: true });\n```\n\n| Derived Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `instanceId` | String | The mongoscope | `localhost:27017` |\n| `driverAuthMechanism` | String | Converts the value of `authStrategy` for humans into the `authMechanism` value for the driver | `undefined` |\n| `safeUrl` | String | The URL where a password is replaced with stars | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrl` | String | Use this URL in order to connect via DataService | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrlWithSsh` | String | Use this URL in order to connect via connection model itself | `mongodb://localhost:29201/?readPreference=primary&ssl=false` |\n| `driverOptions` | String | The second argument `mongoscope-server` passes to `mongodb.connect` | `{}` |\n\n## Events\n\n> New in mongodb-connection-model@5.0.0\n\n#### Example: SSH Tunnel\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', skipped: true,\n  reason: 'The selected SSL mode does not need to load any files.' }\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', complete: true}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n#### Example: SSL\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  ssl: 'ALL',\n  sslCA: '~/.ssl/my-ca.pem',\n  sslCert: '~/.ssl/my-server.pem',\n  sslKey: '~/.ssl/my-server.pem'\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', complete: true}\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', skipped: true,\n  reason: 'The selected SSH Tunnel mode is NONE.'}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n[workflow_img]: https://github.com/mongodb-js/connection-model/workflows/Check%20and%20Test/badge.svg?event=push\n[workflow_url]: https://github.com/mongodb-js/connection-model/actions?query=workflow%3A%22Check+and+Test%22\n[npm_img]: https://img.shields.io/npm/v/mongodb-connection-model.svg?style=flat-square\n[npm_url]: https://www.npmjs.org/package/mongodb-connection-model\n[gitter_img]: https://badges.gitter.im/Join%20Chat.svg\n[gitter_url]: http://gitter.im/mongodb-js/mongodb-js\n[enterprise_img]: https://img.shields.io/badge/MongoDB-Enterprise-blue.svg?style=flat-square\n[coming_soon_img]: https://img.shields.io/badge/-Coming%20Soon-ff69b4.svg?style=flat-square\n[kerberos-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/kerberos_tests.js\n[ldap-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ldap_tests.js\n[x509-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ssl_x509_tests.js\n[ns]: https://github.com/mongodb-js/ns\n[sf-ssh-tunnel]: http://serverfault.com/questions/597765/how-to-connect-to-mongodb-server-via-ssh-tunnel\n[ec2-key-pairs]: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html\n[driver-ssl-impl]: https://github.com/christkv/mongodb-core/blob/c3d21cb636d74d7a68134ecd3b9f6af536311279/lib/connection/connection.js#L365-L407\n[driver-ssl-tutorial]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/\n[driver-ssl-none]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#no-certificate-validation\n[driver-ssl-server]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate\n[driver-ssl-all]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate-and-present-valid-certificate\n","gitHead":"f9347a106881d77aa4b1f7f37daed25d73c5f92c","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","test":"mocha","check":"npm run lint && npm run depcheck","pretest":"mongodb-runner install && mongodb-runner start --port=27018","test-ci":"npm run test","depcheck":"depcheck","posttest":"mongodb-runner stop --port=27018","posttest-ci":"node ../../scripts/killall-mongo.js","test-check-ci":"npm run check && npm test"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.17.0+x64 (linux)","description":"MongoDB connection model.","directories":{},"_nodeVersion":"16.17.0","compass:main":"index.js","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","debug":"^4.2.0","lodash":"^4.17.15","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.2.0","storage-mixin":"0.0.0-next-f9347a106881d77aa4b1f7f37daed25d73c5f92c","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.2","@mongodb-js/ssh-tunnel":"0.0.0-next-f9347a106881d77aa4b1f7f37daed25d73c5f92c","@mongodb-js/compass-utils":"0.0.0-next-f9347a106881d77aa4b1f7f37daed25d73c5f92c","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.5.4"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"^4.10.0","depcheck":"^1.4.1","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.9.0","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^4.10.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_0.0.0-next-f9347a106881d77aa4b1f7f37daed25d73c5f92c_1669416441434_0.43456334386790285","host":"s3://npm-registry-packages"}},"0.0.0-next-94f03d5249971d1eea1868df296db6e766f40f9f":{"name":"mongodb-connection-model","version":"0.0.0-next-94f03d5249971d1eea1868df296db6e766f40f9f","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@0.0.0-next-94f03d5249971d1eea1868df296db6e766f40f9f","maintainers":[{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"iteng@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"0db4bf9ef59dedaf0df99e14063cdfef3fe51c71","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-0.0.0-next-94f03d5249971d1eea1868df296db6e766f40f9f.tgz","fileCount":20,"integrity":"sha512-2oUBj2OktIT3RMAGMPki0+6y/NBrnqFLW4eF7y+XSieKAld3W3n2WBOGKdCh8vAk7h0OXZ7uUBv4/Ax+RLK5KQ==","signatures":[{"sig":"MEUCIQCXGKgaTpm7SDZ7SE5PeNtntDbArVVh3r4QdE8iFMPrcQIgembtEafqKtcyKnravn5L50ong1uTLJA25GCq6mI8OpM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":108152,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjgVQ/ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrRPBAAjLeTLNDkmALp/uDopFSBNfLzDDq+nPNIKJD/IJ8sUXwsqxjl\r\nxc8PWanti3KSFScBdKPj1ljIL34tM60vEUYoWYBd8BiRginMlc6UF+7vF+TX\r\nwQm+4wkchSUo9qlDGEUXcevewTYioozz2eIo+DfLqza3w1hWbWAvoYVq0/Pg\r\n/twE8qFKzsxFfdWfyWQz2Zqtp2j0t+7RNxWtruZfsC+lY7Mlc2qlJQHP8tby\r\nsXe2qdVrObdFSIUcmnlxyjAx+d39OmuCmDkQHGtZY5uZjq8R0bVqi+l9xbRX\r\nAx4fXGSBrcuM7My/YzvFnChtb5gNVE4ynCHf2sqUIbrfNBYcm0i5GigkWmp7\r\nMQrBfo2uccvAzoYWo06191f+j5ngGlYGNTvWcPjf3gplyZcxKAfpi2l4BjMi\r\nW1x/654RIUtWC8/PiBfDqyT1m1YrS2Yr7DjB6fwigENdA7Fa0UpZgNsIIiX/\r\nTCSlNZn6hIizme5WqNV6ZXtfIL/ucd/gdKkiGhq+PauiVMQJRH/fvTZ/MqoG\r\ns/gasv1woobJfcPmNG0Ns8yDRaRKMEzMI2QCvhXBTxWehse4QChs2dcvLC1o\r\nlF3WtoHGQJGgvxney73+BmBXRCd0ozLw4qkeqoogLUgxDQrc+MMS8G4OKmr7\r\nbzKq1ye0X9wcWY9aBZC+l42O6b/wNJeo3qU=\r\n=SkDZ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","readme":"# mongodb-connection-model [![][workflow_img]][workflow_url] [![][npm_img]][npm_url]\n\n> MongoDB connection model\n\nThe main purpose of the MongoDB connection model is to be a domain model around a MongoDB connection. It encapsulates generating a [Connection String URI](https://docs.mongodb.com/manual/reference/connection-string/) from a group of attributes and parses URI using the [MongoDB Node.JS Driver URI Parser](https://github.com/mongodb-js/mongodb-core/blob/master/lib/uri_parser.js).\n\n## Installation\n\n```\nnpm install --save mongodb-connection-model\n```\n\n## Usage\n\n### Building URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\nconst c = new Connection({ appname: 'My App Name' });\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://localhost:27017/?readPreference=primary&appname=My%20App&ssl=false'\n```\n\n### Parsing URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\n\nConnection.from(\n  'mongodb://someUsername:testPassword@localhost',\n  (error, result) => {\n    console.log(result);\n    >>> `{\n      hosts: [{ host: 'localhost', port: 27017 }],\n      hostname: 'localhost',\n      port: 27017,\n      auth: {\n        username: 'someUsername',\n        password: 'testPassword',\n        db: 'admin'\n      },\n      isSrvRecord: false,\n      authStrategy: 'MONGODB',\n      mongodbUsername: 'someUsername',\n      mongodbPassword: 'testPassword',\n      mongodbDatabaseName: 'admin',\n      extraOptions: {},\n      connectionType: 'NODE_DRIVER',\n      readPreference: 'primary',\n      kerberosCanonicalizeHostname: false,\n      sslMethod: 'NONE',\n      sshTunnel: 'NONE',\n      sshTunnelPort: 22\n    }`\n  }\n);\n```\n\n## Properties\n\nMongoDB connection model is based on Ampersand.js framework and consist of [props](https://ampersandjs.com/docs/#ampersand-state-props) and [derived props](https://ampersandjs.com/docs/#ampersand-state-derived). The props object describes the observable properties that MongoDB connection model gets from the Node.js Driver API.\n\n```javascript\nconst с = new Connection();\nconst props = с.getAttributes({ props: true });\n```\n\n#### See Also\n\n- [URI Generic Syntax](https://tools.ietf.org/html/rfc3986)\n- [URI Options Specification](https://github.com/mongodb/specifications/blob/master/source/uri-options/uri-options.rst)\n\n### General Properties\n\n```javascript\nconst c = new Connection({ isSrvRecord: true });\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ns` | String | A valid [ns][ns] the user can read from | `undefined` |\n| `isSrvRecord` | Boolean | Indicates SRV record | `false` |\n| `auth` | Object | Authentication from driver (username, user, db, password) | `undefined` |\n| `hostname` | String | Hostname of a MongoDB Instance. In case of the replica set the first host and port will be taken | `localhost` |\n| `port` | Number | TCP port of a MongoDB Instance | `27017` |\n| `hosts` | Array | Contains all hosts and ports for replica set | `[{ host: 'localhost', port: 27017 }]` |\n| `extraOptions` | Object | Extra options passed to the node driver as part of `driverOptions` | `{}` |\n| `connectionType` | String | The desired connection type. Possible values: `NODE_DRIVER`, `STITCH_ON_PREM`, `STITCH_ATLAS` | `NODE_DRIVER` |\n| `authStrategy` | String | The desired authentication strategy. Possible values: `NONE`, `MONGODB`, `X509`, `KERBEROS`, `LDAP`, `SCRAM-SHA-256` | `NONE` |\n\n### Connection string options\n\n```javascript\nconst c = new Connection({ appname: 'My App', replicaSet: 'testing' });\n```\n\n#### General connection string options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `replicaSet` | String | Specifies the name of the replica set, if the mongod is a member of a replica set | `undefined` |\n| `connectTimeoutMS` | Number | The time in milliseconds to attempt a connection before timing out | `undefined` |\n| `socketTimeoutMS` | Number | The time in milliseconds to attempt a send or receive on a socket before the attempt times out | `undefined` |\n| `compression` | Object | Object includes compressors and a compression level. The following compressors can be specified: `snappy`, `zlib` (Available in MongoDB 3.6 or greater) | `undefined` |\n\n#### Connection Pool Option\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `maxPoolSize` | Number | The maximum number of connections in the connection pool | `undefined` |\n| `minPoolSize` | Number | The minimum number of connections in the connection pool | `undefined` |\n| `maxIdleTimeMS` | Number | The maximum number of milliseconds that a connection can remain idle in the pool before being removed and closed | `undefined` |\n| `waitQueueMultiple` | Number | A number that the driver multiples the maxPoolSize value to, to provide the maximum number of threads allowed to wait for a connection to become available from the pool | `undefined` |\n| `waitQueueTimeoutMS` | Number | The maximum time in milliseconds that a thread can wait for a connection to become available | `undefined` |\n\n#### Write Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `w` | Number/String | Corresponds to the write concern [w Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-w) | `undefined` |\n| `wTimeoutMS` | Number | Corresponds to the write concern [wtimeout](https://docs.mongodb.com/manual/reference/write-concern/#wc-wtimeout) | `undefined` |\n| `journal` | Boolean | Corresponds to the write concern [j Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-j) | `undefined` |\n\n#### Read Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readConcernLevel` | String | The level of isolation | `undefined` |\n\n#### Read Preference Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readPreference` | String | Specifies the read preferences for this connection. Possible values: `PRIMARY`, `PRIMARY_PREFERRED`, `SECONDARY`, `SECONDARY_PREFERRED`, `NEAREST` | `PRIMARY` |\n| `maxStalenessSeconds` | Number | Specifies, in seconds, how stale a secondary can be before the client stops using it for read operations | `undefined` |\n| `readPreferenceTags` | Object | Default read preference tags for the client | `undefined` |\n\n#### Authentication Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `authSource` | String | Specify the database name associated with the user’s credentials | `undefined` |\n| `authMechanism` | String | Specifies the authentication mechanism that MongoDB will use to authenticate the connection. Possible values: `DEFAULT`, `GSSAPI`, `MONGODB-X509`, `PLAIN`, `SCRAM-SHA-256` | `undefined` |\n| `authMechanismProperties` | Object | Additional options provided for authentication (e.g. to enable hostname canonicalization for GSSAPI) | `undefined` |\n| `gssapiServiceName` | String | Set the Kerberos service name when connecting to Kerberized MongoDB instances | `undefined` |\n| `gssapiServiceRealm` | String | Set the Realm service name | `undefined` |\n| `gssapiCanonicalizeHostName` | Boolean | Whether canonicalized hostname | `undefined` |\n\n#### Server Selection and Discovery Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `localThresholdMS` | Number | The size (in milliseconds) of the latency window for selecting among multiple suitable MongoDB instances | `undefined` |\n| `serverSelectionTimeoutMS` | Number | Specifies how long (in milliseconds) to block for server selection before throwing an exception | `undefined` |\n| `serverSelectionTryOnce` | Boolean | Instructs the driver to scan the MongoDB deployment exactly once after server selection fails and then either select a server or raise an error | `undefined` |\n| `heartbeatFrequencyMS` | Number | Controls when the driver checks the state of the MongoDB deployment | `undefined` |\n\n#### Miscellaneous Configuration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `appname` | String | An application name passed to server as client metadata | `undefined` |\n| `retryWrites` | Boolean | Enable retryable writes | `undefined` |\n| `uuidRepresentation` | String | The legacy representation of UUID. Possible values: `standard`, `csharpLegacy`, `javaLegacy`, `pythonLegacy` | `undefined` |\n| `loadBalanced` | Boolean | Whether or not the server is running in load balanced mode | `undefined` |\n\n### Stitch attributes\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `stitchServiceName` | String | Stitch service name | `undefined` |\n| `stitchClientAppId` | String | Stitch сlient app ID | `undefined` |\n| `stitchGroupId` | String | Stitch group ID | `undefined` |\n| `stitchBaseUrl` | String | Stitch base Url | `undefined` |\n\n### MONGODB authentication\n\n```javascript\nconst c = new Connection({\n  mongodbUsername: 'arlo',\n  mongodbPassword: 'w@of'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/?slaveOk=true&authSource=admin'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `mongodbUsername` | String | MongoDB username | `undefined` |\n| `mongodbPassword` | String | MongoDB password | `undefined` |\n| `mongodbDatabaseName` | String | The database name associated with the user's credentials | `undefined` |\n| `promoteValues` | Boolean | Whether BSON values should be promoted to their JS type counterparts | `undefined` |\n\n### KERBEROS authentication\n\n```javascript\nconst c = new Connection({\n  kerberosServiceName: 'mongodb',\n  kerberosPrincipal: 'arlo/dog@krb5.mongodb.parts',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo%252Fdog%2540krb5.mongodb.parts@localhost:27017/toys?authMechanism=GSSAPI'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n> @note (imlucas): Kerberos on Windows is broken out as it's own state for UX consideration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `kerberosServiceName` | String | Any program or computer you access over a network | `undefined` |\n| `kerberosPrincipal` | String | The format of a typical Kerberos V5 principal is `primary/instance@REALM` | `undefined` |\n| `kerberosCanonicalizeHostname` | Boolean | Whether canonicalized kerberos hostname | `undefined` |\n\n#### See Also\n\n- [node.js driver Kerberos reference](http://bit.ly/mongodb-node-driver-kerberos)\n- [node.js driver Kerberos functional test][kerberos-functional]\n\n### LDAP authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  ldapUsername: 'arlo',\n  ldapPassword: 'w@of',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/toys?slaveOk=true&authMechanism=PLAIN'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ldapUsername` | String | LDAP username | `undefined` |\n| `ldapPassword` | String | LDAP password | `undefined` |\n\n#### See Also\n\n- [node.js driver LDAP reference](http://bit.ly/mongodb-node-driver-ldap)\n- [node.js driver X509 functional test][ldap-functional]\n\n### X509 authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  x509Username: 'CN=client,OU=arlo,O=MongoDB,L=Philadelphia,ST=Pennsylvania,C=US'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://CN%253Dclient%252COU%253Darlo%252CO%253DMongoDB%252CL%253DPhiladelphia%252CST%253DPennsylvania%252CC%253DUS@localhost:27017?slaveOk=true&authMechanism=MONGODB-X509'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `x509Username` | String | The x.509 certificate derived user name, e.g. `CN=user,OU=OrgUnit,O=myOrg,...` | `undefined` |\n\n#### See Also\n\n- [node.js driver X509 reference](http://bit.ly/mongodb-node-driver-x509)\n- [node.js driver X509 functional test][x509-functional]\n\n### SSL\n\n> **Note**: Not to be confused with `authentication=X509`\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ssl` | Number/String | A boolean to enable or disables TLS/SSL for the connection | `undefined` |\n| `sslMethod` | String | The desired ssl method. Possible values: `NONE`, `SYSTEMCA`, `IFAVAILABLE`, `UNVALIDATED`, `SERVER`, `ALL` | `NONE` |\n| `sslCA` | Buffer/String | Array of valid certificates | `undefined` |\n| `sslCert` | Buffer/String | The certificate | `undefined` |\n| `sslKey` | Buffer/String | The certificate private key | `undefined` |\n| `sslPass` | Buffer/String | The certificate password | `undefined` |\n\nDescription of `sslMethod` values:\n\n- `SYSTEMCA` - SSL required, validate using System CA, with host verification.\n- `IFAVAILABLE` - The driver should try SSL first, fall back to no SSL if unavailable, and use the system's Certificate Authority.\n- `SERVER` - The driver should validate the server certificate and fail to connect if validation fails. See also [node.js driver \"Validate Server Certificate\" docs][driver-ssl-server].\n- `ALL` - The driver must present a valid certificate and validate the server certificate. See also [node.js driver \"Validate Server Certificate and Present Valid Certificate\" docs][driver-ssl-all].\n- `NONE` - No SSL (Not recommended).\n- `UNVALIDATED` - Use SSL but do not perform any validation of the certificate chain. See also [node.js driver \"No Certificate Validation\" docs][driver-ssl-none]. **Very** not recommended and likely to be deprecated in future releases because it exposes potential Man-In-The-Middle attack vectors.\n\n#### See also\n\n- [node.js driver SSL implementation][driver-ssl-impl]\n- [node.js driver SSL tutorial][driver-ssl-tutorial]\n\n### SSH TUNNEL\n\n> New in mongodb-connection-model@5.0.0\n\nBecause [authentication](#authentication) is quite difficult for operators to migrate to, the most common method of securing a MongoDB deployment is to use an [SSH tunnel][sf-ssh-tunnel].  This allows operators to leverage their existing SSH security infrastructure to also provide secure access to MongoDB.  For a standard deployment of MongoDB on AWS, this is almost always to strategy.  Because of this, we now support creating SSH tunnels automatically when connecting to MongoDB.\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options, (connectionError, client) => {\n  if (connectionError) {\n    return console.log(connectionError);\n  }\n\n  client.db('mongodb').collection('fanclub').count((countingError, count) => {\n    console.log('counted:', countingError, count);\n    client.close();\n  });\n});\n```\n\nThe above provides the same functionality as creating the tunnel using the bash\ncommand below and connecting to MongoDB via another terminal. Notice that\nconnection-model uses a random local port each time it creates a tunnel.\nUsing the command line, you'd have to replace `<random port>` with an actual\nport number.\n\n```bash\nssh -i ~/.ssh/my-key-aws-pair.pem -L <random port>:localhost:27017 ubuntu@ec2-11-111-111-111.compute-1.amazonaws.com\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `sshTunnel` | String | The desired SSH tunnel strategy. Possible values: `NONE`, `USER_PASSWORD`, `IDENTITY_FILE` | `undefined` |\n| `sshTunnelHostname` | String | The hostname of the SSH remote host | `undefined` |\n| `sshTunnelPort` | Port | The SSH port of the remote host | `22` |\n| `sshTunnelBindToLocalPort` | Port | Bind the localhost endpoint of the SSH Tunnel to this port | `undefined` |\n| `sshTunnelUsername` | String | The optional SSH username for the remote host | `undefined` |\n| `sshTunnelPassword` | String | The optional SSH password for the remote host | `undefined` |\n| `sshTunnelIdentityFile` | String/Array | The optional path to the SSH identity file for the remote host | `undefined` |\n| `sshTunnelPassphrase` | String | The optional passphrase for `sshTunnelIdentityFile` | `undefined` |\n\nDescription of `sshTunnel` values:\n\n- `NONE` - Do not use SSH tunneling.\n- `USER_PASSWORD` - The tunnel is created with SSH username and password only.\n- `IDENTITY_FILE` - The tunnel is created using an identity file.\n\n## Derived Properties\n\nDerived properties (also known as computed properties) are properties of the state object that depend on other properties to determine their value.\n\n```javascript\nconst c = new Connection();\nconst derivedProps = c.getAttributes({ derived: true });\n```\n\n| Derived Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `instanceId` | String | The mongoscope | `localhost:27017` |\n| `driverAuthMechanism` | String | Converts the value of `authStrategy` for humans into the `authMechanism` value for the driver | `undefined` |\n| `safeUrl` | String | The URL where a password is replaced with stars | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrl` | String | Use this URL in order to connect via DataService | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrlWithSsh` | String | Use this URL in order to connect via connection model itself | `mongodb://localhost:29201/?readPreference=primary&ssl=false` |\n| `driverOptions` | String | The second argument `mongoscope-server` passes to `mongodb.connect` | `{}` |\n\n## Events\n\n> New in mongodb-connection-model@5.0.0\n\n#### Example: SSH Tunnel\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', skipped: true,\n  reason: 'The selected SSL mode does not need to load any files.' }\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', complete: true}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n#### Example: SSL\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  ssl: 'ALL',\n  sslCA: '~/.ssl/my-ca.pem',\n  sslCert: '~/.ssl/my-server.pem',\n  sslKey: '~/.ssl/my-server.pem'\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', complete: true}\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', skipped: true,\n  reason: 'The selected SSH Tunnel mode is NONE.'}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n[workflow_img]: https://github.com/mongodb-js/connection-model/workflows/Check%20and%20Test/badge.svg?event=push\n[workflow_url]: https://github.com/mongodb-js/connection-model/actions?query=workflow%3A%22Check+and+Test%22\n[npm_img]: https://img.shields.io/npm/v/mongodb-connection-model.svg?style=flat-square\n[npm_url]: https://www.npmjs.org/package/mongodb-connection-model\n[gitter_img]: https://badges.gitter.im/Join%20Chat.svg\n[gitter_url]: http://gitter.im/mongodb-js/mongodb-js\n[enterprise_img]: https://img.shields.io/badge/MongoDB-Enterprise-blue.svg?style=flat-square\n[coming_soon_img]: https://img.shields.io/badge/-Coming%20Soon-ff69b4.svg?style=flat-square\n[kerberos-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/kerberos_tests.js\n[ldap-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ldap_tests.js\n[x509-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ssl_x509_tests.js\n[ns]: https://github.com/mongodb-js/ns\n[sf-ssh-tunnel]: http://serverfault.com/questions/597765/how-to-connect-to-mongodb-server-via-ssh-tunnel\n[ec2-key-pairs]: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html\n[driver-ssl-impl]: https://github.com/christkv/mongodb-core/blob/c3d21cb636d74d7a68134ecd3b9f6af536311279/lib/connection/connection.js#L365-L407\n[driver-ssl-tutorial]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/\n[driver-ssl-none]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#no-certificate-validation\n[driver-ssl-server]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate\n[driver-ssl-all]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate-and-present-valid-certificate\n","gitHead":"94f03d5249971d1eea1868df296db6e766f40f9f","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","test":"mocha","check":"npm run lint && npm run depcheck","pretest":"mongodb-runner install && mongodb-runner start --port=27018","test-ci":"npm run test","depcheck":"depcheck","posttest":"mongodb-runner stop --port=27018","posttest-ci":"node ../../scripts/killall-mongo.js","test-check-ci":"npm run check && npm test"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.17.0+x64 (linux)","description":"MongoDB connection model.","directories":{},"_nodeVersion":"16.17.0","compass:main":"index.js","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","debug":"^4.2.0","lodash":"^4.17.15","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.2.0","storage-mixin":"0.0.0-next-94f03d5249971d1eea1868df296db6e766f40f9f","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.2","@mongodb-js/ssh-tunnel":"0.0.0-next-94f03d5249971d1eea1868df296db6e766f40f9f","@mongodb-js/compass-utils":"0.0.0-next-94f03d5249971d1eea1868df296db6e766f40f9f","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.5.4"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"^4.10.0","depcheck":"^1.4.1","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.9.0","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^4.10.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_0.0.0-next-94f03d5249971d1eea1868df296db6e766f40f9f_1669420095514_0.7784950355262192","host":"s3://npm-registry-packages"}},"22.1.3":{"name":"mongodb-connection-model","version":"22.1.3","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@22.1.3","maintainers":[{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"iteng@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"d1ad3fa55c92b874da398fdc4588c9d0720e797d","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-22.1.3.tgz","fileCount":20,"integrity":"sha512-PynG8NuqrajjjpfcB10L22RGFXeaA/1UMSdOuiM+jePGtkQhxHCSK2J2Ckq5+SdBn0MtmlbvBsB3SchJJACxwg==","signatures":[{"sig":"MEUCIQDOkPHdYoyO/qggSfayfbRZoRqUORkJ3FcPTxTruaL1YwIgSstnaLFFQraZKL1GdF8QXTsIwXpbI7jjQdxji08VuBk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":107972,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjhgyQACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpnNw//fjE9BOSKahCCXTJTrMhy+fP+mLgx9GmYRXL53eje7SYE19dI\r\n/OP/XjaOEk0UqHKFm+5YwcR1SCsOny1Vx0csTSQUfNgatamneArtXxsYs7ot\r\nABWNLNUpaa/fRn8rEKWpc1pKr1e6F+375g9JSdaVxWwhr52Gq/FcB+vicIyU\r\ni46K6ycHdMPdNEzd5Fb6B06X6RvtIkor/ecV6Pxm4LRoJ3djPVUPK1+Vw7zg\r\nHYvYbCEAp4LOkq8tT/Lt96BswvS6yZmf+7uJlGWZnPIoWCwfa3eHvFsQgD3q\r\nS7IgqGJHPd5OE7xnfkY1SzO3eD3N1I1Vs8BeaSf06mJ9Q0NxUA+qCyqqLd9A\r\nHx1Qg4KomGCak+9oSgvsoRmT4IrVl9MsZVWEu2OdEhXvk4tv0R/RnxpSiJeI\r\nzJyeAsTJ4cG4XCHA5bf5DTvAYg20IQdx9cV7j4G4fJz5I27y9+rRLFwK1lkt\r\nQ5r/9KjZv2uGgX+MWcG5p+EdkxRLpJsJ/OvoTCUQdMyhqS6D40pt4AGU+PAh\r\nvNkWMZlykSmbtUjUBGixjxgG+4xgg/1nGviCmR0NRWMIhdQN0jwpvC0JE4IG\r\nhnXPSRDPyR8AyIOuj9S20WX8MZuvR/n4GiMJ8GOsAmQAf7IcSSTuylug5y9k\r\nNSOiWO5Aqp7XAyYpsiKOVqztv2Vr/dJTuX0=\r\n=DTee\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","gitHead":"7f786ed13b999a5c0831af6fde545154890df956","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","test":"mocha","check":"npm run lint && npm run depcheck","pretest":"mongodb-runner install && mongodb-runner start --port=27018","test-ci":"npm run test","depcheck":"depcheck","posttest":"mongodb-runner stop --port=27018","posttest-ci":"node ../../scripts/killall-mongo.js","test-check-ci":"npm run check && npm test"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.18.1+x64 (linux)","description":"MongoDB connection model.","directories":{},"_nodeVersion":"16.18.1","compass:main":"index.js","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","debug":"^4.2.0","lodash":"^4.17.15","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.2.0","storage-mixin":"^5.1.0","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.2","@mongodb-js/ssh-tunnel":"^2.0.1","@mongodb-js/compass-utils":"^0.1.2","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.6.0"},"_hasShrinkwrap":false,"devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"^4.10.0","depcheck":"^1.4.1","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.9.0","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^4.10.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_22.1.3_1669729424308_0.32073329356442093","host":"s3://npm-registry-packages"}},"0.0.0-next-449f5b693a70d24bf653fcbd3719d8d88d91d899":{"name":"mongodb-connection-model","version":"0.0.0-next-449f5b693a70d24bf653fcbd3719d8d88d91d899","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@0.0.0-next-449f5b693a70d24bf653fcbd3719d8d88d91d899","maintainers":[{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"iteng@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"3e3c3c2e235ffe05951a316dd06dd5da6abfd2e7","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-0.0.0-next-449f5b693a70d24bf653fcbd3719d8d88d91d899.tgz","fileCount":20,"integrity":"sha512-uaYkjxVmbRcLQg21bANCt23xUByWHHvnSXS/hi1iXHDTZ+M5QLQQZkf/wGoGDuQ7GXaCT7dBhd7FPMUL21HvIQ==","signatures":[{"sig":"MEYCIQCwTAH9vBylShLgsY0DY2Oz7cDNbg3u6u2KZrsMdaUJcgIhAPe7Q3+sLO3uMUbhccpStJoc7LKimIIndcQWfxmynjnJ","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":108152,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjhpc/ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqHjg/+NaVSOQH6kRPQO8Bjmqc7kOYeEn6quWx8dR1a+4JsQYg8SukH\r\n2vNKIGTaJr4QYxQWlOxNq+CiBsqcUaMx8Al0omRnq7SCv6IJ0AZxVCTR+6RF\r\nJw8V04jGjfPHdaO8D0ORg1RGzIn8wAeprG3FU5UIaNybk6r5QHPv5jJc672h\r\nmdxdSM2zzn1qE8zNfjuSTae2uk6cu6xt7FMkBzU/0aoxAfqZKtZvmWhWANlT\r\nYZODOwqKJ24B7gzre5ZH52ADF/5mUrRIdkRekZ4FcxM5mojW56DChxh4OTyk\r\nxxlr3mub/wGYsb/WL53jg4dkzeQKe4irhe9RE3lr07q6Nf9/sIAM1+X16eKp\r\n12Ax+nRXc5rVJoiYwbF/n+d6rklNMVbm3J1NVvscQBTeTtcpDCAnoZJGNffk\r\nWFLiL10Ne5UASk99LwM07NtHIgDVEJhDQOzuMP0VOlch9cHi5tIBuonxdtvf\r\n5dxLixLjqryEpA0pcAp5I7xdTwY4lKfKK7KhLCD0y6HHjOegVYNIJMCR69Qf\r\njLygJ2cE1V+Ss5+8BKT3O5YsRENO5Yeg36V/I/gioQ07nvhrcYpYyKJpsBNe\r\nEqvg4Yo1c4EUGrAM1b6zBX79stFgihGiW2Cn/SzjFpECrmEzv6T1+6/gvOcw\r\n7I9unctLr3pET5NAmD3ZmeVa8HgnCBYxqoo=\r\n=t6C6\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","readme":"# mongodb-connection-model [![][workflow_img]][workflow_url] [![][npm_img]][npm_url]\n\n> MongoDB connection model\n\nThe main purpose of the MongoDB connection model is to be a domain model around a MongoDB connection. It encapsulates generating a [Connection String URI](https://docs.mongodb.com/manual/reference/connection-string/) from a group of attributes and parses URI using the [MongoDB Node.JS Driver URI Parser](https://github.com/mongodb-js/mongodb-core/blob/master/lib/uri_parser.js).\n\n## Installation\n\n```\nnpm install --save mongodb-connection-model\n```\n\n## Usage\n\n### Building URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\nconst c = new Connection({ appname: 'My App Name' });\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://localhost:27017/?readPreference=primary&appname=My%20App&ssl=false'\n```\n\n### Parsing URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\n\nConnection.from(\n  'mongodb://someUsername:testPassword@localhost',\n  (error, result) => {\n    console.log(result);\n    >>> `{\n      hosts: [{ host: 'localhost', port: 27017 }],\n      hostname: 'localhost',\n      port: 27017,\n      auth: {\n        username: 'someUsername',\n        password: 'testPassword',\n        db: 'admin'\n      },\n      isSrvRecord: false,\n      authStrategy: 'MONGODB',\n      mongodbUsername: 'someUsername',\n      mongodbPassword: 'testPassword',\n      mongodbDatabaseName: 'admin',\n      extraOptions: {},\n      connectionType: 'NODE_DRIVER',\n      readPreference: 'primary',\n      kerberosCanonicalizeHostname: false,\n      sslMethod: 'NONE',\n      sshTunnel: 'NONE',\n      sshTunnelPort: 22\n    }`\n  }\n);\n```\n\n## Properties\n\nMongoDB connection model is based on Ampersand.js framework and consist of [props](https://ampersandjs.com/docs/#ampersand-state-props) and [derived props](https://ampersandjs.com/docs/#ampersand-state-derived). The props object describes the observable properties that MongoDB connection model gets from the Node.js Driver API.\n\n```javascript\nconst с = new Connection();\nconst props = с.getAttributes({ props: true });\n```\n\n#### See Also\n\n- [URI Generic Syntax](https://tools.ietf.org/html/rfc3986)\n- [URI Options Specification](https://github.com/mongodb/specifications/blob/master/source/uri-options/uri-options.rst)\n\n### General Properties\n\n```javascript\nconst c = new Connection({ isSrvRecord: true });\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ns` | String | A valid [ns][ns] the user can read from | `undefined` |\n| `isSrvRecord` | Boolean | Indicates SRV record | `false` |\n| `auth` | Object | Authentication from driver (username, user, db, password) | `undefined` |\n| `hostname` | String | Hostname of a MongoDB Instance. In case of the replica set the first host and port will be taken | `localhost` |\n| `port` | Number | TCP port of a MongoDB Instance | `27017` |\n| `hosts` | Array | Contains all hosts and ports for replica set | `[{ host: 'localhost', port: 27017 }]` |\n| `extraOptions` | Object | Extra options passed to the node driver as part of `driverOptions` | `{}` |\n| `connectionType` | String | The desired connection type. Possible values: `NODE_DRIVER`, `STITCH_ON_PREM`, `STITCH_ATLAS` | `NODE_DRIVER` |\n| `authStrategy` | String | The desired authentication strategy. Possible values: `NONE`, `MONGODB`, `X509`, `KERBEROS`, `LDAP`, `SCRAM-SHA-256` | `NONE` |\n\n### Connection string options\n\n```javascript\nconst c = new Connection({ appname: 'My App', replicaSet: 'testing' });\n```\n\n#### General connection string options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `replicaSet` | String | Specifies the name of the replica set, if the mongod is a member of a replica set | `undefined` |\n| `connectTimeoutMS` | Number | The time in milliseconds to attempt a connection before timing out | `undefined` |\n| `socketTimeoutMS` | Number | The time in milliseconds to attempt a send or receive on a socket before the attempt times out | `undefined` |\n| `compression` | Object | Object includes compressors and a compression level. The following compressors can be specified: `snappy`, `zlib` (Available in MongoDB 3.6 or greater) | `undefined` |\n\n#### Connection Pool Option\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `maxPoolSize` | Number | The maximum number of connections in the connection pool | `undefined` |\n| `minPoolSize` | Number | The minimum number of connections in the connection pool | `undefined` |\n| `maxIdleTimeMS` | Number | The maximum number of milliseconds that a connection can remain idle in the pool before being removed and closed | `undefined` |\n| `waitQueueMultiple` | Number | A number that the driver multiples the maxPoolSize value to, to provide the maximum number of threads allowed to wait for a connection to become available from the pool | `undefined` |\n| `waitQueueTimeoutMS` | Number | The maximum time in milliseconds that a thread can wait for a connection to become available | `undefined` |\n\n#### Write Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `w` | Number/String | Corresponds to the write concern [w Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-w) | `undefined` |\n| `wTimeoutMS` | Number | Corresponds to the write concern [wtimeout](https://docs.mongodb.com/manual/reference/write-concern/#wc-wtimeout) | `undefined` |\n| `journal` | Boolean | Corresponds to the write concern [j Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-j) | `undefined` |\n\n#### Read Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readConcernLevel` | String | The level of isolation | `undefined` |\n\n#### Read Preference Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readPreference` | String | Specifies the read preferences for this connection. Possible values: `PRIMARY`, `PRIMARY_PREFERRED`, `SECONDARY`, `SECONDARY_PREFERRED`, `NEAREST` | `PRIMARY` |\n| `maxStalenessSeconds` | Number | Specifies, in seconds, how stale a secondary can be before the client stops using it for read operations | `undefined` |\n| `readPreferenceTags` | Object | Default read preference tags for the client | `undefined` |\n\n#### Authentication Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `authSource` | String | Specify the database name associated with the user’s credentials | `undefined` |\n| `authMechanism` | String | Specifies the authentication mechanism that MongoDB will use to authenticate the connection. Possible values: `DEFAULT`, `GSSAPI`, `MONGODB-X509`, `PLAIN`, `SCRAM-SHA-256` | `undefined` |\n| `authMechanismProperties` | Object | Additional options provided for authentication (e.g. to enable hostname canonicalization for GSSAPI) | `undefined` |\n| `gssapiServiceName` | String | Set the Kerberos service name when connecting to Kerberized MongoDB instances | `undefined` |\n| `gssapiServiceRealm` | String | Set the Realm service name | `undefined` |\n| `gssapiCanonicalizeHostName` | Boolean | Whether canonicalized hostname | `undefined` |\n\n#### Server Selection and Discovery Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `localThresholdMS` | Number | The size (in milliseconds) of the latency window for selecting among multiple suitable MongoDB instances | `undefined` |\n| `serverSelectionTimeoutMS` | Number | Specifies how long (in milliseconds) to block for server selection before throwing an exception | `undefined` |\n| `serverSelectionTryOnce` | Boolean | Instructs the driver to scan the MongoDB deployment exactly once after server selection fails and then either select a server or raise an error | `undefined` |\n| `heartbeatFrequencyMS` | Number | Controls when the driver checks the state of the MongoDB deployment | `undefined` |\n\n#### Miscellaneous Configuration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `appname` | String | An application name passed to server as client metadata | `undefined` |\n| `retryWrites` | Boolean | Enable retryable writes | `undefined` |\n| `uuidRepresentation` | String | The legacy representation of UUID. Possible values: `standard`, `csharpLegacy`, `javaLegacy`, `pythonLegacy` | `undefined` |\n| `loadBalanced` | Boolean | Whether or not the server is running in load balanced mode | `undefined` |\n\n### Stitch attributes\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `stitchServiceName` | String | Stitch service name | `undefined` |\n| `stitchClientAppId` | String | Stitch сlient app ID | `undefined` |\n| `stitchGroupId` | String | Stitch group ID | `undefined` |\n| `stitchBaseUrl` | String | Stitch base Url | `undefined` |\n\n### MONGODB authentication\n\n```javascript\nconst c = new Connection({\n  mongodbUsername: 'arlo',\n  mongodbPassword: 'w@of'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/?slaveOk=true&authSource=admin'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `mongodbUsername` | String | MongoDB username | `undefined` |\n| `mongodbPassword` | String | MongoDB password | `undefined` |\n| `mongodbDatabaseName` | String | The database name associated with the user's credentials | `undefined` |\n| `promoteValues` | Boolean | Whether BSON values should be promoted to their JS type counterparts | `undefined` |\n\n### KERBEROS authentication\n\n```javascript\nconst c = new Connection({\n  kerberosServiceName: 'mongodb',\n  kerberosPrincipal: 'arlo/dog@krb5.mongodb.parts',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo%252Fdog%2540krb5.mongodb.parts@localhost:27017/toys?authMechanism=GSSAPI'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n> @note (imlucas): Kerberos on Windows is broken out as it's own state for UX consideration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `kerberosServiceName` | String | Any program or computer you access over a network | `undefined` |\n| `kerberosPrincipal` | String | The format of a typical Kerberos V5 principal is `primary/instance@REALM` | `undefined` |\n| `kerberosCanonicalizeHostname` | Boolean | Whether canonicalized kerberos hostname | `undefined` |\n\n#### See Also\n\n- [node.js driver Kerberos reference](http://bit.ly/mongodb-node-driver-kerberos)\n- [node.js driver Kerberos functional test][kerberos-functional]\n\n### LDAP authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  ldapUsername: 'arlo',\n  ldapPassword: 'w@of',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/toys?slaveOk=true&authMechanism=PLAIN'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ldapUsername` | String | LDAP username | `undefined` |\n| `ldapPassword` | String | LDAP password | `undefined` |\n\n#### See Also\n\n- [node.js driver LDAP reference](http://bit.ly/mongodb-node-driver-ldap)\n- [node.js driver X509 functional test][ldap-functional]\n\n### X509 authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  x509Username: 'CN=client,OU=arlo,O=MongoDB,L=Philadelphia,ST=Pennsylvania,C=US'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://CN%253Dclient%252COU%253Darlo%252CO%253DMongoDB%252CL%253DPhiladelphia%252CST%253DPennsylvania%252CC%253DUS@localhost:27017?slaveOk=true&authMechanism=MONGODB-X509'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `x509Username` | String | The x.509 certificate derived user name, e.g. `CN=user,OU=OrgUnit,O=myOrg,...` | `undefined` |\n\n#### See Also\n\n- [node.js driver X509 reference](http://bit.ly/mongodb-node-driver-x509)\n- [node.js driver X509 functional test][x509-functional]\n\n### SSL\n\n> **Note**: Not to be confused with `authentication=X509`\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ssl` | Number/String | A boolean to enable or disables TLS/SSL for the connection | `undefined` |\n| `sslMethod` | String | The desired ssl method. Possible values: `NONE`, `SYSTEMCA`, `IFAVAILABLE`, `UNVALIDATED`, `SERVER`, `ALL` | `NONE` |\n| `sslCA` | Buffer/String | Array of valid certificates | `undefined` |\n| `sslCert` | Buffer/String | The certificate | `undefined` |\n| `sslKey` | Buffer/String | The certificate private key | `undefined` |\n| `sslPass` | Buffer/String | The certificate password | `undefined` |\n\nDescription of `sslMethod` values:\n\n- `SYSTEMCA` - SSL required, validate using System CA, with host verification.\n- `IFAVAILABLE` - The driver should try SSL first, fall back to no SSL if unavailable, and use the system's Certificate Authority.\n- `SERVER` - The driver should validate the server certificate and fail to connect if validation fails. See also [node.js driver \"Validate Server Certificate\" docs][driver-ssl-server].\n- `ALL` - The driver must present a valid certificate and validate the server certificate. See also [node.js driver \"Validate Server Certificate and Present Valid Certificate\" docs][driver-ssl-all].\n- `NONE` - No SSL (Not recommended).\n- `UNVALIDATED` - Use SSL but do not perform any validation of the certificate chain. See also [node.js driver \"No Certificate Validation\" docs][driver-ssl-none]. **Very** not recommended and likely to be deprecated in future releases because it exposes potential Man-In-The-Middle attack vectors.\n\n#### See also\n\n- [node.js driver SSL implementation][driver-ssl-impl]\n- [node.js driver SSL tutorial][driver-ssl-tutorial]\n\n### SSH TUNNEL\n\n> New in mongodb-connection-model@5.0.0\n\nBecause [authentication](#authentication) is quite difficult for operators to migrate to, the most common method of securing a MongoDB deployment is to use an [SSH tunnel][sf-ssh-tunnel].  This allows operators to leverage their existing SSH security infrastructure to also provide secure access to MongoDB.  For a standard deployment of MongoDB on AWS, this is almost always to strategy.  Because of this, we now support creating SSH tunnels automatically when connecting to MongoDB.\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options, (connectionError, client) => {\n  if (connectionError) {\n    return console.log(connectionError);\n  }\n\n  client.db('mongodb').collection('fanclub').count((countingError, count) => {\n    console.log('counted:', countingError, count);\n    client.close();\n  });\n});\n```\n\nThe above provides the same functionality as creating the tunnel using the bash\ncommand below and connecting to MongoDB via another terminal. Notice that\nconnection-model uses a random local port each time it creates a tunnel.\nUsing the command line, you'd have to replace `<random port>` with an actual\nport number.\n\n```bash\nssh -i ~/.ssh/my-key-aws-pair.pem -L <random port>:localhost:27017 ubuntu@ec2-11-111-111-111.compute-1.amazonaws.com\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `sshTunnel` | String | The desired SSH tunnel strategy. Possible values: `NONE`, `USER_PASSWORD`, `IDENTITY_FILE` | `undefined` |\n| `sshTunnelHostname` | String | The hostname of the SSH remote host | `undefined` |\n| `sshTunnelPort` | Port | The SSH port of the remote host | `22` |\n| `sshTunnelBindToLocalPort` | Port | Bind the localhost endpoint of the SSH Tunnel to this port | `undefined` |\n| `sshTunnelUsername` | String | The optional SSH username for the remote host | `undefined` |\n| `sshTunnelPassword` | String | The optional SSH password for the remote host | `undefined` |\n| `sshTunnelIdentityFile` | String/Array | The optional path to the SSH identity file for the remote host | `undefined` |\n| `sshTunnelPassphrase` | String | The optional passphrase for `sshTunnelIdentityFile` | `undefined` |\n\nDescription of `sshTunnel` values:\n\n- `NONE` - Do not use SSH tunneling.\n- `USER_PASSWORD` - The tunnel is created with SSH username and password only.\n- `IDENTITY_FILE` - The tunnel is created using an identity file.\n\n## Derived Properties\n\nDerived properties (also known as computed properties) are properties of the state object that depend on other properties to determine their value.\n\n```javascript\nconst c = new Connection();\nconst derivedProps = c.getAttributes({ derived: true });\n```\n\n| Derived Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `instanceId` | String | The mongoscope | `localhost:27017` |\n| `driverAuthMechanism` | String | Converts the value of `authStrategy` for humans into the `authMechanism` value for the driver | `undefined` |\n| `safeUrl` | String | The URL where a password is replaced with stars | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrl` | String | Use this URL in order to connect via DataService | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrlWithSsh` | String | Use this URL in order to connect via connection model itself | `mongodb://localhost:29201/?readPreference=primary&ssl=false` |\n| `driverOptions` | String | The second argument `mongoscope-server` passes to `mongodb.connect` | `{}` |\n\n## Events\n\n> New in mongodb-connection-model@5.0.0\n\n#### Example: SSH Tunnel\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', skipped: true,\n  reason: 'The selected SSL mode does not need to load any files.' }\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', complete: true}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n#### Example: SSL\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  ssl: 'ALL',\n  sslCA: '~/.ssl/my-ca.pem',\n  sslCert: '~/.ssl/my-server.pem',\n  sslKey: '~/.ssl/my-server.pem'\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', complete: true}\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', skipped: true,\n  reason: 'The selected SSH Tunnel mode is NONE.'}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n[workflow_img]: https://github.com/mongodb-js/connection-model/workflows/Check%20and%20Test/badge.svg?event=push\n[workflow_url]: https://github.com/mongodb-js/connection-model/actions?query=workflow%3A%22Check+and+Test%22\n[npm_img]: https://img.shields.io/npm/v/mongodb-connection-model.svg?style=flat-square\n[npm_url]: https://www.npmjs.org/package/mongodb-connection-model\n[gitter_img]: https://badges.gitter.im/Join%20Chat.svg\n[gitter_url]: http://gitter.im/mongodb-js/mongodb-js\n[enterprise_img]: https://img.shields.io/badge/MongoDB-Enterprise-blue.svg?style=flat-square\n[coming_soon_img]: https://img.shields.io/badge/-Coming%20Soon-ff69b4.svg?style=flat-square\n[kerberos-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/kerberos_tests.js\n[ldap-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ldap_tests.js\n[x509-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ssl_x509_tests.js\n[ns]: https://github.com/mongodb-js/ns\n[sf-ssh-tunnel]: http://serverfault.com/questions/597765/how-to-connect-to-mongodb-server-via-ssh-tunnel\n[ec2-key-pairs]: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html\n[driver-ssl-impl]: https://github.com/christkv/mongodb-core/blob/c3d21cb636d74d7a68134ecd3b9f6af536311279/lib/connection/connection.js#L365-L407\n[driver-ssl-tutorial]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/\n[driver-ssl-none]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#no-certificate-validation\n[driver-ssl-server]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate\n[driver-ssl-all]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate-and-present-valid-certificate\n","gitHead":"449f5b693a70d24bf653fcbd3719d8d88d91d899","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","test":"mocha","check":"npm run lint && npm run depcheck","pretest":"mongodb-runner install && mongodb-runner start --port=27018","test-ci":"npm run test","depcheck":"depcheck","posttest":"mongodb-runner stop --port=27018","posttest-ci":"node ../../scripts/killall-mongo.js","test-check-ci":"npm run check && npm test"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.17.0+x64 (linux)","description":"MongoDB connection model.","directories":{},"_nodeVersion":"16.17.0","compass:main":"index.js","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","debug":"^4.2.0","lodash":"^4.17.15","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.2.0","storage-mixin":"0.0.0-next-449f5b693a70d24bf653fcbd3719d8d88d91d899","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.2","@mongodb-js/ssh-tunnel":"0.0.0-next-449f5b693a70d24bf653fcbd3719d8d88d91d899","@mongodb-js/compass-utils":"0.0.0-next-449f5b693a70d24bf653fcbd3719d8d88d91d899","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.6.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"^4.10.0","depcheck":"^1.4.1","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.9.0","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^4.10.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_0.0.0-next-449f5b693a70d24bf653fcbd3719d8d88d91d899_1669764927037_0.7389749127016938","host":"s3://npm-registry-packages"}},"0.0.0-next-9ee9b0963df24390835a677f1a9081d9bc53ca2a":{"name":"mongodb-connection-model","version":"0.0.0-next-9ee9b0963df24390835a677f1a9081d9bc53ca2a","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@0.0.0-next-9ee9b0963df24390835a677f1a9081d9bc53ca2a","maintainers":[{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"iteng@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"b94d47afa69f7d53cff2480e322089d35ed3b756","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-0.0.0-next-9ee9b0963df24390835a677f1a9081d9bc53ca2a.tgz","fileCount":20,"integrity":"sha512-ey1TxYV/7i3Ya3xVp9/O0TMcwyslbpy+Fh7xIQZrLvFj7cx3xAV2WboYt7Ngffd5byMTe4gbIt0lzjPZWEYL+w==","signatures":[{"sig":"MEUCICzTzPXZNXYCmGIVcHCqlaWAU48Imb2KXyZ3tnv7GBg6AiEAtV5iVhlCmuCIoWXKNIo0JVH9QZ+ReYVy0SWJTG9TktQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":108152,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjhphKACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp3yQ/+JnpJ+qCW2TklZlnhfFFCma3RmplL514nRl/BC+pnTPO61MBB\r\nGupaosL7JhInm6mVZkGuh37I25BcRPd7rgucYTfMZqpNQ8dVApFhTp3oWh/i\r\naJQpRYs+K8H1sY2EQSINwhS28q8Bac0i4saz8qQYPOeJm99TfIcmg/LTRkU9\r\nNhP5jbxuV+Nt2vq6P1oiFgZd5srbfpmwBcF/gxboDlvpnllY58ujszs8i/oB\r\nooix8hgBo9/OHLgf60DHW9CSC5eLcr25uwM1PqfpG+ZRv+KIE+PgdLiAv11/\r\n9L9TzxczwbZs5AbVdUe3OkVhuyHtxtK2+FJmoy31E7P3fc7iNOEp4Tj9U0+N\r\nJ2yjzQjP45mYFQ3cU22geK2hLMpHJO8biPW6065+YgRcq1/+6/yMvPSYUFCL\r\n93bfFQbtG1S8RfqZnHxSJdGV1TKVkDl22mcQzInp/6XvrwXCoYcueHS0W56D\r\nGS3RA7xNO7TylXAHgO3mvygKWeBLq2wlmQ0UhKQGwT/MUQxKDeZsMGGfAUtU\r\nWNlanklnf3pol0ecnM6eQ56csb+DVpMVTVu/GDbE4NFxnFFq4jTqnQoaUkRm\r\naRHKbJ+e9nny2nhEWfIpuYdwt5QODUlIo66d7H2JNPNQC0ux2srDVDbSiF1+\r\nO73uerRkPJrVxCmq2MSyLduX3UxivgoCS7w=\r\n=0sVY\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","readme":"# mongodb-connection-model [![][workflow_img]][workflow_url] [![][npm_img]][npm_url]\n\n> MongoDB connection model\n\nThe main purpose of the MongoDB connection model is to be a domain model around a MongoDB connection. It encapsulates generating a [Connection String URI](https://docs.mongodb.com/manual/reference/connection-string/) from a group of attributes and parses URI using the [MongoDB Node.JS Driver URI Parser](https://github.com/mongodb-js/mongodb-core/blob/master/lib/uri_parser.js).\n\n## Installation\n\n```\nnpm install --save mongodb-connection-model\n```\n\n## Usage\n\n### Building URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\nconst c = new Connection({ appname: 'My App Name' });\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://localhost:27017/?readPreference=primary&appname=My%20App&ssl=false'\n```\n\n### Parsing URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\n\nConnection.from(\n  'mongodb://someUsername:testPassword@localhost',\n  (error, result) => {\n    console.log(result);\n    >>> `{\n      hosts: [{ host: 'localhost', port: 27017 }],\n      hostname: 'localhost',\n      port: 27017,\n      auth: {\n        username: 'someUsername',\n        password: 'testPassword',\n        db: 'admin'\n      },\n      isSrvRecord: false,\n      authStrategy: 'MONGODB',\n      mongodbUsername: 'someUsername',\n      mongodbPassword: 'testPassword',\n      mongodbDatabaseName: 'admin',\n      extraOptions: {},\n      connectionType: 'NODE_DRIVER',\n      readPreference: 'primary',\n      kerberosCanonicalizeHostname: false,\n      sslMethod: 'NONE',\n      sshTunnel: 'NONE',\n      sshTunnelPort: 22\n    }`\n  }\n);\n```\n\n## Properties\n\nMongoDB connection model is based on Ampersand.js framework and consist of [props](https://ampersandjs.com/docs/#ampersand-state-props) and [derived props](https://ampersandjs.com/docs/#ampersand-state-derived). The props object describes the observable properties that MongoDB connection model gets from the Node.js Driver API.\n\n```javascript\nconst с = new Connection();\nconst props = с.getAttributes({ props: true });\n```\n\n#### See Also\n\n- [URI Generic Syntax](https://tools.ietf.org/html/rfc3986)\n- [URI Options Specification](https://github.com/mongodb/specifications/blob/master/source/uri-options/uri-options.rst)\n\n### General Properties\n\n```javascript\nconst c = new Connection({ isSrvRecord: true });\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ns` | String | A valid [ns][ns] the user can read from | `undefined` |\n| `isSrvRecord` | Boolean | Indicates SRV record | `false` |\n| `auth` | Object | Authentication from driver (username, user, db, password) | `undefined` |\n| `hostname` | String | Hostname of a MongoDB Instance. In case of the replica set the first host and port will be taken | `localhost` |\n| `port` | Number | TCP port of a MongoDB Instance | `27017` |\n| `hosts` | Array | Contains all hosts and ports for replica set | `[{ host: 'localhost', port: 27017 }]` |\n| `extraOptions` | Object | Extra options passed to the node driver as part of `driverOptions` | `{}` |\n| `connectionType` | String | The desired connection type. Possible values: `NODE_DRIVER`, `STITCH_ON_PREM`, `STITCH_ATLAS` | `NODE_DRIVER` |\n| `authStrategy` | String | The desired authentication strategy. Possible values: `NONE`, `MONGODB`, `X509`, `KERBEROS`, `LDAP`, `SCRAM-SHA-256` | `NONE` |\n\n### Connection string options\n\n```javascript\nconst c = new Connection({ appname: 'My App', replicaSet: 'testing' });\n```\n\n#### General connection string options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `replicaSet` | String | Specifies the name of the replica set, if the mongod is a member of a replica set | `undefined` |\n| `connectTimeoutMS` | Number | The time in milliseconds to attempt a connection before timing out | `undefined` |\n| `socketTimeoutMS` | Number | The time in milliseconds to attempt a send or receive on a socket before the attempt times out | `undefined` |\n| `compression` | Object | Object includes compressors and a compression level. The following compressors can be specified: `snappy`, `zlib` (Available in MongoDB 3.6 or greater) | `undefined` |\n\n#### Connection Pool Option\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `maxPoolSize` | Number | The maximum number of connections in the connection pool | `undefined` |\n| `minPoolSize` | Number | The minimum number of connections in the connection pool | `undefined` |\n| `maxIdleTimeMS` | Number | The maximum number of milliseconds that a connection can remain idle in the pool before being removed and closed | `undefined` |\n| `waitQueueMultiple` | Number | A number that the driver multiples the maxPoolSize value to, to provide the maximum number of threads allowed to wait for a connection to become available from the pool | `undefined` |\n| `waitQueueTimeoutMS` | Number | The maximum time in milliseconds that a thread can wait for a connection to become available | `undefined` |\n\n#### Write Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `w` | Number/String | Corresponds to the write concern [w Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-w) | `undefined` |\n| `wTimeoutMS` | Number | Corresponds to the write concern [wtimeout](https://docs.mongodb.com/manual/reference/write-concern/#wc-wtimeout) | `undefined` |\n| `journal` | Boolean | Corresponds to the write concern [j Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-j) | `undefined` |\n\n#### Read Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readConcernLevel` | String | The level of isolation | `undefined` |\n\n#### Read Preference Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readPreference` | String | Specifies the read preferences for this connection. Possible values: `PRIMARY`, `PRIMARY_PREFERRED`, `SECONDARY`, `SECONDARY_PREFERRED`, `NEAREST` | `PRIMARY` |\n| `maxStalenessSeconds` | Number | Specifies, in seconds, how stale a secondary can be before the client stops using it for read operations | `undefined` |\n| `readPreferenceTags` | Object | Default read preference tags for the client | `undefined` |\n\n#### Authentication Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `authSource` | String | Specify the database name associated with the user’s credentials | `undefined` |\n| `authMechanism` | String | Specifies the authentication mechanism that MongoDB will use to authenticate the connection. Possible values: `DEFAULT`, `GSSAPI`, `MONGODB-X509`, `PLAIN`, `SCRAM-SHA-256` | `undefined` |\n| `authMechanismProperties` | Object | Additional options provided for authentication (e.g. to enable hostname canonicalization for GSSAPI) | `undefined` |\n| `gssapiServiceName` | String | Set the Kerberos service name when connecting to Kerberized MongoDB instances | `undefined` |\n| `gssapiServiceRealm` | String | Set the Realm service name | `undefined` |\n| `gssapiCanonicalizeHostName` | Boolean | Whether canonicalized hostname | `undefined` |\n\n#### Server Selection and Discovery Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `localThresholdMS` | Number | The size (in milliseconds) of the latency window for selecting among multiple suitable MongoDB instances | `undefined` |\n| `serverSelectionTimeoutMS` | Number | Specifies how long (in milliseconds) to block for server selection before throwing an exception | `undefined` |\n| `serverSelectionTryOnce` | Boolean | Instructs the driver to scan the MongoDB deployment exactly once after server selection fails and then either select a server or raise an error | `undefined` |\n| `heartbeatFrequencyMS` | Number | Controls when the driver checks the state of the MongoDB deployment | `undefined` |\n\n#### Miscellaneous Configuration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `appname` | String | An application name passed to server as client metadata | `undefined` |\n| `retryWrites` | Boolean | Enable retryable writes | `undefined` |\n| `uuidRepresentation` | String | The legacy representation of UUID. Possible values: `standard`, `csharpLegacy`, `javaLegacy`, `pythonLegacy` | `undefined` |\n| `loadBalanced` | Boolean | Whether or not the server is running in load balanced mode | `undefined` |\n\n### Stitch attributes\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `stitchServiceName` | String | Stitch service name | `undefined` |\n| `stitchClientAppId` | String | Stitch сlient app ID | `undefined` |\n| `stitchGroupId` | String | Stitch group ID | `undefined` |\n| `stitchBaseUrl` | String | Stitch base Url | `undefined` |\n\n### MONGODB authentication\n\n```javascript\nconst c = new Connection({\n  mongodbUsername: 'arlo',\n  mongodbPassword: 'w@of'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/?slaveOk=true&authSource=admin'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `mongodbUsername` | String | MongoDB username | `undefined` |\n| `mongodbPassword` | String | MongoDB password | `undefined` |\n| `mongodbDatabaseName` | String | The database name associated with the user's credentials | `undefined` |\n| `promoteValues` | Boolean | Whether BSON values should be promoted to their JS type counterparts | `undefined` |\n\n### KERBEROS authentication\n\n```javascript\nconst c = new Connection({\n  kerberosServiceName: 'mongodb',\n  kerberosPrincipal: 'arlo/dog@krb5.mongodb.parts',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo%252Fdog%2540krb5.mongodb.parts@localhost:27017/toys?authMechanism=GSSAPI'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n> @note (imlucas): Kerberos on Windows is broken out as it's own state for UX consideration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `kerberosServiceName` | String | Any program or computer you access over a network | `undefined` |\n| `kerberosPrincipal` | String | The format of a typical Kerberos V5 principal is `primary/instance@REALM` | `undefined` |\n| `kerberosCanonicalizeHostname` | Boolean | Whether canonicalized kerberos hostname | `undefined` |\n\n#### See Also\n\n- [node.js driver Kerberos reference](http://bit.ly/mongodb-node-driver-kerberos)\n- [node.js driver Kerberos functional test][kerberos-functional]\n\n### LDAP authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  ldapUsername: 'arlo',\n  ldapPassword: 'w@of',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/toys?slaveOk=true&authMechanism=PLAIN'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ldapUsername` | String | LDAP username | `undefined` |\n| `ldapPassword` | String | LDAP password | `undefined` |\n\n#### See Also\n\n- [node.js driver LDAP reference](http://bit.ly/mongodb-node-driver-ldap)\n- [node.js driver X509 functional test][ldap-functional]\n\n### X509 authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  x509Username: 'CN=client,OU=arlo,O=MongoDB,L=Philadelphia,ST=Pennsylvania,C=US'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://CN%253Dclient%252COU%253Darlo%252CO%253DMongoDB%252CL%253DPhiladelphia%252CST%253DPennsylvania%252CC%253DUS@localhost:27017?slaveOk=true&authMechanism=MONGODB-X509'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `x509Username` | String | The x.509 certificate derived user name, e.g. `CN=user,OU=OrgUnit,O=myOrg,...` | `undefined` |\n\n#### See Also\n\n- [node.js driver X509 reference](http://bit.ly/mongodb-node-driver-x509)\n- [node.js driver X509 functional test][x509-functional]\n\n### SSL\n\n> **Note**: Not to be confused with `authentication=X509`\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ssl` | Number/String | A boolean to enable or disables TLS/SSL for the connection | `undefined` |\n| `sslMethod` | String | The desired ssl method. Possible values: `NONE`, `SYSTEMCA`, `IFAVAILABLE`, `UNVALIDATED`, `SERVER`, `ALL` | `NONE` |\n| `sslCA` | Buffer/String | Array of valid certificates | `undefined` |\n| `sslCert` | Buffer/String | The certificate | `undefined` |\n| `sslKey` | Buffer/String | The certificate private key | `undefined` |\n| `sslPass` | Buffer/String | The certificate password | `undefined` |\n\nDescription of `sslMethod` values:\n\n- `SYSTEMCA` - SSL required, validate using System CA, with host verification.\n- `IFAVAILABLE` - The driver should try SSL first, fall back to no SSL if unavailable, and use the system's Certificate Authority.\n- `SERVER` - The driver should validate the server certificate and fail to connect if validation fails. See also [node.js driver \"Validate Server Certificate\" docs][driver-ssl-server].\n- `ALL` - The driver must present a valid certificate and validate the server certificate. See also [node.js driver \"Validate Server Certificate and Present Valid Certificate\" docs][driver-ssl-all].\n- `NONE` - No SSL (Not recommended).\n- `UNVALIDATED` - Use SSL but do not perform any validation of the certificate chain. See also [node.js driver \"No Certificate Validation\" docs][driver-ssl-none]. **Very** not recommended and likely to be deprecated in future releases because it exposes potential Man-In-The-Middle attack vectors.\n\n#### See also\n\n- [node.js driver SSL implementation][driver-ssl-impl]\n- [node.js driver SSL tutorial][driver-ssl-tutorial]\n\n### SSH TUNNEL\n\n> New in mongodb-connection-model@5.0.0\n\nBecause [authentication](#authentication) is quite difficult for operators to migrate to, the most common method of securing a MongoDB deployment is to use an [SSH tunnel][sf-ssh-tunnel].  This allows operators to leverage their existing SSH security infrastructure to also provide secure access to MongoDB.  For a standard deployment of MongoDB on AWS, this is almost always to strategy.  Because of this, we now support creating SSH tunnels automatically when connecting to MongoDB.\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options, (connectionError, client) => {\n  if (connectionError) {\n    return console.log(connectionError);\n  }\n\n  client.db('mongodb').collection('fanclub').count((countingError, count) => {\n    console.log('counted:', countingError, count);\n    client.close();\n  });\n});\n```\n\nThe above provides the same functionality as creating the tunnel using the bash\ncommand below and connecting to MongoDB via another terminal. Notice that\nconnection-model uses a random local port each time it creates a tunnel.\nUsing the command line, you'd have to replace `<random port>` with an actual\nport number.\n\n```bash\nssh -i ~/.ssh/my-key-aws-pair.pem -L <random port>:localhost:27017 ubuntu@ec2-11-111-111-111.compute-1.amazonaws.com\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `sshTunnel` | String | The desired SSH tunnel strategy. Possible values: `NONE`, `USER_PASSWORD`, `IDENTITY_FILE` | `undefined` |\n| `sshTunnelHostname` | String | The hostname of the SSH remote host | `undefined` |\n| `sshTunnelPort` | Port | The SSH port of the remote host | `22` |\n| `sshTunnelBindToLocalPort` | Port | Bind the localhost endpoint of the SSH Tunnel to this port | `undefined` |\n| `sshTunnelUsername` | String | The optional SSH username for the remote host | `undefined` |\n| `sshTunnelPassword` | String | The optional SSH password for the remote host | `undefined` |\n| `sshTunnelIdentityFile` | String/Array | The optional path to the SSH identity file for the remote host | `undefined` |\n| `sshTunnelPassphrase` | String | The optional passphrase for `sshTunnelIdentityFile` | `undefined` |\n\nDescription of `sshTunnel` values:\n\n- `NONE` - Do not use SSH tunneling.\n- `USER_PASSWORD` - The tunnel is created with SSH username and password only.\n- `IDENTITY_FILE` - The tunnel is created using an identity file.\n\n## Derived Properties\n\nDerived properties (also known as computed properties) are properties of the state object that depend on other properties to determine their value.\n\n```javascript\nconst c = new Connection();\nconst derivedProps = c.getAttributes({ derived: true });\n```\n\n| Derived Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `instanceId` | String | The mongoscope | `localhost:27017` |\n| `driverAuthMechanism` | String | Converts the value of `authStrategy` for humans into the `authMechanism` value for the driver | `undefined` |\n| `safeUrl` | String | The URL where a password is replaced with stars | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrl` | String | Use this URL in order to connect via DataService | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrlWithSsh` | String | Use this URL in order to connect via connection model itself | `mongodb://localhost:29201/?readPreference=primary&ssl=false` |\n| `driverOptions` | String | The second argument `mongoscope-server` passes to `mongodb.connect` | `{}` |\n\n## Events\n\n> New in mongodb-connection-model@5.0.0\n\n#### Example: SSH Tunnel\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', skipped: true,\n  reason: 'The selected SSL mode does not need to load any files.' }\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', complete: true}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n#### Example: SSL\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  ssl: 'ALL',\n  sslCA: '~/.ssl/my-ca.pem',\n  sslCert: '~/.ssl/my-server.pem',\n  sslKey: '~/.ssl/my-server.pem'\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', complete: true}\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', skipped: true,\n  reason: 'The selected SSH Tunnel mode is NONE.'}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n[workflow_img]: https://github.com/mongodb-js/connection-model/workflows/Check%20and%20Test/badge.svg?event=push\n[workflow_url]: https://github.com/mongodb-js/connection-model/actions?query=workflow%3A%22Check+and+Test%22\n[npm_img]: https://img.shields.io/npm/v/mongodb-connection-model.svg?style=flat-square\n[npm_url]: https://www.npmjs.org/package/mongodb-connection-model\n[gitter_img]: https://badges.gitter.im/Join%20Chat.svg\n[gitter_url]: http://gitter.im/mongodb-js/mongodb-js\n[enterprise_img]: https://img.shields.io/badge/MongoDB-Enterprise-blue.svg?style=flat-square\n[coming_soon_img]: https://img.shields.io/badge/-Coming%20Soon-ff69b4.svg?style=flat-square\n[kerberos-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/kerberos_tests.js\n[ldap-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ldap_tests.js\n[x509-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ssl_x509_tests.js\n[ns]: https://github.com/mongodb-js/ns\n[sf-ssh-tunnel]: http://serverfault.com/questions/597765/how-to-connect-to-mongodb-server-via-ssh-tunnel\n[ec2-key-pairs]: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html\n[driver-ssl-impl]: https://github.com/christkv/mongodb-core/blob/c3d21cb636d74d7a68134ecd3b9f6af536311279/lib/connection/connection.js#L365-L407\n[driver-ssl-tutorial]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/\n[driver-ssl-none]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#no-certificate-validation\n[driver-ssl-server]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate\n[driver-ssl-all]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate-and-present-valid-certificate\n","gitHead":"9ee9b0963df24390835a677f1a9081d9bc53ca2a","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","test":"mocha","check":"npm run lint && npm run depcheck","pretest":"mongodb-runner install && mongodb-runner start --port=27018","test-ci":"npm run test","depcheck":"depcheck","posttest":"mongodb-runner stop --port=27018","posttest-ci":"node ../../scripts/killall-mongo.js","test-check-ci":"npm run check && npm test"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.17.0+x64 (linux)","description":"MongoDB connection model.","directories":{},"_nodeVersion":"16.17.0","compass:main":"index.js","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","debug":"^4.2.0","lodash":"^4.17.15","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.2.0","storage-mixin":"0.0.0-next-9ee9b0963df24390835a677f1a9081d9bc53ca2a","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.2","@mongodb-js/ssh-tunnel":"0.0.0-next-9ee9b0963df24390835a677f1a9081d9bc53ca2a","@mongodb-js/compass-utils":"0.0.0-next-9ee9b0963df24390835a677f1a9081d9bc53ca2a","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.6.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"^4.10.0","depcheck":"^1.4.1","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.9.0","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^4.10.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_0.0.0-next-9ee9b0963df24390835a677f1a9081d9bc53ca2a_1669765193776_0.1598865650244381","host":"s3://npm-registry-packages"}},"0.0.0-next-98550b9ab2651e46658429899a0b7353249a18c0":{"name":"mongodb-connection-model","version":"0.0.0-next-98550b9ab2651e46658429899a0b7353249a18c0","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@0.0.0-next-98550b9ab2651e46658429899a0b7353249a18c0","maintainers":[{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"iteng@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"78d8dfae0515a950cf69294e5ae2dce1c742e3b5","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-0.0.0-next-98550b9ab2651e46658429899a0b7353249a18c0.tgz","fileCount":20,"integrity":"sha512-Vi8G9qTU5ksAfkVn+V0Zlh5Xxe4jirzbydQjqS1P/8vukV/ntVYCRDdRsan9++HsraW9hTFKA+65Nyj4RTMXfw==","signatures":[{"sig":"MEQCIDU+huB9ibOHSRbvRwu5lMRyKsHDSHgN8XRGqAfqSsiDAiA/Qsa6zE0Eq3NUj5R4TO06T2/egNQO58Egwe7i/N6/qQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":108151,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjiHgcACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmptuA/+L4f1wNPvieobnDc6uxO5ZRID1gzGLurk92hFLddgwT1YE/65\r\nNhjcOd3y2QIofRr6Idu4nEG6AXhoIGjxCFtzk71edOtSXKmm20M/TZEBE1nj\r\nC/bvwuK61CBZ+26Azh/3jMjnKbSAjA0fnb+26aeCVA5pWIdUKTs1hPhT7wVM\r\ne9InnKQ/MabS1H3R9Ao3nSnt2islS+et1BD0yZA87OawzlvDhkkDjZ1gHrjf\r\nPUR9ThSm285lC7Io2m0acwebC+31uqB8g4ht6ljrN4KAru12nSThXGpr1efr\r\nPkdz2/VAbtL6in9kGCbyE2C/DYMgo9JRKSCtQZO7b7qEaPimqMMO7HLqw4om\r\nxLxa03TZK0oTI9EMS5NP2QEK1EQQaHjsPDp6jW+q5M+qI5kqCALZ8lamktfA\r\ndrolHFDFxh4bTW/TiqzaMmK4FbmK+dOAP2SwQNRwjo3gFEz6rwcnJolPYY9D\r\nH25+tYX85pmjkv46BqBJARYePh1KSH1z5bqOlHXyDgg1/ogcjNwXBB28M7UA\r\nVpJBX6Mb7tcszZQ7ks+QJvZ8zQIg7nsM/wP7wA6D0QhWcswwZZeGAfH7s8vQ\r\nbSIiX4NlzSp17I7UTLhOR+cf6XyUUOWzjfK3LeebfpWGfXyJb29QW+waVPus\r\nbtuxPzp/yRbG98zLJu/DXif4WhpG8rwycys=\r\n=c4Ls\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","readme":"# mongodb-connection-model [![][workflow_img]][workflow_url] [![][npm_img]][npm_url]\n\n> MongoDB connection model\n\nThe main purpose of the MongoDB connection model is to be a domain model around a MongoDB connection. It encapsulates generating a [Connection String URI](https://docs.mongodb.com/manual/reference/connection-string/) from a group of attributes and parses URI using the [MongoDB Node.JS Driver URI Parser](https://github.com/mongodb-js/mongodb-core/blob/master/lib/uri_parser.js).\n\n## Installation\n\n```\nnpm install --save mongodb-connection-model\n```\n\n## Usage\n\n### Building URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\nconst c = new Connection({ appname: 'My App Name' });\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://localhost:27017/?readPreference=primary&appname=My%20App&ssl=false'\n```\n\n### Parsing URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\n\nConnection.from(\n  'mongodb://someUsername:testPassword@localhost',\n  (error, result) => {\n    console.log(result);\n    >>> `{\n      hosts: [{ host: 'localhost', port: 27017 }],\n      hostname: 'localhost',\n      port: 27017,\n      auth: {\n        username: 'someUsername',\n        password: 'testPassword',\n        db: 'admin'\n      },\n      isSrvRecord: false,\n      authStrategy: 'MONGODB',\n      mongodbUsername: 'someUsername',\n      mongodbPassword: 'testPassword',\n      mongodbDatabaseName: 'admin',\n      extraOptions: {},\n      connectionType: 'NODE_DRIVER',\n      readPreference: 'primary',\n      kerberosCanonicalizeHostname: false,\n      sslMethod: 'NONE',\n      sshTunnel: 'NONE',\n      sshTunnelPort: 22\n    }`\n  }\n);\n```\n\n## Properties\n\nMongoDB connection model is based on Ampersand.js framework and consist of [props](https://ampersandjs.com/docs/#ampersand-state-props) and [derived props](https://ampersandjs.com/docs/#ampersand-state-derived). The props object describes the observable properties that MongoDB connection model gets from the Node.js Driver API.\n\n```javascript\nconst с = new Connection();\nconst props = с.getAttributes({ props: true });\n```\n\n#### See Also\n\n- [URI Generic Syntax](https://tools.ietf.org/html/rfc3986)\n- [URI Options Specification](https://github.com/mongodb/specifications/blob/master/source/uri-options/uri-options.rst)\n\n### General Properties\n\n```javascript\nconst c = new Connection({ isSrvRecord: true });\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ns` | String | A valid [ns][ns] the user can read from | `undefined` |\n| `isSrvRecord` | Boolean | Indicates SRV record | `false` |\n| `auth` | Object | Authentication from driver (username, user, db, password) | `undefined` |\n| `hostname` | String | Hostname of a MongoDB Instance. In case of the replica set the first host and port will be taken | `localhost` |\n| `port` | Number | TCP port of a MongoDB Instance | `27017` |\n| `hosts` | Array | Contains all hosts and ports for replica set | `[{ host: 'localhost', port: 27017 }]` |\n| `extraOptions` | Object | Extra options passed to the node driver as part of `driverOptions` | `{}` |\n| `connectionType` | String | The desired connection type. Possible values: `NODE_DRIVER`, `STITCH_ON_PREM`, `STITCH_ATLAS` | `NODE_DRIVER` |\n| `authStrategy` | String | The desired authentication strategy. Possible values: `NONE`, `MONGODB`, `X509`, `KERBEROS`, `LDAP`, `SCRAM-SHA-256` | `NONE` |\n\n### Connection string options\n\n```javascript\nconst c = new Connection({ appname: 'My App', replicaSet: 'testing' });\n```\n\n#### General connection string options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `replicaSet` | String | Specifies the name of the replica set, if the mongod is a member of a replica set | `undefined` |\n| `connectTimeoutMS` | Number | The time in milliseconds to attempt a connection before timing out | `undefined` |\n| `socketTimeoutMS` | Number | The time in milliseconds to attempt a send or receive on a socket before the attempt times out | `undefined` |\n| `compression` | Object | Object includes compressors and a compression level. The following compressors can be specified: `snappy`, `zlib` (Available in MongoDB 3.6 or greater) | `undefined` |\n\n#### Connection Pool Option\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `maxPoolSize` | Number | The maximum number of connections in the connection pool | `undefined` |\n| `minPoolSize` | Number | The minimum number of connections in the connection pool | `undefined` |\n| `maxIdleTimeMS` | Number | The maximum number of milliseconds that a connection can remain idle in the pool before being removed and closed | `undefined` |\n| `waitQueueMultiple` | Number | A number that the driver multiples the maxPoolSize value to, to provide the maximum number of threads allowed to wait for a connection to become available from the pool | `undefined` |\n| `waitQueueTimeoutMS` | Number | The maximum time in milliseconds that a thread can wait for a connection to become available | `undefined` |\n\n#### Write Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `w` | Number/String | Corresponds to the write concern [w Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-w) | `undefined` |\n| `wTimeoutMS` | Number | Corresponds to the write concern [wtimeout](https://docs.mongodb.com/manual/reference/write-concern/#wc-wtimeout) | `undefined` |\n| `journal` | Boolean | Corresponds to the write concern [j Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-j) | `undefined` |\n\n#### Read Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readConcernLevel` | String | The level of isolation | `undefined` |\n\n#### Read Preference Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readPreference` | String | Specifies the read preferences for this connection. Possible values: `PRIMARY`, `PRIMARY_PREFERRED`, `SECONDARY`, `SECONDARY_PREFERRED`, `NEAREST` | `PRIMARY` |\n| `maxStalenessSeconds` | Number | Specifies, in seconds, how stale a secondary can be before the client stops using it for read operations | `undefined` |\n| `readPreferenceTags` | Object | Default read preference tags for the client | `undefined` |\n\n#### Authentication Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `authSource` | String | Specify the database name associated with the user’s credentials | `undefined` |\n| `authMechanism` | String | Specifies the authentication mechanism that MongoDB will use to authenticate the connection. Possible values: `DEFAULT`, `GSSAPI`, `MONGODB-X509`, `PLAIN`, `SCRAM-SHA-256` | `undefined` |\n| `authMechanismProperties` | Object | Additional options provided for authentication (e.g. to enable hostname canonicalization for GSSAPI) | `undefined` |\n| `gssapiServiceName` | String | Set the Kerberos service name when connecting to Kerberized MongoDB instances | `undefined` |\n| `gssapiServiceRealm` | String | Set the Realm service name | `undefined` |\n| `gssapiCanonicalizeHostName` | Boolean | Whether canonicalized hostname | `undefined` |\n\n#### Server Selection and Discovery Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `localThresholdMS` | Number | The size (in milliseconds) of the latency window for selecting among multiple suitable MongoDB instances | `undefined` |\n| `serverSelectionTimeoutMS` | Number | Specifies how long (in milliseconds) to block for server selection before throwing an exception | `undefined` |\n| `serverSelectionTryOnce` | Boolean | Instructs the driver to scan the MongoDB deployment exactly once after server selection fails and then either select a server or raise an error | `undefined` |\n| `heartbeatFrequencyMS` | Number | Controls when the driver checks the state of the MongoDB deployment | `undefined` |\n\n#### Miscellaneous Configuration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `appname` | String | An application name passed to server as client metadata | `undefined` |\n| `retryWrites` | Boolean | Enable retryable writes | `undefined` |\n| `uuidRepresentation` | String | The legacy representation of UUID. Possible values: `standard`, `csharpLegacy`, `javaLegacy`, `pythonLegacy` | `undefined` |\n| `loadBalanced` | Boolean | Whether or not the server is running in load balanced mode | `undefined` |\n\n### Stitch attributes\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `stitchServiceName` | String | Stitch service name | `undefined` |\n| `stitchClientAppId` | String | Stitch сlient app ID | `undefined` |\n| `stitchGroupId` | String | Stitch group ID | `undefined` |\n| `stitchBaseUrl` | String | Stitch base Url | `undefined` |\n\n### MONGODB authentication\n\n```javascript\nconst c = new Connection({\n  mongodbUsername: 'arlo',\n  mongodbPassword: 'w@of'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/?slaveOk=true&authSource=admin'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `mongodbUsername` | String | MongoDB username | `undefined` |\n| `mongodbPassword` | String | MongoDB password | `undefined` |\n| `mongodbDatabaseName` | String | The database name associated with the user's credentials | `undefined` |\n| `promoteValues` | Boolean | Whether BSON values should be promoted to their JS type counterparts | `undefined` |\n\n### KERBEROS authentication\n\n```javascript\nconst c = new Connection({\n  kerberosServiceName: 'mongodb',\n  kerberosPrincipal: 'arlo/dog@krb5.mongodb.parts',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo%252Fdog%2540krb5.mongodb.parts@localhost:27017/toys?authMechanism=GSSAPI'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n> @note (imlucas): Kerberos on Windows is broken out as it's own state for UX consideration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `kerberosServiceName` | String | Any program or computer you access over a network | `undefined` |\n| `kerberosPrincipal` | String | The format of a typical Kerberos V5 principal is `primary/instance@REALM` | `undefined` |\n| `kerberosCanonicalizeHostname` | Boolean | Whether canonicalized kerberos hostname | `undefined` |\n\n#### See Also\n\n- [node.js driver Kerberos reference](http://bit.ly/mongodb-node-driver-kerberos)\n- [node.js driver Kerberos functional test][kerberos-functional]\n\n### LDAP authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  ldapUsername: 'arlo',\n  ldapPassword: 'w@of',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/toys?slaveOk=true&authMechanism=PLAIN'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ldapUsername` | String | LDAP username | `undefined` |\n| `ldapPassword` | String | LDAP password | `undefined` |\n\n#### See Also\n\n- [node.js driver LDAP reference](http://bit.ly/mongodb-node-driver-ldap)\n- [node.js driver X509 functional test][ldap-functional]\n\n### X509 authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  x509Username: 'CN=client,OU=arlo,O=MongoDB,L=Philadelphia,ST=Pennsylvania,C=US'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://CN%253Dclient%252COU%253Darlo%252CO%253DMongoDB%252CL%253DPhiladelphia%252CST%253DPennsylvania%252CC%253DUS@localhost:27017?slaveOk=true&authMechanism=MONGODB-X509'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `x509Username` | String | The x.509 certificate derived user name, e.g. `CN=user,OU=OrgUnit,O=myOrg,...` | `undefined` |\n\n#### See Also\n\n- [node.js driver X509 reference](http://bit.ly/mongodb-node-driver-x509)\n- [node.js driver X509 functional test][x509-functional]\n\n### SSL\n\n> **Note**: Not to be confused with `authentication=X509`\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ssl` | Number/String | A boolean to enable or disables TLS/SSL for the connection | `undefined` |\n| `sslMethod` | String | The desired ssl method. Possible values: `NONE`, `SYSTEMCA`, `IFAVAILABLE`, `UNVALIDATED`, `SERVER`, `ALL` | `NONE` |\n| `sslCA` | Buffer/String | Array of valid certificates | `undefined` |\n| `sslCert` | Buffer/String | The certificate | `undefined` |\n| `sslKey` | Buffer/String | The certificate private key | `undefined` |\n| `sslPass` | Buffer/String | The certificate password | `undefined` |\n\nDescription of `sslMethod` values:\n\n- `SYSTEMCA` - SSL required, validate using System CA, with host verification.\n- `IFAVAILABLE` - The driver should try SSL first, fall back to no SSL if unavailable, and use the system's Certificate Authority.\n- `SERVER` - The driver should validate the server certificate and fail to connect if validation fails. See also [node.js driver \"Validate Server Certificate\" docs][driver-ssl-server].\n- `ALL` - The driver must present a valid certificate and validate the server certificate. See also [node.js driver \"Validate Server Certificate and Present Valid Certificate\" docs][driver-ssl-all].\n- `NONE` - No SSL (Not recommended).\n- `UNVALIDATED` - Use SSL but do not perform any validation of the certificate chain. See also [node.js driver \"No Certificate Validation\" docs][driver-ssl-none]. **Very** not recommended and likely to be deprecated in future releases because it exposes potential Man-In-The-Middle attack vectors.\n\n#### See also\n\n- [node.js driver SSL implementation][driver-ssl-impl]\n- [node.js driver SSL tutorial][driver-ssl-tutorial]\n\n### SSH TUNNEL\n\n> New in mongodb-connection-model@5.0.0\n\nBecause [authentication](#authentication) is quite difficult for operators to migrate to, the most common method of securing a MongoDB deployment is to use an [SSH tunnel][sf-ssh-tunnel].  This allows operators to leverage their existing SSH security infrastructure to also provide secure access to MongoDB.  For a standard deployment of MongoDB on AWS, this is almost always to strategy.  Because of this, we now support creating SSH tunnels automatically when connecting to MongoDB.\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options, (connectionError, client) => {\n  if (connectionError) {\n    return console.log(connectionError);\n  }\n\n  client.db('mongodb').collection('fanclub').count((countingError, count) => {\n    console.log('counted:', countingError, count);\n    client.close();\n  });\n});\n```\n\nThe above provides the same functionality as creating the tunnel using the bash\ncommand below and connecting to MongoDB via another terminal. Notice that\nconnection-model uses a random local port each time it creates a tunnel.\nUsing the command line, you'd have to replace `<random port>` with an actual\nport number.\n\n```bash\nssh -i ~/.ssh/my-key-aws-pair.pem -L <random port>:localhost:27017 ubuntu@ec2-11-111-111-111.compute-1.amazonaws.com\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `sshTunnel` | String | The desired SSH tunnel strategy. Possible values: `NONE`, `USER_PASSWORD`, `IDENTITY_FILE` | `undefined` |\n| `sshTunnelHostname` | String | The hostname of the SSH remote host | `undefined` |\n| `sshTunnelPort` | Port | The SSH port of the remote host | `22` |\n| `sshTunnelBindToLocalPort` | Port | Bind the localhost endpoint of the SSH Tunnel to this port | `undefined` |\n| `sshTunnelUsername` | String | The optional SSH username for the remote host | `undefined` |\n| `sshTunnelPassword` | String | The optional SSH password for the remote host | `undefined` |\n| `sshTunnelIdentityFile` | String/Array | The optional path to the SSH identity file for the remote host | `undefined` |\n| `sshTunnelPassphrase` | String | The optional passphrase for `sshTunnelIdentityFile` | `undefined` |\n\nDescription of `sshTunnel` values:\n\n- `NONE` - Do not use SSH tunneling.\n- `USER_PASSWORD` - The tunnel is created with SSH username and password only.\n- `IDENTITY_FILE` - The tunnel is created using an identity file.\n\n## Derived Properties\n\nDerived properties (also known as computed properties) are properties of the state object that depend on other properties to determine their value.\n\n```javascript\nconst c = new Connection();\nconst derivedProps = c.getAttributes({ derived: true });\n```\n\n| Derived Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `instanceId` | String | The mongoscope | `localhost:27017` |\n| `driverAuthMechanism` | String | Converts the value of `authStrategy` for humans into the `authMechanism` value for the driver | `undefined` |\n| `safeUrl` | String | The URL where a password is replaced with stars | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrl` | String | Use this URL in order to connect via DataService | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrlWithSsh` | String | Use this URL in order to connect via connection model itself | `mongodb://localhost:29201/?readPreference=primary&ssl=false` |\n| `driverOptions` | String | The second argument `mongoscope-server` passes to `mongodb.connect` | `{}` |\n\n## Events\n\n> New in mongodb-connection-model@5.0.0\n\n#### Example: SSH Tunnel\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', skipped: true,\n  reason: 'The selected SSL mode does not need to load any files.' }\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', complete: true}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n#### Example: SSL\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  ssl: 'ALL',\n  sslCA: '~/.ssl/my-ca.pem',\n  sslCert: '~/.ssl/my-server.pem',\n  sslKey: '~/.ssl/my-server.pem'\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', complete: true}\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', skipped: true,\n  reason: 'The selected SSH Tunnel mode is NONE.'}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n[workflow_img]: https://github.com/mongodb-js/connection-model/workflows/Check%20and%20Test/badge.svg?event=push\n[workflow_url]: https://github.com/mongodb-js/connection-model/actions?query=workflow%3A%22Check+and+Test%22\n[npm_img]: https://img.shields.io/npm/v/mongodb-connection-model.svg?style=flat-square\n[npm_url]: https://www.npmjs.org/package/mongodb-connection-model\n[gitter_img]: https://badges.gitter.im/Join%20Chat.svg\n[gitter_url]: http://gitter.im/mongodb-js/mongodb-js\n[enterprise_img]: https://img.shields.io/badge/MongoDB-Enterprise-blue.svg?style=flat-square\n[coming_soon_img]: https://img.shields.io/badge/-Coming%20Soon-ff69b4.svg?style=flat-square\n[kerberos-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/kerberos_tests.js\n[ldap-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ldap_tests.js\n[x509-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ssl_x509_tests.js\n[ns]: https://github.com/mongodb-js/ns\n[sf-ssh-tunnel]: http://serverfault.com/questions/597765/how-to-connect-to-mongodb-server-via-ssh-tunnel\n[ec2-key-pairs]: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html\n[driver-ssl-impl]: https://github.com/christkv/mongodb-core/blob/c3d21cb636d74d7a68134ecd3b9f6af536311279/lib/connection/connection.js#L365-L407\n[driver-ssl-tutorial]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/\n[driver-ssl-none]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#no-certificate-validation\n[driver-ssl-server]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate\n[driver-ssl-all]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate-and-present-valid-certificate\n","gitHead":"98550b9ab2651e46658429899a0b7353249a18c0","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","test":"mocha","check":"npm run lint && npm run depcheck","pretest":"mongodb-runner install && mongodb-runner start --port=27018","test-ci":"npm run test","depcheck":"depcheck","posttest":"mongodb-runner stop --port=27018","posttest-ci":"node ../../scripts/killall-mongo.js","test-check-ci":"npm run check && npm test"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.17.0+x64 (linux)","description":"MongoDB connection model","directories":{},"_nodeVersion":"16.17.0","compass:main":"index.js","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","debug":"^4.2.0","lodash":"^4.17.15","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.2.0","storage-mixin":"0.0.0-next-98550b9ab2651e46658429899a0b7353249a18c0","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.2","@mongodb-js/ssh-tunnel":"0.0.0-next-98550b9ab2651e46658429899a0b7353249a18c0","@mongodb-js/compass-utils":"0.0.0-next-98550b9ab2651e46658429899a0b7353249a18c0","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.6.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"^4.10.0","depcheck":"^1.4.1","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.9.0","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^4.10.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_0.0.0-next-98550b9ab2651e46658429899a0b7353249a18c0_1669888028057_0.5934778646033716","host":"s3://npm-registry-packages"}},"0.0.0-next-6a5d526328ecfce1da82bf064daeb19f1c2bf6a5":{"name":"mongodb-connection-model","version":"0.0.0-next-6a5d526328ecfce1da82bf064daeb19f1c2bf6a5","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@0.0.0-next-6a5d526328ecfce1da82bf064daeb19f1c2bf6a5","maintainers":[{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"iteng@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"caf758d3860d5701b4604b348d45a1cef716b6b4","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-0.0.0-next-6a5d526328ecfce1da82bf064daeb19f1c2bf6a5.tgz","fileCount":20,"integrity":"sha512-EhaJABgJAr718uaJEjZlwjp/sbIT8dOWONTO3/0uorknLzW3Xi7tO93iBxHcCiw5JrF2x0UQozOeEVx8JcNPGA==","signatures":[{"sig":"MEQCIAh+S/dlXNaI+CDhyMxC6J6SXRB9cAxgNqMsclevZ7zoAiAO4Xs6GaTlase19t0luLv4CnxjL/wM7Y5cnMmxWcFdXQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":108151,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjjR/IACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpiaQ/9GVIOqOj9uqZhvl0/KmyXmUkbk6DU27IvrnmPHbR2Db7qAwI1\r\nmNYqT+IsWmCqpUFe/NoCOpf6b5jpwFatfBBCcd/DVl/njUdXHs1i9hCNIq0k\r\nkVXwMnyDXR8fPkRWfTlfiUpdL2CuU3J8hkrMVD3Cj3n62RB30E6OOpk7S1Cf\r\nl8pR8jGcfXZW2pDM4sw5j7ClkZsgZLIulBz5oQ7rFF80vG5ia5k3GP0rFRVL\r\nsDqx03X80X3ZrDdeZnh3I1vSXEMpIXre+3bSvEiNTGuR7llNnDKjOl0sSXqZ\r\nbh6y9PtnRI1e5Mnll17Av8FH75C7LTcMXBz0+hxwg3fZPOOmUsjkBURoeNwZ\r\nrtSB13/hB/IDcUVF7JNYSkr3HRYW075jBi+vn4h38HlMJaFoy+gXAgm24AnZ\r\nkOG9SBaxYD5vAfilkbOq6un+Tpkr09Xj6OvNw0Ms7RbA7wWObgZ3Aq2UdREe\r\nBLI2RzmA2kRbKw/GqbeqYZD68vONKYl/rrziTbWD2+uevkAHl6UngkNLn+Q0\r\n6xjiT3aB6QTHQCrCr9UaQndPw8ztoQw/i1VGBdHyVMG6CwBqhQO4EUoCb4Ee\r\nMoQr62vs9VjBuDiU50OxOubwhQAVs7KCYo5NGbWeGH8Y/GZmX/ex6gjOSOux\r\nVQDOJRYtdSTNHinvhu/bHuBPu4Sf+Lzi1m4=\r\n=Lito\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","readme":"# mongodb-connection-model [![][workflow_img]][workflow_url] [![][npm_img]][npm_url]\n\n> MongoDB connection model\n\nThe main purpose of the MongoDB connection model is to be a domain model around a MongoDB connection. It encapsulates generating a [Connection String URI](https://docs.mongodb.com/manual/reference/connection-string/) from a group of attributes and parses URI using the [MongoDB Node.JS Driver URI Parser](https://github.com/mongodb-js/mongodb-core/blob/master/lib/uri_parser.js).\n\n## Installation\n\n```\nnpm install --save mongodb-connection-model\n```\n\n## Usage\n\n### Building URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\nconst c = new Connection({ appname: 'My App Name' });\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://localhost:27017/?readPreference=primary&appname=My%20App&ssl=false'\n```\n\n### Parsing URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\n\nConnection.from(\n  'mongodb://someUsername:testPassword@localhost',\n  (error, result) => {\n    console.log(result);\n    >>> `{\n      hosts: [{ host: 'localhost', port: 27017 }],\n      hostname: 'localhost',\n      port: 27017,\n      auth: {\n        username: 'someUsername',\n        password: 'testPassword',\n        db: 'admin'\n      },\n      isSrvRecord: false,\n      authStrategy: 'MONGODB',\n      mongodbUsername: 'someUsername',\n      mongodbPassword: 'testPassword',\n      mongodbDatabaseName: 'admin',\n      extraOptions: {},\n      connectionType: 'NODE_DRIVER',\n      readPreference: 'primary',\n      kerberosCanonicalizeHostname: false,\n      sslMethod: 'NONE',\n      sshTunnel: 'NONE',\n      sshTunnelPort: 22\n    }`\n  }\n);\n```\n\n## Properties\n\nMongoDB connection model is based on Ampersand.js framework and consist of [props](https://ampersandjs.com/docs/#ampersand-state-props) and [derived props](https://ampersandjs.com/docs/#ampersand-state-derived). The props object describes the observable properties that MongoDB connection model gets from the Node.js Driver API.\n\n```javascript\nconst с = new Connection();\nconst props = с.getAttributes({ props: true });\n```\n\n#### See Also\n\n- [URI Generic Syntax](https://tools.ietf.org/html/rfc3986)\n- [URI Options Specification](https://github.com/mongodb/specifications/blob/master/source/uri-options/uri-options.rst)\n\n### General Properties\n\n```javascript\nconst c = new Connection({ isSrvRecord: true });\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ns` | String | A valid [ns][ns] the user can read from | `undefined` |\n| `isSrvRecord` | Boolean | Indicates SRV record | `false` |\n| `auth` | Object | Authentication from driver (username, user, db, password) | `undefined` |\n| `hostname` | String | Hostname of a MongoDB Instance. In case of the replica set the first host and port will be taken | `localhost` |\n| `port` | Number | TCP port of a MongoDB Instance | `27017` |\n| `hosts` | Array | Contains all hosts and ports for replica set | `[{ host: 'localhost', port: 27017 }]` |\n| `extraOptions` | Object | Extra options passed to the node driver as part of `driverOptions` | `{}` |\n| `connectionType` | String | The desired connection type. Possible values: `NODE_DRIVER`, `STITCH_ON_PREM`, `STITCH_ATLAS` | `NODE_DRIVER` |\n| `authStrategy` | String | The desired authentication strategy. Possible values: `NONE`, `MONGODB`, `X509`, `KERBEROS`, `LDAP`, `SCRAM-SHA-256` | `NONE` |\n\n### Connection string options\n\n```javascript\nconst c = new Connection({ appname: 'My App', replicaSet: 'testing' });\n```\n\n#### General connection string options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `replicaSet` | String | Specifies the name of the replica set, if the mongod is a member of a replica set | `undefined` |\n| `connectTimeoutMS` | Number | The time in milliseconds to attempt a connection before timing out | `undefined` |\n| `socketTimeoutMS` | Number | The time in milliseconds to attempt a send or receive on a socket before the attempt times out | `undefined` |\n| `compression` | Object | Object includes compressors and a compression level. The following compressors can be specified: `snappy`, `zlib` (Available in MongoDB 3.6 or greater) | `undefined` |\n\n#### Connection Pool Option\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `maxPoolSize` | Number | The maximum number of connections in the connection pool | `undefined` |\n| `minPoolSize` | Number | The minimum number of connections in the connection pool | `undefined` |\n| `maxIdleTimeMS` | Number | The maximum number of milliseconds that a connection can remain idle in the pool before being removed and closed | `undefined` |\n| `waitQueueMultiple` | Number | A number that the driver multiples the maxPoolSize value to, to provide the maximum number of threads allowed to wait for a connection to become available from the pool | `undefined` |\n| `waitQueueTimeoutMS` | Number | The maximum time in milliseconds that a thread can wait for a connection to become available | `undefined` |\n\n#### Write Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `w` | Number/String | Corresponds to the write concern [w Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-w) | `undefined` |\n| `wTimeoutMS` | Number | Corresponds to the write concern [wtimeout](https://docs.mongodb.com/manual/reference/write-concern/#wc-wtimeout) | `undefined` |\n| `journal` | Boolean | Corresponds to the write concern [j Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-j) | `undefined` |\n\n#### Read Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readConcernLevel` | String | The level of isolation | `undefined` |\n\n#### Read Preference Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readPreference` | String | Specifies the read preferences for this connection. Possible values: `PRIMARY`, `PRIMARY_PREFERRED`, `SECONDARY`, `SECONDARY_PREFERRED`, `NEAREST` | `PRIMARY` |\n| `maxStalenessSeconds` | Number | Specifies, in seconds, how stale a secondary can be before the client stops using it for read operations | `undefined` |\n| `readPreferenceTags` | Object | Default read preference tags for the client | `undefined` |\n\n#### Authentication Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `authSource` | String | Specify the database name associated with the user’s credentials | `undefined` |\n| `authMechanism` | String | Specifies the authentication mechanism that MongoDB will use to authenticate the connection. Possible values: `DEFAULT`, `GSSAPI`, `MONGODB-X509`, `PLAIN`, `SCRAM-SHA-256` | `undefined` |\n| `authMechanismProperties` | Object | Additional options provided for authentication (e.g. to enable hostname canonicalization for GSSAPI) | `undefined` |\n| `gssapiServiceName` | String | Set the Kerberos service name when connecting to Kerberized MongoDB instances | `undefined` |\n| `gssapiServiceRealm` | String | Set the Realm service name | `undefined` |\n| `gssapiCanonicalizeHostName` | Boolean | Whether canonicalized hostname | `undefined` |\n\n#### Server Selection and Discovery Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `localThresholdMS` | Number | The size (in milliseconds) of the latency window for selecting among multiple suitable MongoDB instances | `undefined` |\n| `serverSelectionTimeoutMS` | Number | Specifies how long (in milliseconds) to block for server selection before throwing an exception | `undefined` |\n| `serverSelectionTryOnce` | Boolean | Instructs the driver to scan the MongoDB deployment exactly once after server selection fails and then either select a server or raise an error | `undefined` |\n| `heartbeatFrequencyMS` | Number | Controls when the driver checks the state of the MongoDB deployment | `undefined` |\n\n#### Miscellaneous Configuration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `appname` | String | An application name passed to server as client metadata | `undefined` |\n| `retryWrites` | Boolean | Enable retryable writes | `undefined` |\n| `uuidRepresentation` | String | The legacy representation of UUID. Possible values: `standard`, `csharpLegacy`, `javaLegacy`, `pythonLegacy` | `undefined` |\n| `loadBalanced` | Boolean | Whether or not the server is running in load balanced mode | `undefined` |\n\n### Stitch attributes\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `stitchServiceName` | String | Stitch service name | `undefined` |\n| `stitchClientAppId` | String | Stitch сlient app ID | `undefined` |\n| `stitchGroupId` | String | Stitch group ID | `undefined` |\n| `stitchBaseUrl` | String | Stitch base Url | `undefined` |\n\n### MONGODB authentication\n\n```javascript\nconst c = new Connection({\n  mongodbUsername: 'arlo',\n  mongodbPassword: 'w@of'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/?slaveOk=true&authSource=admin'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `mongodbUsername` | String | MongoDB username | `undefined` |\n| `mongodbPassword` | String | MongoDB password | `undefined` |\n| `mongodbDatabaseName` | String | The database name associated with the user's credentials | `undefined` |\n| `promoteValues` | Boolean | Whether BSON values should be promoted to their JS type counterparts | `undefined` |\n\n### KERBEROS authentication\n\n```javascript\nconst c = new Connection({\n  kerberosServiceName: 'mongodb',\n  kerberosPrincipal: 'arlo/dog@krb5.mongodb.parts',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo%252Fdog%2540krb5.mongodb.parts@localhost:27017/toys?authMechanism=GSSAPI'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n> @note (imlucas): Kerberos on Windows is broken out as it's own state for UX consideration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `kerberosServiceName` | String | Any program or computer you access over a network | `undefined` |\n| `kerberosPrincipal` | String | The format of a typical Kerberos V5 principal is `primary/instance@REALM` | `undefined` |\n| `kerberosCanonicalizeHostname` | Boolean | Whether canonicalized kerberos hostname | `undefined` |\n\n#### See Also\n\n- [node.js driver Kerberos reference](http://bit.ly/mongodb-node-driver-kerberos)\n- [node.js driver Kerberos functional test][kerberos-functional]\n\n### LDAP authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  ldapUsername: 'arlo',\n  ldapPassword: 'w@of',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/toys?slaveOk=true&authMechanism=PLAIN'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ldapUsername` | String | LDAP username | `undefined` |\n| `ldapPassword` | String | LDAP password | `undefined` |\n\n#### See Also\n\n- [node.js driver LDAP reference](http://bit.ly/mongodb-node-driver-ldap)\n- [node.js driver X509 functional test][ldap-functional]\n\n### X509 authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  x509Username: 'CN=client,OU=arlo,O=MongoDB,L=Philadelphia,ST=Pennsylvania,C=US'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://CN%253Dclient%252COU%253Darlo%252CO%253DMongoDB%252CL%253DPhiladelphia%252CST%253DPennsylvania%252CC%253DUS@localhost:27017?slaveOk=true&authMechanism=MONGODB-X509'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `x509Username` | String | The x.509 certificate derived user name, e.g. `CN=user,OU=OrgUnit,O=myOrg,...` | `undefined` |\n\n#### See Also\n\n- [node.js driver X509 reference](http://bit.ly/mongodb-node-driver-x509)\n- [node.js driver X509 functional test][x509-functional]\n\n### SSL\n\n> **Note**: Not to be confused with `authentication=X509`\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ssl` | Number/String | A boolean to enable or disables TLS/SSL for the connection | `undefined` |\n| `sslMethod` | String | The desired ssl method. Possible values: `NONE`, `SYSTEMCA`, `IFAVAILABLE`, `UNVALIDATED`, `SERVER`, `ALL` | `NONE` |\n| `sslCA` | Buffer/String | Array of valid certificates | `undefined` |\n| `sslCert` | Buffer/String | The certificate | `undefined` |\n| `sslKey` | Buffer/String | The certificate private key | `undefined` |\n| `sslPass` | Buffer/String | The certificate password | `undefined` |\n\nDescription of `sslMethod` values:\n\n- `SYSTEMCA` - SSL required, validate using System CA, with host verification.\n- `IFAVAILABLE` - The driver should try SSL first, fall back to no SSL if unavailable, and use the system's Certificate Authority.\n- `SERVER` - The driver should validate the server certificate and fail to connect if validation fails. See also [node.js driver \"Validate Server Certificate\" docs][driver-ssl-server].\n- `ALL` - The driver must present a valid certificate and validate the server certificate. See also [node.js driver \"Validate Server Certificate and Present Valid Certificate\" docs][driver-ssl-all].\n- `NONE` - No SSL (Not recommended).\n- `UNVALIDATED` - Use SSL but do not perform any validation of the certificate chain. See also [node.js driver \"No Certificate Validation\" docs][driver-ssl-none]. **Very** not recommended and likely to be deprecated in future releases because it exposes potential Man-In-The-Middle attack vectors.\n\n#### See also\n\n- [node.js driver SSL implementation][driver-ssl-impl]\n- [node.js driver SSL tutorial][driver-ssl-tutorial]\n\n### SSH TUNNEL\n\n> New in mongodb-connection-model@5.0.0\n\nBecause [authentication](#authentication) is quite difficult for operators to migrate to, the most common method of securing a MongoDB deployment is to use an [SSH tunnel][sf-ssh-tunnel].  This allows operators to leverage their existing SSH security infrastructure to also provide secure access to MongoDB.  For a standard deployment of MongoDB on AWS, this is almost always to strategy.  Because of this, we now support creating SSH tunnels automatically when connecting to MongoDB.\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options, (connectionError, client) => {\n  if (connectionError) {\n    return console.log(connectionError);\n  }\n\n  client.db('mongodb').collection('fanclub').count((countingError, count) => {\n    console.log('counted:', countingError, count);\n    client.close();\n  });\n});\n```\n\nThe above provides the same functionality as creating the tunnel using the bash\ncommand below and connecting to MongoDB via another terminal. Notice that\nconnection-model uses a random local port each time it creates a tunnel.\nUsing the command line, you'd have to replace `<random port>` with an actual\nport number.\n\n```bash\nssh -i ~/.ssh/my-key-aws-pair.pem -L <random port>:localhost:27017 ubuntu@ec2-11-111-111-111.compute-1.amazonaws.com\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `sshTunnel` | String | The desired SSH tunnel strategy. Possible values: `NONE`, `USER_PASSWORD`, `IDENTITY_FILE` | `undefined` |\n| `sshTunnelHostname` | String | The hostname of the SSH remote host | `undefined` |\n| `sshTunnelPort` | Port | The SSH port of the remote host | `22` |\n| `sshTunnelBindToLocalPort` | Port | Bind the localhost endpoint of the SSH Tunnel to this port | `undefined` |\n| `sshTunnelUsername` | String | The optional SSH username for the remote host | `undefined` |\n| `sshTunnelPassword` | String | The optional SSH password for the remote host | `undefined` |\n| `sshTunnelIdentityFile` | String/Array | The optional path to the SSH identity file for the remote host | `undefined` |\n| `sshTunnelPassphrase` | String | The optional passphrase for `sshTunnelIdentityFile` | `undefined` |\n\nDescription of `sshTunnel` values:\n\n- `NONE` - Do not use SSH tunneling.\n- `USER_PASSWORD` - The tunnel is created with SSH username and password only.\n- `IDENTITY_FILE` - The tunnel is created using an identity file.\n\n## Derived Properties\n\nDerived properties (also known as computed properties) are properties of the state object that depend on other properties to determine their value.\n\n```javascript\nconst c = new Connection();\nconst derivedProps = c.getAttributes({ derived: true });\n```\n\n| Derived Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `instanceId` | String | The mongoscope | `localhost:27017` |\n| `driverAuthMechanism` | String | Converts the value of `authStrategy` for humans into the `authMechanism` value for the driver | `undefined` |\n| `safeUrl` | String | The URL where a password is replaced with stars | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrl` | String | Use this URL in order to connect via DataService | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrlWithSsh` | String | Use this URL in order to connect via connection model itself | `mongodb://localhost:29201/?readPreference=primary&ssl=false` |\n| `driverOptions` | String | The second argument `mongoscope-server` passes to `mongodb.connect` | `{}` |\n\n## Events\n\n> New in mongodb-connection-model@5.0.0\n\n#### Example: SSH Tunnel\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', skipped: true,\n  reason: 'The selected SSL mode does not need to load any files.' }\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', complete: true}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n#### Example: SSL\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  ssl: 'ALL',\n  sslCA: '~/.ssl/my-ca.pem',\n  sslCert: '~/.ssl/my-server.pem',\n  sslKey: '~/.ssl/my-server.pem'\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', complete: true}\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', skipped: true,\n  reason: 'The selected SSH Tunnel mode is NONE.'}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n[workflow_img]: https://github.com/mongodb-js/connection-model/workflows/Check%20and%20Test/badge.svg?event=push\n[workflow_url]: https://github.com/mongodb-js/connection-model/actions?query=workflow%3A%22Check+and+Test%22\n[npm_img]: https://img.shields.io/npm/v/mongodb-connection-model.svg?style=flat-square\n[npm_url]: https://www.npmjs.org/package/mongodb-connection-model\n[gitter_img]: https://badges.gitter.im/Join%20Chat.svg\n[gitter_url]: http://gitter.im/mongodb-js/mongodb-js\n[enterprise_img]: https://img.shields.io/badge/MongoDB-Enterprise-blue.svg?style=flat-square\n[coming_soon_img]: https://img.shields.io/badge/-Coming%20Soon-ff69b4.svg?style=flat-square\n[kerberos-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/kerberos_tests.js\n[ldap-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ldap_tests.js\n[x509-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ssl_x509_tests.js\n[ns]: https://github.com/mongodb-js/ns\n[sf-ssh-tunnel]: http://serverfault.com/questions/597765/how-to-connect-to-mongodb-server-via-ssh-tunnel\n[ec2-key-pairs]: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html\n[driver-ssl-impl]: https://github.com/christkv/mongodb-core/blob/c3d21cb636d74d7a68134ecd3b9f6af536311279/lib/connection/connection.js#L365-L407\n[driver-ssl-tutorial]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/\n[driver-ssl-none]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#no-certificate-validation\n[driver-ssl-server]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate\n[driver-ssl-all]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate-and-present-valid-certificate\n","gitHead":"6a5d526328ecfce1da82bf064daeb19f1c2bf6a5","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","test":"mocha","check":"npm run lint && npm run depcheck","pretest":"mongodb-runner install && mongodb-runner start --port=27018","test-ci":"npm run test","depcheck":"depcheck","posttest":"mongodb-runner stop --port=27018","posttest-ci":"node ../../scripts/killall-mongo.js","test-check-ci":"npm run check && npm test"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.17.0+x64 (linux)","description":"MongoDB connection model","directories":{},"_nodeVersion":"16.17.0","compass:main":"index.js","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","debug":"^4.2.0","lodash":"^4.17.15","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.2.0","storage-mixin":"0.0.0-next-6a5d526328ecfce1da82bf064daeb19f1c2bf6a5","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.2","@mongodb-js/ssh-tunnel":"0.0.0-next-6a5d526328ecfce1da82bf064daeb19f1c2bf6a5","@mongodb-js/compass-utils":"0.0.0-next-6a5d526328ecfce1da82bf064daeb19f1c2bf6a5","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.6.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"^4.10.0","depcheck":"^1.4.1","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.9.0","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^4.10.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_0.0.0-next-6a5d526328ecfce1da82bf064daeb19f1c2bf6a5_1670193096168_0.8636456429798753","host":"s3://npm-registry-packages"}},"0.0.0-next-2f189f8218b434e8d36a7472a2ac843f17147b9b":{"name":"mongodb-connection-model","version":"0.0.0-next-2f189f8218b434e8d36a7472a2ac843f17147b9b","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@0.0.0-next-2f189f8218b434e8d36a7472a2ac843f17147b9b","maintainers":[{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"iteng@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"909adf24ffea391bb40aaa116b76b5488f3867e0","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-0.0.0-next-2f189f8218b434e8d36a7472a2ac843f17147b9b.tgz","fileCount":20,"integrity":"sha512-PqbD6iv419FjVM9Gx1D1qeBKpHq851FYHOinjV94UbWRzUw5lILqa6Fa0k2kxMzxaA1EZ6xgZlajic2kM9u33g==","signatures":[{"sig":"MEUCIQCu6jUPx/AYzQl24SIFNJF70ps7KRrVNrR6Iq71LhATZgIgJf5U0bDIFMzZnKAwAMa2VHddRBwhGTxf1M4lgA+iDa4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":108151,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjjpJIACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpL9BAAgrW0k72LI2jchVwBaGXMGvg9gcQREjTq4pZsc2MiBf73YSLi\r\nT01Dq+DDfVia8PGKNYmz+UDHPjrBdcrqQGED0uOT0fuaSn54TZxKgKAvmC9l\r\npXiipkk58kzk6AuSP2RdWZW0i9WcHzpse064+kUil+CahRPRxCdzBUPubBM1\r\npby+O7eLffdQoyN2ujDEbkn0+d87nlma0Ph80jUpzEGx+gdnYpylXhozMvqe\r\nir2siPeQtdOcEuf94maMJ4OpH12ivGZVXZmP7uOHB45ZFVjnK1S/vxAbLQgO\r\nLNrnOizMMfI4ET2/ZKrJ+ldciNy2fkR8AzgGrFTHHxz8vUgPpK/JnHPxB0AY\r\nAf88GQEhPg0ncbZgQVPtcypMcIpG7RpZzZq4bYsD6iZPwoy7X3dxA4JMZ1ap\r\n/7A+beSoZadr5TSIMOwymwb0IhWQYRF0c1AKbp84CDADYXHmH3hzN2O8y+aT\r\nWIkKIJ7Ow+5MzOtORT53ZnxxWuAnNTYJy0rvsTabT/Mzn3x32GUNhy3TB85K\r\nRrT5XsoagrITSVxbjf1DUqwWF+LqkQEF/VAo2uHTpWGy9PVmZrLwTfuKmdId\r\nma6disEfQIsMowWRIPv4UZq31Eh8YP9sAlfFk+hThq9w7ePwWLH8T3z6a+oL\r\nGXBS3cNXQyqiOhzglXeuUnbYnFd2ThAqvdI=\r\n=iR/W\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","readme":"# mongodb-connection-model [![][workflow_img]][workflow_url] [![][npm_img]][npm_url]\n\n> MongoDB connection model\n\nThe main purpose of the MongoDB connection model is to be a domain model around a MongoDB connection. It encapsulates generating a [Connection String URI](https://docs.mongodb.com/manual/reference/connection-string/) from a group of attributes and parses URI using the [MongoDB Node.JS Driver URI Parser](https://github.com/mongodb-js/mongodb-core/blob/master/lib/uri_parser.js).\n\n## Installation\n\n```\nnpm install --save mongodb-connection-model\n```\n\n## Usage\n\n### Building URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\nconst c = new Connection({ appname: 'My App Name' });\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://localhost:27017/?readPreference=primary&appname=My%20App&ssl=false'\n```\n\n### Parsing URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\n\nConnection.from(\n  'mongodb://someUsername:testPassword@localhost',\n  (error, result) => {\n    console.log(result);\n    >>> `{\n      hosts: [{ host: 'localhost', port: 27017 }],\n      hostname: 'localhost',\n      port: 27017,\n      auth: {\n        username: 'someUsername',\n        password: 'testPassword',\n        db: 'admin'\n      },\n      isSrvRecord: false,\n      authStrategy: 'MONGODB',\n      mongodbUsername: 'someUsername',\n      mongodbPassword: 'testPassword',\n      mongodbDatabaseName: 'admin',\n      extraOptions: {},\n      connectionType: 'NODE_DRIVER',\n      readPreference: 'primary',\n      kerberosCanonicalizeHostname: false,\n      sslMethod: 'NONE',\n      sshTunnel: 'NONE',\n      sshTunnelPort: 22\n    }`\n  }\n);\n```\n\n## Properties\n\nMongoDB connection model is based on Ampersand.js framework and consist of [props](https://ampersandjs.com/docs/#ampersand-state-props) and [derived props](https://ampersandjs.com/docs/#ampersand-state-derived). The props object describes the observable properties that MongoDB connection model gets from the Node.js Driver API.\n\n```javascript\nconst с = new Connection();\nconst props = с.getAttributes({ props: true });\n```\n\n#### See Also\n\n- [URI Generic Syntax](https://tools.ietf.org/html/rfc3986)\n- [URI Options Specification](https://github.com/mongodb/specifications/blob/master/source/uri-options/uri-options.rst)\n\n### General Properties\n\n```javascript\nconst c = new Connection({ isSrvRecord: true });\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ns` | String | A valid [ns][ns] the user can read from | `undefined` |\n| `isSrvRecord` | Boolean | Indicates SRV record | `false` |\n| `auth` | Object | Authentication from driver (username, user, db, password) | `undefined` |\n| `hostname` | String | Hostname of a MongoDB Instance. In case of the replica set the first host and port will be taken | `localhost` |\n| `port` | Number | TCP port of a MongoDB Instance | `27017` |\n| `hosts` | Array | Contains all hosts and ports for replica set | `[{ host: 'localhost', port: 27017 }]` |\n| `extraOptions` | Object | Extra options passed to the node driver as part of `driverOptions` | `{}` |\n| `connectionType` | String | The desired connection type. Possible values: `NODE_DRIVER`, `STITCH_ON_PREM`, `STITCH_ATLAS` | `NODE_DRIVER` |\n| `authStrategy` | String | The desired authentication strategy. Possible values: `NONE`, `MONGODB`, `X509`, `KERBEROS`, `LDAP`, `SCRAM-SHA-256` | `NONE` |\n\n### Connection string options\n\n```javascript\nconst c = new Connection({ appname: 'My App', replicaSet: 'testing' });\n```\n\n#### General connection string options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `replicaSet` | String | Specifies the name of the replica set, if the mongod is a member of a replica set | `undefined` |\n| `connectTimeoutMS` | Number | The time in milliseconds to attempt a connection before timing out | `undefined` |\n| `socketTimeoutMS` | Number | The time in milliseconds to attempt a send or receive on a socket before the attempt times out | `undefined` |\n| `compression` | Object | Object includes compressors and a compression level. The following compressors can be specified: `snappy`, `zlib` (Available in MongoDB 3.6 or greater) | `undefined` |\n\n#### Connection Pool Option\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `maxPoolSize` | Number | The maximum number of connections in the connection pool | `undefined` |\n| `minPoolSize` | Number | The minimum number of connections in the connection pool | `undefined` |\n| `maxIdleTimeMS` | Number | The maximum number of milliseconds that a connection can remain idle in the pool before being removed and closed | `undefined` |\n| `waitQueueMultiple` | Number | A number that the driver multiples the maxPoolSize value to, to provide the maximum number of threads allowed to wait for a connection to become available from the pool | `undefined` |\n| `waitQueueTimeoutMS` | Number | The maximum time in milliseconds that a thread can wait for a connection to become available | `undefined` |\n\n#### Write Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `w` | Number/String | Corresponds to the write concern [w Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-w) | `undefined` |\n| `wTimeoutMS` | Number | Corresponds to the write concern [wtimeout](https://docs.mongodb.com/manual/reference/write-concern/#wc-wtimeout) | `undefined` |\n| `journal` | Boolean | Corresponds to the write concern [j Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-j) | `undefined` |\n\n#### Read Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readConcernLevel` | String | The level of isolation | `undefined` |\n\n#### Read Preference Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readPreference` | String | Specifies the read preferences for this connection. Possible values: `PRIMARY`, `PRIMARY_PREFERRED`, `SECONDARY`, `SECONDARY_PREFERRED`, `NEAREST` | `PRIMARY` |\n| `maxStalenessSeconds` | Number | Specifies, in seconds, how stale a secondary can be before the client stops using it for read operations | `undefined` |\n| `readPreferenceTags` | Object | Default read preference tags for the client | `undefined` |\n\n#### Authentication Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `authSource` | String | Specify the database name associated with the user’s credentials | `undefined` |\n| `authMechanism` | String | Specifies the authentication mechanism that MongoDB will use to authenticate the connection. Possible values: `DEFAULT`, `GSSAPI`, `MONGODB-X509`, `PLAIN`, `SCRAM-SHA-256` | `undefined` |\n| `authMechanismProperties` | Object | Additional options provided for authentication (e.g. to enable hostname canonicalization for GSSAPI) | `undefined` |\n| `gssapiServiceName` | String | Set the Kerberos service name when connecting to Kerberized MongoDB instances | `undefined` |\n| `gssapiServiceRealm` | String | Set the Realm service name | `undefined` |\n| `gssapiCanonicalizeHostName` | Boolean | Whether canonicalized hostname | `undefined` |\n\n#### Server Selection and Discovery Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `localThresholdMS` | Number | The size (in milliseconds) of the latency window for selecting among multiple suitable MongoDB instances | `undefined` |\n| `serverSelectionTimeoutMS` | Number | Specifies how long (in milliseconds) to block for server selection before throwing an exception | `undefined` |\n| `serverSelectionTryOnce` | Boolean | Instructs the driver to scan the MongoDB deployment exactly once after server selection fails and then either select a server or raise an error | `undefined` |\n| `heartbeatFrequencyMS` | Number | Controls when the driver checks the state of the MongoDB deployment | `undefined` |\n\n#### Miscellaneous Configuration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `appname` | String | An application name passed to server as client metadata | `undefined` |\n| `retryWrites` | Boolean | Enable retryable writes | `undefined` |\n| `uuidRepresentation` | String | The legacy representation of UUID. Possible values: `standard`, `csharpLegacy`, `javaLegacy`, `pythonLegacy` | `undefined` |\n| `loadBalanced` | Boolean | Whether or not the server is running in load balanced mode | `undefined` |\n\n### Stitch attributes\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `stitchServiceName` | String | Stitch service name | `undefined` |\n| `stitchClientAppId` | String | Stitch сlient app ID | `undefined` |\n| `stitchGroupId` | String | Stitch group ID | `undefined` |\n| `stitchBaseUrl` | String | Stitch base Url | `undefined` |\n\n### MONGODB authentication\n\n```javascript\nconst c = new Connection({\n  mongodbUsername: 'arlo',\n  mongodbPassword: 'w@of'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/?slaveOk=true&authSource=admin'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `mongodbUsername` | String | MongoDB username | `undefined` |\n| `mongodbPassword` | String | MongoDB password | `undefined` |\n| `mongodbDatabaseName` | String | The database name associated with the user's credentials | `undefined` |\n| `promoteValues` | Boolean | Whether BSON values should be promoted to their JS type counterparts | `undefined` |\n\n### KERBEROS authentication\n\n```javascript\nconst c = new Connection({\n  kerberosServiceName: 'mongodb',\n  kerberosPrincipal: 'arlo/dog@krb5.mongodb.parts',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo%252Fdog%2540krb5.mongodb.parts@localhost:27017/toys?authMechanism=GSSAPI'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n> @note (imlucas): Kerberos on Windows is broken out as it's own state for UX consideration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `kerberosServiceName` | String | Any program or computer you access over a network | `undefined` |\n| `kerberosPrincipal` | String | The format of a typical Kerberos V5 principal is `primary/instance@REALM` | `undefined` |\n| `kerberosCanonicalizeHostname` | Boolean | Whether canonicalized kerberos hostname | `undefined` |\n\n#### See Also\n\n- [node.js driver Kerberos reference](http://bit.ly/mongodb-node-driver-kerberos)\n- [node.js driver Kerberos functional test][kerberos-functional]\n\n### LDAP authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  ldapUsername: 'arlo',\n  ldapPassword: 'w@of',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/toys?slaveOk=true&authMechanism=PLAIN'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ldapUsername` | String | LDAP username | `undefined` |\n| `ldapPassword` | String | LDAP password | `undefined` |\n\n#### See Also\n\n- [node.js driver LDAP reference](http://bit.ly/mongodb-node-driver-ldap)\n- [node.js driver X509 functional test][ldap-functional]\n\n### X509 authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  x509Username: 'CN=client,OU=arlo,O=MongoDB,L=Philadelphia,ST=Pennsylvania,C=US'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://CN%253Dclient%252COU%253Darlo%252CO%253DMongoDB%252CL%253DPhiladelphia%252CST%253DPennsylvania%252CC%253DUS@localhost:27017?slaveOk=true&authMechanism=MONGODB-X509'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `x509Username` | String | The x.509 certificate derived user name, e.g. `CN=user,OU=OrgUnit,O=myOrg,...` | `undefined` |\n\n#### See Also\n\n- [node.js driver X509 reference](http://bit.ly/mongodb-node-driver-x509)\n- [node.js driver X509 functional test][x509-functional]\n\n### SSL\n\n> **Note**: Not to be confused with `authentication=X509`\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ssl` | Number/String | A boolean to enable or disables TLS/SSL for the connection | `undefined` |\n| `sslMethod` | String | The desired ssl method. Possible values: `NONE`, `SYSTEMCA`, `IFAVAILABLE`, `UNVALIDATED`, `SERVER`, `ALL` | `NONE` |\n| `sslCA` | Buffer/String | Array of valid certificates | `undefined` |\n| `sslCert` | Buffer/String | The certificate | `undefined` |\n| `sslKey` | Buffer/String | The certificate private key | `undefined` |\n| `sslPass` | Buffer/String | The certificate password | `undefined` |\n\nDescription of `sslMethod` values:\n\n- `SYSTEMCA` - SSL required, validate using System CA, with host verification.\n- `IFAVAILABLE` - The driver should try SSL first, fall back to no SSL if unavailable, and use the system's Certificate Authority.\n- `SERVER` - The driver should validate the server certificate and fail to connect if validation fails. See also [node.js driver \"Validate Server Certificate\" docs][driver-ssl-server].\n- `ALL` - The driver must present a valid certificate and validate the server certificate. See also [node.js driver \"Validate Server Certificate and Present Valid Certificate\" docs][driver-ssl-all].\n- `NONE` - No SSL (Not recommended).\n- `UNVALIDATED` - Use SSL but do not perform any validation of the certificate chain. See also [node.js driver \"No Certificate Validation\" docs][driver-ssl-none]. **Very** not recommended and likely to be deprecated in future releases because it exposes potential Man-In-The-Middle attack vectors.\n\n#### See also\n\n- [node.js driver SSL implementation][driver-ssl-impl]\n- [node.js driver SSL tutorial][driver-ssl-tutorial]\n\n### SSH TUNNEL\n\n> New in mongodb-connection-model@5.0.0\n\nBecause [authentication](#authentication) is quite difficult for operators to migrate to, the most common method of securing a MongoDB deployment is to use an [SSH tunnel][sf-ssh-tunnel].  This allows operators to leverage their existing SSH security infrastructure to also provide secure access to MongoDB.  For a standard deployment of MongoDB on AWS, this is almost always to strategy.  Because of this, we now support creating SSH tunnels automatically when connecting to MongoDB.\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options, (connectionError, client) => {\n  if (connectionError) {\n    return console.log(connectionError);\n  }\n\n  client.db('mongodb').collection('fanclub').count((countingError, count) => {\n    console.log('counted:', countingError, count);\n    client.close();\n  });\n});\n```\n\nThe above provides the same functionality as creating the tunnel using the bash\ncommand below and connecting to MongoDB via another terminal. Notice that\nconnection-model uses a random local port each time it creates a tunnel.\nUsing the command line, you'd have to replace `<random port>` with an actual\nport number.\n\n```bash\nssh -i ~/.ssh/my-key-aws-pair.pem -L <random port>:localhost:27017 ubuntu@ec2-11-111-111-111.compute-1.amazonaws.com\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `sshTunnel` | String | The desired SSH tunnel strategy. Possible values: `NONE`, `USER_PASSWORD`, `IDENTITY_FILE` | `undefined` |\n| `sshTunnelHostname` | String | The hostname of the SSH remote host | `undefined` |\n| `sshTunnelPort` | Port | The SSH port of the remote host | `22` |\n| `sshTunnelBindToLocalPort` | Port | Bind the localhost endpoint of the SSH Tunnel to this port | `undefined` |\n| `sshTunnelUsername` | String | The optional SSH username for the remote host | `undefined` |\n| `sshTunnelPassword` | String | The optional SSH password for the remote host | `undefined` |\n| `sshTunnelIdentityFile` | String/Array | The optional path to the SSH identity file for the remote host | `undefined` |\n| `sshTunnelPassphrase` | String | The optional passphrase for `sshTunnelIdentityFile` | `undefined` |\n\nDescription of `sshTunnel` values:\n\n- `NONE` - Do not use SSH tunneling.\n- `USER_PASSWORD` - The tunnel is created with SSH username and password only.\n- `IDENTITY_FILE` - The tunnel is created using an identity file.\n\n## Derived Properties\n\nDerived properties (also known as computed properties) are properties of the state object that depend on other properties to determine their value.\n\n```javascript\nconst c = new Connection();\nconst derivedProps = c.getAttributes({ derived: true });\n```\n\n| Derived Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `instanceId` | String | The mongoscope | `localhost:27017` |\n| `driverAuthMechanism` | String | Converts the value of `authStrategy` for humans into the `authMechanism` value for the driver | `undefined` |\n| `safeUrl` | String | The URL where a password is replaced with stars | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrl` | String | Use this URL in order to connect via DataService | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrlWithSsh` | String | Use this URL in order to connect via connection model itself | `mongodb://localhost:29201/?readPreference=primary&ssl=false` |\n| `driverOptions` | String | The second argument `mongoscope-server` passes to `mongodb.connect` | `{}` |\n\n## Events\n\n> New in mongodb-connection-model@5.0.0\n\n#### Example: SSH Tunnel\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', skipped: true,\n  reason: 'The selected SSL mode does not need to load any files.' }\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', complete: true}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n#### Example: SSL\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  ssl: 'ALL',\n  sslCA: '~/.ssl/my-ca.pem',\n  sslCert: '~/.ssl/my-server.pem',\n  sslKey: '~/.ssl/my-server.pem'\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', complete: true}\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', skipped: true,\n  reason: 'The selected SSH Tunnel mode is NONE.'}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n[workflow_img]: https://github.com/mongodb-js/connection-model/workflows/Check%20and%20Test/badge.svg?event=push\n[workflow_url]: https://github.com/mongodb-js/connection-model/actions?query=workflow%3A%22Check+and+Test%22\n[npm_img]: https://img.shields.io/npm/v/mongodb-connection-model.svg?style=flat-square\n[npm_url]: https://www.npmjs.org/package/mongodb-connection-model\n[gitter_img]: https://badges.gitter.im/Join%20Chat.svg\n[gitter_url]: http://gitter.im/mongodb-js/mongodb-js\n[enterprise_img]: https://img.shields.io/badge/MongoDB-Enterprise-blue.svg?style=flat-square\n[coming_soon_img]: https://img.shields.io/badge/-Coming%20Soon-ff69b4.svg?style=flat-square\n[kerberos-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/kerberos_tests.js\n[ldap-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ldap_tests.js\n[x509-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ssl_x509_tests.js\n[ns]: https://github.com/mongodb-js/ns\n[sf-ssh-tunnel]: http://serverfault.com/questions/597765/how-to-connect-to-mongodb-server-via-ssh-tunnel\n[ec2-key-pairs]: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html\n[driver-ssl-impl]: https://github.com/christkv/mongodb-core/blob/c3d21cb636d74d7a68134ecd3b9f6af536311279/lib/connection/connection.js#L365-L407\n[driver-ssl-tutorial]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/\n[driver-ssl-none]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#no-certificate-validation\n[driver-ssl-server]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate\n[driver-ssl-all]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate-and-present-valid-certificate\n","gitHead":"2f189f8218b434e8d36a7472a2ac843f17147b9b","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","test":"mocha","check":"npm run lint && npm run depcheck","pretest":"mongodb-runner install && mongodb-runner start --port=27018","test-ci":"npm run test","depcheck":"depcheck","posttest":"mongodb-runner stop --port=27018","posttest-ci":"node ../../scripts/killall-mongo.js","test-check-ci":"npm run check && npm test"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.17.0+x64 (linux)","description":"MongoDB connection model","directories":{},"_nodeVersion":"16.17.0","compass:main":"index.js","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","debug":"^4.2.0","lodash":"^4.17.15","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.2.0","storage-mixin":"0.0.0-next-2f189f8218b434e8d36a7472a2ac843f17147b9b","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.2","@mongodb-js/ssh-tunnel":"0.0.0-next-2f189f8218b434e8d36a7472a2ac843f17147b9b","@mongodb-js/compass-utils":"0.0.0-next-2f189f8218b434e8d36a7472a2ac843f17147b9b","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.6.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"^4.10.0","depcheck":"^1.4.1","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.9.0","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^4.10.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_0.0.0-next-2f189f8218b434e8d36a7472a2ac843f17147b9b_1670287943997_0.3918754932304884","host":"s3://npm-registry-packages"}},"0.0.0-next-faf899c161858cffa138dc64f4fbf9c0da2145e0":{"name":"mongodb-connection-model","version":"0.0.0-next-faf899c161858cffa138dc64f4fbf9c0da2145e0","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@0.0.0-next-faf899c161858cffa138dc64f4fbf9c0da2145e0","maintainers":[{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"iteng@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"62b119934806e80aafc90f2aac0bed88b1e68879","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-0.0.0-next-faf899c161858cffa138dc64f4fbf9c0da2145e0.tgz","fileCount":20,"integrity":"sha512-sEJf0rcun32L6jnpamTSymPA1+OjFRzgQAh7qupfvESLU9rh2IOaT93+cYaH/FCeMoQ+WnMsF2OJyzrJ8hKcuw==","signatures":[{"sig":"MEQCIDHCwRLTBc6F0Tcj3ELmENMLpdh6dNHsWL5UQuhf3+QIAiBMVUtsGYCzXQmlkLi3SsofZSCPM/8B1TZ5GaHLsJsoog==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":108151,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjjpKuACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrCfg//ZWTaHJAkiBJ0QXgDfBsQDig04p2nRmrPEQDd6t+WtKRVRNRk\r\nRHtm6+hhycoMryFwrIPxeTE3QiL+ef1ovbEIEXzI+QoV0Mq/nliHmGCL9g7w\r\nSAWQMEjlnRG1xrmx18iD9TLaXZQcQOUnu5/9iBqvcr7obq/STafSxeC9Dgmp\r\nH1FvBtSjZlbp8D6z3rHit842vUrWC2mu5xVAl+nfSou2VK8DuyBkLfsPLC29\r\n+uFExJxBvFWBgZkNUfstUslIMhdHziBwuCUtPwT6kC+r0p+YTyOJl12HhiVq\r\noCaomQXCuIp2IPugLSro1le6hYsHMUVL4NW0BrkLCmV+GkP+0mIRRmLc713K\r\nYCfJbjwi6OWevhRThBviUPAMuepCjivLRsM1/6qKu22bQR/DPXFW2f32Uh6M\r\nl4/EXeDUAc7x/lKjZN92xhPjBnIUcvNnN4P55syWYM8lWePPsszga13QMdba\r\nYb+pY7/7/N22yd55gX4OaPFFFysAC7U6IVUY7hR1vZArkfUG1w8VMSy20dlv\r\nlBij7ac9SKFO9pW2Gf/mPTXahyA6C7/Sj8Ywn/bLVuW5fMiwfzMeTIYebf62\r\njv7grgd236cNkGTrE9LE+uG20hX92Hu/Hfw7VjhJJs4jkR8vjEL4ysIzGTip\r\ndjTMSb9JeNchpVJSUsFhKooNMrMwZDbAAF0=\r\n=whYD\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","readme":"# mongodb-connection-model [![][workflow_img]][workflow_url] [![][npm_img]][npm_url]\n\n> MongoDB connection model\n\nThe main purpose of the MongoDB connection model is to be a domain model around a MongoDB connection. It encapsulates generating a [Connection String URI](https://docs.mongodb.com/manual/reference/connection-string/) from a group of attributes and parses URI using the [MongoDB Node.JS Driver URI Parser](https://github.com/mongodb-js/mongodb-core/blob/master/lib/uri_parser.js).\n\n## Installation\n\n```\nnpm install --save mongodb-connection-model\n```\n\n## Usage\n\n### Building URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\nconst c = new Connection({ appname: 'My App Name' });\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://localhost:27017/?readPreference=primary&appname=My%20App&ssl=false'\n```\n\n### Parsing URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\n\nConnection.from(\n  'mongodb://someUsername:testPassword@localhost',\n  (error, result) => {\n    console.log(result);\n    >>> `{\n      hosts: [{ host: 'localhost', port: 27017 }],\n      hostname: 'localhost',\n      port: 27017,\n      auth: {\n        username: 'someUsername',\n        password: 'testPassword',\n        db: 'admin'\n      },\n      isSrvRecord: false,\n      authStrategy: 'MONGODB',\n      mongodbUsername: 'someUsername',\n      mongodbPassword: 'testPassword',\n      mongodbDatabaseName: 'admin',\n      extraOptions: {},\n      connectionType: 'NODE_DRIVER',\n      readPreference: 'primary',\n      kerberosCanonicalizeHostname: false,\n      sslMethod: 'NONE',\n      sshTunnel: 'NONE',\n      sshTunnelPort: 22\n    }`\n  }\n);\n```\n\n## Properties\n\nMongoDB connection model is based on Ampersand.js framework and consist of [props](https://ampersandjs.com/docs/#ampersand-state-props) and [derived props](https://ampersandjs.com/docs/#ampersand-state-derived). The props object describes the observable properties that MongoDB connection model gets from the Node.js Driver API.\n\n```javascript\nconst с = new Connection();\nconst props = с.getAttributes({ props: true });\n```\n\n#### See Also\n\n- [URI Generic Syntax](https://tools.ietf.org/html/rfc3986)\n- [URI Options Specification](https://github.com/mongodb/specifications/blob/master/source/uri-options/uri-options.rst)\n\n### General Properties\n\n```javascript\nconst c = new Connection({ isSrvRecord: true });\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ns` | String | A valid [ns][ns] the user can read from | `undefined` |\n| `isSrvRecord` | Boolean | Indicates SRV record | `false` |\n| `auth` | Object | Authentication from driver (username, user, db, password) | `undefined` |\n| `hostname` | String | Hostname of a MongoDB Instance. In case of the replica set the first host and port will be taken | `localhost` |\n| `port` | Number | TCP port of a MongoDB Instance | `27017` |\n| `hosts` | Array | Contains all hosts and ports for replica set | `[{ host: 'localhost', port: 27017 }]` |\n| `extraOptions` | Object | Extra options passed to the node driver as part of `driverOptions` | `{}` |\n| `connectionType` | String | The desired connection type. Possible values: `NODE_DRIVER`, `STITCH_ON_PREM`, `STITCH_ATLAS` | `NODE_DRIVER` |\n| `authStrategy` | String | The desired authentication strategy. Possible values: `NONE`, `MONGODB`, `X509`, `KERBEROS`, `LDAP`, `SCRAM-SHA-256` | `NONE` |\n\n### Connection string options\n\n```javascript\nconst c = new Connection({ appname: 'My App', replicaSet: 'testing' });\n```\n\n#### General connection string options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `replicaSet` | String | Specifies the name of the replica set, if the mongod is a member of a replica set | `undefined` |\n| `connectTimeoutMS` | Number | The time in milliseconds to attempt a connection before timing out | `undefined` |\n| `socketTimeoutMS` | Number | The time in milliseconds to attempt a send or receive on a socket before the attempt times out | `undefined` |\n| `compression` | Object | Object includes compressors and a compression level. The following compressors can be specified: `snappy`, `zlib` (Available in MongoDB 3.6 or greater) | `undefined` |\n\n#### Connection Pool Option\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `maxPoolSize` | Number | The maximum number of connections in the connection pool | `undefined` |\n| `minPoolSize` | Number | The minimum number of connections in the connection pool | `undefined` |\n| `maxIdleTimeMS` | Number | The maximum number of milliseconds that a connection can remain idle in the pool before being removed and closed | `undefined` |\n| `waitQueueMultiple` | Number | A number that the driver multiples the maxPoolSize value to, to provide the maximum number of threads allowed to wait for a connection to become available from the pool | `undefined` |\n| `waitQueueTimeoutMS` | Number | The maximum time in milliseconds that a thread can wait for a connection to become available | `undefined` |\n\n#### Write Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `w` | Number/String | Corresponds to the write concern [w Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-w) | `undefined` |\n| `wTimeoutMS` | Number | Corresponds to the write concern [wtimeout](https://docs.mongodb.com/manual/reference/write-concern/#wc-wtimeout) | `undefined` |\n| `journal` | Boolean | Corresponds to the write concern [j Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-j) | `undefined` |\n\n#### Read Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readConcernLevel` | String | The level of isolation | `undefined` |\n\n#### Read Preference Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readPreference` | String | Specifies the read preferences for this connection. Possible values: `PRIMARY`, `PRIMARY_PREFERRED`, `SECONDARY`, `SECONDARY_PREFERRED`, `NEAREST` | `PRIMARY` |\n| `maxStalenessSeconds` | Number | Specifies, in seconds, how stale a secondary can be before the client stops using it for read operations | `undefined` |\n| `readPreferenceTags` | Object | Default read preference tags for the client | `undefined` |\n\n#### Authentication Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `authSource` | String | Specify the database name associated with the user’s credentials | `undefined` |\n| `authMechanism` | String | Specifies the authentication mechanism that MongoDB will use to authenticate the connection. Possible values: `DEFAULT`, `GSSAPI`, `MONGODB-X509`, `PLAIN`, `SCRAM-SHA-256` | `undefined` |\n| `authMechanismProperties` | Object | Additional options provided for authentication (e.g. to enable hostname canonicalization for GSSAPI) | `undefined` |\n| `gssapiServiceName` | String | Set the Kerberos service name when connecting to Kerberized MongoDB instances | `undefined` |\n| `gssapiServiceRealm` | String | Set the Realm service name | `undefined` |\n| `gssapiCanonicalizeHostName` | Boolean | Whether canonicalized hostname | `undefined` |\n\n#### Server Selection and Discovery Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `localThresholdMS` | Number | The size (in milliseconds) of the latency window for selecting among multiple suitable MongoDB instances | `undefined` |\n| `serverSelectionTimeoutMS` | Number | Specifies how long (in milliseconds) to block for server selection before throwing an exception | `undefined` |\n| `serverSelectionTryOnce` | Boolean | Instructs the driver to scan the MongoDB deployment exactly once after server selection fails and then either select a server or raise an error | `undefined` |\n| `heartbeatFrequencyMS` | Number | Controls when the driver checks the state of the MongoDB deployment | `undefined` |\n\n#### Miscellaneous Configuration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `appname` | String | An application name passed to server as client metadata | `undefined` |\n| `retryWrites` | Boolean | Enable retryable writes | `undefined` |\n| `uuidRepresentation` | String | The legacy representation of UUID. Possible values: `standard`, `csharpLegacy`, `javaLegacy`, `pythonLegacy` | `undefined` |\n| `loadBalanced` | Boolean | Whether or not the server is running in load balanced mode | `undefined` |\n\n### Stitch attributes\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `stitchServiceName` | String | Stitch service name | `undefined` |\n| `stitchClientAppId` | String | Stitch сlient app ID | `undefined` |\n| `stitchGroupId` | String | Stitch group ID | `undefined` |\n| `stitchBaseUrl` | String | Stitch base Url | `undefined` |\n\n### MONGODB authentication\n\n```javascript\nconst c = new Connection({\n  mongodbUsername: 'arlo',\n  mongodbPassword: 'w@of'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/?slaveOk=true&authSource=admin'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `mongodbUsername` | String | MongoDB username | `undefined` |\n| `mongodbPassword` | String | MongoDB password | `undefined` |\n| `mongodbDatabaseName` | String | The database name associated with the user's credentials | `undefined` |\n| `promoteValues` | Boolean | Whether BSON values should be promoted to their JS type counterparts | `undefined` |\n\n### KERBEROS authentication\n\n```javascript\nconst c = new Connection({\n  kerberosServiceName: 'mongodb',\n  kerberosPrincipal: 'arlo/dog@krb5.mongodb.parts',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo%252Fdog%2540krb5.mongodb.parts@localhost:27017/toys?authMechanism=GSSAPI'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n> @note (imlucas): Kerberos on Windows is broken out as it's own state for UX consideration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `kerberosServiceName` | String | Any program or computer you access over a network | `undefined` |\n| `kerberosPrincipal` | String | The format of a typical Kerberos V5 principal is `primary/instance@REALM` | `undefined` |\n| `kerberosCanonicalizeHostname` | Boolean | Whether canonicalized kerberos hostname | `undefined` |\n\n#### See Also\n\n- [node.js driver Kerberos reference](http://bit.ly/mongodb-node-driver-kerberos)\n- [node.js driver Kerberos functional test][kerberos-functional]\n\n### LDAP authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  ldapUsername: 'arlo',\n  ldapPassword: 'w@of',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/toys?slaveOk=true&authMechanism=PLAIN'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ldapUsername` | String | LDAP username | `undefined` |\n| `ldapPassword` | String | LDAP password | `undefined` |\n\n#### See Also\n\n- [node.js driver LDAP reference](http://bit.ly/mongodb-node-driver-ldap)\n- [node.js driver X509 functional test][ldap-functional]\n\n### X509 authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  x509Username: 'CN=client,OU=arlo,O=MongoDB,L=Philadelphia,ST=Pennsylvania,C=US'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://CN%253Dclient%252COU%253Darlo%252CO%253DMongoDB%252CL%253DPhiladelphia%252CST%253DPennsylvania%252CC%253DUS@localhost:27017?slaveOk=true&authMechanism=MONGODB-X509'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `x509Username` | String | The x.509 certificate derived user name, e.g. `CN=user,OU=OrgUnit,O=myOrg,...` | `undefined` |\n\n#### See Also\n\n- [node.js driver X509 reference](http://bit.ly/mongodb-node-driver-x509)\n- [node.js driver X509 functional test][x509-functional]\n\n### SSL\n\n> **Note**: Not to be confused with `authentication=X509`\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ssl` | Number/String | A boolean to enable or disables TLS/SSL for the connection | `undefined` |\n| `sslMethod` | String | The desired ssl method. Possible values: `NONE`, `SYSTEMCA`, `IFAVAILABLE`, `UNVALIDATED`, `SERVER`, `ALL` | `NONE` |\n| `sslCA` | Buffer/String | Array of valid certificates | `undefined` |\n| `sslCert` | Buffer/String | The certificate | `undefined` |\n| `sslKey` | Buffer/String | The certificate private key | `undefined` |\n| `sslPass` | Buffer/String | The certificate password | `undefined` |\n\nDescription of `sslMethod` values:\n\n- `SYSTEMCA` - SSL required, validate using System CA, with host verification.\n- `IFAVAILABLE` - The driver should try SSL first, fall back to no SSL if unavailable, and use the system's Certificate Authority.\n- `SERVER` - The driver should validate the server certificate and fail to connect if validation fails. See also [node.js driver \"Validate Server Certificate\" docs][driver-ssl-server].\n- `ALL` - The driver must present a valid certificate and validate the server certificate. See also [node.js driver \"Validate Server Certificate and Present Valid Certificate\" docs][driver-ssl-all].\n- `NONE` - No SSL (Not recommended).\n- `UNVALIDATED` - Use SSL but do not perform any validation of the certificate chain. See also [node.js driver \"No Certificate Validation\" docs][driver-ssl-none]. **Very** not recommended and likely to be deprecated in future releases because it exposes potential Man-In-The-Middle attack vectors.\n\n#### See also\n\n- [node.js driver SSL implementation][driver-ssl-impl]\n- [node.js driver SSL tutorial][driver-ssl-tutorial]\n\n### SSH TUNNEL\n\n> New in mongodb-connection-model@5.0.0\n\nBecause [authentication](#authentication) is quite difficult for operators to migrate to, the most common method of securing a MongoDB deployment is to use an [SSH tunnel][sf-ssh-tunnel].  This allows operators to leverage their existing SSH security infrastructure to also provide secure access to MongoDB.  For a standard deployment of MongoDB on AWS, this is almost always to strategy.  Because of this, we now support creating SSH tunnels automatically when connecting to MongoDB.\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options, (connectionError, client) => {\n  if (connectionError) {\n    return console.log(connectionError);\n  }\n\n  client.db('mongodb').collection('fanclub').count((countingError, count) => {\n    console.log('counted:', countingError, count);\n    client.close();\n  });\n});\n```\n\nThe above provides the same functionality as creating the tunnel using the bash\ncommand below and connecting to MongoDB via another terminal. Notice that\nconnection-model uses a random local port each time it creates a tunnel.\nUsing the command line, you'd have to replace `<random port>` with an actual\nport number.\n\n```bash\nssh -i ~/.ssh/my-key-aws-pair.pem -L <random port>:localhost:27017 ubuntu@ec2-11-111-111-111.compute-1.amazonaws.com\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `sshTunnel` | String | The desired SSH tunnel strategy. Possible values: `NONE`, `USER_PASSWORD`, `IDENTITY_FILE` | `undefined` |\n| `sshTunnelHostname` | String | The hostname of the SSH remote host | `undefined` |\n| `sshTunnelPort` | Port | The SSH port of the remote host | `22` |\n| `sshTunnelBindToLocalPort` | Port | Bind the localhost endpoint of the SSH Tunnel to this port | `undefined` |\n| `sshTunnelUsername` | String | The optional SSH username for the remote host | `undefined` |\n| `sshTunnelPassword` | String | The optional SSH password for the remote host | `undefined` |\n| `sshTunnelIdentityFile` | String/Array | The optional path to the SSH identity file for the remote host | `undefined` |\n| `sshTunnelPassphrase` | String | The optional passphrase for `sshTunnelIdentityFile` | `undefined` |\n\nDescription of `sshTunnel` values:\n\n- `NONE` - Do not use SSH tunneling.\n- `USER_PASSWORD` - The tunnel is created with SSH username and password only.\n- `IDENTITY_FILE` - The tunnel is created using an identity file.\n\n## Derived Properties\n\nDerived properties (also known as computed properties) are properties of the state object that depend on other properties to determine their value.\n\n```javascript\nconst c = new Connection();\nconst derivedProps = c.getAttributes({ derived: true });\n```\n\n| Derived Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `instanceId` | String | The mongoscope | `localhost:27017` |\n| `driverAuthMechanism` | String | Converts the value of `authStrategy` for humans into the `authMechanism` value for the driver | `undefined` |\n| `safeUrl` | String | The URL where a password is replaced with stars | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrl` | String | Use this URL in order to connect via DataService | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrlWithSsh` | String | Use this URL in order to connect via connection model itself | `mongodb://localhost:29201/?readPreference=primary&ssl=false` |\n| `driverOptions` | String | The second argument `mongoscope-server` passes to `mongodb.connect` | `{}` |\n\n## Events\n\n> New in mongodb-connection-model@5.0.0\n\n#### Example: SSH Tunnel\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', skipped: true,\n  reason: 'The selected SSL mode does not need to load any files.' }\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', complete: true}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n#### Example: SSL\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  ssl: 'ALL',\n  sslCA: '~/.ssl/my-ca.pem',\n  sslCert: '~/.ssl/my-server.pem',\n  sslKey: '~/.ssl/my-server.pem'\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', complete: true}\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', skipped: true,\n  reason: 'The selected SSH Tunnel mode is NONE.'}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n[workflow_img]: https://github.com/mongodb-js/connection-model/workflows/Check%20and%20Test/badge.svg?event=push\n[workflow_url]: https://github.com/mongodb-js/connection-model/actions?query=workflow%3A%22Check+and+Test%22\n[npm_img]: https://img.shields.io/npm/v/mongodb-connection-model.svg?style=flat-square\n[npm_url]: https://www.npmjs.org/package/mongodb-connection-model\n[gitter_img]: https://badges.gitter.im/Join%20Chat.svg\n[gitter_url]: http://gitter.im/mongodb-js/mongodb-js\n[enterprise_img]: https://img.shields.io/badge/MongoDB-Enterprise-blue.svg?style=flat-square\n[coming_soon_img]: https://img.shields.io/badge/-Coming%20Soon-ff69b4.svg?style=flat-square\n[kerberos-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/kerberos_tests.js\n[ldap-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ldap_tests.js\n[x509-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ssl_x509_tests.js\n[ns]: https://github.com/mongodb-js/ns\n[sf-ssh-tunnel]: http://serverfault.com/questions/597765/how-to-connect-to-mongodb-server-via-ssh-tunnel\n[ec2-key-pairs]: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html\n[driver-ssl-impl]: https://github.com/christkv/mongodb-core/blob/c3d21cb636d74d7a68134ecd3b9f6af536311279/lib/connection/connection.js#L365-L407\n[driver-ssl-tutorial]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/\n[driver-ssl-none]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#no-certificate-validation\n[driver-ssl-server]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate\n[driver-ssl-all]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate-and-present-valid-certificate\n","gitHead":"faf899c161858cffa138dc64f4fbf9c0da2145e0","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","test":"mocha","check":"npm run lint && npm run depcheck","pretest":"mongodb-runner install && mongodb-runner start --port=27018","test-ci":"npm run test","depcheck":"depcheck","posttest":"mongodb-runner stop --port=27018","posttest-ci":"node ../../scripts/killall-mongo.js","test-check-ci":"npm run check && npm test"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.17.0+x64 (linux)","description":"MongoDB connection model","directories":{},"_nodeVersion":"16.17.0","compass:main":"index.js","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","debug":"^4.2.0","lodash":"^4.17.15","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.2.0","storage-mixin":"0.0.0-next-faf899c161858cffa138dc64f4fbf9c0da2145e0","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.2","@mongodb-js/ssh-tunnel":"0.0.0-next-faf899c161858cffa138dc64f4fbf9c0da2145e0","@mongodb-js/compass-utils":"0.0.0-next-faf899c161858cffa138dc64f4fbf9c0da2145e0","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.6.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"^4.10.0","depcheck":"^1.4.1","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.9.0","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^4.10.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_0.0.0-next-faf899c161858cffa138dc64f4fbf9c0da2145e0_1670288045867_0.5816165024828677","host":"s3://npm-registry-packages"}},"0.0.0-next-1336f6ccd01a8b5f63ed6bea289fa9f8fc4d9557":{"name":"mongodb-connection-model","version":"0.0.0-next-1336f6ccd01a8b5f63ed6bea289fa9f8fc4d9557","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@0.0.0-next-1336f6ccd01a8b5f63ed6bea289fa9f8fc4d9557","maintainers":[{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"iteng@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"18dd926e2cc7647b07e583a3582f66728618a912","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-0.0.0-next-1336f6ccd01a8b5f63ed6bea289fa9f8fc4d9557.tgz","fileCount":20,"integrity":"sha512-aduRmsSA/DaPAK9HWzjH8Z7gEPcvg8/BoEtQJ77jMJxmziJyqyPn88i07qzTyrjMFDaN9eGMbvBWnJYOGlbh/w==","signatures":[{"sig":"MEQCIFKQHR16YsOa07TwvV1eVhPV9RvXRbH3/xVki3ZGY2QnAiA1YvjHINNVj0g8XTLgc9M8qExusETLRJlnaWesRamwyQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":108151,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjkqEGACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpgjQ//YKI6/lEY038rMu2wMDQCJx1OqCBxj+UEKMUdByoCSgAwu3ox\r\nwveuhTgm1OPp4bsCoI8wcLOWYhPEdQqvjEoF7Dpw509ZYR+rP9UxB2XuJrhd\r\nE97IIwX2C4k/q62bf7UyswS7yWfkC0PyGKot6+H0QwnTFtyaIGGhmydaFF21\r\nEzElEEkh7AZiHEJcImkPI3pUUS8h9MZjPQWakKlkB8uoJcyW4O95MYX8stKN\r\naWcueG3SF3PJKIasvcqDmzK6V905zNHjQSkWrwI8fAB+9xBPBwus7M1wKvuk\r\nZuAbVIjFHGRLSSA14liH3JNNuAaknaBT8VeVMXIJogMeP4lXTmcRrUsvr3ch\r\ni+Fqm+uLk1uXlmafTkkeUY5DiMrqYDHImXc5OCoaoB/xcLaJL/Ztqc9jJqF0\r\nFCXa0i+6ts80hjzYdk/AOOBdPkOnZ7zxzLURfWwGSHSFm/4eJH4DrIPx2UC3\r\nhp5JmQJDRU7NvIEP5WHDQX5wAqbf5TBFX2eYR6QXeWAAZH4cau0ti//LBXsS\r\nJQ7b88S6qoIPZqIc1oAUWvvmqb1uX2DAlki4PK1PH7fIhz4dxBUvDrz9Zb/f\r\nM5WQ1M3OYAmVbovJKgNY9eoFI0U6Y4xgY6a8Zof3qUJlDfPhspqcPEWuZNEi\r\nAztcB66OzjLHvDQpNiumg0zyWVeI/IbJYxI=\r\n=FNH3\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","readme":"# mongodb-connection-model [![][workflow_img]][workflow_url] [![][npm_img]][npm_url]\n\n> MongoDB connection model\n\nThe main purpose of the MongoDB connection model is to be a domain model around a MongoDB connection. It encapsulates generating a [Connection String URI](https://docs.mongodb.com/manual/reference/connection-string/) from a group of attributes and parses URI using the [MongoDB Node.JS Driver URI Parser](https://github.com/mongodb-js/mongodb-core/blob/master/lib/uri_parser.js).\n\n## Installation\n\n```\nnpm install --save mongodb-connection-model\n```\n\n## Usage\n\n### Building URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\nconst c = new Connection({ appname: 'My App Name' });\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://localhost:27017/?readPreference=primary&appname=My%20App&ssl=false'\n```\n\n### Parsing URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\n\nConnection.from(\n  'mongodb://someUsername:testPassword@localhost',\n  (error, result) => {\n    console.log(result);\n    >>> `{\n      hosts: [{ host: 'localhost', port: 27017 }],\n      hostname: 'localhost',\n      port: 27017,\n      auth: {\n        username: 'someUsername',\n        password: 'testPassword',\n        db: 'admin'\n      },\n      isSrvRecord: false,\n      authStrategy: 'MONGODB',\n      mongodbUsername: 'someUsername',\n      mongodbPassword: 'testPassword',\n      mongodbDatabaseName: 'admin',\n      extraOptions: {},\n      connectionType: 'NODE_DRIVER',\n      readPreference: 'primary',\n      kerberosCanonicalizeHostname: false,\n      sslMethod: 'NONE',\n      sshTunnel: 'NONE',\n      sshTunnelPort: 22\n    }`\n  }\n);\n```\n\n## Properties\n\nMongoDB connection model is based on Ampersand.js framework and consist of [props](https://ampersandjs.com/docs/#ampersand-state-props) and [derived props](https://ampersandjs.com/docs/#ampersand-state-derived). The props object describes the observable properties that MongoDB connection model gets from the Node.js Driver API.\n\n```javascript\nconst с = new Connection();\nconst props = с.getAttributes({ props: true });\n```\n\n#### See Also\n\n- [URI Generic Syntax](https://tools.ietf.org/html/rfc3986)\n- [URI Options Specification](https://github.com/mongodb/specifications/blob/master/source/uri-options/uri-options.rst)\n\n### General Properties\n\n```javascript\nconst c = new Connection({ isSrvRecord: true });\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ns` | String | A valid [ns][ns] the user can read from | `undefined` |\n| `isSrvRecord` | Boolean | Indicates SRV record | `false` |\n| `auth` | Object | Authentication from driver (username, user, db, password) | `undefined` |\n| `hostname` | String | Hostname of a MongoDB Instance. In case of the replica set the first host and port will be taken | `localhost` |\n| `port` | Number | TCP port of a MongoDB Instance | `27017` |\n| `hosts` | Array | Contains all hosts and ports for replica set | `[{ host: 'localhost', port: 27017 }]` |\n| `extraOptions` | Object | Extra options passed to the node driver as part of `driverOptions` | `{}` |\n| `connectionType` | String | The desired connection type. Possible values: `NODE_DRIVER`, `STITCH_ON_PREM`, `STITCH_ATLAS` | `NODE_DRIVER` |\n| `authStrategy` | String | The desired authentication strategy. Possible values: `NONE`, `MONGODB`, `X509`, `KERBEROS`, `LDAP`, `SCRAM-SHA-256` | `NONE` |\n\n### Connection string options\n\n```javascript\nconst c = new Connection({ appname: 'My App', replicaSet: 'testing' });\n```\n\n#### General connection string options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `replicaSet` | String | Specifies the name of the replica set, if the mongod is a member of a replica set | `undefined` |\n| `connectTimeoutMS` | Number | The time in milliseconds to attempt a connection before timing out | `undefined` |\n| `socketTimeoutMS` | Number | The time in milliseconds to attempt a send or receive on a socket before the attempt times out | `undefined` |\n| `compression` | Object | Object includes compressors and a compression level. The following compressors can be specified: `snappy`, `zlib` (Available in MongoDB 3.6 or greater) | `undefined` |\n\n#### Connection Pool Option\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `maxPoolSize` | Number | The maximum number of connections in the connection pool | `undefined` |\n| `minPoolSize` | Number | The minimum number of connections in the connection pool | `undefined` |\n| `maxIdleTimeMS` | Number | The maximum number of milliseconds that a connection can remain idle in the pool before being removed and closed | `undefined` |\n| `waitQueueMultiple` | Number | A number that the driver multiples the maxPoolSize value to, to provide the maximum number of threads allowed to wait for a connection to become available from the pool | `undefined` |\n| `waitQueueTimeoutMS` | Number | The maximum time in milliseconds that a thread can wait for a connection to become available | `undefined` |\n\n#### Write Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `w` | Number/String | Corresponds to the write concern [w Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-w) | `undefined` |\n| `wTimeoutMS` | Number | Corresponds to the write concern [wtimeout](https://docs.mongodb.com/manual/reference/write-concern/#wc-wtimeout) | `undefined` |\n| `journal` | Boolean | Corresponds to the write concern [j Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-j) | `undefined` |\n\n#### Read Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readConcernLevel` | String | The level of isolation | `undefined` |\n\n#### Read Preference Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readPreference` | String | Specifies the read preferences for this connection. Possible values: `PRIMARY`, `PRIMARY_PREFERRED`, `SECONDARY`, `SECONDARY_PREFERRED`, `NEAREST` | `PRIMARY` |\n| `maxStalenessSeconds` | Number | Specifies, in seconds, how stale a secondary can be before the client stops using it for read operations | `undefined` |\n| `readPreferenceTags` | Object | Default read preference tags for the client | `undefined` |\n\n#### Authentication Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `authSource` | String | Specify the database name associated with the user’s credentials | `undefined` |\n| `authMechanism` | String | Specifies the authentication mechanism that MongoDB will use to authenticate the connection. Possible values: `DEFAULT`, `GSSAPI`, `MONGODB-X509`, `PLAIN`, `SCRAM-SHA-256` | `undefined` |\n| `authMechanismProperties` | Object | Additional options provided for authentication (e.g. to enable hostname canonicalization for GSSAPI) | `undefined` |\n| `gssapiServiceName` | String | Set the Kerberos service name when connecting to Kerberized MongoDB instances | `undefined` |\n| `gssapiServiceRealm` | String | Set the Realm service name | `undefined` |\n| `gssapiCanonicalizeHostName` | Boolean | Whether canonicalized hostname | `undefined` |\n\n#### Server Selection and Discovery Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `localThresholdMS` | Number | The size (in milliseconds) of the latency window for selecting among multiple suitable MongoDB instances | `undefined` |\n| `serverSelectionTimeoutMS` | Number | Specifies how long (in milliseconds) to block for server selection before throwing an exception | `undefined` |\n| `serverSelectionTryOnce` | Boolean | Instructs the driver to scan the MongoDB deployment exactly once after server selection fails and then either select a server or raise an error | `undefined` |\n| `heartbeatFrequencyMS` | Number | Controls when the driver checks the state of the MongoDB deployment | `undefined` |\n\n#### Miscellaneous Configuration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `appname` | String | An application name passed to server as client metadata | `undefined` |\n| `retryWrites` | Boolean | Enable retryable writes | `undefined` |\n| `uuidRepresentation` | String | The legacy representation of UUID. Possible values: `standard`, `csharpLegacy`, `javaLegacy`, `pythonLegacy` | `undefined` |\n| `loadBalanced` | Boolean | Whether or not the server is running in load balanced mode | `undefined` |\n\n### Stitch attributes\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `stitchServiceName` | String | Stitch service name | `undefined` |\n| `stitchClientAppId` | String | Stitch сlient app ID | `undefined` |\n| `stitchGroupId` | String | Stitch group ID | `undefined` |\n| `stitchBaseUrl` | String | Stitch base Url | `undefined` |\n\n### MONGODB authentication\n\n```javascript\nconst c = new Connection({\n  mongodbUsername: 'arlo',\n  mongodbPassword: 'w@of'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/?slaveOk=true&authSource=admin'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `mongodbUsername` | String | MongoDB username | `undefined` |\n| `mongodbPassword` | String | MongoDB password | `undefined` |\n| `mongodbDatabaseName` | String | The database name associated with the user's credentials | `undefined` |\n| `promoteValues` | Boolean | Whether BSON values should be promoted to their JS type counterparts | `undefined` |\n\n### KERBEROS authentication\n\n```javascript\nconst c = new Connection({\n  kerberosServiceName: 'mongodb',\n  kerberosPrincipal: 'arlo/dog@krb5.mongodb.parts',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo%252Fdog%2540krb5.mongodb.parts@localhost:27017/toys?authMechanism=GSSAPI'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n> @note (imlucas): Kerberos on Windows is broken out as it's own state for UX consideration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `kerberosServiceName` | String | Any program or computer you access over a network | `undefined` |\n| `kerberosPrincipal` | String | The format of a typical Kerberos V5 principal is `primary/instance@REALM` | `undefined` |\n| `kerberosCanonicalizeHostname` | Boolean | Whether canonicalized kerberos hostname | `undefined` |\n\n#### See Also\n\n- [node.js driver Kerberos reference](http://bit.ly/mongodb-node-driver-kerberos)\n- [node.js driver Kerberos functional test][kerberos-functional]\n\n### LDAP authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  ldapUsername: 'arlo',\n  ldapPassword: 'w@of',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/toys?slaveOk=true&authMechanism=PLAIN'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ldapUsername` | String | LDAP username | `undefined` |\n| `ldapPassword` | String | LDAP password | `undefined` |\n\n#### See Also\n\n- [node.js driver LDAP reference](http://bit.ly/mongodb-node-driver-ldap)\n- [node.js driver X509 functional test][ldap-functional]\n\n### X509 authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  x509Username: 'CN=client,OU=arlo,O=MongoDB,L=Philadelphia,ST=Pennsylvania,C=US'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://CN%253Dclient%252COU%253Darlo%252CO%253DMongoDB%252CL%253DPhiladelphia%252CST%253DPennsylvania%252CC%253DUS@localhost:27017?slaveOk=true&authMechanism=MONGODB-X509'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `x509Username` | String | The x.509 certificate derived user name, e.g. `CN=user,OU=OrgUnit,O=myOrg,...` | `undefined` |\n\n#### See Also\n\n- [node.js driver X509 reference](http://bit.ly/mongodb-node-driver-x509)\n- [node.js driver X509 functional test][x509-functional]\n\n### SSL\n\n> **Note**: Not to be confused with `authentication=X509`\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ssl` | Number/String | A boolean to enable or disables TLS/SSL for the connection | `undefined` |\n| `sslMethod` | String | The desired ssl method. Possible values: `NONE`, `SYSTEMCA`, `IFAVAILABLE`, `UNVALIDATED`, `SERVER`, `ALL` | `NONE` |\n| `sslCA` | Buffer/String | Array of valid certificates | `undefined` |\n| `sslCert` | Buffer/String | The certificate | `undefined` |\n| `sslKey` | Buffer/String | The certificate private key | `undefined` |\n| `sslPass` | Buffer/String | The certificate password | `undefined` |\n\nDescription of `sslMethod` values:\n\n- `SYSTEMCA` - SSL required, validate using System CA, with host verification.\n- `IFAVAILABLE` - The driver should try SSL first, fall back to no SSL if unavailable, and use the system's Certificate Authority.\n- `SERVER` - The driver should validate the server certificate and fail to connect if validation fails. See also [node.js driver \"Validate Server Certificate\" docs][driver-ssl-server].\n- `ALL` - The driver must present a valid certificate and validate the server certificate. See also [node.js driver \"Validate Server Certificate and Present Valid Certificate\" docs][driver-ssl-all].\n- `NONE` - No SSL (Not recommended).\n- `UNVALIDATED` - Use SSL but do not perform any validation of the certificate chain. See also [node.js driver \"No Certificate Validation\" docs][driver-ssl-none]. **Very** not recommended and likely to be deprecated in future releases because it exposes potential Man-In-The-Middle attack vectors.\n\n#### See also\n\n- [node.js driver SSL implementation][driver-ssl-impl]\n- [node.js driver SSL tutorial][driver-ssl-tutorial]\n\n### SSH TUNNEL\n\n> New in mongodb-connection-model@5.0.0\n\nBecause [authentication](#authentication) is quite difficult for operators to migrate to, the most common method of securing a MongoDB deployment is to use an [SSH tunnel][sf-ssh-tunnel].  This allows operators to leverage their existing SSH security infrastructure to also provide secure access to MongoDB.  For a standard deployment of MongoDB on AWS, this is almost always to strategy.  Because of this, we now support creating SSH tunnels automatically when connecting to MongoDB.\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options, (connectionError, client) => {\n  if (connectionError) {\n    return console.log(connectionError);\n  }\n\n  client.db('mongodb').collection('fanclub').count((countingError, count) => {\n    console.log('counted:', countingError, count);\n    client.close();\n  });\n});\n```\n\nThe above provides the same functionality as creating the tunnel using the bash\ncommand below and connecting to MongoDB via another terminal. Notice that\nconnection-model uses a random local port each time it creates a tunnel.\nUsing the command line, you'd have to replace `<random port>` with an actual\nport number.\n\n```bash\nssh -i ~/.ssh/my-key-aws-pair.pem -L <random port>:localhost:27017 ubuntu@ec2-11-111-111-111.compute-1.amazonaws.com\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `sshTunnel` | String | The desired SSH tunnel strategy. Possible values: `NONE`, `USER_PASSWORD`, `IDENTITY_FILE` | `undefined` |\n| `sshTunnelHostname` | String | The hostname of the SSH remote host | `undefined` |\n| `sshTunnelPort` | Port | The SSH port of the remote host | `22` |\n| `sshTunnelBindToLocalPort` | Port | Bind the localhost endpoint of the SSH Tunnel to this port | `undefined` |\n| `sshTunnelUsername` | String | The optional SSH username for the remote host | `undefined` |\n| `sshTunnelPassword` | String | The optional SSH password for the remote host | `undefined` |\n| `sshTunnelIdentityFile` | String/Array | The optional path to the SSH identity file for the remote host | `undefined` |\n| `sshTunnelPassphrase` | String | The optional passphrase for `sshTunnelIdentityFile` | `undefined` |\n\nDescription of `sshTunnel` values:\n\n- `NONE` - Do not use SSH tunneling.\n- `USER_PASSWORD` - The tunnel is created with SSH username and password only.\n- `IDENTITY_FILE` - The tunnel is created using an identity file.\n\n## Derived Properties\n\nDerived properties (also known as computed properties) are properties of the state object that depend on other properties to determine their value.\n\n```javascript\nconst c = new Connection();\nconst derivedProps = c.getAttributes({ derived: true });\n```\n\n| Derived Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `instanceId` | String | The mongoscope | `localhost:27017` |\n| `driverAuthMechanism` | String | Converts the value of `authStrategy` for humans into the `authMechanism` value for the driver | `undefined` |\n| `safeUrl` | String | The URL where a password is replaced with stars | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrl` | String | Use this URL in order to connect via DataService | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrlWithSsh` | String | Use this URL in order to connect via connection model itself | `mongodb://localhost:29201/?readPreference=primary&ssl=false` |\n| `driverOptions` | String | The second argument `mongoscope-server` passes to `mongodb.connect` | `{}` |\n\n## Events\n\n> New in mongodb-connection-model@5.0.0\n\n#### Example: SSH Tunnel\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', skipped: true,\n  reason: 'The selected SSL mode does not need to load any files.' }\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', complete: true}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n#### Example: SSL\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  ssl: 'ALL',\n  sslCA: '~/.ssl/my-ca.pem',\n  sslCert: '~/.ssl/my-server.pem',\n  sslKey: '~/.ssl/my-server.pem'\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', complete: true}\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', skipped: true,\n  reason: 'The selected SSH Tunnel mode is NONE.'}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n[workflow_img]: https://github.com/mongodb-js/connection-model/workflows/Check%20and%20Test/badge.svg?event=push\n[workflow_url]: https://github.com/mongodb-js/connection-model/actions?query=workflow%3A%22Check+and+Test%22\n[npm_img]: https://img.shields.io/npm/v/mongodb-connection-model.svg?style=flat-square\n[npm_url]: https://www.npmjs.org/package/mongodb-connection-model\n[gitter_img]: https://badges.gitter.im/Join%20Chat.svg\n[gitter_url]: http://gitter.im/mongodb-js/mongodb-js\n[enterprise_img]: https://img.shields.io/badge/MongoDB-Enterprise-blue.svg?style=flat-square\n[coming_soon_img]: https://img.shields.io/badge/-Coming%20Soon-ff69b4.svg?style=flat-square\n[kerberos-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/kerberos_tests.js\n[ldap-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ldap_tests.js\n[x509-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ssl_x509_tests.js\n[ns]: https://github.com/mongodb-js/ns\n[sf-ssh-tunnel]: http://serverfault.com/questions/597765/how-to-connect-to-mongodb-server-via-ssh-tunnel\n[ec2-key-pairs]: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html\n[driver-ssl-impl]: https://github.com/christkv/mongodb-core/blob/c3d21cb636d74d7a68134ecd3b9f6af536311279/lib/connection/connection.js#L365-L407\n[driver-ssl-tutorial]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/\n[driver-ssl-none]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#no-certificate-validation\n[driver-ssl-server]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate\n[driver-ssl-all]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate-and-present-valid-certificate\n","gitHead":"1336f6ccd01a8b5f63ed6bea289fa9f8fc4d9557","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","test":"mocha","check":"npm run lint && npm run depcheck","pretest":"mongodb-runner install && mongodb-runner start --port=27018","test-ci":"npm run test","depcheck":"depcheck","posttest":"mongodb-runner stop --port=27018","posttest-ci":"node ../../scripts/killall-mongo.js","test-check-ci":"npm run check && npm test"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.17.0+x64 (linux)","description":"MongoDB connection model","directories":{},"_nodeVersion":"16.17.0","compass:main":"index.js","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","debug":"^4.2.0","lodash":"^4.17.15","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.2.0","storage-mixin":"0.0.0-next-1336f6ccd01a8b5f63ed6bea289fa9f8fc4d9557","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.2","@mongodb-js/ssh-tunnel":"0.0.0-next-1336f6ccd01a8b5f63ed6bea289fa9f8fc4d9557","@mongodb-js/compass-utils":"0.0.0-next-1336f6ccd01a8b5f63ed6bea289fa9f8fc4d9557","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.6.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"^4.12.1","depcheck":"^1.4.1","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.9.0","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^4.12.1"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_0.0.0-next-1336f6ccd01a8b5f63ed6bea289fa9f8fc4d9557_1670553861890_0.27748511160751677","host":"s3://npm-registry-packages"}},"0.0.0-next-d43728ce0cf99f511bd2d2aebad966bc49276179":{"name":"mongodb-connection-model","version":"0.0.0-next-d43728ce0cf99f511bd2d2aebad966bc49276179","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@0.0.0-next-d43728ce0cf99f511bd2d2aebad966bc49276179","maintainers":[{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"iteng@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"27966655077d6929ea14dd262212401cdd86df31","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-0.0.0-next-d43728ce0cf99f511bd2d2aebad966bc49276179.tgz","fileCount":20,"integrity":"sha512-GLEm8H2n26dAejrO3jBLvpZOW1ALMvpnZwXot6phhYpKM4D10DFSDgGdRewCoXfnuxsrQfb927C3WxYbUkBb8Q==","signatures":[{"sig":"MEUCIQCAB4hORfxDAZmtPETfG+ImaJupeD2J8gts2eR6vmxAGQIgP+tjaHMLBckgVeWIIrMHc2xqk02CxBcWcEpFHVrKyE0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":108151,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjkqGYACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqq0BAAndBM98iVoWpMVuguyLcAyb1uJIJIxYrUkuQ4GiSX7qnqV04F\r\n1ouNm140axcu7fgnXBHeSoFfJY2oPVQzOQ/IPg+BxwvzppNoIZaJsRehsfT9\r\ng67KAFQr/Lw6p1ldAEhsrBqsEJYs6QKVkNSzTEh8lOWZyFOqxVZT2a4je4Kq\r\nn1STWqha3BKhPUaV5+hw0tKEqfC6ob1RQ4LUw8tD2ZL0zNcpqjnL04cP9JFB\r\nlN4oRkML3UqtrSVb6hl65fVDFMXr8zZ6yHA44ueioqAU9AtSrgij0thx5goN\r\nM49MqHJJIRo2T3bLXa5PEafS0UI0M/vIf1pu+smRgDTpuKA9fhf7oFUOoP+R\r\n5QYIATLzH/st8v/CNfjOVwjAJPth/XaY6mnfEGq3LVE0qJSd4efM1CHER9sW\r\nbmZSDcy0OE/wj2ZC0Sbrt7vwghY/D9vUv/745AyrlWnFK+V4FAes0sWNnODP\r\n817yje6BBVVec39+m1TG0/IJ1fXmQQU4Wd93PBJjvvS78tyG2e8xzw7JLQUK\r\nUOzkq5DanvP03xX/rLfzN9Jlpk9wUZlNYQDctkYJFTuxBcruvLtzNxw0+1jI\r\nO0YZG9vA2Jr3n2v4zqujZI3RZldVFZyVpk80+I2QEfT/R/bm/xpPyk4soiu5\r\naB514d+YjYWszATPNBXX5YKnmbPrWwb2O+o=\r\n=lR9A\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","readme":"# mongodb-connection-model [![][workflow_img]][workflow_url] [![][npm_img]][npm_url]\n\n> MongoDB connection model\n\nThe main purpose of the MongoDB connection model is to be a domain model around a MongoDB connection. It encapsulates generating a [Connection String URI](https://docs.mongodb.com/manual/reference/connection-string/) from a group of attributes and parses URI using the [MongoDB Node.JS Driver URI Parser](https://github.com/mongodb-js/mongodb-core/blob/master/lib/uri_parser.js).\n\n## Installation\n\n```\nnpm install --save mongodb-connection-model\n```\n\n## Usage\n\n### Building URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\nconst c = new Connection({ appname: 'My App Name' });\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://localhost:27017/?readPreference=primary&appname=My%20App&ssl=false'\n```\n\n### Parsing URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\n\nConnection.from(\n  'mongodb://someUsername:testPassword@localhost',\n  (error, result) => {\n    console.log(result);\n    >>> `{\n      hosts: [{ host: 'localhost', port: 27017 }],\n      hostname: 'localhost',\n      port: 27017,\n      auth: {\n        username: 'someUsername',\n        password: 'testPassword',\n        db: 'admin'\n      },\n      isSrvRecord: false,\n      authStrategy: 'MONGODB',\n      mongodbUsername: 'someUsername',\n      mongodbPassword: 'testPassword',\n      mongodbDatabaseName: 'admin',\n      extraOptions: {},\n      connectionType: 'NODE_DRIVER',\n      readPreference: 'primary',\n      kerberosCanonicalizeHostname: false,\n      sslMethod: 'NONE',\n      sshTunnel: 'NONE',\n      sshTunnelPort: 22\n    }`\n  }\n);\n```\n\n## Properties\n\nMongoDB connection model is based on Ampersand.js framework and consist of [props](https://ampersandjs.com/docs/#ampersand-state-props) and [derived props](https://ampersandjs.com/docs/#ampersand-state-derived). The props object describes the observable properties that MongoDB connection model gets from the Node.js Driver API.\n\n```javascript\nconst с = new Connection();\nconst props = с.getAttributes({ props: true });\n```\n\n#### See Also\n\n- [URI Generic Syntax](https://tools.ietf.org/html/rfc3986)\n- [URI Options Specification](https://github.com/mongodb/specifications/blob/master/source/uri-options/uri-options.rst)\n\n### General Properties\n\n```javascript\nconst c = new Connection({ isSrvRecord: true });\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ns` | String | A valid [ns][ns] the user can read from | `undefined` |\n| `isSrvRecord` | Boolean | Indicates SRV record | `false` |\n| `auth` | Object | Authentication from driver (username, user, db, password) | `undefined` |\n| `hostname` | String | Hostname of a MongoDB Instance. In case of the replica set the first host and port will be taken | `localhost` |\n| `port` | Number | TCP port of a MongoDB Instance | `27017` |\n| `hosts` | Array | Contains all hosts and ports for replica set | `[{ host: 'localhost', port: 27017 }]` |\n| `extraOptions` | Object | Extra options passed to the node driver as part of `driverOptions` | `{}` |\n| `connectionType` | String | The desired connection type. Possible values: `NODE_DRIVER`, `STITCH_ON_PREM`, `STITCH_ATLAS` | `NODE_DRIVER` |\n| `authStrategy` | String | The desired authentication strategy. Possible values: `NONE`, `MONGODB`, `X509`, `KERBEROS`, `LDAP`, `SCRAM-SHA-256` | `NONE` |\n\n### Connection string options\n\n```javascript\nconst c = new Connection({ appname: 'My App', replicaSet: 'testing' });\n```\n\n#### General connection string options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `replicaSet` | String | Specifies the name of the replica set, if the mongod is a member of a replica set | `undefined` |\n| `connectTimeoutMS` | Number | The time in milliseconds to attempt a connection before timing out | `undefined` |\n| `socketTimeoutMS` | Number | The time in milliseconds to attempt a send or receive on a socket before the attempt times out | `undefined` |\n| `compression` | Object | Object includes compressors and a compression level. The following compressors can be specified: `snappy`, `zlib` (Available in MongoDB 3.6 or greater) | `undefined` |\n\n#### Connection Pool Option\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `maxPoolSize` | Number | The maximum number of connections in the connection pool | `undefined` |\n| `minPoolSize` | Number | The minimum number of connections in the connection pool | `undefined` |\n| `maxIdleTimeMS` | Number | The maximum number of milliseconds that a connection can remain idle in the pool before being removed and closed | `undefined` |\n| `waitQueueMultiple` | Number | A number that the driver multiples the maxPoolSize value to, to provide the maximum number of threads allowed to wait for a connection to become available from the pool | `undefined` |\n| `waitQueueTimeoutMS` | Number | The maximum time in milliseconds that a thread can wait for a connection to become available | `undefined` |\n\n#### Write Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `w` | Number/String | Corresponds to the write concern [w Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-w) | `undefined` |\n| `wTimeoutMS` | Number | Corresponds to the write concern [wtimeout](https://docs.mongodb.com/manual/reference/write-concern/#wc-wtimeout) | `undefined` |\n| `journal` | Boolean | Corresponds to the write concern [j Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-j) | `undefined` |\n\n#### Read Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readConcernLevel` | String | The level of isolation | `undefined` |\n\n#### Read Preference Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readPreference` | String | Specifies the read preferences for this connection. Possible values: `PRIMARY`, `PRIMARY_PREFERRED`, `SECONDARY`, `SECONDARY_PREFERRED`, `NEAREST` | `PRIMARY` |\n| `maxStalenessSeconds` | Number | Specifies, in seconds, how stale a secondary can be before the client stops using it for read operations | `undefined` |\n| `readPreferenceTags` | Object | Default read preference tags for the client | `undefined` |\n\n#### Authentication Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `authSource` | String | Specify the database name associated with the user’s credentials | `undefined` |\n| `authMechanism` | String | Specifies the authentication mechanism that MongoDB will use to authenticate the connection. Possible values: `DEFAULT`, `GSSAPI`, `MONGODB-X509`, `PLAIN`, `SCRAM-SHA-256` | `undefined` |\n| `authMechanismProperties` | Object | Additional options provided for authentication (e.g. to enable hostname canonicalization for GSSAPI) | `undefined` |\n| `gssapiServiceName` | String | Set the Kerberos service name when connecting to Kerberized MongoDB instances | `undefined` |\n| `gssapiServiceRealm` | String | Set the Realm service name | `undefined` |\n| `gssapiCanonicalizeHostName` | Boolean | Whether canonicalized hostname | `undefined` |\n\n#### Server Selection and Discovery Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `localThresholdMS` | Number | The size (in milliseconds) of the latency window for selecting among multiple suitable MongoDB instances | `undefined` |\n| `serverSelectionTimeoutMS` | Number | Specifies how long (in milliseconds) to block for server selection before throwing an exception | `undefined` |\n| `serverSelectionTryOnce` | Boolean | Instructs the driver to scan the MongoDB deployment exactly once after server selection fails and then either select a server or raise an error | `undefined` |\n| `heartbeatFrequencyMS` | Number | Controls when the driver checks the state of the MongoDB deployment | `undefined` |\n\n#### Miscellaneous Configuration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `appname` | String | An application name passed to server as client metadata | `undefined` |\n| `retryWrites` | Boolean | Enable retryable writes | `undefined` |\n| `uuidRepresentation` | String | The legacy representation of UUID. Possible values: `standard`, `csharpLegacy`, `javaLegacy`, `pythonLegacy` | `undefined` |\n| `loadBalanced` | Boolean | Whether or not the server is running in load balanced mode | `undefined` |\n\n### Stitch attributes\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `stitchServiceName` | String | Stitch service name | `undefined` |\n| `stitchClientAppId` | String | Stitch сlient app ID | `undefined` |\n| `stitchGroupId` | String | Stitch group ID | `undefined` |\n| `stitchBaseUrl` | String | Stitch base Url | `undefined` |\n\n### MONGODB authentication\n\n```javascript\nconst c = new Connection({\n  mongodbUsername: 'arlo',\n  mongodbPassword: 'w@of'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/?slaveOk=true&authSource=admin'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `mongodbUsername` | String | MongoDB username | `undefined` |\n| `mongodbPassword` | String | MongoDB password | `undefined` |\n| `mongodbDatabaseName` | String | The database name associated with the user's credentials | `undefined` |\n| `promoteValues` | Boolean | Whether BSON values should be promoted to their JS type counterparts | `undefined` |\n\n### KERBEROS authentication\n\n```javascript\nconst c = new Connection({\n  kerberosServiceName: 'mongodb',\n  kerberosPrincipal: 'arlo/dog@krb5.mongodb.parts',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo%252Fdog%2540krb5.mongodb.parts@localhost:27017/toys?authMechanism=GSSAPI'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n> @note (imlucas): Kerberos on Windows is broken out as it's own state for UX consideration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `kerberosServiceName` | String | Any program or computer you access over a network | `undefined` |\n| `kerberosPrincipal` | String | The format of a typical Kerberos V5 principal is `primary/instance@REALM` | `undefined` |\n| `kerberosCanonicalizeHostname` | Boolean | Whether canonicalized kerberos hostname | `undefined` |\n\n#### See Also\n\n- [node.js driver Kerberos reference](http://bit.ly/mongodb-node-driver-kerberos)\n- [node.js driver Kerberos functional test][kerberos-functional]\n\n### LDAP authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  ldapUsername: 'arlo',\n  ldapPassword: 'w@of',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/toys?slaveOk=true&authMechanism=PLAIN'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ldapUsername` | String | LDAP username | `undefined` |\n| `ldapPassword` | String | LDAP password | `undefined` |\n\n#### See Also\n\n- [node.js driver LDAP reference](http://bit.ly/mongodb-node-driver-ldap)\n- [node.js driver X509 functional test][ldap-functional]\n\n### X509 authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  x509Username: 'CN=client,OU=arlo,O=MongoDB,L=Philadelphia,ST=Pennsylvania,C=US'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://CN%253Dclient%252COU%253Darlo%252CO%253DMongoDB%252CL%253DPhiladelphia%252CST%253DPennsylvania%252CC%253DUS@localhost:27017?slaveOk=true&authMechanism=MONGODB-X509'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `x509Username` | String | The x.509 certificate derived user name, e.g. `CN=user,OU=OrgUnit,O=myOrg,...` | `undefined` |\n\n#### See Also\n\n- [node.js driver X509 reference](http://bit.ly/mongodb-node-driver-x509)\n- [node.js driver X509 functional test][x509-functional]\n\n### SSL\n\n> **Note**: Not to be confused with `authentication=X509`\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ssl` | Number/String | A boolean to enable or disables TLS/SSL for the connection | `undefined` |\n| `sslMethod` | String | The desired ssl method. Possible values: `NONE`, `SYSTEMCA`, `IFAVAILABLE`, `UNVALIDATED`, `SERVER`, `ALL` | `NONE` |\n| `sslCA` | Buffer/String | Array of valid certificates | `undefined` |\n| `sslCert` | Buffer/String | The certificate | `undefined` |\n| `sslKey` | Buffer/String | The certificate private key | `undefined` |\n| `sslPass` | Buffer/String | The certificate password | `undefined` |\n\nDescription of `sslMethod` values:\n\n- `SYSTEMCA` - SSL required, validate using System CA, with host verification.\n- `IFAVAILABLE` - The driver should try SSL first, fall back to no SSL if unavailable, and use the system's Certificate Authority.\n- `SERVER` - The driver should validate the server certificate and fail to connect if validation fails. See also [node.js driver \"Validate Server Certificate\" docs][driver-ssl-server].\n- `ALL` - The driver must present a valid certificate and validate the server certificate. See also [node.js driver \"Validate Server Certificate and Present Valid Certificate\" docs][driver-ssl-all].\n- `NONE` - No SSL (Not recommended).\n- `UNVALIDATED` - Use SSL but do not perform any validation of the certificate chain. See also [node.js driver \"No Certificate Validation\" docs][driver-ssl-none]. **Very** not recommended and likely to be deprecated in future releases because it exposes potential Man-In-The-Middle attack vectors.\n\n#### See also\n\n- [node.js driver SSL implementation][driver-ssl-impl]\n- [node.js driver SSL tutorial][driver-ssl-tutorial]\n\n### SSH TUNNEL\n\n> New in mongodb-connection-model@5.0.0\n\nBecause [authentication](#authentication) is quite difficult for operators to migrate to, the most common method of securing a MongoDB deployment is to use an [SSH tunnel][sf-ssh-tunnel].  This allows operators to leverage their existing SSH security infrastructure to also provide secure access to MongoDB.  For a standard deployment of MongoDB on AWS, this is almost always to strategy.  Because of this, we now support creating SSH tunnels automatically when connecting to MongoDB.\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options, (connectionError, client) => {\n  if (connectionError) {\n    return console.log(connectionError);\n  }\n\n  client.db('mongodb').collection('fanclub').count((countingError, count) => {\n    console.log('counted:', countingError, count);\n    client.close();\n  });\n});\n```\n\nThe above provides the same functionality as creating the tunnel using the bash\ncommand below and connecting to MongoDB via another terminal. Notice that\nconnection-model uses a random local port each time it creates a tunnel.\nUsing the command line, you'd have to replace `<random port>` with an actual\nport number.\n\n```bash\nssh -i ~/.ssh/my-key-aws-pair.pem -L <random port>:localhost:27017 ubuntu@ec2-11-111-111-111.compute-1.amazonaws.com\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `sshTunnel` | String | The desired SSH tunnel strategy. Possible values: `NONE`, `USER_PASSWORD`, `IDENTITY_FILE` | `undefined` |\n| `sshTunnelHostname` | String | The hostname of the SSH remote host | `undefined` |\n| `sshTunnelPort` | Port | The SSH port of the remote host | `22` |\n| `sshTunnelBindToLocalPort` | Port | Bind the localhost endpoint of the SSH Tunnel to this port | `undefined` |\n| `sshTunnelUsername` | String | The optional SSH username for the remote host | `undefined` |\n| `sshTunnelPassword` | String | The optional SSH password for the remote host | `undefined` |\n| `sshTunnelIdentityFile` | String/Array | The optional path to the SSH identity file for the remote host | `undefined` |\n| `sshTunnelPassphrase` | String | The optional passphrase for `sshTunnelIdentityFile` | `undefined` |\n\nDescription of `sshTunnel` values:\n\n- `NONE` - Do not use SSH tunneling.\n- `USER_PASSWORD` - The tunnel is created with SSH username and password only.\n- `IDENTITY_FILE` - The tunnel is created using an identity file.\n\n## Derived Properties\n\nDerived properties (also known as computed properties) are properties of the state object that depend on other properties to determine their value.\n\n```javascript\nconst c = new Connection();\nconst derivedProps = c.getAttributes({ derived: true });\n```\n\n| Derived Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `instanceId` | String | The mongoscope | `localhost:27017` |\n| `driverAuthMechanism` | String | Converts the value of `authStrategy` for humans into the `authMechanism` value for the driver | `undefined` |\n| `safeUrl` | String | The URL where a password is replaced with stars | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrl` | String | Use this URL in order to connect via DataService | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrlWithSsh` | String | Use this URL in order to connect via connection model itself | `mongodb://localhost:29201/?readPreference=primary&ssl=false` |\n| `driverOptions` | String | The second argument `mongoscope-server` passes to `mongodb.connect` | `{}` |\n\n## Events\n\n> New in mongodb-connection-model@5.0.0\n\n#### Example: SSH Tunnel\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', skipped: true,\n  reason: 'The selected SSL mode does not need to load any files.' }\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', complete: true}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n#### Example: SSL\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  ssl: 'ALL',\n  sslCA: '~/.ssl/my-ca.pem',\n  sslCert: '~/.ssl/my-server.pem',\n  sslKey: '~/.ssl/my-server.pem'\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', complete: true}\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', skipped: true,\n  reason: 'The selected SSH Tunnel mode is NONE.'}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n[workflow_img]: https://github.com/mongodb-js/connection-model/workflows/Check%20and%20Test/badge.svg?event=push\n[workflow_url]: https://github.com/mongodb-js/connection-model/actions?query=workflow%3A%22Check+and+Test%22\n[npm_img]: https://img.shields.io/npm/v/mongodb-connection-model.svg?style=flat-square\n[npm_url]: https://www.npmjs.org/package/mongodb-connection-model\n[gitter_img]: https://badges.gitter.im/Join%20Chat.svg\n[gitter_url]: http://gitter.im/mongodb-js/mongodb-js\n[enterprise_img]: https://img.shields.io/badge/MongoDB-Enterprise-blue.svg?style=flat-square\n[coming_soon_img]: https://img.shields.io/badge/-Coming%20Soon-ff69b4.svg?style=flat-square\n[kerberos-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/kerberos_tests.js\n[ldap-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ldap_tests.js\n[x509-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ssl_x509_tests.js\n[ns]: https://github.com/mongodb-js/ns\n[sf-ssh-tunnel]: http://serverfault.com/questions/597765/how-to-connect-to-mongodb-server-via-ssh-tunnel\n[ec2-key-pairs]: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html\n[driver-ssl-impl]: https://github.com/christkv/mongodb-core/blob/c3d21cb636d74d7a68134ecd3b9f6af536311279/lib/connection/connection.js#L365-L407\n[driver-ssl-tutorial]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/\n[driver-ssl-none]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#no-certificate-validation\n[driver-ssl-server]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate\n[driver-ssl-all]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate-and-present-valid-certificate\n","gitHead":"d43728ce0cf99f511bd2d2aebad966bc49276179","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","test":"mocha","check":"npm run lint && npm run depcheck","pretest":"mongodb-runner install && mongodb-runner start --port=27018","test-ci":"npm run test","depcheck":"depcheck","posttest":"mongodb-runner stop --port=27018","posttest-ci":"node ../../scripts/killall-mongo.js","test-check-ci":"npm run check && npm test"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.17.0+x64 (linux)","description":"MongoDB connection model","directories":{},"_nodeVersion":"16.17.0","compass:main":"index.js","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","debug":"^4.2.0","lodash":"^4.17.15","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.2.0","storage-mixin":"0.0.0-next-d43728ce0cf99f511bd2d2aebad966bc49276179","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.2","@mongodb-js/ssh-tunnel":"0.0.0-next-d43728ce0cf99f511bd2d2aebad966bc49276179","@mongodb-js/compass-utils":"0.0.0-next-d43728ce0cf99f511bd2d2aebad966bc49276179","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.6.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"^4.12.1","depcheck":"^1.4.1","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.9.0","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^4.12.1"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_0.0.0-next-d43728ce0cf99f511bd2d2aebad966bc49276179_1670554008125_0.882861330429322","host":"s3://npm-registry-packages"}},"0.0.0-next-0d9e77c42a99b49fd4ecc7167d0c769866f92ef2":{"name":"mongodb-connection-model","version":"0.0.0-next-0d9e77c42a99b49fd4ecc7167d0c769866f92ef2","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@0.0.0-next-0d9e77c42a99b49fd4ecc7167d0c769866f92ef2","maintainers":[{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"iteng@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"4a8658540dd7377155aedf1b66907e44d070b5dd","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-0.0.0-next-0d9e77c42a99b49fd4ecc7167d0c769866f92ef2.tgz","fileCount":20,"integrity":"sha512-tqkCa3QHiVQW4urqaxgByuQM6FBfzJGTQGfIG9iiqwivv4Akt0Hm8MEZYhD69u/lhXNGma3wCjZGu+GI3aTXXg==","signatures":[{"sig":"MEUCIFcSj4RYqPgZ3DhpiZODgWNJ63INPp/IBOx1aSqeNXzZAiEAuBmM6ZkkEujiPtpWaDSkKFh50taylqPpggO3gPnOow4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":108151,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjkqPbACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmonlxAAnLM3HwE7KWSMviqplyHAwBEHzgWhwr4b2MAfnG3wlLsSFdck\r\ne/1psa658hhcLEVEVzEUkOi/Sb8w+ZGAhWEW0R7JSFVBYFIXQlDMKZEtu1CR\r\ncrPG4kxnA/n6wDRHqfZ+oCOg+RrJRSpywldlHGwPtPScpUTmDuxHZDEyzlIs\r\nmEw4x+E8YbYP64Eo4lg0rp2Vr2rfS8QVHiWnF66ddBdfNtKpLg/nplTDdS0/\r\n8HpGBZO7/ypFzbMHQy/t7iAvxA5lRnci9w5WlhTtTlcueyfKBx7XbH304pRB\r\nF51bFtKHkZBnZG9zFR3UO6UOOA66K/XYFjOwmtI7ADrcEFJo9qOsyGYXGAId\r\nOzIyPw0Ya2dacBMLug5yGNF5ez1fbq9Mf8CwE1Bmfi4L23um8XfMEbhCgE0w\r\n7Kh/zH0JzpUBK//YXgS5mWU75eKQE5T7hckvps6Ryry2F+LH0SpJ1a+WHXJ6\r\nzy8q4yKglphe25abzQfQ+W9WJ0gQ9J3i4ONSCWWrxPGLSBgWVxFV97hHTYv9\r\nDVwLbFpCS18j+3d4ICSxe2RH/NdUfHltUWa0fYvVg2+Cuy+ztBrI2dVCrI93\r\ncPqwZLdxQBduxOTa92+MdvL/cL2dU3j5dkoW9tqpGGNlQelwD/mIoMs8e1ra\r\nt27LbAk01TEnv8fCfNnDAsRt946F/xmwIic=\r\n=E2Gd\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","readme":"# mongodb-connection-model [![][workflow_img]][workflow_url] [![][npm_img]][npm_url]\n\n> MongoDB connection model\n\nThe main purpose of the MongoDB connection model is to be a domain model around a MongoDB connection. It encapsulates generating a [Connection String URI](https://docs.mongodb.com/manual/reference/connection-string/) from a group of attributes and parses URI using the [MongoDB Node.JS Driver URI Parser](https://github.com/mongodb-js/mongodb-core/blob/master/lib/uri_parser.js).\n\n## Installation\n\n```\nnpm install --save mongodb-connection-model\n```\n\n## Usage\n\n### Building URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\nconst c = new Connection({ appname: 'My App Name' });\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://localhost:27017/?readPreference=primary&appname=My%20App&ssl=false'\n```\n\n### Parsing URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\n\nConnection.from(\n  'mongodb://someUsername:testPassword@localhost',\n  (error, result) => {\n    console.log(result);\n    >>> `{\n      hosts: [{ host: 'localhost', port: 27017 }],\n      hostname: 'localhost',\n      port: 27017,\n      auth: {\n        username: 'someUsername',\n        password: 'testPassword',\n        db: 'admin'\n      },\n      isSrvRecord: false,\n      authStrategy: 'MONGODB',\n      mongodbUsername: 'someUsername',\n      mongodbPassword: 'testPassword',\n      mongodbDatabaseName: 'admin',\n      extraOptions: {},\n      connectionType: 'NODE_DRIVER',\n      readPreference: 'primary',\n      kerberosCanonicalizeHostname: false,\n      sslMethod: 'NONE',\n      sshTunnel: 'NONE',\n      sshTunnelPort: 22\n    }`\n  }\n);\n```\n\n## Properties\n\nMongoDB connection model is based on Ampersand.js framework and consist of [props](https://ampersandjs.com/docs/#ampersand-state-props) and [derived props](https://ampersandjs.com/docs/#ampersand-state-derived). The props object describes the observable properties that MongoDB connection model gets from the Node.js Driver API.\n\n```javascript\nconst с = new Connection();\nconst props = с.getAttributes({ props: true });\n```\n\n#### See Also\n\n- [URI Generic Syntax](https://tools.ietf.org/html/rfc3986)\n- [URI Options Specification](https://github.com/mongodb/specifications/blob/master/source/uri-options/uri-options.rst)\n\n### General Properties\n\n```javascript\nconst c = new Connection({ isSrvRecord: true });\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ns` | String | A valid [ns][ns] the user can read from | `undefined` |\n| `isSrvRecord` | Boolean | Indicates SRV record | `false` |\n| `auth` | Object | Authentication from driver (username, user, db, password) | `undefined` |\n| `hostname` | String | Hostname of a MongoDB Instance. In case of the replica set the first host and port will be taken | `localhost` |\n| `port` | Number | TCP port of a MongoDB Instance | `27017` |\n| `hosts` | Array | Contains all hosts and ports for replica set | `[{ host: 'localhost', port: 27017 }]` |\n| `extraOptions` | Object | Extra options passed to the node driver as part of `driverOptions` | `{}` |\n| `connectionType` | String | The desired connection type. Possible values: `NODE_DRIVER`, `STITCH_ON_PREM`, `STITCH_ATLAS` | `NODE_DRIVER` |\n| `authStrategy` | String | The desired authentication strategy. Possible values: `NONE`, `MONGODB`, `X509`, `KERBEROS`, `LDAP`, `SCRAM-SHA-256` | `NONE` |\n\n### Connection string options\n\n```javascript\nconst c = new Connection({ appname: 'My App', replicaSet: 'testing' });\n```\n\n#### General connection string options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `replicaSet` | String | Specifies the name of the replica set, if the mongod is a member of a replica set | `undefined` |\n| `connectTimeoutMS` | Number | The time in milliseconds to attempt a connection before timing out | `undefined` |\n| `socketTimeoutMS` | Number | The time in milliseconds to attempt a send or receive on a socket before the attempt times out | `undefined` |\n| `compression` | Object | Object includes compressors and a compression level. The following compressors can be specified: `snappy`, `zlib` (Available in MongoDB 3.6 or greater) | `undefined` |\n\n#### Connection Pool Option\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `maxPoolSize` | Number | The maximum number of connections in the connection pool | `undefined` |\n| `minPoolSize` | Number | The minimum number of connections in the connection pool | `undefined` |\n| `maxIdleTimeMS` | Number | The maximum number of milliseconds that a connection can remain idle in the pool before being removed and closed | `undefined` |\n| `waitQueueMultiple` | Number | A number that the driver multiples the maxPoolSize value to, to provide the maximum number of threads allowed to wait for a connection to become available from the pool | `undefined` |\n| `waitQueueTimeoutMS` | Number | The maximum time in milliseconds that a thread can wait for a connection to become available | `undefined` |\n\n#### Write Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `w` | Number/String | Corresponds to the write concern [w Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-w) | `undefined` |\n| `wTimeoutMS` | Number | Corresponds to the write concern [wtimeout](https://docs.mongodb.com/manual/reference/write-concern/#wc-wtimeout) | `undefined` |\n| `journal` | Boolean | Corresponds to the write concern [j Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-j) | `undefined` |\n\n#### Read Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readConcernLevel` | String | The level of isolation | `undefined` |\n\n#### Read Preference Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readPreference` | String | Specifies the read preferences for this connection. Possible values: `PRIMARY`, `PRIMARY_PREFERRED`, `SECONDARY`, `SECONDARY_PREFERRED`, `NEAREST` | `PRIMARY` |\n| `maxStalenessSeconds` | Number | Specifies, in seconds, how stale a secondary can be before the client stops using it for read operations | `undefined` |\n| `readPreferenceTags` | Object | Default read preference tags for the client | `undefined` |\n\n#### Authentication Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `authSource` | String | Specify the database name associated with the user’s credentials | `undefined` |\n| `authMechanism` | String | Specifies the authentication mechanism that MongoDB will use to authenticate the connection. Possible values: `DEFAULT`, `GSSAPI`, `MONGODB-X509`, `PLAIN`, `SCRAM-SHA-256` | `undefined` |\n| `authMechanismProperties` | Object | Additional options provided for authentication (e.g. to enable hostname canonicalization for GSSAPI) | `undefined` |\n| `gssapiServiceName` | String | Set the Kerberos service name when connecting to Kerberized MongoDB instances | `undefined` |\n| `gssapiServiceRealm` | String | Set the Realm service name | `undefined` |\n| `gssapiCanonicalizeHostName` | Boolean | Whether canonicalized hostname | `undefined` |\n\n#### Server Selection and Discovery Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `localThresholdMS` | Number | The size (in milliseconds) of the latency window for selecting among multiple suitable MongoDB instances | `undefined` |\n| `serverSelectionTimeoutMS` | Number | Specifies how long (in milliseconds) to block for server selection before throwing an exception | `undefined` |\n| `serverSelectionTryOnce` | Boolean | Instructs the driver to scan the MongoDB deployment exactly once after server selection fails and then either select a server or raise an error | `undefined` |\n| `heartbeatFrequencyMS` | Number | Controls when the driver checks the state of the MongoDB deployment | `undefined` |\n\n#### Miscellaneous Configuration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `appname` | String | An application name passed to server as client metadata | `undefined` |\n| `retryWrites` | Boolean | Enable retryable writes | `undefined` |\n| `uuidRepresentation` | String | The legacy representation of UUID. Possible values: `standard`, `csharpLegacy`, `javaLegacy`, `pythonLegacy` | `undefined` |\n| `loadBalanced` | Boolean | Whether or not the server is running in load balanced mode | `undefined` |\n\n### Stitch attributes\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `stitchServiceName` | String | Stitch service name | `undefined` |\n| `stitchClientAppId` | String | Stitch сlient app ID | `undefined` |\n| `stitchGroupId` | String | Stitch group ID | `undefined` |\n| `stitchBaseUrl` | String | Stitch base Url | `undefined` |\n\n### MONGODB authentication\n\n```javascript\nconst c = new Connection({\n  mongodbUsername: 'arlo',\n  mongodbPassword: 'w@of'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/?slaveOk=true&authSource=admin'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `mongodbUsername` | String | MongoDB username | `undefined` |\n| `mongodbPassword` | String | MongoDB password | `undefined` |\n| `mongodbDatabaseName` | String | The database name associated with the user's credentials | `undefined` |\n| `promoteValues` | Boolean | Whether BSON values should be promoted to their JS type counterparts | `undefined` |\n\n### KERBEROS authentication\n\n```javascript\nconst c = new Connection({\n  kerberosServiceName: 'mongodb',\n  kerberosPrincipal: 'arlo/dog@krb5.mongodb.parts',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo%252Fdog%2540krb5.mongodb.parts@localhost:27017/toys?authMechanism=GSSAPI'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n> @note (imlucas): Kerberos on Windows is broken out as it's own state for UX consideration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `kerberosServiceName` | String | Any program or computer you access over a network | `undefined` |\n| `kerberosPrincipal` | String | The format of a typical Kerberos V5 principal is `primary/instance@REALM` | `undefined` |\n| `kerberosCanonicalizeHostname` | Boolean | Whether canonicalized kerberos hostname | `undefined` |\n\n#### See Also\n\n- [node.js driver Kerberos reference](http://bit.ly/mongodb-node-driver-kerberos)\n- [node.js driver Kerberos functional test][kerberos-functional]\n\n### LDAP authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  ldapUsername: 'arlo',\n  ldapPassword: 'w@of',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/toys?slaveOk=true&authMechanism=PLAIN'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ldapUsername` | String | LDAP username | `undefined` |\n| `ldapPassword` | String | LDAP password | `undefined` |\n\n#### See Also\n\n- [node.js driver LDAP reference](http://bit.ly/mongodb-node-driver-ldap)\n- [node.js driver X509 functional test][ldap-functional]\n\n### X509 authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  x509Username: 'CN=client,OU=arlo,O=MongoDB,L=Philadelphia,ST=Pennsylvania,C=US'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://CN%253Dclient%252COU%253Darlo%252CO%253DMongoDB%252CL%253DPhiladelphia%252CST%253DPennsylvania%252CC%253DUS@localhost:27017?slaveOk=true&authMechanism=MONGODB-X509'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `x509Username` | String | The x.509 certificate derived user name, e.g. `CN=user,OU=OrgUnit,O=myOrg,...` | `undefined` |\n\n#### See Also\n\n- [node.js driver X509 reference](http://bit.ly/mongodb-node-driver-x509)\n- [node.js driver X509 functional test][x509-functional]\n\n### SSL\n\n> **Note**: Not to be confused with `authentication=X509`\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ssl` | Number/String | A boolean to enable or disables TLS/SSL for the connection | `undefined` |\n| `sslMethod` | String | The desired ssl method. Possible values: `NONE`, `SYSTEMCA`, `IFAVAILABLE`, `UNVALIDATED`, `SERVER`, `ALL` | `NONE` |\n| `sslCA` | Buffer/String | Array of valid certificates | `undefined` |\n| `sslCert` | Buffer/String | The certificate | `undefined` |\n| `sslKey` | Buffer/String | The certificate private key | `undefined` |\n| `sslPass` | Buffer/String | The certificate password | `undefined` |\n\nDescription of `sslMethod` values:\n\n- `SYSTEMCA` - SSL required, validate using System CA, with host verification.\n- `IFAVAILABLE` - The driver should try SSL first, fall back to no SSL if unavailable, and use the system's Certificate Authority.\n- `SERVER` - The driver should validate the server certificate and fail to connect if validation fails. See also [node.js driver \"Validate Server Certificate\" docs][driver-ssl-server].\n- `ALL` - The driver must present a valid certificate and validate the server certificate. See also [node.js driver \"Validate Server Certificate and Present Valid Certificate\" docs][driver-ssl-all].\n- `NONE` - No SSL (Not recommended).\n- `UNVALIDATED` - Use SSL but do not perform any validation of the certificate chain. See also [node.js driver \"No Certificate Validation\" docs][driver-ssl-none]. **Very** not recommended and likely to be deprecated in future releases because it exposes potential Man-In-The-Middle attack vectors.\n\n#### See also\n\n- [node.js driver SSL implementation][driver-ssl-impl]\n- [node.js driver SSL tutorial][driver-ssl-tutorial]\n\n### SSH TUNNEL\n\n> New in mongodb-connection-model@5.0.0\n\nBecause [authentication](#authentication) is quite difficult for operators to migrate to, the most common method of securing a MongoDB deployment is to use an [SSH tunnel][sf-ssh-tunnel].  This allows operators to leverage their existing SSH security infrastructure to also provide secure access to MongoDB.  For a standard deployment of MongoDB on AWS, this is almost always to strategy.  Because of this, we now support creating SSH tunnels automatically when connecting to MongoDB.\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options, (connectionError, client) => {\n  if (connectionError) {\n    return console.log(connectionError);\n  }\n\n  client.db('mongodb').collection('fanclub').count((countingError, count) => {\n    console.log('counted:', countingError, count);\n    client.close();\n  });\n});\n```\n\nThe above provides the same functionality as creating the tunnel using the bash\ncommand below and connecting to MongoDB via another terminal. Notice that\nconnection-model uses a random local port each time it creates a tunnel.\nUsing the command line, you'd have to replace `<random port>` with an actual\nport number.\n\n```bash\nssh -i ~/.ssh/my-key-aws-pair.pem -L <random port>:localhost:27017 ubuntu@ec2-11-111-111-111.compute-1.amazonaws.com\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `sshTunnel` | String | The desired SSH tunnel strategy. Possible values: `NONE`, `USER_PASSWORD`, `IDENTITY_FILE` | `undefined` |\n| `sshTunnelHostname` | String | The hostname of the SSH remote host | `undefined` |\n| `sshTunnelPort` | Port | The SSH port of the remote host | `22` |\n| `sshTunnelBindToLocalPort` | Port | Bind the localhost endpoint of the SSH Tunnel to this port | `undefined` |\n| `sshTunnelUsername` | String | The optional SSH username for the remote host | `undefined` |\n| `sshTunnelPassword` | String | The optional SSH password for the remote host | `undefined` |\n| `sshTunnelIdentityFile` | String/Array | The optional path to the SSH identity file for the remote host | `undefined` |\n| `sshTunnelPassphrase` | String | The optional passphrase for `sshTunnelIdentityFile` | `undefined` |\n\nDescription of `sshTunnel` values:\n\n- `NONE` - Do not use SSH tunneling.\n- `USER_PASSWORD` - The tunnel is created with SSH username and password only.\n- `IDENTITY_FILE` - The tunnel is created using an identity file.\n\n## Derived Properties\n\nDerived properties (also known as computed properties) are properties of the state object that depend on other properties to determine their value.\n\n```javascript\nconst c = new Connection();\nconst derivedProps = c.getAttributes({ derived: true });\n```\n\n| Derived Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `instanceId` | String | The mongoscope | `localhost:27017` |\n| `driverAuthMechanism` | String | Converts the value of `authStrategy` for humans into the `authMechanism` value for the driver | `undefined` |\n| `safeUrl` | String | The URL where a password is replaced with stars | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrl` | String | Use this URL in order to connect via DataService | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrlWithSsh` | String | Use this URL in order to connect via connection model itself | `mongodb://localhost:29201/?readPreference=primary&ssl=false` |\n| `driverOptions` | String | The second argument `mongoscope-server` passes to `mongodb.connect` | `{}` |\n\n## Events\n\n> New in mongodb-connection-model@5.0.0\n\n#### Example: SSH Tunnel\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', skipped: true,\n  reason: 'The selected SSL mode does not need to load any files.' }\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', complete: true}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n#### Example: SSL\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  ssl: 'ALL',\n  sslCA: '~/.ssl/my-ca.pem',\n  sslCert: '~/.ssl/my-server.pem',\n  sslKey: '~/.ssl/my-server.pem'\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', complete: true}\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', skipped: true,\n  reason: 'The selected SSH Tunnel mode is NONE.'}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n[workflow_img]: https://github.com/mongodb-js/connection-model/workflows/Check%20and%20Test/badge.svg?event=push\n[workflow_url]: https://github.com/mongodb-js/connection-model/actions?query=workflow%3A%22Check+and+Test%22\n[npm_img]: https://img.shields.io/npm/v/mongodb-connection-model.svg?style=flat-square\n[npm_url]: https://www.npmjs.org/package/mongodb-connection-model\n[gitter_img]: https://badges.gitter.im/Join%20Chat.svg\n[gitter_url]: http://gitter.im/mongodb-js/mongodb-js\n[enterprise_img]: https://img.shields.io/badge/MongoDB-Enterprise-blue.svg?style=flat-square\n[coming_soon_img]: https://img.shields.io/badge/-Coming%20Soon-ff69b4.svg?style=flat-square\n[kerberos-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/kerberos_tests.js\n[ldap-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ldap_tests.js\n[x509-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ssl_x509_tests.js\n[ns]: https://github.com/mongodb-js/ns\n[sf-ssh-tunnel]: http://serverfault.com/questions/597765/how-to-connect-to-mongodb-server-via-ssh-tunnel\n[ec2-key-pairs]: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html\n[driver-ssl-impl]: https://github.com/christkv/mongodb-core/blob/c3d21cb636d74d7a68134ecd3b9f6af536311279/lib/connection/connection.js#L365-L407\n[driver-ssl-tutorial]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/\n[driver-ssl-none]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#no-certificate-validation\n[driver-ssl-server]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate\n[driver-ssl-all]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate-and-present-valid-certificate\n","gitHead":"0d9e77c42a99b49fd4ecc7167d0c769866f92ef2","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","test":"mocha","check":"npm run lint && npm run depcheck","pretest":"mongodb-runner install && mongodb-runner start --port=27018","test-ci":"npm run test","depcheck":"depcheck","posttest":"mongodb-runner stop --port=27018","posttest-ci":"node ../../scripts/killall-mongo.js","test-check-ci":"npm run check && npm test"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.17.0+x64 (linux)","description":"MongoDB connection model","directories":{},"_nodeVersion":"16.17.0","compass:main":"index.js","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","debug":"^4.2.0","lodash":"^4.17.15","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.2.0","storage-mixin":"0.0.0-next-0d9e77c42a99b49fd4ecc7167d0c769866f92ef2","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.2","@mongodb-js/ssh-tunnel":"0.0.0-next-0d9e77c42a99b49fd4ecc7167d0c769866f92ef2","@mongodb-js/compass-utils":"0.0.0-next-0d9e77c42a99b49fd4ecc7167d0c769866f92ef2","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.6.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"^4.12.1","depcheck":"^1.4.1","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.9.0","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^4.12.1"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_0.0.0-next-0d9e77c42a99b49fd4ecc7167d0c769866f92ef2_1670554586963_0.17476281555844309","host":"s3://npm-registry-packages"}},"0.0.0-next-907430527b638cb96704541b347715ec1dcc648b":{"name":"mongodb-connection-model","version":"0.0.0-next-907430527b638cb96704541b347715ec1dcc648b","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@0.0.0-next-907430527b638cb96704541b347715ec1dcc648b","maintainers":[{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"iteng@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"10d2b0e309dea4c86b1d58c2bffd0887c3c1984d","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-0.0.0-next-907430527b638cb96704541b347715ec1dcc648b.tgz","fileCount":20,"integrity":"sha512-OmYCmbyQxjt0LsrM6RAqVjNA6/4mRfvvdoaZmrJaZJmuNUsa4K/Yz4HVEUGxkp1jHRpWycUnXARJjig8O2xdtQ==","signatures":[{"sig":"MEUCIQDK6hwLEaad7NhA3fArfLS5BYPzwj6Wqjt2fJpJUS0/CAIgDtF4g1XpPLbSO8Oqz7gTFMNPUJSH0EkDnDlf/96vTck=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":108151,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjl54VACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqZlA/5AHEKXHFUMThlhfdgmXMDzy3RPkdFhJa18SkBjYFN0v9Ja6LF\r\nU1am2nfD4Z4YztJGOsqywkmzJkVRqkI84QMxOCJQ2srKhoVG4DDJqV/KOzy7\r\nuF/jQKIIRWc5+HPgzYmCmfZ29x489EEyTrAfbgor0uv4nfktxX9VNx961OoI\r\ncJpO4UQH/0twbqi5f8Dn8L/utwpLUhUAe8v3Amp1xwc4oBnjshGAZQ+n67R6\r\nfUMsiC9SBriH67/UBAClecxpz1GSPH3gvJPgoYj0VilmLNAP0exqhDcmLD/h\r\nARpgf7N+LLCAlthNzFrduAvz0rb0QjaOihtmojMA1xlMP7WzZh0gw6Obe+yb\r\nDXhO/bV1/5hmZLepA9yRAjSHGCRd79Im2SM8+7MvvNCepdJXtI3kts73bHtg\r\nc4MBnhalWVXRLJa2/yiyiYcDCmWR0DSUXtBeyRAYBtKd8RKpwXJ9E87Jz8x7\r\nOnEeMQlgA+24VrlEetsLt5SoqJR51SXwIsJrRubGCCCX/H4axVwXNYVqRu8Z\r\nvLS76C0abQU3gDhL6HXZV+8hcFKpecSOuYNc8mAkweUNqGTXLeVkxLiAPXyJ\r\n+g0a/L73KrNAOnq+BQhtEIUA9INXZbpycA6s/lGIG93GzMHPM+WkOle70VzR\r\n8Fr68e9ACg9UCqjznowo9d3qumaKugyBi2k=\r\n=UwiI\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","readme":"# mongodb-connection-model [![][workflow_img]][workflow_url] [![][npm_img]][npm_url]\n\n> MongoDB connection model\n\nThe main purpose of the MongoDB connection model is to be a domain model around a MongoDB connection. It encapsulates generating a [Connection String URI](https://docs.mongodb.com/manual/reference/connection-string/) from a group of attributes and parses URI using the [MongoDB Node.JS Driver URI Parser](https://github.com/mongodb-js/mongodb-core/blob/master/lib/uri_parser.js).\n\n## Installation\n\n```\nnpm install --save mongodb-connection-model\n```\n\n## Usage\n\n### Building URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\nconst c = new Connection({ appname: 'My App Name' });\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://localhost:27017/?readPreference=primary&appname=My%20App&ssl=false'\n```\n\n### Parsing URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\n\nConnection.from(\n  'mongodb://someUsername:testPassword@localhost',\n  (error, result) => {\n    console.log(result);\n    >>> `{\n      hosts: [{ host: 'localhost', port: 27017 }],\n      hostname: 'localhost',\n      port: 27017,\n      auth: {\n        username: 'someUsername',\n        password: 'testPassword',\n        db: 'admin'\n      },\n      isSrvRecord: false,\n      authStrategy: 'MONGODB',\n      mongodbUsername: 'someUsername',\n      mongodbPassword: 'testPassword',\n      mongodbDatabaseName: 'admin',\n      extraOptions: {},\n      connectionType: 'NODE_DRIVER',\n      readPreference: 'primary',\n      kerberosCanonicalizeHostname: false,\n      sslMethod: 'NONE',\n      sshTunnel: 'NONE',\n      sshTunnelPort: 22\n    }`\n  }\n);\n```\n\n## Properties\n\nMongoDB connection model is based on Ampersand.js framework and consist of [props](https://ampersandjs.com/docs/#ampersand-state-props) and [derived props](https://ampersandjs.com/docs/#ampersand-state-derived). The props object describes the observable properties that MongoDB connection model gets from the Node.js Driver API.\n\n```javascript\nconst с = new Connection();\nconst props = с.getAttributes({ props: true });\n```\n\n#### See Also\n\n- [URI Generic Syntax](https://tools.ietf.org/html/rfc3986)\n- [URI Options Specification](https://github.com/mongodb/specifications/blob/master/source/uri-options/uri-options.rst)\n\n### General Properties\n\n```javascript\nconst c = new Connection({ isSrvRecord: true });\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ns` | String | A valid [ns][ns] the user can read from | `undefined` |\n| `isSrvRecord` | Boolean | Indicates SRV record | `false` |\n| `auth` | Object | Authentication from driver (username, user, db, password) | `undefined` |\n| `hostname` | String | Hostname of a MongoDB Instance. In case of the replica set the first host and port will be taken | `localhost` |\n| `port` | Number | TCP port of a MongoDB Instance | `27017` |\n| `hosts` | Array | Contains all hosts and ports for replica set | `[{ host: 'localhost', port: 27017 }]` |\n| `extraOptions` | Object | Extra options passed to the node driver as part of `driverOptions` | `{}` |\n| `connectionType` | String | The desired connection type. Possible values: `NODE_DRIVER`, `STITCH_ON_PREM`, `STITCH_ATLAS` | `NODE_DRIVER` |\n| `authStrategy` | String | The desired authentication strategy. Possible values: `NONE`, `MONGODB`, `X509`, `KERBEROS`, `LDAP`, `SCRAM-SHA-256` | `NONE` |\n\n### Connection string options\n\n```javascript\nconst c = new Connection({ appname: 'My App', replicaSet: 'testing' });\n```\n\n#### General connection string options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `replicaSet` | String | Specifies the name of the replica set, if the mongod is a member of a replica set | `undefined` |\n| `connectTimeoutMS` | Number | The time in milliseconds to attempt a connection before timing out | `undefined` |\n| `socketTimeoutMS` | Number | The time in milliseconds to attempt a send or receive on a socket before the attempt times out | `undefined` |\n| `compression` | Object | Object includes compressors and a compression level. The following compressors can be specified: `snappy`, `zlib` (Available in MongoDB 3.6 or greater) | `undefined` |\n\n#### Connection Pool Option\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `maxPoolSize` | Number | The maximum number of connections in the connection pool | `undefined` |\n| `minPoolSize` | Number | The minimum number of connections in the connection pool | `undefined` |\n| `maxIdleTimeMS` | Number | The maximum number of milliseconds that a connection can remain idle in the pool before being removed and closed | `undefined` |\n| `waitQueueMultiple` | Number | A number that the driver multiples the maxPoolSize value to, to provide the maximum number of threads allowed to wait for a connection to become available from the pool | `undefined` |\n| `waitQueueTimeoutMS` | Number | The maximum time in milliseconds that a thread can wait for a connection to become available | `undefined` |\n\n#### Write Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `w` | Number/String | Corresponds to the write concern [w Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-w) | `undefined` |\n| `wTimeoutMS` | Number | Corresponds to the write concern [wtimeout](https://docs.mongodb.com/manual/reference/write-concern/#wc-wtimeout) | `undefined` |\n| `journal` | Boolean | Corresponds to the write concern [j Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-j) | `undefined` |\n\n#### Read Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readConcernLevel` | String | The level of isolation | `undefined` |\n\n#### Read Preference Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readPreference` | String | Specifies the read preferences for this connection. Possible values: `PRIMARY`, `PRIMARY_PREFERRED`, `SECONDARY`, `SECONDARY_PREFERRED`, `NEAREST` | `PRIMARY` |\n| `maxStalenessSeconds` | Number | Specifies, in seconds, how stale a secondary can be before the client stops using it for read operations | `undefined` |\n| `readPreferenceTags` | Object | Default read preference tags for the client | `undefined` |\n\n#### Authentication Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `authSource` | String | Specify the database name associated with the user’s credentials | `undefined` |\n| `authMechanism` | String | Specifies the authentication mechanism that MongoDB will use to authenticate the connection. Possible values: `DEFAULT`, `GSSAPI`, `MONGODB-X509`, `PLAIN`, `SCRAM-SHA-256` | `undefined` |\n| `authMechanismProperties` | Object | Additional options provided for authentication (e.g. to enable hostname canonicalization for GSSAPI) | `undefined` |\n| `gssapiServiceName` | String | Set the Kerberos service name when connecting to Kerberized MongoDB instances | `undefined` |\n| `gssapiServiceRealm` | String | Set the Realm service name | `undefined` |\n| `gssapiCanonicalizeHostName` | Boolean | Whether canonicalized hostname | `undefined` |\n\n#### Server Selection and Discovery Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `localThresholdMS` | Number | The size (in milliseconds) of the latency window for selecting among multiple suitable MongoDB instances | `undefined` |\n| `serverSelectionTimeoutMS` | Number | Specifies how long (in milliseconds) to block for server selection before throwing an exception | `undefined` |\n| `serverSelectionTryOnce` | Boolean | Instructs the driver to scan the MongoDB deployment exactly once after server selection fails and then either select a server or raise an error | `undefined` |\n| `heartbeatFrequencyMS` | Number | Controls when the driver checks the state of the MongoDB deployment | `undefined` |\n\n#### Miscellaneous Configuration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `appname` | String | An application name passed to server as client metadata | `undefined` |\n| `retryWrites` | Boolean | Enable retryable writes | `undefined` |\n| `uuidRepresentation` | String | The legacy representation of UUID. Possible values: `standard`, `csharpLegacy`, `javaLegacy`, `pythonLegacy` | `undefined` |\n| `loadBalanced` | Boolean | Whether or not the server is running in load balanced mode | `undefined` |\n\n### Stitch attributes\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `stitchServiceName` | String | Stitch service name | `undefined` |\n| `stitchClientAppId` | String | Stitch сlient app ID | `undefined` |\n| `stitchGroupId` | String | Stitch group ID | `undefined` |\n| `stitchBaseUrl` | String | Stitch base Url | `undefined` |\n\n### MONGODB authentication\n\n```javascript\nconst c = new Connection({\n  mongodbUsername: 'arlo',\n  mongodbPassword: 'w@of'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/?slaveOk=true&authSource=admin'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `mongodbUsername` | String | MongoDB username | `undefined` |\n| `mongodbPassword` | String | MongoDB password | `undefined` |\n| `mongodbDatabaseName` | String | The database name associated with the user's credentials | `undefined` |\n| `promoteValues` | Boolean | Whether BSON values should be promoted to their JS type counterparts | `undefined` |\n\n### KERBEROS authentication\n\n```javascript\nconst c = new Connection({\n  kerberosServiceName: 'mongodb',\n  kerberosPrincipal: 'arlo/dog@krb5.mongodb.parts',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo%252Fdog%2540krb5.mongodb.parts@localhost:27017/toys?authMechanism=GSSAPI'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n> @note (imlucas): Kerberos on Windows is broken out as it's own state for UX consideration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `kerberosServiceName` | String | Any program or computer you access over a network | `undefined` |\n| `kerberosPrincipal` | String | The format of a typical Kerberos V5 principal is `primary/instance@REALM` | `undefined` |\n| `kerberosCanonicalizeHostname` | Boolean | Whether canonicalized kerberos hostname | `undefined` |\n\n#### See Also\n\n- [node.js driver Kerberos reference](http://bit.ly/mongodb-node-driver-kerberos)\n- [node.js driver Kerberos functional test][kerberos-functional]\n\n### LDAP authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  ldapUsername: 'arlo',\n  ldapPassword: 'w@of',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/toys?slaveOk=true&authMechanism=PLAIN'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ldapUsername` | String | LDAP username | `undefined` |\n| `ldapPassword` | String | LDAP password | `undefined` |\n\n#### See Also\n\n- [node.js driver LDAP reference](http://bit.ly/mongodb-node-driver-ldap)\n- [node.js driver X509 functional test][ldap-functional]\n\n### X509 authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  x509Username: 'CN=client,OU=arlo,O=MongoDB,L=Philadelphia,ST=Pennsylvania,C=US'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://CN%253Dclient%252COU%253Darlo%252CO%253DMongoDB%252CL%253DPhiladelphia%252CST%253DPennsylvania%252CC%253DUS@localhost:27017?slaveOk=true&authMechanism=MONGODB-X509'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `x509Username` | String | The x.509 certificate derived user name, e.g. `CN=user,OU=OrgUnit,O=myOrg,...` | `undefined` |\n\n#### See Also\n\n- [node.js driver X509 reference](http://bit.ly/mongodb-node-driver-x509)\n- [node.js driver X509 functional test][x509-functional]\n\n### SSL\n\n> **Note**: Not to be confused with `authentication=X509`\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ssl` | Number/String | A boolean to enable or disables TLS/SSL for the connection | `undefined` |\n| `sslMethod` | String | The desired ssl method. Possible values: `NONE`, `SYSTEMCA`, `IFAVAILABLE`, `UNVALIDATED`, `SERVER`, `ALL` | `NONE` |\n| `sslCA` | Buffer/String | Array of valid certificates | `undefined` |\n| `sslCert` | Buffer/String | The certificate | `undefined` |\n| `sslKey` | Buffer/String | The certificate private key | `undefined` |\n| `sslPass` | Buffer/String | The certificate password | `undefined` |\n\nDescription of `sslMethod` values:\n\n- `SYSTEMCA` - SSL required, validate using System CA, with host verification.\n- `IFAVAILABLE` - The driver should try SSL first, fall back to no SSL if unavailable, and use the system's Certificate Authority.\n- `SERVER` - The driver should validate the server certificate and fail to connect if validation fails. See also [node.js driver \"Validate Server Certificate\" docs][driver-ssl-server].\n- `ALL` - The driver must present a valid certificate and validate the server certificate. See also [node.js driver \"Validate Server Certificate and Present Valid Certificate\" docs][driver-ssl-all].\n- `NONE` - No SSL (Not recommended).\n- `UNVALIDATED` - Use SSL but do not perform any validation of the certificate chain. See also [node.js driver \"No Certificate Validation\" docs][driver-ssl-none]. **Very** not recommended and likely to be deprecated in future releases because it exposes potential Man-In-The-Middle attack vectors.\n\n#### See also\n\n- [node.js driver SSL implementation][driver-ssl-impl]\n- [node.js driver SSL tutorial][driver-ssl-tutorial]\n\n### SSH TUNNEL\n\n> New in mongodb-connection-model@5.0.0\n\nBecause [authentication](#authentication) is quite difficult for operators to migrate to, the most common method of securing a MongoDB deployment is to use an [SSH tunnel][sf-ssh-tunnel].  This allows operators to leverage their existing SSH security infrastructure to also provide secure access to MongoDB.  For a standard deployment of MongoDB on AWS, this is almost always to strategy.  Because of this, we now support creating SSH tunnels automatically when connecting to MongoDB.\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options, (connectionError, client) => {\n  if (connectionError) {\n    return console.log(connectionError);\n  }\n\n  client.db('mongodb').collection('fanclub').count((countingError, count) => {\n    console.log('counted:', countingError, count);\n    client.close();\n  });\n});\n```\n\nThe above provides the same functionality as creating the tunnel using the bash\ncommand below and connecting to MongoDB via another terminal. Notice that\nconnection-model uses a random local port each time it creates a tunnel.\nUsing the command line, you'd have to replace `<random port>` with an actual\nport number.\n\n```bash\nssh -i ~/.ssh/my-key-aws-pair.pem -L <random port>:localhost:27017 ubuntu@ec2-11-111-111-111.compute-1.amazonaws.com\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `sshTunnel` | String | The desired SSH tunnel strategy. Possible values: `NONE`, `USER_PASSWORD`, `IDENTITY_FILE` | `undefined` |\n| `sshTunnelHostname` | String | The hostname of the SSH remote host | `undefined` |\n| `sshTunnelPort` | Port | The SSH port of the remote host | `22` |\n| `sshTunnelBindToLocalPort` | Port | Bind the localhost endpoint of the SSH Tunnel to this port | `undefined` |\n| `sshTunnelUsername` | String | The optional SSH username for the remote host | `undefined` |\n| `sshTunnelPassword` | String | The optional SSH password for the remote host | `undefined` |\n| `sshTunnelIdentityFile` | String/Array | The optional path to the SSH identity file for the remote host | `undefined` |\n| `sshTunnelPassphrase` | String | The optional passphrase for `sshTunnelIdentityFile` | `undefined` |\n\nDescription of `sshTunnel` values:\n\n- `NONE` - Do not use SSH tunneling.\n- `USER_PASSWORD` - The tunnel is created with SSH username and password only.\n- `IDENTITY_FILE` - The tunnel is created using an identity file.\n\n## Derived Properties\n\nDerived properties (also known as computed properties) are properties of the state object that depend on other properties to determine their value.\n\n```javascript\nconst c = new Connection();\nconst derivedProps = c.getAttributes({ derived: true });\n```\n\n| Derived Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `instanceId` | String | The mongoscope | `localhost:27017` |\n| `driverAuthMechanism` | String | Converts the value of `authStrategy` for humans into the `authMechanism` value for the driver | `undefined` |\n| `safeUrl` | String | The URL where a password is replaced with stars | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrl` | String | Use this URL in order to connect via DataService | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrlWithSsh` | String | Use this URL in order to connect via connection model itself | `mongodb://localhost:29201/?readPreference=primary&ssl=false` |\n| `driverOptions` | String | The second argument `mongoscope-server` passes to `mongodb.connect` | `{}` |\n\n## Events\n\n> New in mongodb-connection-model@5.0.0\n\n#### Example: SSH Tunnel\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', skipped: true,\n  reason: 'The selected SSL mode does not need to load any files.' }\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', complete: true}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n#### Example: SSL\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  ssl: 'ALL',\n  sslCA: '~/.ssl/my-ca.pem',\n  sslCert: '~/.ssl/my-server.pem',\n  sslKey: '~/.ssl/my-server.pem'\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', complete: true}\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', skipped: true,\n  reason: 'The selected SSH Tunnel mode is NONE.'}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n[workflow_img]: https://github.com/mongodb-js/connection-model/workflows/Check%20and%20Test/badge.svg?event=push\n[workflow_url]: https://github.com/mongodb-js/connection-model/actions?query=workflow%3A%22Check+and+Test%22\n[npm_img]: https://img.shields.io/npm/v/mongodb-connection-model.svg?style=flat-square\n[npm_url]: https://www.npmjs.org/package/mongodb-connection-model\n[gitter_img]: https://badges.gitter.im/Join%20Chat.svg\n[gitter_url]: http://gitter.im/mongodb-js/mongodb-js\n[enterprise_img]: https://img.shields.io/badge/MongoDB-Enterprise-blue.svg?style=flat-square\n[coming_soon_img]: https://img.shields.io/badge/-Coming%20Soon-ff69b4.svg?style=flat-square\n[kerberos-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/kerberos_tests.js\n[ldap-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ldap_tests.js\n[x509-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ssl_x509_tests.js\n[ns]: https://github.com/mongodb-js/ns\n[sf-ssh-tunnel]: http://serverfault.com/questions/597765/how-to-connect-to-mongodb-server-via-ssh-tunnel\n[ec2-key-pairs]: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html\n[driver-ssl-impl]: https://github.com/christkv/mongodb-core/blob/c3d21cb636d74d7a68134ecd3b9f6af536311279/lib/connection/connection.js#L365-L407\n[driver-ssl-tutorial]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/\n[driver-ssl-none]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#no-certificate-validation\n[driver-ssl-server]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate\n[driver-ssl-all]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate-and-present-valid-certificate\n","gitHead":"907430527b638cb96704541b347715ec1dcc648b","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","test":"mocha","check":"npm run lint && npm run depcheck","pretest":"mongodb-runner install && mongodb-runner start --port=27018","test-ci":"npm run test","depcheck":"depcheck","posttest":"mongodb-runner stop --port=27018","posttest-ci":"node ../../scripts/killall-mongo.js","test-check-ci":"npm run check && npm test"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.17.0+x64 (linux)","description":"MongoDB connection model","directories":{},"_nodeVersion":"16.17.0","compass:main":"index.js","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","debug":"^4.2.0","lodash":"^4.17.15","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.2.0","storage-mixin":"0.0.0-next-907430527b638cb96704541b347715ec1dcc648b","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.2","@mongodb-js/ssh-tunnel":"0.0.0-next-907430527b638cb96704541b347715ec1dcc648b","@mongodb-js/compass-utils":"0.0.0-next-907430527b638cb96704541b347715ec1dcc648b","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.6.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"^4.12.1","depcheck":"^1.4.1","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.9.0","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^4.12.1"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_0.0.0-next-907430527b638cb96704541b347715ec1dcc648b_1670880789338_0.9921742946753378","host":"s3://npm-registry-packages"}},"0.0.0-next-3888dd701d06bedcc2b043270c5dc626b9997eb0":{"name":"mongodb-connection-model","version":"0.0.0-next-3888dd701d06bedcc2b043270c5dc626b9997eb0","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@0.0.0-next-3888dd701d06bedcc2b043270c5dc626b9997eb0","maintainers":[{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"iteng@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"eb2e0fcffa082281ca1995d17db38664d3520b66","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-0.0.0-next-3888dd701d06bedcc2b043270c5dc626b9997eb0.tgz","fileCount":20,"integrity":"sha512-nncTQUL5I77RGZJq3rRDdpcFm3T+N0K+hqXyw05i5bkAeftqN30N1VYSr3Cee3XXYhQjD4eUa6VWlW2d8O0RRg==","signatures":[{"sig":"MEUCIQCGecM8GxT+zFmjdFuiYDrQZ5/9nsk+saIqMi3Mf/ov0wIgdYKGM5YEbRAayRRd+ItfBwyf8a65L5OBxdn51dFUlIk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":108151,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjl59CACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqmPRAAlZPbECfo/baL/W5vSAB8YVYzMsrx6oSTo6LVu4kB8iRg1MAk\r\nCh1L4SI1H/nEsZfZxjB4P4R60UFHg9W8pWaahXyzj1Ej/na8kysUzzUEdQ80\r\nyObdpA7/ZHIFsXQbH25J0dStNUJu20+6vt6yAa0W81kFSfx0hjtBa18wD3sh\r\ns//18RtLti/aGYujm0zMMeYkQMkRMmwwI1C7HUlLupJmULAGL9Z9FCLsS7Ej\r\nY6mU8UE4s5T9px8x1c5821aVOPPNuzo4IXtUZxn2+VJKiwhdeHMCgwg88UD5\r\nXDD75nwv+Izv5KmKkDVoDzJpUY+HbdH3Q7lCE8pyRLTSKANpeshNAp3YjDki\r\nnvATisyU6m165WCv1QErYxgnr0yxZ93p25sZhKK9VTXSCCSfByH/nW2AYHPs\r\nbqtbpfMx1eRxP4Ltg8Rf5Y1G1hjo3V8Yyd6ZFWwp0HCqvtJMW7Qld0aN6b4e\r\n3WuXUNetW3I6712Lj1l22IMorZdRZ1dVjOn8CmQ4Ale4yjL+qWzhgeUii4bx\r\nC3UAVd32SgDSE1rA60tVDwRyJIR8FJRrJXHYLw0Mn5c8kltkqTG6HlHDTf4g\r\nlkFUhFgzZBgRS2uolgQhsKb/rZiLldnFMOr0p1fcwBsLhjqmbpMVGVYIRqB5\r\n5Ngg18/x+xzNTgCaTe5XVmKk2vAtVogF9rE=\r\n=4hec\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","readme":"# mongodb-connection-model [![][workflow_img]][workflow_url] [![][npm_img]][npm_url]\n\n> MongoDB connection model\n\nThe main purpose of the MongoDB connection model is to be a domain model around a MongoDB connection. It encapsulates generating a [Connection String URI](https://docs.mongodb.com/manual/reference/connection-string/) from a group of attributes and parses URI using the [MongoDB Node.JS Driver URI Parser](https://github.com/mongodb-js/mongodb-core/blob/master/lib/uri_parser.js).\n\n## Installation\n\n```\nnpm install --save mongodb-connection-model\n```\n\n## Usage\n\n### Building URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\nconst c = new Connection({ appname: 'My App Name' });\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://localhost:27017/?readPreference=primary&appname=My%20App&ssl=false'\n```\n\n### Parsing URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\n\nConnection.from(\n  'mongodb://someUsername:testPassword@localhost',\n  (error, result) => {\n    console.log(result);\n    >>> `{\n      hosts: [{ host: 'localhost', port: 27017 }],\n      hostname: 'localhost',\n      port: 27017,\n      auth: {\n        username: 'someUsername',\n        password: 'testPassword',\n        db: 'admin'\n      },\n      isSrvRecord: false,\n      authStrategy: 'MONGODB',\n      mongodbUsername: 'someUsername',\n      mongodbPassword: 'testPassword',\n      mongodbDatabaseName: 'admin',\n      extraOptions: {},\n      connectionType: 'NODE_DRIVER',\n      readPreference: 'primary',\n      kerberosCanonicalizeHostname: false,\n      sslMethod: 'NONE',\n      sshTunnel: 'NONE',\n      sshTunnelPort: 22\n    }`\n  }\n);\n```\n\n## Properties\n\nMongoDB connection model is based on Ampersand.js framework and consist of [props](https://ampersandjs.com/docs/#ampersand-state-props) and [derived props](https://ampersandjs.com/docs/#ampersand-state-derived). The props object describes the observable properties that MongoDB connection model gets from the Node.js Driver API.\n\n```javascript\nconst с = new Connection();\nconst props = с.getAttributes({ props: true });\n```\n\n#### See Also\n\n- [URI Generic Syntax](https://tools.ietf.org/html/rfc3986)\n- [URI Options Specification](https://github.com/mongodb/specifications/blob/master/source/uri-options/uri-options.rst)\n\n### General Properties\n\n```javascript\nconst c = new Connection({ isSrvRecord: true });\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ns` | String | A valid [ns][ns] the user can read from | `undefined` |\n| `isSrvRecord` | Boolean | Indicates SRV record | `false` |\n| `auth` | Object | Authentication from driver (username, user, db, password) | `undefined` |\n| `hostname` | String | Hostname of a MongoDB Instance. In case of the replica set the first host and port will be taken | `localhost` |\n| `port` | Number | TCP port of a MongoDB Instance | `27017` |\n| `hosts` | Array | Contains all hosts and ports for replica set | `[{ host: 'localhost', port: 27017 }]` |\n| `extraOptions` | Object | Extra options passed to the node driver as part of `driverOptions` | `{}` |\n| `connectionType` | String | The desired connection type. Possible values: `NODE_DRIVER`, `STITCH_ON_PREM`, `STITCH_ATLAS` | `NODE_DRIVER` |\n| `authStrategy` | String | The desired authentication strategy. Possible values: `NONE`, `MONGODB`, `X509`, `KERBEROS`, `LDAP`, `SCRAM-SHA-256` | `NONE` |\n\n### Connection string options\n\n```javascript\nconst c = new Connection({ appname: 'My App', replicaSet: 'testing' });\n```\n\n#### General connection string options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `replicaSet` | String | Specifies the name of the replica set, if the mongod is a member of a replica set | `undefined` |\n| `connectTimeoutMS` | Number | The time in milliseconds to attempt a connection before timing out | `undefined` |\n| `socketTimeoutMS` | Number | The time in milliseconds to attempt a send or receive on a socket before the attempt times out | `undefined` |\n| `compression` | Object | Object includes compressors and a compression level. The following compressors can be specified: `snappy`, `zlib` (Available in MongoDB 3.6 or greater) | `undefined` |\n\n#### Connection Pool Option\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `maxPoolSize` | Number | The maximum number of connections in the connection pool | `undefined` |\n| `minPoolSize` | Number | The minimum number of connections in the connection pool | `undefined` |\n| `maxIdleTimeMS` | Number | The maximum number of milliseconds that a connection can remain idle in the pool before being removed and closed | `undefined` |\n| `waitQueueMultiple` | Number | A number that the driver multiples the maxPoolSize value to, to provide the maximum number of threads allowed to wait for a connection to become available from the pool | `undefined` |\n| `waitQueueTimeoutMS` | Number | The maximum time in milliseconds that a thread can wait for a connection to become available | `undefined` |\n\n#### Write Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `w` | Number/String | Corresponds to the write concern [w Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-w) | `undefined` |\n| `wTimeoutMS` | Number | Corresponds to the write concern [wtimeout](https://docs.mongodb.com/manual/reference/write-concern/#wc-wtimeout) | `undefined` |\n| `journal` | Boolean | Corresponds to the write concern [j Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-j) | `undefined` |\n\n#### Read Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readConcernLevel` | String | The level of isolation | `undefined` |\n\n#### Read Preference Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readPreference` | String | Specifies the read preferences for this connection. Possible values: `PRIMARY`, `PRIMARY_PREFERRED`, `SECONDARY`, `SECONDARY_PREFERRED`, `NEAREST` | `PRIMARY` |\n| `maxStalenessSeconds` | Number | Specifies, in seconds, how stale a secondary can be before the client stops using it for read operations | `undefined` |\n| `readPreferenceTags` | Object | Default read preference tags for the client | `undefined` |\n\n#### Authentication Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `authSource` | String | Specify the database name associated with the user’s credentials | `undefined` |\n| `authMechanism` | String | Specifies the authentication mechanism that MongoDB will use to authenticate the connection. Possible values: `DEFAULT`, `GSSAPI`, `MONGODB-X509`, `PLAIN`, `SCRAM-SHA-256` | `undefined` |\n| `authMechanismProperties` | Object | Additional options provided for authentication (e.g. to enable hostname canonicalization for GSSAPI) | `undefined` |\n| `gssapiServiceName` | String | Set the Kerberos service name when connecting to Kerberized MongoDB instances | `undefined` |\n| `gssapiServiceRealm` | String | Set the Realm service name | `undefined` |\n| `gssapiCanonicalizeHostName` | Boolean | Whether canonicalized hostname | `undefined` |\n\n#### Server Selection and Discovery Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `localThresholdMS` | Number | The size (in milliseconds) of the latency window for selecting among multiple suitable MongoDB instances | `undefined` |\n| `serverSelectionTimeoutMS` | Number | Specifies how long (in milliseconds) to block for server selection before throwing an exception | `undefined` |\n| `serverSelectionTryOnce` | Boolean | Instructs the driver to scan the MongoDB deployment exactly once after server selection fails and then either select a server or raise an error | `undefined` |\n| `heartbeatFrequencyMS` | Number | Controls when the driver checks the state of the MongoDB deployment | `undefined` |\n\n#### Miscellaneous Configuration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `appname` | String | An application name passed to server as client metadata | `undefined` |\n| `retryWrites` | Boolean | Enable retryable writes | `undefined` |\n| `uuidRepresentation` | String | The legacy representation of UUID. Possible values: `standard`, `csharpLegacy`, `javaLegacy`, `pythonLegacy` | `undefined` |\n| `loadBalanced` | Boolean | Whether or not the server is running in load balanced mode | `undefined` |\n\n### Stitch attributes\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `stitchServiceName` | String | Stitch service name | `undefined` |\n| `stitchClientAppId` | String | Stitch сlient app ID | `undefined` |\n| `stitchGroupId` | String | Stitch group ID | `undefined` |\n| `stitchBaseUrl` | String | Stitch base Url | `undefined` |\n\n### MONGODB authentication\n\n```javascript\nconst c = new Connection({\n  mongodbUsername: 'arlo',\n  mongodbPassword: 'w@of'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/?slaveOk=true&authSource=admin'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `mongodbUsername` | String | MongoDB username | `undefined` |\n| `mongodbPassword` | String | MongoDB password | `undefined` |\n| `mongodbDatabaseName` | String | The database name associated with the user's credentials | `undefined` |\n| `promoteValues` | Boolean | Whether BSON values should be promoted to their JS type counterparts | `undefined` |\n\n### KERBEROS authentication\n\n```javascript\nconst c = new Connection({\n  kerberosServiceName: 'mongodb',\n  kerberosPrincipal: 'arlo/dog@krb5.mongodb.parts',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo%252Fdog%2540krb5.mongodb.parts@localhost:27017/toys?authMechanism=GSSAPI'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n> @note (imlucas): Kerberos on Windows is broken out as it's own state for UX consideration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `kerberosServiceName` | String | Any program or computer you access over a network | `undefined` |\n| `kerberosPrincipal` | String | The format of a typical Kerberos V5 principal is `primary/instance@REALM` | `undefined` |\n| `kerberosCanonicalizeHostname` | Boolean | Whether canonicalized kerberos hostname | `undefined` |\n\n#### See Also\n\n- [node.js driver Kerberos reference](http://bit.ly/mongodb-node-driver-kerberos)\n- [node.js driver Kerberos functional test][kerberos-functional]\n\n### LDAP authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  ldapUsername: 'arlo',\n  ldapPassword: 'w@of',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/toys?slaveOk=true&authMechanism=PLAIN'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ldapUsername` | String | LDAP username | `undefined` |\n| `ldapPassword` | String | LDAP password | `undefined` |\n\n#### See Also\n\n- [node.js driver LDAP reference](http://bit.ly/mongodb-node-driver-ldap)\n- [node.js driver X509 functional test][ldap-functional]\n\n### X509 authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  x509Username: 'CN=client,OU=arlo,O=MongoDB,L=Philadelphia,ST=Pennsylvania,C=US'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://CN%253Dclient%252COU%253Darlo%252CO%253DMongoDB%252CL%253DPhiladelphia%252CST%253DPennsylvania%252CC%253DUS@localhost:27017?slaveOk=true&authMechanism=MONGODB-X509'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `x509Username` | String | The x.509 certificate derived user name, e.g. `CN=user,OU=OrgUnit,O=myOrg,...` | `undefined` |\n\n#### See Also\n\n- [node.js driver X509 reference](http://bit.ly/mongodb-node-driver-x509)\n- [node.js driver X509 functional test][x509-functional]\n\n### SSL\n\n> **Note**: Not to be confused with `authentication=X509`\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ssl` | Number/String | A boolean to enable or disables TLS/SSL for the connection | `undefined` |\n| `sslMethod` | String | The desired ssl method. Possible values: `NONE`, `SYSTEMCA`, `IFAVAILABLE`, `UNVALIDATED`, `SERVER`, `ALL` | `NONE` |\n| `sslCA` | Buffer/String | Array of valid certificates | `undefined` |\n| `sslCert` | Buffer/String | The certificate | `undefined` |\n| `sslKey` | Buffer/String | The certificate private key | `undefined` |\n| `sslPass` | Buffer/String | The certificate password | `undefined` |\n\nDescription of `sslMethod` values:\n\n- `SYSTEMCA` - SSL required, validate using System CA, with host verification.\n- `IFAVAILABLE` - The driver should try SSL first, fall back to no SSL if unavailable, and use the system's Certificate Authority.\n- `SERVER` - The driver should validate the server certificate and fail to connect if validation fails. See also [node.js driver \"Validate Server Certificate\" docs][driver-ssl-server].\n- `ALL` - The driver must present a valid certificate and validate the server certificate. See also [node.js driver \"Validate Server Certificate and Present Valid Certificate\" docs][driver-ssl-all].\n- `NONE` - No SSL (Not recommended).\n- `UNVALIDATED` - Use SSL but do not perform any validation of the certificate chain. See also [node.js driver \"No Certificate Validation\" docs][driver-ssl-none]. **Very** not recommended and likely to be deprecated in future releases because it exposes potential Man-In-The-Middle attack vectors.\n\n#### See also\n\n- [node.js driver SSL implementation][driver-ssl-impl]\n- [node.js driver SSL tutorial][driver-ssl-tutorial]\n\n### SSH TUNNEL\n\n> New in mongodb-connection-model@5.0.0\n\nBecause [authentication](#authentication) is quite difficult for operators to migrate to, the most common method of securing a MongoDB deployment is to use an [SSH tunnel][sf-ssh-tunnel].  This allows operators to leverage their existing SSH security infrastructure to also provide secure access to MongoDB.  For a standard deployment of MongoDB on AWS, this is almost always to strategy.  Because of this, we now support creating SSH tunnels automatically when connecting to MongoDB.\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options, (connectionError, client) => {\n  if (connectionError) {\n    return console.log(connectionError);\n  }\n\n  client.db('mongodb').collection('fanclub').count((countingError, count) => {\n    console.log('counted:', countingError, count);\n    client.close();\n  });\n});\n```\n\nThe above provides the same functionality as creating the tunnel using the bash\ncommand below and connecting to MongoDB via another terminal. Notice that\nconnection-model uses a random local port each time it creates a tunnel.\nUsing the command line, you'd have to replace `<random port>` with an actual\nport number.\n\n```bash\nssh -i ~/.ssh/my-key-aws-pair.pem -L <random port>:localhost:27017 ubuntu@ec2-11-111-111-111.compute-1.amazonaws.com\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `sshTunnel` | String | The desired SSH tunnel strategy. Possible values: `NONE`, `USER_PASSWORD`, `IDENTITY_FILE` | `undefined` |\n| `sshTunnelHostname` | String | The hostname of the SSH remote host | `undefined` |\n| `sshTunnelPort` | Port | The SSH port of the remote host | `22` |\n| `sshTunnelBindToLocalPort` | Port | Bind the localhost endpoint of the SSH Tunnel to this port | `undefined` |\n| `sshTunnelUsername` | String | The optional SSH username for the remote host | `undefined` |\n| `sshTunnelPassword` | String | The optional SSH password for the remote host | `undefined` |\n| `sshTunnelIdentityFile` | String/Array | The optional path to the SSH identity file for the remote host | `undefined` |\n| `sshTunnelPassphrase` | String | The optional passphrase for `sshTunnelIdentityFile` | `undefined` |\n\nDescription of `sshTunnel` values:\n\n- `NONE` - Do not use SSH tunneling.\n- `USER_PASSWORD` - The tunnel is created with SSH username and password only.\n- `IDENTITY_FILE` - The tunnel is created using an identity file.\n\n## Derived Properties\n\nDerived properties (also known as computed properties) are properties of the state object that depend on other properties to determine their value.\n\n```javascript\nconst c = new Connection();\nconst derivedProps = c.getAttributes({ derived: true });\n```\n\n| Derived Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `instanceId` | String | The mongoscope | `localhost:27017` |\n| `driverAuthMechanism` | String | Converts the value of `authStrategy` for humans into the `authMechanism` value for the driver | `undefined` |\n| `safeUrl` | String | The URL where a password is replaced with stars | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrl` | String | Use this URL in order to connect via DataService | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrlWithSsh` | String | Use this URL in order to connect via connection model itself | `mongodb://localhost:29201/?readPreference=primary&ssl=false` |\n| `driverOptions` | String | The second argument `mongoscope-server` passes to `mongodb.connect` | `{}` |\n\n## Events\n\n> New in mongodb-connection-model@5.0.0\n\n#### Example: SSH Tunnel\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', skipped: true,\n  reason: 'The selected SSL mode does not need to load any files.' }\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', complete: true}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n#### Example: SSL\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  ssl: 'ALL',\n  sslCA: '~/.ssl/my-ca.pem',\n  sslCert: '~/.ssl/my-server.pem',\n  sslKey: '~/.ssl/my-server.pem'\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', complete: true}\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', skipped: true,\n  reason: 'The selected SSH Tunnel mode is NONE.'}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n[workflow_img]: https://github.com/mongodb-js/connection-model/workflows/Check%20and%20Test/badge.svg?event=push\n[workflow_url]: https://github.com/mongodb-js/connection-model/actions?query=workflow%3A%22Check+and+Test%22\n[npm_img]: https://img.shields.io/npm/v/mongodb-connection-model.svg?style=flat-square\n[npm_url]: https://www.npmjs.org/package/mongodb-connection-model\n[gitter_img]: https://badges.gitter.im/Join%20Chat.svg\n[gitter_url]: http://gitter.im/mongodb-js/mongodb-js\n[enterprise_img]: https://img.shields.io/badge/MongoDB-Enterprise-blue.svg?style=flat-square\n[coming_soon_img]: https://img.shields.io/badge/-Coming%20Soon-ff69b4.svg?style=flat-square\n[kerberos-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/kerberos_tests.js\n[ldap-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ldap_tests.js\n[x509-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ssl_x509_tests.js\n[ns]: https://github.com/mongodb-js/ns\n[sf-ssh-tunnel]: http://serverfault.com/questions/597765/how-to-connect-to-mongodb-server-via-ssh-tunnel\n[ec2-key-pairs]: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html\n[driver-ssl-impl]: https://github.com/christkv/mongodb-core/blob/c3d21cb636d74d7a68134ecd3b9f6af536311279/lib/connection/connection.js#L365-L407\n[driver-ssl-tutorial]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/\n[driver-ssl-none]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#no-certificate-validation\n[driver-ssl-server]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate\n[driver-ssl-all]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate-and-present-valid-certificate\n","gitHead":"3888dd701d06bedcc2b043270c5dc626b9997eb0","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","test":"mocha","check":"npm run lint && npm run depcheck","pretest":"mongodb-runner install && mongodb-runner start --port=27018","test-ci":"npm run test","depcheck":"depcheck","posttest":"mongodb-runner stop --port=27018","posttest-ci":"node ../../scripts/killall-mongo.js","test-check-ci":"npm run check && npm test"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.17.0+x64 (linux)","description":"MongoDB connection model","directories":{},"_nodeVersion":"16.17.0","compass:main":"index.js","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","debug":"^4.2.0","lodash":"^4.17.15","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.2.0","storage-mixin":"0.0.0-next-3888dd701d06bedcc2b043270c5dc626b9997eb0","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.2","@mongodb-js/ssh-tunnel":"0.0.0-next-3888dd701d06bedcc2b043270c5dc626b9997eb0","@mongodb-js/compass-utils":"0.0.0-next-3888dd701d06bedcc2b043270c5dc626b9997eb0","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.6.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"^4.12.1","depcheck":"^1.4.1","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.9.0","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^4.12.1"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_0.0.0-next-3888dd701d06bedcc2b043270c5dc626b9997eb0_1670881089890_0.7448926684191242","host":"s3://npm-registry-packages"}},"0.0.0-next-dc4590988660016a4419dbc587f3182af207ed15":{"name":"mongodb-connection-model","version":"0.0.0-next-dc4590988660016a4419dbc587f3182af207ed15","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@0.0.0-next-dc4590988660016a4419dbc587f3182af207ed15","maintainers":[{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"iteng@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"3a83cc14d9d04cbddfbd9d30624962560d3750f3","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-0.0.0-next-dc4590988660016a4419dbc587f3182af207ed15.tgz","fileCount":20,"integrity":"sha512-rSf+Dtvx/1P1lCbYjkIOtCIq82hJN0901pKuVvFqom/lD/vlrMKGEzjSsP9SbOOhFoNAzcTs/1OkByilM2clnA==","signatures":[{"sig":"MEYCIQDHW0uRJDjwz5IHQqtjr/NkTQmLFAlQqZtLKSHHtopF8QIhAJTLcJ/k6a5opVYhqem65uWujxiqq+H1u5UgcG9MuvD+","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":108151,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjmhXJACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqzKw//W9W6lcwuNxhhtz+iCBSefImudfBjKCDi0kTG9uDubM3yCI4f\r\nZnd9jVBKDn9BAsXAbg7gFKWAqlkGqZ3fACJhg2zFfpxBqj0Rw8AMSDC1TBZ8\r\nZCyiH79o0PkXUfIN8omjsfb+CLpcrZogmeWvP5CknmjDa/8zQZaBwekotyJi\r\n2KijGkzzKZa80VfcDIaVESRHIDzmRbLA13+LL0/RytmIMyxy1JaacSmbuGOr\r\n7bvRLpSA5o7e/sqEo29r3D/KdeJbmm58k6tVn4FmLY20pR1UatBhDCjU8H6y\r\nTXTVHTksHE7Euu03wQDq7AODC/OpE3yps4ffMKi0smR/7CBMqPOVIpyb63mB\r\n3mmxPvPc/UEYXo7Ifxqg4o143z4IdY2XOrzY26pCMyv4GemJCQnSNh5YiHhT\r\n0nxHKAy2ihJDdk+DyNwo6ViEEio1+NYRxVqpgZ1e6/vVk9lsfRMEzHfPPX1A\r\nfyAqSCduCQyQIS0n3N2CRRBCbNHT3SAFokpII3B21E115akLLDl/3T++a9Zd\r\nURs/NngfFnGEAFAI2M21H74gNByA1HcMR2oJJb47BNGbxHnKQL9MNMk3cdF6\r\nuT+aXJdqIjiWj4nEw3XnjqIjXku4BerKiXGSL8I/5Ud1VCVtnunXj6km9enx\r\njWxFNl65BWHjFdL4PNsggtcab0qNUk1MpWs=\r\n=SF59\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","readme":"# mongodb-connection-model [![][workflow_img]][workflow_url] [![][npm_img]][npm_url]\n\n> MongoDB connection model\n\nThe main purpose of the MongoDB connection model is to be a domain model around a MongoDB connection. It encapsulates generating a [Connection String URI](https://docs.mongodb.com/manual/reference/connection-string/) from a group of attributes and parses URI using the [MongoDB Node.JS Driver URI Parser](https://github.com/mongodb-js/mongodb-core/blob/master/lib/uri_parser.js).\n\n## Installation\n\n```\nnpm install --save mongodb-connection-model\n```\n\n## Usage\n\n### Building URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\nconst c = new Connection({ appname: 'My App Name' });\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://localhost:27017/?readPreference=primary&appname=My%20App&ssl=false'\n```\n\n### Parsing URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\n\nConnection.from(\n  'mongodb://someUsername:testPassword@localhost',\n  (error, result) => {\n    console.log(result);\n    >>> `{\n      hosts: [{ host: 'localhost', port: 27017 }],\n      hostname: 'localhost',\n      port: 27017,\n      auth: {\n        username: 'someUsername',\n        password: 'testPassword',\n        db: 'admin'\n      },\n      isSrvRecord: false,\n      authStrategy: 'MONGODB',\n      mongodbUsername: 'someUsername',\n      mongodbPassword: 'testPassword',\n      mongodbDatabaseName: 'admin',\n      extraOptions: {},\n      connectionType: 'NODE_DRIVER',\n      readPreference: 'primary',\n      kerberosCanonicalizeHostname: false,\n      sslMethod: 'NONE',\n      sshTunnel: 'NONE',\n      sshTunnelPort: 22\n    }`\n  }\n);\n```\n\n## Properties\n\nMongoDB connection model is based on Ampersand.js framework and consist of [props](https://ampersandjs.com/docs/#ampersand-state-props) and [derived props](https://ampersandjs.com/docs/#ampersand-state-derived). The props object describes the observable properties that MongoDB connection model gets from the Node.js Driver API.\n\n```javascript\nconst с = new Connection();\nconst props = с.getAttributes({ props: true });\n```\n\n#### See Also\n\n- [URI Generic Syntax](https://tools.ietf.org/html/rfc3986)\n- [URI Options Specification](https://github.com/mongodb/specifications/blob/master/source/uri-options/uri-options.rst)\n\n### General Properties\n\n```javascript\nconst c = new Connection({ isSrvRecord: true });\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ns` | String | A valid [ns][ns] the user can read from | `undefined` |\n| `isSrvRecord` | Boolean | Indicates SRV record | `false` |\n| `auth` | Object | Authentication from driver (username, user, db, password) | `undefined` |\n| `hostname` | String | Hostname of a MongoDB Instance. In case of the replica set the first host and port will be taken | `localhost` |\n| `port` | Number | TCP port of a MongoDB Instance | `27017` |\n| `hosts` | Array | Contains all hosts and ports for replica set | `[{ host: 'localhost', port: 27017 }]` |\n| `extraOptions` | Object | Extra options passed to the node driver as part of `driverOptions` | `{}` |\n| `connectionType` | String | The desired connection type. Possible values: `NODE_DRIVER`, `STITCH_ON_PREM`, `STITCH_ATLAS` | `NODE_DRIVER` |\n| `authStrategy` | String | The desired authentication strategy. Possible values: `NONE`, `MONGODB`, `X509`, `KERBEROS`, `LDAP`, `SCRAM-SHA-256` | `NONE` |\n\n### Connection string options\n\n```javascript\nconst c = new Connection({ appname: 'My App', replicaSet: 'testing' });\n```\n\n#### General connection string options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `replicaSet` | String | Specifies the name of the replica set, if the mongod is a member of a replica set | `undefined` |\n| `connectTimeoutMS` | Number | The time in milliseconds to attempt a connection before timing out | `undefined` |\n| `socketTimeoutMS` | Number | The time in milliseconds to attempt a send or receive on a socket before the attempt times out | `undefined` |\n| `compression` | Object | Object includes compressors and a compression level. The following compressors can be specified: `snappy`, `zlib` (Available in MongoDB 3.6 or greater) | `undefined` |\n\n#### Connection Pool Option\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `maxPoolSize` | Number | The maximum number of connections in the connection pool | `undefined` |\n| `minPoolSize` | Number | The minimum number of connections in the connection pool | `undefined` |\n| `maxIdleTimeMS` | Number | The maximum number of milliseconds that a connection can remain idle in the pool before being removed and closed | `undefined` |\n| `waitQueueMultiple` | Number | A number that the driver multiples the maxPoolSize value to, to provide the maximum number of threads allowed to wait for a connection to become available from the pool | `undefined` |\n| `waitQueueTimeoutMS` | Number | The maximum time in milliseconds that a thread can wait for a connection to become available | `undefined` |\n\n#### Write Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `w` | Number/String | Corresponds to the write concern [w Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-w) | `undefined` |\n| `wTimeoutMS` | Number | Corresponds to the write concern [wtimeout](https://docs.mongodb.com/manual/reference/write-concern/#wc-wtimeout) | `undefined` |\n| `journal` | Boolean | Corresponds to the write concern [j Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-j) | `undefined` |\n\n#### Read Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readConcernLevel` | String | The level of isolation | `undefined` |\n\n#### Read Preference Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readPreference` | String | Specifies the read preferences for this connection. Possible values: `PRIMARY`, `PRIMARY_PREFERRED`, `SECONDARY`, `SECONDARY_PREFERRED`, `NEAREST` | `PRIMARY` |\n| `maxStalenessSeconds` | Number | Specifies, in seconds, how stale a secondary can be before the client stops using it for read operations | `undefined` |\n| `readPreferenceTags` | Object | Default read preference tags for the client | `undefined` |\n\n#### Authentication Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `authSource` | String | Specify the database name associated with the user’s credentials | `undefined` |\n| `authMechanism` | String | Specifies the authentication mechanism that MongoDB will use to authenticate the connection. Possible values: `DEFAULT`, `GSSAPI`, `MONGODB-X509`, `PLAIN`, `SCRAM-SHA-256` | `undefined` |\n| `authMechanismProperties` | Object | Additional options provided for authentication (e.g. to enable hostname canonicalization for GSSAPI) | `undefined` |\n| `gssapiServiceName` | String | Set the Kerberos service name when connecting to Kerberized MongoDB instances | `undefined` |\n| `gssapiServiceRealm` | String | Set the Realm service name | `undefined` |\n| `gssapiCanonicalizeHostName` | Boolean | Whether canonicalized hostname | `undefined` |\n\n#### Server Selection and Discovery Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `localThresholdMS` | Number | The size (in milliseconds) of the latency window for selecting among multiple suitable MongoDB instances | `undefined` |\n| `serverSelectionTimeoutMS` | Number | Specifies how long (in milliseconds) to block for server selection before throwing an exception | `undefined` |\n| `serverSelectionTryOnce` | Boolean | Instructs the driver to scan the MongoDB deployment exactly once after server selection fails and then either select a server or raise an error | `undefined` |\n| `heartbeatFrequencyMS` | Number | Controls when the driver checks the state of the MongoDB deployment | `undefined` |\n\n#### Miscellaneous Configuration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `appname` | String | An application name passed to server as client metadata | `undefined` |\n| `retryWrites` | Boolean | Enable retryable writes | `undefined` |\n| `uuidRepresentation` | String | The legacy representation of UUID. Possible values: `standard`, `csharpLegacy`, `javaLegacy`, `pythonLegacy` | `undefined` |\n| `loadBalanced` | Boolean | Whether or not the server is running in load balanced mode | `undefined` |\n\n### Stitch attributes\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `stitchServiceName` | String | Stitch service name | `undefined` |\n| `stitchClientAppId` | String | Stitch сlient app ID | `undefined` |\n| `stitchGroupId` | String | Stitch group ID | `undefined` |\n| `stitchBaseUrl` | String | Stitch base Url | `undefined` |\n\n### MONGODB authentication\n\n```javascript\nconst c = new Connection({\n  mongodbUsername: 'arlo',\n  mongodbPassword: 'w@of'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/?slaveOk=true&authSource=admin'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `mongodbUsername` | String | MongoDB username | `undefined` |\n| `mongodbPassword` | String | MongoDB password | `undefined` |\n| `mongodbDatabaseName` | String | The database name associated with the user's credentials | `undefined` |\n| `promoteValues` | Boolean | Whether BSON values should be promoted to their JS type counterparts | `undefined` |\n\n### KERBEROS authentication\n\n```javascript\nconst c = new Connection({\n  kerberosServiceName: 'mongodb',\n  kerberosPrincipal: 'arlo/dog@krb5.mongodb.parts',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo%252Fdog%2540krb5.mongodb.parts@localhost:27017/toys?authMechanism=GSSAPI'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n> @note (imlucas): Kerberos on Windows is broken out as it's own state for UX consideration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `kerberosServiceName` | String | Any program or computer you access over a network | `undefined` |\n| `kerberosPrincipal` | String | The format of a typical Kerberos V5 principal is `primary/instance@REALM` | `undefined` |\n| `kerberosCanonicalizeHostname` | Boolean | Whether canonicalized kerberos hostname | `undefined` |\n\n#### See Also\n\n- [node.js driver Kerberos reference](http://bit.ly/mongodb-node-driver-kerberos)\n- [node.js driver Kerberos functional test][kerberos-functional]\n\n### LDAP authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  ldapUsername: 'arlo',\n  ldapPassword: 'w@of',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/toys?slaveOk=true&authMechanism=PLAIN'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ldapUsername` | String | LDAP username | `undefined` |\n| `ldapPassword` | String | LDAP password | `undefined` |\n\n#### See Also\n\n- [node.js driver LDAP reference](http://bit.ly/mongodb-node-driver-ldap)\n- [node.js driver X509 functional test][ldap-functional]\n\n### X509 authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  x509Username: 'CN=client,OU=arlo,O=MongoDB,L=Philadelphia,ST=Pennsylvania,C=US'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://CN%253Dclient%252COU%253Darlo%252CO%253DMongoDB%252CL%253DPhiladelphia%252CST%253DPennsylvania%252CC%253DUS@localhost:27017?slaveOk=true&authMechanism=MONGODB-X509'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `x509Username` | String | The x.509 certificate derived user name, e.g. `CN=user,OU=OrgUnit,O=myOrg,...` | `undefined` |\n\n#### See Also\n\n- [node.js driver X509 reference](http://bit.ly/mongodb-node-driver-x509)\n- [node.js driver X509 functional test][x509-functional]\n\n### SSL\n\n> **Note**: Not to be confused with `authentication=X509`\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ssl` | Number/String | A boolean to enable or disables TLS/SSL for the connection | `undefined` |\n| `sslMethod` | String | The desired ssl method. Possible values: `NONE`, `SYSTEMCA`, `IFAVAILABLE`, `UNVALIDATED`, `SERVER`, `ALL` | `NONE` |\n| `sslCA` | Buffer/String | Array of valid certificates | `undefined` |\n| `sslCert` | Buffer/String | The certificate | `undefined` |\n| `sslKey` | Buffer/String | The certificate private key | `undefined` |\n| `sslPass` | Buffer/String | The certificate password | `undefined` |\n\nDescription of `sslMethod` values:\n\n- `SYSTEMCA` - SSL required, validate using System CA, with host verification.\n- `IFAVAILABLE` - The driver should try SSL first, fall back to no SSL if unavailable, and use the system's Certificate Authority.\n- `SERVER` - The driver should validate the server certificate and fail to connect if validation fails. See also [node.js driver \"Validate Server Certificate\" docs][driver-ssl-server].\n- `ALL` - The driver must present a valid certificate and validate the server certificate. See also [node.js driver \"Validate Server Certificate and Present Valid Certificate\" docs][driver-ssl-all].\n- `NONE` - No SSL (Not recommended).\n- `UNVALIDATED` - Use SSL but do not perform any validation of the certificate chain. See also [node.js driver \"No Certificate Validation\" docs][driver-ssl-none]. **Very** not recommended and likely to be deprecated in future releases because it exposes potential Man-In-The-Middle attack vectors.\n\n#### See also\n\n- [node.js driver SSL implementation][driver-ssl-impl]\n- [node.js driver SSL tutorial][driver-ssl-tutorial]\n\n### SSH TUNNEL\n\n> New in mongodb-connection-model@5.0.0\n\nBecause [authentication](#authentication) is quite difficult for operators to migrate to, the most common method of securing a MongoDB deployment is to use an [SSH tunnel][sf-ssh-tunnel].  This allows operators to leverage their existing SSH security infrastructure to also provide secure access to MongoDB.  For a standard deployment of MongoDB on AWS, this is almost always to strategy.  Because of this, we now support creating SSH tunnels automatically when connecting to MongoDB.\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options, (connectionError, client) => {\n  if (connectionError) {\n    return console.log(connectionError);\n  }\n\n  client.db('mongodb').collection('fanclub').count((countingError, count) => {\n    console.log('counted:', countingError, count);\n    client.close();\n  });\n});\n```\n\nThe above provides the same functionality as creating the tunnel using the bash\ncommand below and connecting to MongoDB via another terminal. Notice that\nconnection-model uses a random local port each time it creates a tunnel.\nUsing the command line, you'd have to replace `<random port>` with an actual\nport number.\n\n```bash\nssh -i ~/.ssh/my-key-aws-pair.pem -L <random port>:localhost:27017 ubuntu@ec2-11-111-111-111.compute-1.amazonaws.com\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `sshTunnel` | String | The desired SSH tunnel strategy. Possible values: `NONE`, `USER_PASSWORD`, `IDENTITY_FILE` | `undefined` |\n| `sshTunnelHostname` | String | The hostname of the SSH remote host | `undefined` |\n| `sshTunnelPort` | Port | The SSH port of the remote host | `22` |\n| `sshTunnelBindToLocalPort` | Port | Bind the localhost endpoint of the SSH Tunnel to this port | `undefined` |\n| `sshTunnelUsername` | String | The optional SSH username for the remote host | `undefined` |\n| `sshTunnelPassword` | String | The optional SSH password for the remote host | `undefined` |\n| `sshTunnelIdentityFile` | String/Array | The optional path to the SSH identity file for the remote host | `undefined` |\n| `sshTunnelPassphrase` | String | The optional passphrase for `sshTunnelIdentityFile` | `undefined` |\n\nDescription of `sshTunnel` values:\n\n- `NONE` - Do not use SSH tunneling.\n- `USER_PASSWORD` - The tunnel is created with SSH username and password only.\n- `IDENTITY_FILE` - The tunnel is created using an identity file.\n\n## Derived Properties\n\nDerived properties (also known as computed properties) are properties of the state object that depend on other properties to determine their value.\n\n```javascript\nconst c = new Connection();\nconst derivedProps = c.getAttributes({ derived: true });\n```\n\n| Derived Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `instanceId` | String | The mongoscope | `localhost:27017` |\n| `driverAuthMechanism` | String | Converts the value of `authStrategy` for humans into the `authMechanism` value for the driver | `undefined` |\n| `safeUrl` | String | The URL where a password is replaced with stars | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrl` | String | Use this URL in order to connect via DataService | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrlWithSsh` | String | Use this URL in order to connect via connection model itself | `mongodb://localhost:29201/?readPreference=primary&ssl=false` |\n| `driverOptions` | String | The second argument `mongoscope-server` passes to `mongodb.connect` | `{}` |\n\n## Events\n\n> New in mongodb-connection-model@5.0.0\n\n#### Example: SSH Tunnel\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', skipped: true,\n  reason: 'The selected SSL mode does not need to load any files.' }\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', complete: true}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n#### Example: SSL\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  ssl: 'ALL',\n  sslCA: '~/.ssl/my-ca.pem',\n  sslCert: '~/.ssl/my-server.pem',\n  sslKey: '~/.ssl/my-server.pem'\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', complete: true}\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', skipped: true,\n  reason: 'The selected SSH Tunnel mode is NONE.'}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n[workflow_img]: https://github.com/mongodb-js/connection-model/workflows/Check%20and%20Test/badge.svg?event=push\n[workflow_url]: https://github.com/mongodb-js/connection-model/actions?query=workflow%3A%22Check+and+Test%22\n[npm_img]: https://img.shields.io/npm/v/mongodb-connection-model.svg?style=flat-square\n[npm_url]: https://www.npmjs.org/package/mongodb-connection-model\n[gitter_img]: https://badges.gitter.im/Join%20Chat.svg\n[gitter_url]: http://gitter.im/mongodb-js/mongodb-js\n[enterprise_img]: https://img.shields.io/badge/MongoDB-Enterprise-blue.svg?style=flat-square\n[coming_soon_img]: https://img.shields.io/badge/-Coming%20Soon-ff69b4.svg?style=flat-square\n[kerberos-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/kerberos_tests.js\n[ldap-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ldap_tests.js\n[x509-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ssl_x509_tests.js\n[ns]: https://github.com/mongodb-js/ns\n[sf-ssh-tunnel]: http://serverfault.com/questions/597765/how-to-connect-to-mongodb-server-via-ssh-tunnel\n[ec2-key-pairs]: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html\n[driver-ssl-impl]: https://github.com/christkv/mongodb-core/blob/c3d21cb636d74d7a68134ecd3b9f6af536311279/lib/connection/connection.js#L365-L407\n[driver-ssl-tutorial]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/\n[driver-ssl-none]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#no-certificate-validation\n[driver-ssl-server]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate\n[driver-ssl-all]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate-and-present-valid-certificate\n","gitHead":"dc4590988660016a4419dbc587f3182af207ed15","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","test":"mocha","check":"npm run lint && npm run depcheck","pretest":"mongodb-runner install && mongodb-runner start --port=27018","test-ci":"npm run test","depcheck":"depcheck","posttest":"mongodb-runner stop --port=27018","posttest-ci":"node ../../scripts/killall-mongo.js","test-check-ci":"npm run check && npm test"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.17.0+x64 (linux)","description":"MongoDB connection model","directories":{},"_nodeVersion":"16.17.0","compass:main":"index.js","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","debug":"^4.2.0","lodash":"^4.17.15","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.2.0","storage-mixin":"0.0.0-next-dc4590988660016a4419dbc587f3182af207ed15","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.2","@mongodb-js/ssh-tunnel":"0.0.0-next-dc4590988660016a4419dbc587f3182af207ed15","@mongodb-js/compass-utils":"0.0.0-next-dc4590988660016a4419dbc587f3182af207ed15","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.6.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"^4.12.1","depcheck":"^1.4.1","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.9.0","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^4.12.1"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_0.0.0-next-dc4590988660016a4419dbc587f3182af207ed15_1671042504900_0.28000071379006974","host":"s3://npm-registry-packages"}},"0.0.0-next-cb3371cdb3289f37402f09c6388269e88c943a81":{"name":"mongodb-connection-model","version":"0.0.0-next-cb3371cdb3289f37402f09c6388269e88c943a81","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@0.0.0-next-cb3371cdb3289f37402f09c6388269e88c943a81","maintainers":[{"name":"mongo-j","email":"james.wang@mongodb.com"},{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"iteng@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"e0f4ddb7587ffa1162606e76ca68d7e8f210b4ce","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-0.0.0-next-cb3371cdb3289f37402f09c6388269e88c943a81.tgz","fileCount":20,"integrity":"sha512-U2WAJ2ZozKriJmUUh34mcPNIwpalw8+3VVflCUPwZDnzzCkpudFSL2OJK5DTC5jzdHGoHlcZAPMM2JqtxTrvfA==","signatures":[{"sig":"MEUCIDYq/tv19H3Qz/cBKvB2EgvndML+amhp1k3tebtgFhsfAiEA/H28LnDak1PBIXVV1Xk8vP/B5C/AN9lL4RRNcCw2pCE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":108151,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjwZckACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoXgA/+NKuoPaf865Iy/dhDzB91Sv04eGMg+7sV1FdsShMQw8Xim1Up\r\ns9HuZLZdSbH7Wb9lSZxEuK/yxJZ6ofnezOz1Ac7Xc2fgw+tgromcZOlppBT7\r\njdmik7cHCG5TujMPMxmGvUQ103XCoR7zh/vCET/25k9vjgo0JzvbrybCC7ZM\r\nbc0f9jqIadFLv66UXQh8E8meyvFDQpRL0tLpvbVfuMv8CK0dEu7Il6cDbhPM\r\nI92G9lHg68WdKI5aWEzNVBSDiTCd0c0tByIhdRZZJn7p/AIqx+kznX17tZla\r\njf3Kt2Ne+y8s4a4l679xMFq5OEwKStn0PTcT//TaIxJLUib8hm7RSzRLuw/g\r\nDuCyDHk5zTnp1d4bD/4HC48HoYWHwGc6h+thPwql8tzZlEBSAImUxG9Xotc6\r\nXKzxa16QFoq4n2++22u6KKGbueMZVQhv0icjMvVhl2DyzvWYSfRgBfSePLmA\r\nGv5zH5hT5EuKXq3XS3kcFjabnQ8IBxwTGsWkpirHosdEk07FyfFkgMb+qHpG\r\nEdwHqHSZnoHL69ZWwgXqnfR6Pv2Ptc5vSfR/52scihO+ON33ISw1YD+3lgMl\r\nAI8AKxmwlVdgJfGxYq3miuLfDCfj1Lrzyj0WXD0QgUSSOuZnljkBxitwfkCo\r\nNcUxK2zqGfcr7qJeITgsdKPs/qH5p1VUxSY=\r\n=oESI\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","readme":"# mongodb-connection-model [![][workflow_img]][workflow_url] [![][npm_img]][npm_url]\n\n> MongoDB connection model\n\nThe main purpose of the MongoDB connection model is to be a domain model around a MongoDB connection. It encapsulates generating a [Connection String URI](https://docs.mongodb.com/manual/reference/connection-string/) from a group of attributes and parses URI using the [MongoDB Node.JS Driver URI Parser](https://github.com/mongodb-js/mongodb-core/blob/master/lib/uri_parser.js).\n\n## Installation\n\n```\nnpm install --save mongodb-connection-model\n```\n\n## Usage\n\n### Building URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\nconst c = new Connection({ appname: 'My App Name' });\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://localhost:27017/?readPreference=primary&appname=My%20App&ssl=false'\n```\n\n### Parsing URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\n\nConnection.from(\n  'mongodb://someUsername:testPassword@localhost',\n  (error, result) => {\n    console.log(result);\n    >>> `{\n      hosts: [{ host: 'localhost', port: 27017 }],\n      hostname: 'localhost',\n      port: 27017,\n      auth: {\n        username: 'someUsername',\n        password: 'testPassword',\n        db: 'admin'\n      },\n      isSrvRecord: false,\n      authStrategy: 'MONGODB',\n      mongodbUsername: 'someUsername',\n      mongodbPassword: 'testPassword',\n      mongodbDatabaseName: 'admin',\n      extraOptions: {},\n      connectionType: 'NODE_DRIVER',\n      readPreference: 'primary',\n      kerberosCanonicalizeHostname: false,\n      sslMethod: 'NONE',\n      sshTunnel: 'NONE',\n      sshTunnelPort: 22\n    }`\n  }\n);\n```\n\n## Properties\n\nMongoDB connection model is based on Ampersand.js framework and consist of [props](https://ampersandjs.com/docs/#ampersand-state-props) and [derived props](https://ampersandjs.com/docs/#ampersand-state-derived). The props object describes the observable properties that MongoDB connection model gets from the Node.js Driver API.\n\n```javascript\nconst с = new Connection();\nconst props = с.getAttributes({ props: true });\n```\n\n#### See Also\n\n- [URI Generic Syntax](https://tools.ietf.org/html/rfc3986)\n- [URI Options Specification](https://github.com/mongodb/specifications/blob/master/source/uri-options/uri-options.rst)\n\n### General Properties\n\n```javascript\nconst c = new Connection({ isSrvRecord: true });\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ns` | String | A valid [ns][ns] the user can read from | `undefined` |\n| `isSrvRecord` | Boolean | Indicates SRV record | `false` |\n| `auth` | Object | Authentication from driver (username, user, db, password) | `undefined` |\n| `hostname` | String | Hostname of a MongoDB Instance. In case of the replica set the first host and port will be taken | `localhost` |\n| `port` | Number | TCP port of a MongoDB Instance | `27017` |\n| `hosts` | Array | Contains all hosts and ports for replica set | `[{ host: 'localhost', port: 27017 }]` |\n| `extraOptions` | Object | Extra options passed to the node driver as part of `driverOptions` | `{}` |\n| `connectionType` | String | The desired connection type. Possible values: `NODE_DRIVER`, `STITCH_ON_PREM`, `STITCH_ATLAS` | `NODE_DRIVER` |\n| `authStrategy` | String | The desired authentication strategy. Possible values: `NONE`, `MONGODB`, `X509`, `KERBEROS`, `LDAP`, `SCRAM-SHA-256` | `NONE` |\n\n### Connection string options\n\n```javascript\nconst c = new Connection({ appname: 'My App', replicaSet: 'testing' });\n```\n\n#### General connection string options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `replicaSet` | String | Specifies the name of the replica set, if the mongod is a member of a replica set | `undefined` |\n| `connectTimeoutMS` | Number | The time in milliseconds to attempt a connection before timing out | `undefined` |\n| `socketTimeoutMS` | Number | The time in milliseconds to attempt a send or receive on a socket before the attempt times out | `undefined` |\n| `compression` | Object | Object includes compressors and a compression level. The following compressors can be specified: `snappy`, `zlib` (Available in MongoDB 3.6 or greater) | `undefined` |\n\n#### Connection Pool Option\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `maxPoolSize` | Number | The maximum number of connections in the connection pool | `undefined` |\n| `minPoolSize` | Number | The minimum number of connections in the connection pool | `undefined` |\n| `maxIdleTimeMS` | Number | The maximum number of milliseconds that a connection can remain idle in the pool before being removed and closed | `undefined` |\n| `waitQueueMultiple` | Number | A number that the driver multiples the maxPoolSize value to, to provide the maximum number of threads allowed to wait for a connection to become available from the pool | `undefined` |\n| `waitQueueTimeoutMS` | Number | The maximum time in milliseconds that a thread can wait for a connection to become available | `undefined` |\n\n#### Write Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `w` | Number/String | Corresponds to the write concern [w Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-w) | `undefined` |\n| `wTimeoutMS` | Number | Corresponds to the write concern [wtimeout](https://docs.mongodb.com/manual/reference/write-concern/#wc-wtimeout) | `undefined` |\n| `journal` | Boolean | Corresponds to the write concern [j Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-j) | `undefined` |\n\n#### Read Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readConcernLevel` | String | The level of isolation | `undefined` |\n\n#### Read Preference Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readPreference` | String | Specifies the read preferences for this connection. Possible values: `PRIMARY`, `PRIMARY_PREFERRED`, `SECONDARY`, `SECONDARY_PREFERRED`, `NEAREST` | `PRIMARY` |\n| `maxStalenessSeconds` | Number | Specifies, in seconds, how stale a secondary can be before the client stops using it for read operations | `undefined` |\n| `readPreferenceTags` | Object | Default read preference tags for the client | `undefined` |\n\n#### Authentication Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `authSource` | String | Specify the database name associated with the user’s credentials | `undefined` |\n| `authMechanism` | String | Specifies the authentication mechanism that MongoDB will use to authenticate the connection. Possible values: `DEFAULT`, `GSSAPI`, `MONGODB-X509`, `PLAIN`, `SCRAM-SHA-256` | `undefined` |\n| `authMechanismProperties` | Object | Additional options provided for authentication (e.g. to enable hostname canonicalization for GSSAPI) | `undefined` |\n| `gssapiServiceName` | String | Set the Kerberos service name when connecting to Kerberized MongoDB instances | `undefined` |\n| `gssapiServiceRealm` | String | Set the Realm service name | `undefined` |\n| `gssapiCanonicalizeHostName` | Boolean | Whether canonicalized hostname | `undefined` |\n\n#### Server Selection and Discovery Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `localThresholdMS` | Number | The size (in milliseconds) of the latency window for selecting among multiple suitable MongoDB instances | `undefined` |\n| `serverSelectionTimeoutMS` | Number | Specifies how long (in milliseconds) to block for server selection before throwing an exception | `undefined` |\n| `serverSelectionTryOnce` | Boolean | Instructs the driver to scan the MongoDB deployment exactly once after server selection fails and then either select a server or raise an error | `undefined` |\n| `heartbeatFrequencyMS` | Number | Controls when the driver checks the state of the MongoDB deployment | `undefined` |\n\n#### Miscellaneous Configuration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `appname` | String | An application name passed to server as client metadata | `undefined` |\n| `retryWrites` | Boolean | Enable retryable writes | `undefined` |\n| `uuidRepresentation` | String | The legacy representation of UUID. Possible values: `standard`, `csharpLegacy`, `javaLegacy`, `pythonLegacy` | `undefined` |\n| `loadBalanced` | Boolean | Whether or not the server is running in load balanced mode | `undefined` |\n\n### Stitch attributes\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `stitchServiceName` | String | Stitch service name | `undefined` |\n| `stitchClientAppId` | String | Stitch сlient app ID | `undefined` |\n| `stitchGroupId` | String | Stitch group ID | `undefined` |\n| `stitchBaseUrl` | String | Stitch base Url | `undefined` |\n\n### MONGODB authentication\n\n```javascript\nconst c = new Connection({\n  mongodbUsername: 'arlo',\n  mongodbPassword: 'w@of'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/?slaveOk=true&authSource=admin'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `mongodbUsername` | String | MongoDB username | `undefined` |\n| `mongodbPassword` | String | MongoDB password | `undefined` |\n| `mongodbDatabaseName` | String | The database name associated with the user's credentials | `undefined` |\n| `promoteValues` | Boolean | Whether BSON values should be promoted to their JS type counterparts | `undefined` |\n\n### KERBEROS authentication\n\n```javascript\nconst c = new Connection({\n  kerberosServiceName: 'mongodb',\n  kerberosPrincipal: 'arlo/dog@krb5.mongodb.parts',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo%252Fdog%2540krb5.mongodb.parts@localhost:27017/toys?authMechanism=GSSAPI'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n> @note (imlucas): Kerberos on Windows is broken out as it's own state for UX consideration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `kerberosServiceName` | String | Any program or computer you access over a network | `undefined` |\n| `kerberosPrincipal` | String | The format of a typical Kerberos V5 principal is `primary/instance@REALM` | `undefined` |\n| `kerberosCanonicalizeHostname` | Boolean | Whether canonicalized kerberos hostname | `undefined` |\n\n#### See Also\n\n- [node.js driver Kerberos reference](http://bit.ly/mongodb-node-driver-kerberos)\n- [node.js driver Kerberos functional test][kerberos-functional]\n\n### LDAP authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  ldapUsername: 'arlo',\n  ldapPassword: 'w@of',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/toys?slaveOk=true&authMechanism=PLAIN'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ldapUsername` | String | LDAP username | `undefined` |\n| `ldapPassword` | String | LDAP password | `undefined` |\n\n#### See Also\n\n- [node.js driver LDAP reference](http://bit.ly/mongodb-node-driver-ldap)\n- [node.js driver X509 functional test][ldap-functional]\n\n### X509 authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  x509Username: 'CN=client,OU=arlo,O=MongoDB,L=Philadelphia,ST=Pennsylvania,C=US'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://CN%253Dclient%252COU%253Darlo%252CO%253DMongoDB%252CL%253DPhiladelphia%252CST%253DPennsylvania%252CC%253DUS@localhost:27017?slaveOk=true&authMechanism=MONGODB-X509'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `x509Username` | String | The x.509 certificate derived user name, e.g. `CN=user,OU=OrgUnit,O=myOrg,...` | `undefined` |\n\n#### See Also\n\n- [node.js driver X509 reference](http://bit.ly/mongodb-node-driver-x509)\n- [node.js driver X509 functional test][x509-functional]\n\n### SSL\n\n> **Note**: Not to be confused with `authentication=X509`\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ssl` | Number/String | A boolean to enable or disables TLS/SSL for the connection | `undefined` |\n| `sslMethod` | String | The desired ssl method. Possible values: `NONE`, `SYSTEMCA`, `IFAVAILABLE`, `UNVALIDATED`, `SERVER`, `ALL` | `NONE` |\n| `sslCA` | Buffer/String | Array of valid certificates | `undefined` |\n| `sslCert` | Buffer/String | The certificate | `undefined` |\n| `sslKey` | Buffer/String | The certificate private key | `undefined` |\n| `sslPass` | Buffer/String | The certificate password | `undefined` |\n\nDescription of `sslMethod` values:\n\n- `SYSTEMCA` - SSL required, validate using System CA, with host verification.\n- `IFAVAILABLE` - The driver should try SSL first, fall back to no SSL if unavailable, and use the system's Certificate Authority.\n- `SERVER` - The driver should validate the server certificate and fail to connect if validation fails. See also [node.js driver \"Validate Server Certificate\" docs][driver-ssl-server].\n- `ALL` - The driver must present a valid certificate and validate the server certificate. See also [node.js driver \"Validate Server Certificate and Present Valid Certificate\" docs][driver-ssl-all].\n- `NONE` - No SSL (Not recommended).\n- `UNVALIDATED` - Use SSL but do not perform any validation of the certificate chain. See also [node.js driver \"No Certificate Validation\" docs][driver-ssl-none]. **Very** not recommended and likely to be deprecated in future releases because it exposes potential Man-In-The-Middle attack vectors.\n\n#### See also\n\n- [node.js driver SSL implementation][driver-ssl-impl]\n- [node.js driver SSL tutorial][driver-ssl-tutorial]\n\n### SSH TUNNEL\n\n> New in mongodb-connection-model@5.0.0\n\nBecause [authentication](#authentication) is quite difficult for operators to migrate to, the most common method of securing a MongoDB deployment is to use an [SSH tunnel][sf-ssh-tunnel].  This allows operators to leverage their existing SSH security infrastructure to also provide secure access to MongoDB.  For a standard deployment of MongoDB on AWS, this is almost always to strategy.  Because of this, we now support creating SSH tunnels automatically when connecting to MongoDB.\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options, (connectionError, client) => {\n  if (connectionError) {\n    return console.log(connectionError);\n  }\n\n  client.db('mongodb').collection('fanclub').count((countingError, count) => {\n    console.log('counted:', countingError, count);\n    client.close();\n  });\n});\n```\n\nThe above provides the same functionality as creating the tunnel using the bash\ncommand below and connecting to MongoDB via another terminal. Notice that\nconnection-model uses a random local port each time it creates a tunnel.\nUsing the command line, you'd have to replace `<random port>` with an actual\nport number.\n\n```bash\nssh -i ~/.ssh/my-key-aws-pair.pem -L <random port>:localhost:27017 ubuntu@ec2-11-111-111-111.compute-1.amazonaws.com\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `sshTunnel` | String | The desired SSH tunnel strategy. Possible values: `NONE`, `USER_PASSWORD`, `IDENTITY_FILE` | `undefined` |\n| `sshTunnelHostname` | String | The hostname of the SSH remote host | `undefined` |\n| `sshTunnelPort` | Port | The SSH port of the remote host | `22` |\n| `sshTunnelBindToLocalPort` | Port | Bind the localhost endpoint of the SSH Tunnel to this port | `undefined` |\n| `sshTunnelUsername` | String | The optional SSH username for the remote host | `undefined` |\n| `sshTunnelPassword` | String | The optional SSH password for the remote host | `undefined` |\n| `sshTunnelIdentityFile` | String/Array | The optional path to the SSH identity file for the remote host | `undefined` |\n| `sshTunnelPassphrase` | String | The optional passphrase for `sshTunnelIdentityFile` | `undefined` |\n\nDescription of `sshTunnel` values:\n\n- `NONE` - Do not use SSH tunneling.\n- `USER_PASSWORD` - The tunnel is created with SSH username and password only.\n- `IDENTITY_FILE` - The tunnel is created using an identity file.\n\n## Derived Properties\n\nDerived properties (also known as computed properties) are properties of the state object that depend on other properties to determine their value.\n\n```javascript\nconst c = new Connection();\nconst derivedProps = c.getAttributes({ derived: true });\n```\n\n| Derived Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `instanceId` | String | The mongoscope | `localhost:27017` |\n| `driverAuthMechanism` | String | Converts the value of `authStrategy` for humans into the `authMechanism` value for the driver | `undefined` |\n| `safeUrl` | String | The URL where a password is replaced with stars | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrl` | String | Use this URL in order to connect via DataService | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrlWithSsh` | String | Use this URL in order to connect via connection model itself | `mongodb://localhost:29201/?readPreference=primary&ssl=false` |\n| `driverOptions` | String | The second argument `mongoscope-server` passes to `mongodb.connect` | `{}` |\n\n## Events\n\n> New in mongodb-connection-model@5.0.0\n\n#### Example: SSH Tunnel\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', skipped: true,\n  reason: 'The selected SSL mode does not need to load any files.' }\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', complete: true}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n#### Example: SSL\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  ssl: 'ALL',\n  sslCA: '~/.ssl/my-ca.pem',\n  sslCert: '~/.ssl/my-server.pem',\n  sslKey: '~/.ssl/my-server.pem'\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', complete: true}\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', skipped: true,\n  reason: 'The selected SSH Tunnel mode is NONE.'}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n[workflow_img]: https://github.com/mongodb-js/connection-model/workflows/Check%20and%20Test/badge.svg?event=push\n[workflow_url]: https://github.com/mongodb-js/connection-model/actions?query=workflow%3A%22Check+and+Test%22\n[npm_img]: https://img.shields.io/npm/v/mongodb-connection-model.svg?style=flat-square\n[npm_url]: https://www.npmjs.org/package/mongodb-connection-model\n[gitter_img]: https://badges.gitter.im/Join%20Chat.svg\n[gitter_url]: http://gitter.im/mongodb-js/mongodb-js\n[enterprise_img]: https://img.shields.io/badge/MongoDB-Enterprise-blue.svg?style=flat-square\n[coming_soon_img]: https://img.shields.io/badge/-Coming%20Soon-ff69b4.svg?style=flat-square\n[kerberos-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/kerberos_tests.js\n[ldap-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ldap_tests.js\n[x509-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ssl_x509_tests.js\n[ns]: https://github.com/mongodb-js/ns\n[sf-ssh-tunnel]: http://serverfault.com/questions/597765/how-to-connect-to-mongodb-server-via-ssh-tunnel\n[ec2-key-pairs]: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html\n[driver-ssl-impl]: https://github.com/christkv/mongodb-core/blob/c3d21cb636d74d7a68134ecd3b9f6af536311279/lib/connection/connection.js#L365-L407\n[driver-ssl-tutorial]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/\n[driver-ssl-none]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#no-certificate-validation\n[driver-ssl-server]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate\n[driver-ssl-all]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate-and-present-valid-certificate\n","gitHead":"cb3371cdb3289f37402f09c6388269e88c943a81","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","test":"mocha","check":"npm run lint && npm run depcheck","pretest":"mongodb-runner install && mongodb-runner start --port=27018","test-ci":"npm run test","depcheck":"depcheck","posttest":"mongodb-runner stop --port=27018","posttest-ci":"node ../../scripts/killall-mongo.js","test-check-ci":"npm run check && npm test"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.17.0+x64 (linux)","description":"MongoDB connection model","directories":{},"_nodeVersion":"16.17.0","compass:main":"index.js","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","debug":"^4.2.0","lodash":"^4.17.15","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.2.0","storage-mixin":"0.0.0-next-cb3371cdb3289f37402f09c6388269e88c943a81","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.2","@mongodb-js/ssh-tunnel":"0.0.0-next-cb3371cdb3289f37402f09c6388269e88c943a81","@mongodb-js/compass-utils":"0.0.0-next-cb3371cdb3289f37402f09c6388269e88c943a81","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.6.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"^4.13.0","depcheck":"^1.4.1","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.9.0","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^4.13.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_0.0.0-next-cb3371cdb3289f37402f09c6388269e88c943a81_1673631524430_0.9148582152108542","host":"s3://npm-registry-packages"}},"0.0.0-next-f6dcd616f47e1d3843402c3e0f47d541edec53f3":{"name":"mongodb-connection-model","version":"0.0.0-next-f6dcd616f47e1d3843402c3e0f47d541edec53f3","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@0.0.0-next-f6dcd616f47e1d3843402c3e0f47d541edec53f3","maintainers":[{"name":"mongo-j","email":"james.wang@mongodb.com"},{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"iteng@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"c5fec5e375ba30856c39ba06030b61f850af31cd","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-0.0.0-next-f6dcd616f47e1d3843402c3e0f47d541edec53f3.tgz","fileCount":20,"integrity":"sha512-rTLvwNioiKDzFV3LvlL8qbRUAJQ82ad4APi3u4he44PniLFhReFk8LuQvo44kM5EU6lYE0c83jFM/iJAYtN+cg==","signatures":[{"sig":"MEUCIGx2CNAWhhHDU8drPOCPrPQwRO3pv6aanztYnpp5Bb91AiEA4M8JNgm9mSdlyzTG3f0eLw58tv6+Qq/29oLZ/R/yMeY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":108151,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjwwcgACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrQjxAAmB4b5PFXOBGtZ1RAWMrGC/K1LEAy/8U/ZGfIQ48cSJD9DnY+\r\nQPvRANENVpicPJojvJw+Vf7iiDyINRHj/r+cAnyFa/8bxUy4ybPwhUSTYkDK\r\nxtjcJjiDbwx5vSoZITqaLdsDcTxN4SmBnuV379xJG/1xdW7aZqRKxSgY2VEi\r\n2E78kqtL3cuyPWXH/2ieEmb1iDh32KRoE/OudPpbymzrQ21atCLur1D9OA3r\r\nXUhDcWB0SE1EeAZINAfEv3+ZAk3joy9GuqSY46+iMz8pc1uUR+p9uxgWOxVV\r\nkssV+iU2vilauWie0GAgf+RQAY+PaqgT/gwqyoACOSlln00WHOe/4oTHRkHu\r\n0V6eBQ32NddWd+vagwlQjgNa8txne/CG5YUsx7LXKUHdcoz0vSYWbSxSuPdF\r\n8DpCBKtMxLUeaCUv0CQQ0X7BjFId0SojrmjHS+XFLE+G7to3PbnitzFDh4nU\r\nAey3jKCLXMg+/Mi7EnsO1LVEkTFWkI81f4vzZA00n90x4564hdMotFAUme22\r\ncqSxNWOi2hvP30TvKsAk+yRNHkmTqwIuG9J54pjBmaPUts661oT0HzJnWv7H\r\n1MKnDGwA6RH5IRQ3vIUan+/x0kdxwSLkpcWYsvTsNsR4eDdtB6oV3A2H+AXY\r\nF2W95aKx6/q4OTkg56BEOGpESo77jdqt1DI=\r\n=kz0B\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","readme":"# mongodb-connection-model [![][workflow_img]][workflow_url] [![][npm_img]][npm_url]\n\n> MongoDB connection model\n\nThe main purpose of the MongoDB connection model is to be a domain model around a MongoDB connection. It encapsulates generating a [Connection String URI](https://docs.mongodb.com/manual/reference/connection-string/) from a group of attributes and parses URI using the [MongoDB Node.JS Driver URI Parser](https://github.com/mongodb-js/mongodb-core/blob/master/lib/uri_parser.js).\n\n## Installation\n\n```\nnpm install --save mongodb-connection-model\n```\n\n## Usage\n\n### Building URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\nconst c = new Connection({ appname: 'My App Name' });\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://localhost:27017/?readPreference=primary&appname=My%20App&ssl=false'\n```\n\n### Parsing URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\n\nConnection.from(\n  'mongodb://someUsername:testPassword@localhost',\n  (error, result) => {\n    console.log(result);\n    >>> `{\n      hosts: [{ host: 'localhost', port: 27017 }],\n      hostname: 'localhost',\n      port: 27017,\n      auth: {\n        username: 'someUsername',\n        password: 'testPassword',\n        db: 'admin'\n      },\n      isSrvRecord: false,\n      authStrategy: 'MONGODB',\n      mongodbUsername: 'someUsername',\n      mongodbPassword: 'testPassword',\n      mongodbDatabaseName: 'admin',\n      extraOptions: {},\n      connectionType: 'NODE_DRIVER',\n      readPreference: 'primary',\n      kerberosCanonicalizeHostname: false,\n      sslMethod: 'NONE',\n      sshTunnel: 'NONE',\n      sshTunnelPort: 22\n    }`\n  }\n);\n```\n\n## Properties\n\nMongoDB connection model is based on Ampersand.js framework and consist of [props](https://ampersandjs.com/docs/#ampersand-state-props) and [derived props](https://ampersandjs.com/docs/#ampersand-state-derived). The props object describes the observable properties that MongoDB connection model gets from the Node.js Driver API.\n\n```javascript\nconst с = new Connection();\nconst props = с.getAttributes({ props: true });\n```\n\n#### See Also\n\n- [URI Generic Syntax](https://tools.ietf.org/html/rfc3986)\n- [URI Options Specification](https://github.com/mongodb/specifications/blob/master/source/uri-options/uri-options.rst)\n\n### General Properties\n\n```javascript\nconst c = new Connection({ isSrvRecord: true });\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ns` | String | A valid [ns][ns] the user can read from | `undefined` |\n| `isSrvRecord` | Boolean | Indicates SRV record | `false` |\n| `auth` | Object | Authentication from driver (username, user, db, password) | `undefined` |\n| `hostname` | String | Hostname of a MongoDB Instance. In case of the replica set the first host and port will be taken | `localhost` |\n| `port` | Number | TCP port of a MongoDB Instance | `27017` |\n| `hosts` | Array | Contains all hosts and ports for replica set | `[{ host: 'localhost', port: 27017 }]` |\n| `extraOptions` | Object | Extra options passed to the node driver as part of `driverOptions` | `{}` |\n| `connectionType` | String | The desired connection type. Possible values: `NODE_DRIVER`, `STITCH_ON_PREM`, `STITCH_ATLAS` | `NODE_DRIVER` |\n| `authStrategy` | String | The desired authentication strategy. Possible values: `NONE`, `MONGODB`, `X509`, `KERBEROS`, `LDAP`, `SCRAM-SHA-256` | `NONE` |\n\n### Connection string options\n\n```javascript\nconst c = new Connection({ appname: 'My App', replicaSet: 'testing' });\n```\n\n#### General connection string options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `replicaSet` | String | Specifies the name of the replica set, if the mongod is a member of a replica set | `undefined` |\n| `connectTimeoutMS` | Number | The time in milliseconds to attempt a connection before timing out | `undefined` |\n| `socketTimeoutMS` | Number | The time in milliseconds to attempt a send or receive on a socket before the attempt times out | `undefined` |\n| `compression` | Object | Object includes compressors and a compression level. The following compressors can be specified: `snappy`, `zlib` (Available in MongoDB 3.6 or greater) | `undefined` |\n\n#### Connection Pool Option\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `maxPoolSize` | Number | The maximum number of connections in the connection pool | `undefined` |\n| `minPoolSize` | Number | The minimum number of connections in the connection pool | `undefined` |\n| `maxIdleTimeMS` | Number | The maximum number of milliseconds that a connection can remain idle in the pool before being removed and closed | `undefined` |\n| `waitQueueMultiple` | Number | A number that the driver multiples the maxPoolSize value to, to provide the maximum number of threads allowed to wait for a connection to become available from the pool | `undefined` |\n| `waitQueueTimeoutMS` | Number | The maximum time in milliseconds that a thread can wait for a connection to become available | `undefined` |\n\n#### Write Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `w` | Number/String | Corresponds to the write concern [w Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-w) | `undefined` |\n| `wTimeoutMS` | Number | Corresponds to the write concern [wtimeout](https://docs.mongodb.com/manual/reference/write-concern/#wc-wtimeout) | `undefined` |\n| `journal` | Boolean | Corresponds to the write concern [j Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-j) | `undefined` |\n\n#### Read Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readConcernLevel` | String | The level of isolation | `undefined` |\n\n#### Read Preference Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readPreference` | String | Specifies the read preferences for this connection. Possible values: `PRIMARY`, `PRIMARY_PREFERRED`, `SECONDARY`, `SECONDARY_PREFERRED`, `NEAREST` | `PRIMARY` |\n| `maxStalenessSeconds` | Number | Specifies, in seconds, how stale a secondary can be before the client stops using it for read operations | `undefined` |\n| `readPreferenceTags` | Object | Default read preference tags for the client | `undefined` |\n\n#### Authentication Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `authSource` | String | Specify the database name associated with the user’s credentials | `undefined` |\n| `authMechanism` | String | Specifies the authentication mechanism that MongoDB will use to authenticate the connection. Possible values: `DEFAULT`, `GSSAPI`, `MONGODB-X509`, `PLAIN`, `SCRAM-SHA-256` | `undefined` |\n| `authMechanismProperties` | Object | Additional options provided for authentication (e.g. to enable hostname canonicalization for GSSAPI) | `undefined` |\n| `gssapiServiceName` | String | Set the Kerberos service name when connecting to Kerberized MongoDB instances | `undefined` |\n| `gssapiServiceRealm` | String | Set the Realm service name | `undefined` |\n| `gssapiCanonicalizeHostName` | Boolean | Whether canonicalized hostname | `undefined` |\n\n#### Server Selection and Discovery Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `localThresholdMS` | Number | The size (in milliseconds) of the latency window for selecting among multiple suitable MongoDB instances | `undefined` |\n| `serverSelectionTimeoutMS` | Number | Specifies how long (in milliseconds) to block for server selection before throwing an exception | `undefined` |\n| `serverSelectionTryOnce` | Boolean | Instructs the driver to scan the MongoDB deployment exactly once after server selection fails and then either select a server or raise an error | `undefined` |\n| `heartbeatFrequencyMS` | Number | Controls when the driver checks the state of the MongoDB deployment | `undefined` |\n\n#### Miscellaneous Configuration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `appname` | String | An application name passed to server as client metadata | `undefined` |\n| `retryWrites` | Boolean | Enable retryable writes | `undefined` |\n| `uuidRepresentation` | String | The legacy representation of UUID. Possible values: `standard`, `csharpLegacy`, `javaLegacy`, `pythonLegacy` | `undefined` |\n| `loadBalanced` | Boolean | Whether or not the server is running in load balanced mode | `undefined` |\n\n### Stitch attributes\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `stitchServiceName` | String | Stitch service name | `undefined` |\n| `stitchClientAppId` | String | Stitch сlient app ID | `undefined` |\n| `stitchGroupId` | String | Stitch group ID | `undefined` |\n| `stitchBaseUrl` | String | Stitch base Url | `undefined` |\n\n### MONGODB authentication\n\n```javascript\nconst c = new Connection({\n  mongodbUsername: 'arlo',\n  mongodbPassword: 'w@of'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/?slaveOk=true&authSource=admin'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `mongodbUsername` | String | MongoDB username | `undefined` |\n| `mongodbPassword` | String | MongoDB password | `undefined` |\n| `mongodbDatabaseName` | String | The database name associated with the user's credentials | `undefined` |\n| `promoteValues` | Boolean | Whether BSON values should be promoted to their JS type counterparts | `undefined` |\n\n### KERBEROS authentication\n\n```javascript\nconst c = new Connection({\n  kerberosServiceName: 'mongodb',\n  kerberosPrincipal: 'arlo/dog@krb5.mongodb.parts',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo%252Fdog%2540krb5.mongodb.parts@localhost:27017/toys?authMechanism=GSSAPI'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n> @note (imlucas): Kerberos on Windows is broken out as it's own state for UX consideration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `kerberosServiceName` | String | Any program or computer you access over a network | `undefined` |\n| `kerberosPrincipal` | String | The format of a typical Kerberos V5 principal is `primary/instance@REALM` | `undefined` |\n| `kerberosCanonicalizeHostname` | Boolean | Whether canonicalized kerberos hostname | `undefined` |\n\n#### See Also\n\n- [node.js driver Kerberos reference](http://bit.ly/mongodb-node-driver-kerberos)\n- [node.js driver Kerberos functional test][kerberos-functional]\n\n### LDAP authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  ldapUsername: 'arlo',\n  ldapPassword: 'w@of',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/toys?slaveOk=true&authMechanism=PLAIN'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ldapUsername` | String | LDAP username | `undefined` |\n| `ldapPassword` | String | LDAP password | `undefined` |\n\n#### See Also\n\n- [node.js driver LDAP reference](http://bit.ly/mongodb-node-driver-ldap)\n- [node.js driver X509 functional test][ldap-functional]\n\n### X509 authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  x509Username: 'CN=client,OU=arlo,O=MongoDB,L=Philadelphia,ST=Pennsylvania,C=US'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://CN%253Dclient%252COU%253Darlo%252CO%253DMongoDB%252CL%253DPhiladelphia%252CST%253DPennsylvania%252CC%253DUS@localhost:27017?slaveOk=true&authMechanism=MONGODB-X509'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `x509Username` | String | The x.509 certificate derived user name, e.g. `CN=user,OU=OrgUnit,O=myOrg,...` | `undefined` |\n\n#### See Also\n\n- [node.js driver X509 reference](http://bit.ly/mongodb-node-driver-x509)\n- [node.js driver X509 functional test][x509-functional]\n\n### SSL\n\n> **Note**: Not to be confused with `authentication=X509`\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ssl` | Number/String | A boolean to enable or disables TLS/SSL for the connection | `undefined` |\n| `sslMethod` | String | The desired ssl method. Possible values: `NONE`, `SYSTEMCA`, `IFAVAILABLE`, `UNVALIDATED`, `SERVER`, `ALL` | `NONE` |\n| `sslCA` | Buffer/String | Array of valid certificates | `undefined` |\n| `sslCert` | Buffer/String | The certificate | `undefined` |\n| `sslKey` | Buffer/String | The certificate private key | `undefined` |\n| `sslPass` | Buffer/String | The certificate password | `undefined` |\n\nDescription of `sslMethod` values:\n\n- `SYSTEMCA` - SSL required, validate using System CA, with host verification.\n- `IFAVAILABLE` - The driver should try SSL first, fall back to no SSL if unavailable, and use the system's Certificate Authority.\n- `SERVER` - The driver should validate the server certificate and fail to connect if validation fails. See also [node.js driver \"Validate Server Certificate\" docs][driver-ssl-server].\n- `ALL` - The driver must present a valid certificate and validate the server certificate. See also [node.js driver \"Validate Server Certificate and Present Valid Certificate\" docs][driver-ssl-all].\n- `NONE` - No SSL (Not recommended).\n- `UNVALIDATED` - Use SSL but do not perform any validation of the certificate chain. See also [node.js driver \"No Certificate Validation\" docs][driver-ssl-none]. **Very** not recommended and likely to be deprecated in future releases because it exposes potential Man-In-The-Middle attack vectors.\n\n#### See also\n\n- [node.js driver SSL implementation][driver-ssl-impl]\n- [node.js driver SSL tutorial][driver-ssl-tutorial]\n\n### SSH TUNNEL\n\n> New in mongodb-connection-model@5.0.0\n\nBecause [authentication](#authentication) is quite difficult for operators to migrate to, the most common method of securing a MongoDB deployment is to use an [SSH tunnel][sf-ssh-tunnel].  This allows operators to leverage their existing SSH security infrastructure to also provide secure access to MongoDB.  For a standard deployment of MongoDB on AWS, this is almost always to strategy.  Because of this, we now support creating SSH tunnels automatically when connecting to MongoDB.\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options, (connectionError, client) => {\n  if (connectionError) {\n    return console.log(connectionError);\n  }\n\n  client.db('mongodb').collection('fanclub').count((countingError, count) => {\n    console.log('counted:', countingError, count);\n    client.close();\n  });\n});\n```\n\nThe above provides the same functionality as creating the tunnel using the bash\ncommand below and connecting to MongoDB via another terminal. Notice that\nconnection-model uses a random local port each time it creates a tunnel.\nUsing the command line, you'd have to replace `<random port>` with an actual\nport number.\n\n```bash\nssh -i ~/.ssh/my-key-aws-pair.pem -L <random port>:localhost:27017 ubuntu@ec2-11-111-111-111.compute-1.amazonaws.com\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `sshTunnel` | String | The desired SSH tunnel strategy. Possible values: `NONE`, `USER_PASSWORD`, `IDENTITY_FILE` | `undefined` |\n| `sshTunnelHostname` | String | The hostname of the SSH remote host | `undefined` |\n| `sshTunnelPort` | Port | The SSH port of the remote host | `22` |\n| `sshTunnelBindToLocalPort` | Port | Bind the localhost endpoint of the SSH Tunnel to this port | `undefined` |\n| `sshTunnelUsername` | String | The optional SSH username for the remote host | `undefined` |\n| `sshTunnelPassword` | String | The optional SSH password for the remote host | `undefined` |\n| `sshTunnelIdentityFile` | String/Array | The optional path to the SSH identity file for the remote host | `undefined` |\n| `sshTunnelPassphrase` | String | The optional passphrase for `sshTunnelIdentityFile` | `undefined` |\n\nDescription of `sshTunnel` values:\n\n- `NONE` - Do not use SSH tunneling.\n- `USER_PASSWORD` - The tunnel is created with SSH username and password only.\n- `IDENTITY_FILE` - The tunnel is created using an identity file.\n\n## Derived Properties\n\nDerived properties (also known as computed properties) are properties of the state object that depend on other properties to determine their value.\n\n```javascript\nconst c = new Connection();\nconst derivedProps = c.getAttributes({ derived: true });\n```\n\n| Derived Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `instanceId` | String | The mongoscope | `localhost:27017` |\n| `driverAuthMechanism` | String | Converts the value of `authStrategy` for humans into the `authMechanism` value for the driver | `undefined` |\n| `safeUrl` | String | The URL where a password is replaced with stars | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrl` | String | Use this URL in order to connect via DataService | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrlWithSsh` | String | Use this URL in order to connect via connection model itself | `mongodb://localhost:29201/?readPreference=primary&ssl=false` |\n| `driverOptions` | String | The second argument `mongoscope-server` passes to `mongodb.connect` | `{}` |\n\n## Events\n\n> New in mongodb-connection-model@5.0.0\n\n#### Example: SSH Tunnel\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', skipped: true,\n  reason: 'The selected SSL mode does not need to load any files.' }\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', complete: true}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n#### Example: SSL\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  ssl: 'ALL',\n  sslCA: '~/.ssl/my-ca.pem',\n  sslCert: '~/.ssl/my-server.pem',\n  sslKey: '~/.ssl/my-server.pem'\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', complete: true}\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', skipped: true,\n  reason: 'The selected SSH Tunnel mode is NONE.'}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n[workflow_img]: https://github.com/mongodb-js/connection-model/workflows/Check%20and%20Test/badge.svg?event=push\n[workflow_url]: https://github.com/mongodb-js/connection-model/actions?query=workflow%3A%22Check+and+Test%22\n[npm_img]: https://img.shields.io/npm/v/mongodb-connection-model.svg?style=flat-square\n[npm_url]: https://www.npmjs.org/package/mongodb-connection-model\n[gitter_img]: https://badges.gitter.im/Join%20Chat.svg\n[gitter_url]: http://gitter.im/mongodb-js/mongodb-js\n[enterprise_img]: https://img.shields.io/badge/MongoDB-Enterprise-blue.svg?style=flat-square\n[coming_soon_img]: https://img.shields.io/badge/-Coming%20Soon-ff69b4.svg?style=flat-square\n[kerberos-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/kerberos_tests.js\n[ldap-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ldap_tests.js\n[x509-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ssl_x509_tests.js\n[ns]: https://github.com/mongodb-js/ns\n[sf-ssh-tunnel]: http://serverfault.com/questions/597765/how-to-connect-to-mongodb-server-via-ssh-tunnel\n[ec2-key-pairs]: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html\n[driver-ssl-impl]: https://github.com/christkv/mongodb-core/blob/c3d21cb636d74d7a68134ecd3b9f6af536311279/lib/connection/connection.js#L365-L407\n[driver-ssl-tutorial]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/\n[driver-ssl-none]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#no-certificate-validation\n[driver-ssl-server]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate\n[driver-ssl-all]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate-and-present-valid-certificate\n","gitHead":"f6dcd616f47e1d3843402c3e0f47d541edec53f3","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","test":"mocha","check":"npm run lint && npm run depcheck","pretest":"mongodb-runner install && mongodb-runner start --port=27018","test-ci":"npm run test","depcheck":"depcheck","posttest":"mongodb-runner stop --port=27018","posttest-ci":"node ../../scripts/killall-mongo.js","test-check-ci":"npm run check && npm test"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.17.0+x64 (linux)","description":"MongoDB connection model","directories":{},"_nodeVersion":"16.17.0","compass:main":"index.js","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","debug":"^4.2.0","lodash":"^4.17.15","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.2.0","storage-mixin":"0.0.0-next-f6dcd616f47e1d3843402c3e0f47d541edec53f3","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.2","@mongodb-js/ssh-tunnel":"0.0.0-next-f6dcd616f47e1d3843402c3e0f47d541edec53f3","@mongodb-js/compass-utils":"0.0.0-next-f6dcd616f47e1d3843402c3e0f47d541edec53f3","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.6.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"^4.13.0","depcheck":"^1.4.1","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.9.0","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^4.13.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_0.0.0-next-f6dcd616f47e1d3843402c3e0f47d541edec53f3_1673725728047_0.30293301356718705","host":"s3://npm-registry-packages"}},"0.0.0-next-6900ac52ffc5e2e7ef959752bc33235dc12946e4":{"name":"mongodb-connection-model","version":"0.0.0-next-6900ac52ffc5e2e7ef959752bc33235dc12946e4","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@0.0.0-next-6900ac52ffc5e2e7ef959752bc33235dc12946e4","maintainers":[{"name":"mongo-j","email":"james.wang@mongodb.com"},{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"iteng@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"693a6aef44ae1c8d423d63a7c4ebc30257eb0914","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-0.0.0-next-6900ac52ffc5e2e7ef959752bc33235dc12946e4.tgz","fileCount":20,"integrity":"sha512-3jQ0pyoC1BcEZz/yhRiQR4vIuGCTmgTTDQWv7lXoENwVSKRRDfojkluBiTsQMVuuo9VK1RTWMmPOkwcDH7Pr8w==","signatures":[{"sig":"MEUCIAEoCkmbsJ5bWLd4sfPqa5Edsf/heNtjEg/a7Xztl/UEAiEAnHcNf/r9CoF5TIluqFMofS+zrMhvscaFx4Mz6rFxluc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":108151,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjxWJwACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoIvg/+N/KWNIlKtl6ahodRO+D//QSHzT3GMxjaFg2uOFrs1qg3GeSG\r\nqtbbvdzXbch5ctMI+CztAgX8CSREBCb6hhOVnD8GsvdpvdgbVge7voRwS3R+\r\nsQ9K1Eau2b6hhnxlm7CbsodI8gt7P21btbbYuxBszWowtHbGMkR5B7uJKrQb\r\nmf7vNYe6POQMl+4Q8MXvfjtnIjLnX+NwGNkN+modKwQK4zzjLMeQ0qiDvXND\r\nYfo401EPKX+jWi6hw3X8CXFPzusf9i4nNAeL4t1twg4LEMsX1QdJ3h/HVRay\r\nU+5fisHdZ7Qj+6n2E04yQASvtnWMmVsyzC8aUGwreIidZD6lUG9Ul2ruwqnW\r\nyzeY0xtzierysVY52/aFmtLt/5zyFwb3ZhluansvxmUTg0/fmjLJrbiiYYEw\r\n4cMnU/ID1vVv/pVt7p7893R3HSbblgrElYMYixHQqFF1NtpDPg2uf5j187xz\r\nJjPAwN3cUdNL4q0kbbkbJanpIhQBKSMso1ElBalatBj0WWi65u0AYsF0VQxJ\r\nTIu5rHS+yz7QVDq8egofxXY6AkDAIDGV+Eqpv/eJX3pNnvEw5Ys1nXM13EWx\r\n2pqy6/tC2wOw3Yjf8gZPUGi0TwFXkNFM2ze38YrlWG1XHyKxMrmnuJ6b1hXt\r\nlIn+oOSbbanX+/83NoXX/ocDhw3zLXqt3I4=\r\n=kUEO\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","readme":"# mongodb-connection-model [![][workflow_img]][workflow_url] [![][npm_img]][npm_url]\n\n> MongoDB connection model\n\nThe main purpose of the MongoDB connection model is to be a domain model around a MongoDB connection. It encapsulates generating a [Connection String URI](https://docs.mongodb.com/manual/reference/connection-string/) from a group of attributes and parses URI using the [MongoDB Node.JS Driver URI Parser](https://github.com/mongodb-js/mongodb-core/blob/master/lib/uri_parser.js).\n\n## Installation\n\n```\nnpm install --save mongodb-connection-model\n```\n\n## Usage\n\n### Building URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\nconst c = new Connection({ appname: 'My App Name' });\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://localhost:27017/?readPreference=primary&appname=My%20App&ssl=false'\n```\n\n### Parsing URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\n\nConnection.from(\n  'mongodb://someUsername:testPassword@localhost',\n  (error, result) => {\n    console.log(result);\n    >>> `{\n      hosts: [{ host: 'localhost', port: 27017 }],\n      hostname: 'localhost',\n      port: 27017,\n      auth: {\n        username: 'someUsername',\n        password: 'testPassword',\n        db: 'admin'\n      },\n      isSrvRecord: false,\n      authStrategy: 'MONGODB',\n      mongodbUsername: 'someUsername',\n      mongodbPassword: 'testPassword',\n      mongodbDatabaseName: 'admin',\n      extraOptions: {},\n      connectionType: 'NODE_DRIVER',\n      readPreference: 'primary',\n      kerberosCanonicalizeHostname: false,\n      sslMethod: 'NONE',\n      sshTunnel: 'NONE',\n      sshTunnelPort: 22\n    }`\n  }\n);\n```\n\n## Properties\n\nMongoDB connection model is based on Ampersand.js framework and consist of [props](https://ampersandjs.com/docs/#ampersand-state-props) and [derived props](https://ampersandjs.com/docs/#ampersand-state-derived). The props object describes the observable properties that MongoDB connection model gets from the Node.js Driver API.\n\n```javascript\nconst с = new Connection();\nconst props = с.getAttributes({ props: true });\n```\n\n#### See Also\n\n- [URI Generic Syntax](https://tools.ietf.org/html/rfc3986)\n- [URI Options Specification](https://github.com/mongodb/specifications/blob/master/source/uri-options/uri-options.rst)\n\n### General Properties\n\n```javascript\nconst c = new Connection({ isSrvRecord: true });\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ns` | String | A valid [ns][ns] the user can read from | `undefined` |\n| `isSrvRecord` | Boolean | Indicates SRV record | `false` |\n| `auth` | Object | Authentication from driver (username, user, db, password) | `undefined` |\n| `hostname` | String | Hostname of a MongoDB Instance. In case of the replica set the first host and port will be taken | `localhost` |\n| `port` | Number | TCP port of a MongoDB Instance | `27017` |\n| `hosts` | Array | Contains all hosts and ports for replica set | `[{ host: 'localhost', port: 27017 }]` |\n| `extraOptions` | Object | Extra options passed to the node driver as part of `driverOptions` | `{}` |\n| `connectionType` | String | The desired connection type. Possible values: `NODE_DRIVER`, `STITCH_ON_PREM`, `STITCH_ATLAS` | `NODE_DRIVER` |\n| `authStrategy` | String | The desired authentication strategy. Possible values: `NONE`, `MONGODB`, `X509`, `KERBEROS`, `LDAP`, `SCRAM-SHA-256` | `NONE` |\n\n### Connection string options\n\n```javascript\nconst c = new Connection({ appname: 'My App', replicaSet: 'testing' });\n```\n\n#### General connection string options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `replicaSet` | String | Specifies the name of the replica set, if the mongod is a member of a replica set | `undefined` |\n| `connectTimeoutMS` | Number | The time in milliseconds to attempt a connection before timing out | `undefined` |\n| `socketTimeoutMS` | Number | The time in milliseconds to attempt a send or receive on a socket before the attempt times out | `undefined` |\n| `compression` | Object | Object includes compressors and a compression level. The following compressors can be specified: `snappy`, `zlib` (Available in MongoDB 3.6 or greater) | `undefined` |\n\n#### Connection Pool Option\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `maxPoolSize` | Number | The maximum number of connections in the connection pool | `undefined` |\n| `minPoolSize` | Number | The minimum number of connections in the connection pool | `undefined` |\n| `maxIdleTimeMS` | Number | The maximum number of milliseconds that a connection can remain idle in the pool before being removed and closed | `undefined` |\n| `waitQueueMultiple` | Number | A number that the driver multiples the maxPoolSize value to, to provide the maximum number of threads allowed to wait for a connection to become available from the pool | `undefined` |\n| `waitQueueTimeoutMS` | Number | The maximum time in milliseconds that a thread can wait for a connection to become available | `undefined` |\n\n#### Write Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `w` | Number/String | Corresponds to the write concern [w Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-w) | `undefined` |\n| `wTimeoutMS` | Number | Corresponds to the write concern [wtimeout](https://docs.mongodb.com/manual/reference/write-concern/#wc-wtimeout) | `undefined` |\n| `journal` | Boolean | Corresponds to the write concern [j Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-j) | `undefined` |\n\n#### Read Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readConcernLevel` | String | The level of isolation | `undefined` |\n\n#### Read Preference Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readPreference` | String | Specifies the read preferences for this connection. Possible values: `PRIMARY`, `PRIMARY_PREFERRED`, `SECONDARY`, `SECONDARY_PREFERRED`, `NEAREST` | `PRIMARY` |\n| `maxStalenessSeconds` | Number | Specifies, in seconds, how stale a secondary can be before the client stops using it for read operations | `undefined` |\n| `readPreferenceTags` | Object | Default read preference tags for the client | `undefined` |\n\n#### Authentication Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `authSource` | String | Specify the database name associated with the user’s credentials | `undefined` |\n| `authMechanism` | String | Specifies the authentication mechanism that MongoDB will use to authenticate the connection. Possible values: `DEFAULT`, `GSSAPI`, `MONGODB-X509`, `PLAIN`, `SCRAM-SHA-256` | `undefined` |\n| `authMechanismProperties` | Object | Additional options provided for authentication (e.g. to enable hostname canonicalization for GSSAPI) | `undefined` |\n| `gssapiServiceName` | String | Set the Kerberos service name when connecting to Kerberized MongoDB instances | `undefined` |\n| `gssapiServiceRealm` | String | Set the Realm service name | `undefined` |\n| `gssapiCanonicalizeHostName` | Boolean | Whether canonicalized hostname | `undefined` |\n\n#### Server Selection and Discovery Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `localThresholdMS` | Number | The size (in milliseconds) of the latency window for selecting among multiple suitable MongoDB instances | `undefined` |\n| `serverSelectionTimeoutMS` | Number | Specifies how long (in milliseconds) to block for server selection before throwing an exception | `undefined` |\n| `serverSelectionTryOnce` | Boolean | Instructs the driver to scan the MongoDB deployment exactly once after server selection fails and then either select a server or raise an error | `undefined` |\n| `heartbeatFrequencyMS` | Number | Controls when the driver checks the state of the MongoDB deployment | `undefined` |\n\n#### Miscellaneous Configuration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `appname` | String | An application name passed to server as client metadata | `undefined` |\n| `retryWrites` | Boolean | Enable retryable writes | `undefined` |\n| `uuidRepresentation` | String | The legacy representation of UUID. Possible values: `standard`, `csharpLegacy`, `javaLegacy`, `pythonLegacy` | `undefined` |\n| `loadBalanced` | Boolean | Whether or not the server is running in load balanced mode | `undefined` |\n\n### Stitch attributes\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `stitchServiceName` | String | Stitch service name | `undefined` |\n| `stitchClientAppId` | String | Stitch сlient app ID | `undefined` |\n| `stitchGroupId` | String | Stitch group ID | `undefined` |\n| `stitchBaseUrl` | String | Stitch base Url | `undefined` |\n\n### MONGODB authentication\n\n```javascript\nconst c = new Connection({\n  mongodbUsername: 'arlo',\n  mongodbPassword: 'w@of'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/?slaveOk=true&authSource=admin'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `mongodbUsername` | String | MongoDB username | `undefined` |\n| `mongodbPassword` | String | MongoDB password | `undefined` |\n| `mongodbDatabaseName` | String | The database name associated with the user's credentials | `undefined` |\n| `promoteValues` | Boolean | Whether BSON values should be promoted to their JS type counterparts | `undefined` |\n\n### KERBEROS authentication\n\n```javascript\nconst c = new Connection({\n  kerberosServiceName: 'mongodb',\n  kerberosPrincipal: 'arlo/dog@krb5.mongodb.parts',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo%252Fdog%2540krb5.mongodb.parts@localhost:27017/toys?authMechanism=GSSAPI'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n> @note (imlucas): Kerberos on Windows is broken out as it's own state for UX consideration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `kerberosServiceName` | String | Any program or computer you access over a network | `undefined` |\n| `kerberosPrincipal` | String | The format of a typical Kerberos V5 principal is `primary/instance@REALM` | `undefined` |\n| `kerberosCanonicalizeHostname` | Boolean | Whether canonicalized kerberos hostname | `undefined` |\n\n#### See Also\n\n- [node.js driver Kerberos reference](http://bit.ly/mongodb-node-driver-kerberos)\n- [node.js driver Kerberos functional test][kerberos-functional]\n\n### LDAP authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  ldapUsername: 'arlo',\n  ldapPassword: 'w@of',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/toys?slaveOk=true&authMechanism=PLAIN'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ldapUsername` | String | LDAP username | `undefined` |\n| `ldapPassword` | String | LDAP password | `undefined` |\n\n#### See Also\n\n- [node.js driver LDAP reference](http://bit.ly/mongodb-node-driver-ldap)\n- [node.js driver X509 functional test][ldap-functional]\n\n### X509 authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  x509Username: 'CN=client,OU=arlo,O=MongoDB,L=Philadelphia,ST=Pennsylvania,C=US'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://CN%253Dclient%252COU%253Darlo%252CO%253DMongoDB%252CL%253DPhiladelphia%252CST%253DPennsylvania%252CC%253DUS@localhost:27017?slaveOk=true&authMechanism=MONGODB-X509'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `x509Username` | String | The x.509 certificate derived user name, e.g. `CN=user,OU=OrgUnit,O=myOrg,...` | `undefined` |\n\n#### See Also\n\n- [node.js driver X509 reference](http://bit.ly/mongodb-node-driver-x509)\n- [node.js driver X509 functional test][x509-functional]\n\n### SSL\n\n> **Note**: Not to be confused with `authentication=X509`\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ssl` | Number/String | A boolean to enable or disables TLS/SSL for the connection | `undefined` |\n| `sslMethod` | String | The desired ssl method. Possible values: `NONE`, `SYSTEMCA`, `IFAVAILABLE`, `UNVALIDATED`, `SERVER`, `ALL` | `NONE` |\n| `sslCA` | Buffer/String | Array of valid certificates | `undefined` |\n| `sslCert` | Buffer/String | The certificate | `undefined` |\n| `sslKey` | Buffer/String | The certificate private key | `undefined` |\n| `sslPass` | Buffer/String | The certificate password | `undefined` |\n\nDescription of `sslMethod` values:\n\n- `SYSTEMCA` - SSL required, validate using System CA, with host verification.\n- `IFAVAILABLE` - The driver should try SSL first, fall back to no SSL if unavailable, and use the system's Certificate Authority.\n- `SERVER` - The driver should validate the server certificate and fail to connect if validation fails. See also [node.js driver \"Validate Server Certificate\" docs][driver-ssl-server].\n- `ALL` - The driver must present a valid certificate and validate the server certificate. See also [node.js driver \"Validate Server Certificate and Present Valid Certificate\" docs][driver-ssl-all].\n- `NONE` - No SSL (Not recommended).\n- `UNVALIDATED` - Use SSL but do not perform any validation of the certificate chain. See also [node.js driver \"No Certificate Validation\" docs][driver-ssl-none]. **Very** not recommended and likely to be deprecated in future releases because it exposes potential Man-In-The-Middle attack vectors.\n\n#### See also\n\n- [node.js driver SSL implementation][driver-ssl-impl]\n- [node.js driver SSL tutorial][driver-ssl-tutorial]\n\n### SSH TUNNEL\n\n> New in mongodb-connection-model@5.0.0\n\nBecause [authentication](#authentication) is quite difficult for operators to migrate to, the most common method of securing a MongoDB deployment is to use an [SSH tunnel][sf-ssh-tunnel].  This allows operators to leverage their existing SSH security infrastructure to also provide secure access to MongoDB.  For a standard deployment of MongoDB on AWS, this is almost always to strategy.  Because of this, we now support creating SSH tunnels automatically when connecting to MongoDB.\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options, (connectionError, client) => {\n  if (connectionError) {\n    return console.log(connectionError);\n  }\n\n  client.db('mongodb').collection('fanclub').count((countingError, count) => {\n    console.log('counted:', countingError, count);\n    client.close();\n  });\n});\n```\n\nThe above provides the same functionality as creating the tunnel using the bash\ncommand below and connecting to MongoDB via another terminal. Notice that\nconnection-model uses a random local port each time it creates a tunnel.\nUsing the command line, you'd have to replace `<random port>` with an actual\nport number.\n\n```bash\nssh -i ~/.ssh/my-key-aws-pair.pem -L <random port>:localhost:27017 ubuntu@ec2-11-111-111-111.compute-1.amazonaws.com\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `sshTunnel` | String | The desired SSH tunnel strategy. Possible values: `NONE`, `USER_PASSWORD`, `IDENTITY_FILE` | `undefined` |\n| `sshTunnelHostname` | String | The hostname of the SSH remote host | `undefined` |\n| `sshTunnelPort` | Port | The SSH port of the remote host | `22` |\n| `sshTunnelBindToLocalPort` | Port | Bind the localhost endpoint of the SSH Tunnel to this port | `undefined` |\n| `sshTunnelUsername` | String | The optional SSH username for the remote host | `undefined` |\n| `sshTunnelPassword` | String | The optional SSH password for the remote host | `undefined` |\n| `sshTunnelIdentityFile` | String/Array | The optional path to the SSH identity file for the remote host | `undefined` |\n| `sshTunnelPassphrase` | String | The optional passphrase for `sshTunnelIdentityFile` | `undefined` |\n\nDescription of `sshTunnel` values:\n\n- `NONE` - Do not use SSH tunneling.\n- `USER_PASSWORD` - The tunnel is created with SSH username and password only.\n- `IDENTITY_FILE` - The tunnel is created using an identity file.\n\n## Derived Properties\n\nDerived properties (also known as computed properties) are properties of the state object that depend on other properties to determine their value.\n\n```javascript\nconst c = new Connection();\nconst derivedProps = c.getAttributes({ derived: true });\n```\n\n| Derived Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `instanceId` | String | The mongoscope | `localhost:27017` |\n| `driverAuthMechanism` | String | Converts the value of `authStrategy` for humans into the `authMechanism` value for the driver | `undefined` |\n| `safeUrl` | String | The URL where a password is replaced with stars | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrl` | String | Use this URL in order to connect via DataService | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrlWithSsh` | String | Use this URL in order to connect via connection model itself | `mongodb://localhost:29201/?readPreference=primary&ssl=false` |\n| `driverOptions` | String | The second argument `mongoscope-server` passes to `mongodb.connect` | `{}` |\n\n## Events\n\n> New in mongodb-connection-model@5.0.0\n\n#### Example: SSH Tunnel\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', skipped: true,\n  reason: 'The selected SSL mode does not need to load any files.' }\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', complete: true}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n#### Example: SSL\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  ssl: 'ALL',\n  sslCA: '~/.ssl/my-ca.pem',\n  sslCert: '~/.ssl/my-server.pem',\n  sslKey: '~/.ssl/my-server.pem'\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', complete: true}\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', skipped: true,\n  reason: 'The selected SSH Tunnel mode is NONE.'}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n[workflow_img]: https://github.com/mongodb-js/connection-model/workflows/Check%20and%20Test/badge.svg?event=push\n[workflow_url]: https://github.com/mongodb-js/connection-model/actions?query=workflow%3A%22Check+and+Test%22\n[npm_img]: https://img.shields.io/npm/v/mongodb-connection-model.svg?style=flat-square\n[npm_url]: https://www.npmjs.org/package/mongodb-connection-model\n[gitter_img]: https://badges.gitter.im/Join%20Chat.svg\n[gitter_url]: http://gitter.im/mongodb-js/mongodb-js\n[enterprise_img]: https://img.shields.io/badge/MongoDB-Enterprise-blue.svg?style=flat-square\n[coming_soon_img]: https://img.shields.io/badge/-Coming%20Soon-ff69b4.svg?style=flat-square\n[kerberos-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/kerberos_tests.js\n[ldap-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ldap_tests.js\n[x509-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ssl_x509_tests.js\n[ns]: https://github.com/mongodb-js/ns\n[sf-ssh-tunnel]: http://serverfault.com/questions/597765/how-to-connect-to-mongodb-server-via-ssh-tunnel\n[ec2-key-pairs]: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html\n[driver-ssl-impl]: https://github.com/christkv/mongodb-core/blob/c3d21cb636d74d7a68134ecd3b9f6af536311279/lib/connection/connection.js#L365-L407\n[driver-ssl-tutorial]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/\n[driver-ssl-none]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#no-certificate-validation\n[driver-ssl-server]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate\n[driver-ssl-all]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate-and-present-valid-certificate\n","gitHead":"6900ac52ffc5e2e7ef959752bc33235dc12946e4","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","test":"mocha","check":"npm run lint && npm run depcheck","pretest":"mongodb-runner install && mongodb-runner start --port=27018","test-ci":"npm run test","depcheck":"depcheck","posttest":"mongodb-runner stop --port=27018","posttest-ci":"node ../../scripts/killall-mongo.js","test-check-ci":"npm run check && npm test"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.17.0+x64 (linux)","description":"MongoDB connection model","directories":{},"_nodeVersion":"16.17.0","compass:main":"index.js","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","debug":"^4.2.0","lodash":"^4.17.15","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.2.0","storage-mixin":"0.0.0-next-6900ac52ffc5e2e7ef959752bc33235dc12946e4","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.2","@mongodb-js/ssh-tunnel":"0.0.0-next-6900ac52ffc5e2e7ef959752bc33235dc12946e4","@mongodb-js/compass-utils":"0.0.0-next-6900ac52ffc5e2e7ef959752bc33235dc12946e4","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.6.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"^4.13.0","depcheck":"^1.4.1","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.9.0","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^4.13.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_0.0.0-next-6900ac52ffc5e2e7ef959752bc33235dc12946e4_1673880176256_0.44693905106611775","host":"s3://npm-registry-packages"}},"0.0.0-next-d09be9dbbff785d6692110b819e06b0186bd3ac7":{"name":"mongodb-connection-model","version":"0.0.0-next-d09be9dbbff785d6692110b819e06b0186bd3ac7","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@0.0.0-next-d09be9dbbff785d6692110b819e06b0186bd3ac7","maintainers":[{"name":"mongo-j","email":"james.wang@mongodb.com"},{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"iteng@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"2c5cac41325e1d7763e983ec99099d25ff463250","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-0.0.0-next-d09be9dbbff785d6692110b819e06b0186bd3ac7.tgz","fileCount":20,"integrity":"sha512-le5E2GfiA6HAp77J+UF5VwWBWvrnTRZDwNNKy0B+MMBtNsgU/5tjhhtag8I2mFOn9FqRGFEGEGlrolWZ3YxQ7w==","signatures":[{"sig":"MEUCIQCRmnD9PfuLe87TFH6QE4vPcipbOdwNQBZPNbZuU5rOqAIgFjWU89RuJklcwigDReuhNWymMcAUPZSdObxkdEtFIkg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":108151,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjxcjDACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq5pBAAoSjrptguJfDnleinvAUWCFRv0tc43w9J2xlI4GGqaGIMEl0r\r\nyuMA726wyNonDGG4Kf3S3BEY0a82BxTz6F0eZF/xxj3IjJYzOPbCqq10IJcM\r\nCP20jV8H4BHbFjMbAAvnxiHZJ3C2O6Ihu5qls3kXOxlx09jKjb8osPMcAKdD\r\nN/ZxmPa1gVXcqBP34DreqyJW3LNL/v0GjvIbz40hMU59xe76iJ5cTc+uGRzb\r\nKUHrjCYqL8NzfeQEXXHiAhCeWt5ebLcRz3FGmQwzc7cZCufof2GvS3WgLoF/\r\ndUl3Bol7RgmRWM/bTj5wRkQD9Opdpqsg+sX6xW9gAQvtYGbjhr5r95xCj68F\r\nGDw2vrmQn4+MM1AVTktFMFzrP13Qw7qWobEyD1lTbi2ASEzWwDEyaK+9WP7I\r\nzUw22Qxk9O64fv0Pnpi6Ii1IfqqdkRVwVrDV5wjLVjzLQ/8gQEZnzuFdRgeH\r\nRJEWFGBKhOfFohklFmd0GkWrbAnFhjPjElOI938XyfFFrM3OC/2//5OBCQYg\r\nXOZIjRUJvVEhCpuUM1C/KhlVb4RLVOhmmup8jDpOt1ZILU6KQ432p21Imu2C\r\n9kZK1q+mUJ+0R4SnCO6r7LPkRE/MF9TkVSpFKzwkUokHnFzgTJ2QnFCfaLF3\r\nscJR9TQxO9PiRPETCKJCHAguv8b0DIekjwA=\r\n=Lefg\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","readme":"# mongodb-connection-model [![][workflow_img]][workflow_url] [![][npm_img]][npm_url]\n\n> MongoDB connection model\n\nThe main purpose of the MongoDB connection model is to be a domain model around a MongoDB connection. It encapsulates generating a [Connection String URI](https://docs.mongodb.com/manual/reference/connection-string/) from a group of attributes and parses URI using the [MongoDB Node.JS Driver URI Parser](https://github.com/mongodb-js/mongodb-core/blob/master/lib/uri_parser.js).\n\n## Installation\n\n```\nnpm install --save mongodb-connection-model\n```\n\n## Usage\n\n### Building URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\nconst c = new Connection({ appname: 'My App Name' });\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://localhost:27017/?readPreference=primary&appname=My%20App&ssl=false'\n```\n\n### Parsing URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\n\nConnection.from(\n  'mongodb://someUsername:testPassword@localhost',\n  (error, result) => {\n    console.log(result);\n    >>> `{\n      hosts: [{ host: 'localhost', port: 27017 }],\n      hostname: 'localhost',\n      port: 27017,\n      auth: {\n        username: 'someUsername',\n        password: 'testPassword',\n        db: 'admin'\n      },\n      isSrvRecord: false,\n      authStrategy: 'MONGODB',\n      mongodbUsername: 'someUsername',\n      mongodbPassword: 'testPassword',\n      mongodbDatabaseName: 'admin',\n      extraOptions: {},\n      connectionType: 'NODE_DRIVER',\n      readPreference: 'primary',\n      kerberosCanonicalizeHostname: false,\n      sslMethod: 'NONE',\n      sshTunnel: 'NONE',\n      sshTunnelPort: 22\n    }`\n  }\n);\n```\n\n## Properties\n\nMongoDB connection model is based on Ampersand.js framework and consist of [props](https://ampersandjs.com/docs/#ampersand-state-props) and [derived props](https://ampersandjs.com/docs/#ampersand-state-derived). The props object describes the observable properties that MongoDB connection model gets from the Node.js Driver API.\n\n```javascript\nconst с = new Connection();\nconst props = с.getAttributes({ props: true });\n```\n\n#### See Also\n\n- [URI Generic Syntax](https://tools.ietf.org/html/rfc3986)\n- [URI Options Specification](https://github.com/mongodb/specifications/blob/master/source/uri-options/uri-options.rst)\n\n### General Properties\n\n```javascript\nconst c = new Connection({ isSrvRecord: true });\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ns` | String | A valid [ns][ns] the user can read from | `undefined` |\n| `isSrvRecord` | Boolean | Indicates SRV record | `false` |\n| `auth` | Object | Authentication from driver (username, user, db, password) | `undefined` |\n| `hostname` | String | Hostname of a MongoDB Instance. In case of the replica set the first host and port will be taken | `localhost` |\n| `port` | Number | TCP port of a MongoDB Instance | `27017` |\n| `hosts` | Array | Contains all hosts and ports for replica set | `[{ host: 'localhost', port: 27017 }]` |\n| `extraOptions` | Object | Extra options passed to the node driver as part of `driverOptions` | `{}` |\n| `connectionType` | String | The desired connection type. Possible values: `NODE_DRIVER`, `STITCH_ON_PREM`, `STITCH_ATLAS` | `NODE_DRIVER` |\n| `authStrategy` | String | The desired authentication strategy. Possible values: `NONE`, `MONGODB`, `X509`, `KERBEROS`, `LDAP`, `SCRAM-SHA-256` | `NONE` |\n\n### Connection string options\n\n```javascript\nconst c = new Connection({ appname: 'My App', replicaSet: 'testing' });\n```\n\n#### General connection string options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `replicaSet` | String | Specifies the name of the replica set, if the mongod is a member of a replica set | `undefined` |\n| `connectTimeoutMS` | Number | The time in milliseconds to attempt a connection before timing out | `undefined` |\n| `socketTimeoutMS` | Number | The time in milliseconds to attempt a send or receive on a socket before the attempt times out | `undefined` |\n| `compression` | Object | Object includes compressors and a compression level. The following compressors can be specified: `snappy`, `zlib` (Available in MongoDB 3.6 or greater) | `undefined` |\n\n#### Connection Pool Option\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `maxPoolSize` | Number | The maximum number of connections in the connection pool | `undefined` |\n| `minPoolSize` | Number | The minimum number of connections in the connection pool | `undefined` |\n| `maxIdleTimeMS` | Number | The maximum number of milliseconds that a connection can remain idle in the pool before being removed and closed | `undefined` |\n| `waitQueueMultiple` | Number | A number that the driver multiples the maxPoolSize value to, to provide the maximum number of threads allowed to wait for a connection to become available from the pool | `undefined` |\n| `waitQueueTimeoutMS` | Number | The maximum time in milliseconds that a thread can wait for a connection to become available | `undefined` |\n\n#### Write Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `w` | Number/String | Corresponds to the write concern [w Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-w) | `undefined` |\n| `wTimeoutMS` | Number | Corresponds to the write concern [wtimeout](https://docs.mongodb.com/manual/reference/write-concern/#wc-wtimeout) | `undefined` |\n| `journal` | Boolean | Corresponds to the write concern [j Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-j) | `undefined` |\n\n#### Read Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readConcernLevel` | String | The level of isolation | `undefined` |\n\n#### Read Preference Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readPreference` | String | Specifies the read preferences for this connection. Possible values: `PRIMARY`, `PRIMARY_PREFERRED`, `SECONDARY`, `SECONDARY_PREFERRED`, `NEAREST` | `PRIMARY` |\n| `maxStalenessSeconds` | Number | Specifies, in seconds, how stale a secondary can be before the client stops using it for read operations | `undefined` |\n| `readPreferenceTags` | Object | Default read preference tags for the client | `undefined` |\n\n#### Authentication Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `authSource` | String | Specify the database name associated with the user’s credentials | `undefined` |\n| `authMechanism` | String | Specifies the authentication mechanism that MongoDB will use to authenticate the connection. Possible values: `DEFAULT`, `GSSAPI`, `MONGODB-X509`, `PLAIN`, `SCRAM-SHA-256` | `undefined` |\n| `authMechanismProperties` | Object | Additional options provided for authentication (e.g. to enable hostname canonicalization for GSSAPI) | `undefined` |\n| `gssapiServiceName` | String | Set the Kerberos service name when connecting to Kerberized MongoDB instances | `undefined` |\n| `gssapiServiceRealm` | String | Set the Realm service name | `undefined` |\n| `gssapiCanonicalizeHostName` | Boolean | Whether canonicalized hostname | `undefined` |\n\n#### Server Selection and Discovery Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `localThresholdMS` | Number | The size (in milliseconds) of the latency window for selecting among multiple suitable MongoDB instances | `undefined` |\n| `serverSelectionTimeoutMS` | Number | Specifies how long (in milliseconds) to block for server selection before throwing an exception | `undefined` |\n| `serverSelectionTryOnce` | Boolean | Instructs the driver to scan the MongoDB deployment exactly once after server selection fails and then either select a server or raise an error | `undefined` |\n| `heartbeatFrequencyMS` | Number | Controls when the driver checks the state of the MongoDB deployment | `undefined` |\n\n#### Miscellaneous Configuration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `appname` | String | An application name passed to server as client metadata | `undefined` |\n| `retryWrites` | Boolean | Enable retryable writes | `undefined` |\n| `uuidRepresentation` | String | The legacy representation of UUID. Possible values: `standard`, `csharpLegacy`, `javaLegacy`, `pythonLegacy` | `undefined` |\n| `loadBalanced` | Boolean | Whether or not the server is running in load balanced mode | `undefined` |\n\n### Stitch attributes\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `stitchServiceName` | String | Stitch service name | `undefined` |\n| `stitchClientAppId` | String | Stitch сlient app ID | `undefined` |\n| `stitchGroupId` | String | Stitch group ID | `undefined` |\n| `stitchBaseUrl` | String | Stitch base Url | `undefined` |\n\n### MONGODB authentication\n\n```javascript\nconst c = new Connection({\n  mongodbUsername: 'arlo',\n  mongodbPassword: 'w@of'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/?slaveOk=true&authSource=admin'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `mongodbUsername` | String | MongoDB username | `undefined` |\n| `mongodbPassword` | String | MongoDB password | `undefined` |\n| `mongodbDatabaseName` | String | The database name associated with the user's credentials | `undefined` |\n| `promoteValues` | Boolean | Whether BSON values should be promoted to their JS type counterparts | `undefined` |\n\n### KERBEROS authentication\n\n```javascript\nconst c = new Connection({\n  kerberosServiceName: 'mongodb',\n  kerberosPrincipal: 'arlo/dog@krb5.mongodb.parts',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo%252Fdog%2540krb5.mongodb.parts@localhost:27017/toys?authMechanism=GSSAPI'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n> @note (imlucas): Kerberos on Windows is broken out as it's own state for UX consideration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `kerberosServiceName` | String | Any program or computer you access over a network | `undefined` |\n| `kerberosPrincipal` | String | The format of a typical Kerberos V5 principal is `primary/instance@REALM` | `undefined` |\n| `kerberosCanonicalizeHostname` | Boolean | Whether canonicalized kerberos hostname | `undefined` |\n\n#### See Also\n\n- [node.js driver Kerberos reference](http://bit.ly/mongodb-node-driver-kerberos)\n- [node.js driver Kerberos functional test][kerberos-functional]\n\n### LDAP authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  ldapUsername: 'arlo',\n  ldapPassword: 'w@of',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/toys?slaveOk=true&authMechanism=PLAIN'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ldapUsername` | String | LDAP username | `undefined` |\n| `ldapPassword` | String | LDAP password | `undefined` |\n\n#### See Also\n\n- [node.js driver LDAP reference](http://bit.ly/mongodb-node-driver-ldap)\n- [node.js driver X509 functional test][ldap-functional]\n\n### X509 authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  x509Username: 'CN=client,OU=arlo,O=MongoDB,L=Philadelphia,ST=Pennsylvania,C=US'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://CN%253Dclient%252COU%253Darlo%252CO%253DMongoDB%252CL%253DPhiladelphia%252CST%253DPennsylvania%252CC%253DUS@localhost:27017?slaveOk=true&authMechanism=MONGODB-X509'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `x509Username` | String | The x.509 certificate derived user name, e.g. `CN=user,OU=OrgUnit,O=myOrg,...` | `undefined` |\n\n#### See Also\n\n- [node.js driver X509 reference](http://bit.ly/mongodb-node-driver-x509)\n- [node.js driver X509 functional test][x509-functional]\n\n### SSL\n\n> **Note**: Not to be confused with `authentication=X509`\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ssl` | Number/String | A boolean to enable or disables TLS/SSL for the connection | `undefined` |\n| `sslMethod` | String | The desired ssl method. Possible values: `NONE`, `SYSTEMCA`, `IFAVAILABLE`, `UNVALIDATED`, `SERVER`, `ALL` | `NONE` |\n| `sslCA` | Buffer/String | Array of valid certificates | `undefined` |\n| `sslCert` | Buffer/String | The certificate | `undefined` |\n| `sslKey` | Buffer/String | The certificate private key | `undefined` |\n| `sslPass` | Buffer/String | The certificate password | `undefined` |\n\nDescription of `sslMethod` values:\n\n- `SYSTEMCA` - SSL required, validate using System CA, with host verification.\n- `IFAVAILABLE` - The driver should try SSL first, fall back to no SSL if unavailable, and use the system's Certificate Authority.\n- `SERVER` - The driver should validate the server certificate and fail to connect if validation fails. See also [node.js driver \"Validate Server Certificate\" docs][driver-ssl-server].\n- `ALL` - The driver must present a valid certificate and validate the server certificate. See also [node.js driver \"Validate Server Certificate and Present Valid Certificate\" docs][driver-ssl-all].\n- `NONE` - No SSL (Not recommended).\n- `UNVALIDATED` - Use SSL but do not perform any validation of the certificate chain. See also [node.js driver \"No Certificate Validation\" docs][driver-ssl-none]. **Very** not recommended and likely to be deprecated in future releases because it exposes potential Man-In-The-Middle attack vectors.\n\n#### See also\n\n- [node.js driver SSL implementation][driver-ssl-impl]\n- [node.js driver SSL tutorial][driver-ssl-tutorial]\n\n### SSH TUNNEL\n\n> New in mongodb-connection-model@5.0.0\n\nBecause [authentication](#authentication) is quite difficult for operators to migrate to, the most common method of securing a MongoDB deployment is to use an [SSH tunnel][sf-ssh-tunnel].  This allows operators to leverage their existing SSH security infrastructure to also provide secure access to MongoDB.  For a standard deployment of MongoDB on AWS, this is almost always to strategy.  Because of this, we now support creating SSH tunnels automatically when connecting to MongoDB.\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options, (connectionError, client) => {\n  if (connectionError) {\n    return console.log(connectionError);\n  }\n\n  client.db('mongodb').collection('fanclub').count((countingError, count) => {\n    console.log('counted:', countingError, count);\n    client.close();\n  });\n});\n```\n\nThe above provides the same functionality as creating the tunnel using the bash\ncommand below and connecting to MongoDB via another terminal. Notice that\nconnection-model uses a random local port each time it creates a tunnel.\nUsing the command line, you'd have to replace `<random port>` with an actual\nport number.\n\n```bash\nssh -i ~/.ssh/my-key-aws-pair.pem -L <random port>:localhost:27017 ubuntu@ec2-11-111-111-111.compute-1.amazonaws.com\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `sshTunnel` | String | The desired SSH tunnel strategy. Possible values: `NONE`, `USER_PASSWORD`, `IDENTITY_FILE` | `undefined` |\n| `sshTunnelHostname` | String | The hostname of the SSH remote host | `undefined` |\n| `sshTunnelPort` | Port | The SSH port of the remote host | `22` |\n| `sshTunnelBindToLocalPort` | Port | Bind the localhost endpoint of the SSH Tunnel to this port | `undefined` |\n| `sshTunnelUsername` | String | The optional SSH username for the remote host | `undefined` |\n| `sshTunnelPassword` | String | The optional SSH password for the remote host | `undefined` |\n| `sshTunnelIdentityFile` | String/Array | The optional path to the SSH identity file for the remote host | `undefined` |\n| `sshTunnelPassphrase` | String | The optional passphrase for `sshTunnelIdentityFile` | `undefined` |\n\nDescription of `sshTunnel` values:\n\n- `NONE` - Do not use SSH tunneling.\n- `USER_PASSWORD` - The tunnel is created with SSH username and password only.\n- `IDENTITY_FILE` - The tunnel is created using an identity file.\n\n## Derived Properties\n\nDerived properties (also known as computed properties) are properties of the state object that depend on other properties to determine their value.\n\n```javascript\nconst c = new Connection();\nconst derivedProps = c.getAttributes({ derived: true });\n```\n\n| Derived Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `instanceId` | String | The mongoscope | `localhost:27017` |\n| `driverAuthMechanism` | String | Converts the value of `authStrategy` for humans into the `authMechanism` value for the driver | `undefined` |\n| `safeUrl` | String | The URL where a password is replaced with stars | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrl` | String | Use this URL in order to connect via DataService | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrlWithSsh` | String | Use this URL in order to connect via connection model itself | `mongodb://localhost:29201/?readPreference=primary&ssl=false` |\n| `driverOptions` | String | The second argument `mongoscope-server` passes to `mongodb.connect` | `{}` |\n\n## Events\n\n> New in mongodb-connection-model@5.0.0\n\n#### Example: SSH Tunnel\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', skipped: true,\n  reason: 'The selected SSL mode does not need to load any files.' }\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', complete: true}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n#### Example: SSL\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  ssl: 'ALL',\n  sslCA: '~/.ssl/my-ca.pem',\n  sslCert: '~/.ssl/my-server.pem',\n  sslKey: '~/.ssl/my-server.pem'\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', complete: true}\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', skipped: true,\n  reason: 'The selected SSH Tunnel mode is NONE.'}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n[workflow_img]: https://github.com/mongodb-js/connection-model/workflows/Check%20and%20Test/badge.svg?event=push\n[workflow_url]: https://github.com/mongodb-js/connection-model/actions?query=workflow%3A%22Check+and+Test%22\n[npm_img]: https://img.shields.io/npm/v/mongodb-connection-model.svg?style=flat-square\n[npm_url]: https://www.npmjs.org/package/mongodb-connection-model\n[gitter_img]: https://badges.gitter.im/Join%20Chat.svg\n[gitter_url]: http://gitter.im/mongodb-js/mongodb-js\n[enterprise_img]: https://img.shields.io/badge/MongoDB-Enterprise-blue.svg?style=flat-square\n[coming_soon_img]: https://img.shields.io/badge/-Coming%20Soon-ff69b4.svg?style=flat-square\n[kerberos-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/kerberos_tests.js\n[ldap-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ldap_tests.js\n[x509-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ssl_x509_tests.js\n[ns]: https://github.com/mongodb-js/ns\n[sf-ssh-tunnel]: http://serverfault.com/questions/597765/how-to-connect-to-mongodb-server-via-ssh-tunnel\n[ec2-key-pairs]: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html\n[driver-ssl-impl]: https://github.com/christkv/mongodb-core/blob/c3d21cb636d74d7a68134ecd3b9f6af536311279/lib/connection/connection.js#L365-L407\n[driver-ssl-tutorial]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/\n[driver-ssl-none]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#no-certificate-validation\n[driver-ssl-server]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate\n[driver-ssl-all]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate-and-present-valid-certificate\n","gitHead":"d09be9dbbff785d6692110b819e06b0186bd3ac7","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","test":"mocha","check":"npm run lint && npm run depcheck","pretest":"mongodb-runner install && mongodb-runner start --port=27018","test-ci":"npm run test","depcheck":"depcheck","posttest":"mongodb-runner stop --port=27018","posttest-ci":"node ../../scripts/killall-mongo.js","test-check-ci":"npm run check && npm test"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.17.0+x64 (linux)","description":"MongoDB connection model","directories":{},"_nodeVersion":"16.17.0","compass:main":"index.js","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","debug":"^4.2.0","lodash":"^4.17.15","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.2.0","storage-mixin":"0.0.0-next-d09be9dbbff785d6692110b819e06b0186bd3ac7","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.2","@mongodb-js/ssh-tunnel":"0.0.0-next-d09be9dbbff785d6692110b819e06b0186bd3ac7","@mongodb-js/compass-utils":"0.0.0-next-d09be9dbbff785d6692110b819e06b0186bd3ac7","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.6.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"^4.13.0","depcheck":"^1.4.1","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.9.0","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^4.13.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_0.0.0-next-d09be9dbbff785d6692110b819e06b0186bd3ac7_1673906371769_0.25549348775183334","host":"s3://npm-registry-packages"}},"0.0.0-next-b72d7d0f94c6cd6b83966a08494549408ed56560":{"name":"mongodb-connection-model","version":"0.0.0-next-b72d7d0f94c6cd6b83966a08494549408ed56560","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@0.0.0-next-b72d7d0f94c6cd6b83966a08494549408ed56560","maintainers":[{"name":"mongo-j","email":"james.wang@mongodb.com"},{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"iteng@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"939df0d2ff85c2664788afd5bba3b3c0719ad5f0","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-0.0.0-next-b72d7d0f94c6cd6b83966a08494549408ed56560.tgz","fileCount":20,"integrity":"sha512-RylPBL0aQENw/tPleX0tKaBQJ0h8RSe7KfG1FH0OzPhxNG2oao8pyP3dC8Lbn6qHbnI3Ze2SeqUjSCK+A6YB6w==","signatures":[{"sig":"MEUCIQC4+XdW5n3/LQ9Hg4m3Tx27gvy2fInfZf6RbPCX+PDgIgIgD9V4JyfT68AgaAJ+XaBmnpDveFleDewtp8grr9h2SGM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":108151,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjyq/6ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoXahAAgkzlF46Hj2RIIn265MxD721Fb7BYXsx1bdrPZRLo6fy7O/Ao\r\n2AoO0tdp/dowTENLLg+CwDRnla69hDSJABCe3zK27MqAglP/IfdUTW5qnVRU\r\nAODs7aeSPFYZBUBzySoAMamvJx51Jqz/PAWu7/Dl3uqkgFwUlSmmUHCI8Ne6\r\naJzkJQKzff/pr8plFOab+ebumiA81hZT/tfoN8IGGsQ6JgUnz2jV0kTQrrfC\r\nOkT3+FbaIjV9qXqj2V/A57zboIHBgYPC4fQtXLEsvEfEVp95i7MQiLDlbCem\r\n0HP2oGKia9FN2fV6xHOHU9tcabwGUSFIBZQDdKBFmtcm8YhKu2N1Ndee8Ck6\r\nCJg61PsUQNYtX6U6vM3i3j2HHkNGuZaZRcyIlkDbzdUF40ahA7HICf+Zi7/X\r\nd12iMNwY5HFSYqEn9s3i9CIj+OlgIZJKxBGam35F4G0mCMuw+YmTPn31zabL\r\nskBl0zm9j6uB0HOkYMCyZ/u6NzKpQJGEJR/hbeMUGu2Ib0fMflvXw+cQu58c\r\nm0obAS1/WL9PqnhTrepBQlWtkADPjXA7sPclKJ8rcvvZ3pTGLPzqzuy/Hefc\r\n3rTMwjWCYMH/KYpRvOjOmpAR8/QUIxCsSk9CQW1s/KRvcJYLX8fsViKJMXkE\r\nw5qmOoxYfrq7vxDYxPpPTe4DK5zncxfMns4=\r\n=aH0z\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","readme":"# mongodb-connection-model [![][workflow_img]][workflow_url] [![][npm_img]][npm_url]\n\n> MongoDB connection model\n\nThe main purpose of the MongoDB connection model is to be a domain model around a MongoDB connection. It encapsulates generating a [Connection String URI](https://docs.mongodb.com/manual/reference/connection-string/) from a group of attributes and parses URI using the [MongoDB Node.JS Driver URI Parser](https://github.com/mongodb-js/mongodb-core/blob/master/lib/uri_parser.js).\n\n## Installation\n\n```\nnpm install --save mongodb-connection-model\n```\n\n## Usage\n\n### Building URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\nconst c = new Connection({ appname: 'My App Name' });\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://localhost:27017/?readPreference=primary&appname=My%20App&ssl=false'\n```\n\n### Parsing URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\n\nConnection.from(\n  'mongodb://someUsername:testPassword@localhost',\n  (error, result) => {\n    console.log(result);\n    >>> `{\n      hosts: [{ host: 'localhost', port: 27017 }],\n      hostname: 'localhost',\n      port: 27017,\n      auth: {\n        username: 'someUsername',\n        password: 'testPassword',\n        db: 'admin'\n      },\n      isSrvRecord: false,\n      authStrategy: 'MONGODB',\n      mongodbUsername: 'someUsername',\n      mongodbPassword: 'testPassword',\n      mongodbDatabaseName: 'admin',\n      extraOptions: {},\n      connectionType: 'NODE_DRIVER',\n      readPreference: 'primary',\n      kerberosCanonicalizeHostname: false,\n      sslMethod: 'NONE',\n      sshTunnel: 'NONE',\n      sshTunnelPort: 22\n    }`\n  }\n);\n```\n\n## Properties\n\nMongoDB connection model is based on Ampersand.js framework and consist of [props](https://ampersandjs.com/docs/#ampersand-state-props) and [derived props](https://ampersandjs.com/docs/#ampersand-state-derived). The props object describes the observable properties that MongoDB connection model gets from the Node.js Driver API.\n\n```javascript\nconst с = new Connection();\nconst props = с.getAttributes({ props: true });\n```\n\n#### See Also\n\n- [URI Generic Syntax](https://tools.ietf.org/html/rfc3986)\n- [URI Options Specification](https://github.com/mongodb/specifications/blob/master/source/uri-options/uri-options.rst)\n\n### General Properties\n\n```javascript\nconst c = new Connection({ isSrvRecord: true });\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ns` | String | A valid [ns][ns] the user can read from | `undefined` |\n| `isSrvRecord` | Boolean | Indicates SRV record | `false` |\n| `auth` | Object | Authentication from driver (username, user, db, password) | `undefined` |\n| `hostname` | String | Hostname of a MongoDB Instance. In case of the replica set the first host and port will be taken | `localhost` |\n| `port` | Number | TCP port of a MongoDB Instance | `27017` |\n| `hosts` | Array | Contains all hosts and ports for replica set | `[{ host: 'localhost', port: 27017 }]` |\n| `extraOptions` | Object | Extra options passed to the node driver as part of `driverOptions` | `{}` |\n| `connectionType` | String | The desired connection type. Possible values: `NODE_DRIVER`, `STITCH_ON_PREM`, `STITCH_ATLAS` | `NODE_DRIVER` |\n| `authStrategy` | String | The desired authentication strategy. Possible values: `NONE`, `MONGODB`, `X509`, `KERBEROS`, `LDAP`, `SCRAM-SHA-256` | `NONE` |\n\n### Connection string options\n\n```javascript\nconst c = new Connection({ appname: 'My App', replicaSet: 'testing' });\n```\n\n#### General connection string options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `replicaSet` | String | Specifies the name of the replica set, if the mongod is a member of a replica set | `undefined` |\n| `connectTimeoutMS` | Number | The time in milliseconds to attempt a connection before timing out | `undefined` |\n| `socketTimeoutMS` | Number | The time in milliseconds to attempt a send or receive on a socket before the attempt times out | `undefined` |\n| `compression` | Object | Object includes compressors and a compression level. The following compressors can be specified: `snappy`, `zlib` (Available in MongoDB 3.6 or greater) | `undefined` |\n\n#### Connection Pool Option\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `maxPoolSize` | Number | The maximum number of connections in the connection pool | `undefined` |\n| `minPoolSize` | Number | The minimum number of connections in the connection pool | `undefined` |\n| `maxIdleTimeMS` | Number | The maximum number of milliseconds that a connection can remain idle in the pool before being removed and closed | `undefined` |\n| `waitQueueMultiple` | Number | A number that the driver multiples the maxPoolSize value to, to provide the maximum number of threads allowed to wait for a connection to become available from the pool | `undefined` |\n| `waitQueueTimeoutMS` | Number | The maximum time in milliseconds that a thread can wait for a connection to become available | `undefined` |\n\n#### Write Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `w` | Number/String | Corresponds to the write concern [w Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-w) | `undefined` |\n| `wTimeoutMS` | Number | Corresponds to the write concern [wtimeout](https://docs.mongodb.com/manual/reference/write-concern/#wc-wtimeout) | `undefined` |\n| `journal` | Boolean | Corresponds to the write concern [j Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-j) | `undefined` |\n\n#### Read Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readConcernLevel` | String | The level of isolation | `undefined` |\n\n#### Read Preference Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readPreference` | String | Specifies the read preferences for this connection. Possible values: `PRIMARY`, `PRIMARY_PREFERRED`, `SECONDARY`, `SECONDARY_PREFERRED`, `NEAREST` | `PRIMARY` |\n| `maxStalenessSeconds` | Number | Specifies, in seconds, how stale a secondary can be before the client stops using it for read operations | `undefined` |\n| `readPreferenceTags` | Object | Default read preference tags for the client | `undefined` |\n\n#### Authentication Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `authSource` | String | Specify the database name associated with the user’s credentials | `undefined` |\n| `authMechanism` | String | Specifies the authentication mechanism that MongoDB will use to authenticate the connection. Possible values: `DEFAULT`, `GSSAPI`, `MONGODB-X509`, `PLAIN`, `SCRAM-SHA-256` | `undefined` |\n| `authMechanismProperties` | Object | Additional options provided for authentication (e.g. to enable hostname canonicalization for GSSAPI) | `undefined` |\n| `gssapiServiceName` | String | Set the Kerberos service name when connecting to Kerberized MongoDB instances | `undefined` |\n| `gssapiServiceRealm` | String | Set the Realm service name | `undefined` |\n| `gssapiCanonicalizeHostName` | Boolean | Whether canonicalized hostname | `undefined` |\n\n#### Server Selection and Discovery Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `localThresholdMS` | Number | The size (in milliseconds) of the latency window for selecting among multiple suitable MongoDB instances | `undefined` |\n| `serverSelectionTimeoutMS` | Number | Specifies how long (in milliseconds) to block for server selection before throwing an exception | `undefined` |\n| `serverSelectionTryOnce` | Boolean | Instructs the driver to scan the MongoDB deployment exactly once after server selection fails and then either select a server or raise an error | `undefined` |\n| `heartbeatFrequencyMS` | Number | Controls when the driver checks the state of the MongoDB deployment | `undefined` |\n\n#### Miscellaneous Configuration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `appname` | String | An application name passed to server as client metadata | `undefined` |\n| `retryWrites` | Boolean | Enable retryable writes | `undefined` |\n| `uuidRepresentation` | String | The legacy representation of UUID. Possible values: `standard`, `csharpLegacy`, `javaLegacy`, `pythonLegacy` | `undefined` |\n| `loadBalanced` | Boolean | Whether or not the server is running in load balanced mode | `undefined` |\n\n### Stitch attributes\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `stitchServiceName` | String | Stitch service name | `undefined` |\n| `stitchClientAppId` | String | Stitch сlient app ID | `undefined` |\n| `stitchGroupId` | String | Stitch group ID | `undefined` |\n| `stitchBaseUrl` | String | Stitch base Url | `undefined` |\n\n### MONGODB authentication\n\n```javascript\nconst c = new Connection({\n  mongodbUsername: 'arlo',\n  mongodbPassword: 'w@of'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/?slaveOk=true&authSource=admin'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `mongodbUsername` | String | MongoDB username | `undefined` |\n| `mongodbPassword` | String | MongoDB password | `undefined` |\n| `mongodbDatabaseName` | String | The database name associated with the user's credentials | `undefined` |\n| `promoteValues` | Boolean | Whether BSON values should be promoted to their JS type counterparts | `undefined` |\n\n### KERBEROS authentication\n\n```javascript\nconst c = new Connection({\n  kerberosServiceName: 'mongodb',\n  kerberosPrincipal: 'arlo/dog@krb5.mongodb.parts',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo%252Fdog%2540krb5.mongodb.parts@localhost:27017/toys?authMechanism=GSSAPI'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n> @note (imlucas): Kerberos on Windows is broken out as it's own state for UX consideration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `kerberosServiceName` | String | Any program or computer you access over a network | `undefined` |\n| `kerberosPrincipal` | String | The format of a typical Kerberos V5 principal is `primary/instance@REALM` | `undefined` |\n| `kerberosCanonicalizeHostname` | Boolean | Whether canonicalized kerberos hostname | `undefined` |\n\n#### See Also\n\n- [node.js driver Kerberos reference](http://bit.ly/mongodb-node-driver-kerberos)\n- [node.js driver Kerberos functional test][kerberos-functional]\n\n### LDAP authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  ldapUsername: 'arlo',\n  ldapPassword: 'w@of',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/toys?slaveOk=true&authMechanism=PLAIN'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ldapUsername` | String | LDAP username | `undefined` |\n| `ldapPassword` | String | LDAP password | `undefined` |\n\n#### See Also\n\n- [node.js driver LDAP reference](http://bit.ly/mongodb-node-driver-ldap)\n- [node.js driver X509 functional test][ldap-functional]\n\n### X509 authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  x509Username: 'CN=client,OU=arlo,O=MongoDB,L=Philadelphia,ST=Pennsylvania,C=US'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://CN%253Dclient%252COU%253Darlo%252CO%253DMongoDB%252CL%253DPhiladelphia%252CST%253DPennsylvania%252CC%253DUS@localhost:27017?slaveOk=true&authMechanism=MONGODB-X509'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `x509Username` | String | The x.509 certificate derived user name, e.g. `CN=user,OU=OrgUnit,O=myOrg,...` | `undefined` |\n\n#### See Also\n\n- [node.js driver X509 reference](http://bit.ly/mongodb-node-driver-x509)\n- [node.js driver X509 functional test][x509-functional]\n\n### SSL\n\n> **Note**: Not to be confused with `authentication=X509`\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ssl` | Number/String | A boolean to enable or disables TLS/SSL for the connection | `undefined` |\n| `sslMethod` | String | The desired ssl method. Possible values: `NONE`, `SYSTEMCA`, `IFAVAILABLE`, `UNVALIDATED`, `SERVER`, `ALL` | `NONE` |\n| `sslCA` | Buffer/String | Array of valid certificates | `undefined` |\n| `sslCert` | Buffer/String | The certificate | `undefined` |\n| `sslKey` | Buffer/String | The certificate private key | `undefined` |\n| `sslPass` | Buffer/String | The certificate password | `undefined` |\n\nDescription of `sslMethod` values:\n\n- `SYSTEMCA` - SSL required, validate using System CA, with host verification.\n- `IFAVAILABLE` - The driver should try SSL first, fall back to no SSL if unavailable, and use the system's Certificate Authority.\n- `SERVER` - The driver should validate the server certificate and fail to connect if validation fails. See also [node.js driver \"Validate Server Certificate\" docs][driver-ssl-server].\n- `ALL` - The driver must present a valid certificate and validate the server certificate. See also [node.js driver \"Validate Server Certificate and Present Valid Certificate\" docs][driver-ssl-all].\n- `NONE` - No SSL (Not recommended).\n- `UNVALIDATED` - Use SSL but do not perform any validation of the certificate chain. See also [node.js driver \"No Certificate Validation\" docs][driver-ssl-none]. **Very** not recommended and likely to be deprecated in future releases because it exposes potential Man-In-The-Middle attack vectors.\n\n#### See also\n\n- [node.js driver SSL implementation][driver-ssl-impl]\n- [node.js driver SSL tutorial][driver-ssl-tutorial]\n\n### SSH TUNNEL\n\n> New in mongodb-connection-model@5.0.0\n\nBecause [authentication](#authentication) is quite difficult for operators to migrate to, the most common method of securing a MongoDB deployment is to use an [SSH tunnel][sf-ssh-tunnel].  This allows operators to leverage their existing SSH security infrastructure to also provide secure access to MongoDB.  For a standard deployment of MongoDB on AWS, this is almost always to strategy.  Because of this, we now support creating SSH tunnels automatically when connecting to MongoDB.\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options, (connectionError, client) => {\n  if (connectionError) {\n    return console.log(connectionError);\n  }\n\n  client.db('mongodb').collection('fanclub').count((countingError, count) => {\n    console.log('counted:', countingError, count);\n    client.close();\n  });\n});\n```\n\nThe above provides the same functionality as creating the tunnel using the bash\ncommand below and connecting to MongoDB via another terminal. Notice that\nconnection-model uses a random local port each time it creates a tunnel.\nUsing the command line, you'd have to replace `<random port>` with an actual\nport number.\n\n```bash\nssh -i ~/.ssh/my-key-aws-pair.pem -L <random port>:localhost:27017 ubuntu@ec2-11-111-111-111.compute-1.amazonaws.com\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `sshTunnel` | String | The desired SSH tunnel strategy. Possible values: `NONE`, `USER_PASSWORD`, `IDENTITY_FILE` | `undefined` |\n| `sshTunnelHostname` | String | The hostname of the SSH remote host | `undefined` |\n| `sshTunnelPort` | Port | The SSH port of the remote host | `22` |\n| `sshTunnelBindToLocalPort` | Port | Bind the localhost endpoint of the SSH Tunnel to this port | `undefined` |\n| `sshTunnelUsername` | String | The optional SSH username for the remote host | `undefined` |\n| `sshTunnelPassword` | String | The optional SSH password for the remote host | `undefined` |\n| `sshTunnelIdentityFile` | String/Array | The optional path to the SSH identity file for the remote host | `undefined` |\n| `sshTunnelPassphrase` | String | The optional passphrase for `sshTunnelIdentityFile` | `undefined` |\n\nDescription of `sshTunnel` values:\n\n- `NONE` - Do not use SSH tunneling.\n- `USER_PASSWORD` - The tunnel is created with SSH username and password only.\n- `IDENTITY_FILE` - The tunnel is created using an identity file.\n\n## Derived Properties\n\nDerived properties (also known as computed properties) are properties of the state object that depend on other properties to determine their value.\n\n```javascript\nconst c = new Connection();\nconst derivedProps = c.getAttributes({ derived: true });\n```\n\n| Derived Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `instanceId` | String | The mongoscope | `localhost:27017` |\n| `driverAuthMechanism` | String | Converts the value of `authStrategy` for humans into the `authMechanism` value for the driver | `undefined` |\n| `safeUrl` | String | The URL where a password is replaced with stars | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrl` | String | Use this URL in order to connect via DataService | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrlWithSsh` | String | Use this URL in order to connect via connection model itself | `mongodb://localhost:29201/?readPreference=primary&ssl=false` |\n| `driverOptions` | String | The second argument `mongoscope-server` passes to `mongodb.connect` | `{}` |\n\n## Events\n\n> New in mongodb-connection-model@5.0.0\n\n#### Example: SSH Tunnel\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', skipped: true,\n  reason: 'The selected SSL mode does not need to load any files.' }\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', complete: true}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n#### Example: SSL\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  ssl: 'ALL',\n  sslCA: '~/.ssl/my-ca.pem',\n  sslCert: '~/.ssl/my-server.pem',\n  sslKey: '~/.ssl/my-server.pem'\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', complete: true}\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', skipped: true,\n  reason: 'The selected SSH Tunnel mode is NONE.'}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n[workflow_img]: https://github.com/mongodb-js/connection-model/workflows/Check%20and%20Test/badge.svg?event=push\n[workflow_url]: https://github.com/mongodb-js/connection-model/actions?query=workflow%3A%22Check+and+Test%22\n[npm_img]: https://img.shields.io/npm/v/mongodb-connection-model.svg?style=flat-square\n[npm_url]: https://www.npmjs.org/package/mongodb-connection-model\n[gitter_img]: https://badges.gitter.im/Join%20Chat.svg\n[gitter_url]: http://gitter.im/mongodb-js/mongodb-js\n[enterprise_img]: https://img.shields.io/badge/MongoDB-Enterprise-blue.svg?style=flat-square\n[coming_soon_img]: https://img.shields.io/badge/-Coming%20Soon-ff69b4.svg?style=flat-square\n[kerberos-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/kerberos_tests.js\n[ldap-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ldap_tests.js\n[x509-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ssl_x509_tests.js\n[ns]: https://github.com/mongodb-js/ns\n[sf-ssh-tunnel]: http://serverfault.com/questions/597765/how-to-connect-to-mongodb-server-via-ssh-tunnel\n[ec2-key-pairs]: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html\n[driver-ssl-impl]: https://github.com/christkv/mongodb-core/blob/c3d21cb636d74d7a68134ecd3b9f6af536311279/lib/connection/connection.js#L365-L407\n[driver-ssl-tutorial]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/\n[driver-ssl-none]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#no-certificate-validation\n[driver-ssl-server]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate\n[driver-ssl-all]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate-and-present-valid-certificate\n","gitHead":"b72d7d0f94c6cd6b83966a08494549408ed56560","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","test":"mocha","check":"npm run lint && npm run depcheck","pretest":"mongodb-runner install && mongodb-runner start --port=27018","test-ci":"npm run test","depcheck":"depcheck","posttest":"mongodb-runner stop --port=27018","posttest-ci":"node ../../scripts/killall-mongo.js","test-check-ci":"npm run check && npm test"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.17.0+x64 (linux)","description":"MongoDB connection model","directories":{},"_nodeVersion":"16.17.0","compass:main":"index.js","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","debug":"^4.2.0","lodash":"^4.17.15","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.2.0","storage-mixin":"0.0.0-next-b72d7d0f94c6cd6b83966a08494549408ed56560","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.2","@mongodb-js/ssh-tunnel":"0.0.0-next-b72d7d0f94c6cd6b83966a08494549408ed56560","@mongodb-js/compass-utils":"0.0.0-next-b72d7d0f94c6cd6b83966a08494549408ed56560","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.6.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"^4.13.0","depcheck":"^1.4.1","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.9.0","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^4.13.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_0.0.0-next-b72d7d0f94c6cd6b83966a08494549408ed56560_1674227706683_0.5727398806459949","host":"s3://npm-registry-packages"}},"0.0.0-next-288585a9b69e86c5bb1bfcf4b6df1f5db45ad7bf":{"name":"mongodb-connection-model","version":"0.0.0-next-288585a9b69e86c5bb1bfcf4b6df1f5db45ad7bf","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@0.0.0-next-288585a9b69e86c5bb1bfcf4b6df1f5db45ad7bf","maintainers":[{"name":"mongo-j","email":"james.wang@mongodb.com"},{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"iteng@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"81c1d302e679ee6ed03363f90ea35fa7259a44d5","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-0.0.0-next-288585a9b69e86c5bb1bfcf4b6df1f5db45ad7bf.tgz","fileCount":20,"integrity":"sha512-HG8vMfVcI8VIT8f/MwZm6JTcmCLx/GtNWTdG8sK7j7fk1KTv5FSh2HNsvKDAK9Xi1yWBZgya15GQjw5Pux187A==","signatures":[{"sig":"MEQCIDbimDYoDZHdVp7Ug72nU/gQaipG/+6/RrhIr0HA4H8AAiAEdurF1rWnPaoRXCHSH4Igrhx7QnozXhHPX85RkxEr7g==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":108151,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj0eReACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqZpg/8CGd67t2gvdujnQoJ8x1/yo7vhbPLMFonYepo9ekfSO4cWpc/\r\nTt98mAedpKBQpCvDkyqvssaWImAPAJNYIEL/m5gNOrwiS/fOwFAv0ktwohjI\r\nGy0fDaF/17Glx//ZR7xjS7NSvvHaGDgLPoA+1/WsOeoCT60jMgjnLlWO0CYF\r\nWFkoUxkHVsy/77M3nCE+D9iz0buq8rg+uPg7IVWHVQKPaZzuejcCAGVdx/VE\r\nPHNj2ovkVad46Wy+0K8ZMe/0pi6uh+nh2Lvu8oqTNkZnMh7+iqvmeJ2Oo9Wu\r\nCctD0ynZ7pOrz4/EoEEz5wl7vII2RzSG41d6EI/4rL+9EklNUrAUTAl5tu/F\r\n2LNF1/qlHD86P3Lww+D3wB9l7KC8vFask/E1wUMvOmoj6rz0PQfOgo5vJe9d\r\nF5T0THCjoq29/J+R5raR23LSPpg44GfFEdYn8X1YORs4X4ukhiQI1h7ESmK9\r\n6zT83s5If+RT8S0GNEu6EtQ0Rd8oAJ7iWI0iWgvF5N1MNcMq2ZzIgwllvCD4\r\nPfOmhQ5CKNHlLikRCCEy/iH14LrO/EsNR9mqPrebjHQ6HI21ZA2i8MPWD97b\r\nywc/OdOD/qB3QKZQkEkUQ43I8s1obtDRXawm+L3TzxY37Ul4MYAqVINAl+/+\r\nfj4ToDWrVS3iV4UIKuAN4MCgmIFRHCDhaYg=\r\n=WHbn\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","readme":"# mongodb-connection-model [![][workflow_img]][workflow_url] [![][npm_img]][npm_url]\n\n> MongoDB connection model\n\nThe main purpose of the MongoDB connection model is to be a domain model around a MongoDB connection. It encapsulates generating a [Connection String URI](https://docs.mongodb.com/manual/reference/connection-string/) from a group of attributes and parses URI using the [MongoDB Node.JS Driver URI Parser](https://github.com/mongodb-js/mongodb-core/blob/master/lib/uri_parser.js).\n\n## Installation\n\n```\nnpm install --save mongodb-connection-model\n```\n\n## Usage\n\n### Building URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\nconst c = new Connection({ appname: 'My App Name' });\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://localhost:27017/?readPreference=primary&appname=My%20App&ssl=false'\n```\n\n### Parsing URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\n\nConnection.from(\n  'mongodb://someUsername:testPassword@localhost',\n  (error, result) => {\n    console.log(result);\n    >>> `{\n      hosts: [{ host: 'localhost', port: 27017 }],\n      hostname: 'localhost',\n      port: 27017,\n      auth: {\n        username: 'someUsername',\n        password: 'testPassword',\n        db: 'admin'\n      },\n      isSrvRecord: false,\n      authStrategy: 'MONGODB',\n      mongodbUsername: 'someUsername',\n      mongodbPassword: 'testPassword',\n      mongodbDatabaseName: 'admin',\n      extraOptions: {},\n      connectionType: 'NODE_DRIVER',\n      readPreference: 'primary',\n      kerberosCanonicalizeHostname: false,\n      sslMethod: 'NONE',\n      sshTunnel: 'NONE',\n      sshTunnelPort: 22\n    }`\n  }\n);\n```\n\n## Properties\n\nMongoDB connection model is based on Ampersand.js framework and consist of [props](https://ampersandjs.com/docs/#ampersand-state-props) and [derived props](https://ampersandjs.com/docs/#ampersand-state-derived). The props object describes the observable properties that MongoDB connection model gets from the Node.js Driver API.\n\n```javascript\nconst с = new Connection();\nconst props = с.getAttributes({ props: true });\n```\n\n#### See Also\n\n- [URI Generic Syntax](https://tools.ietf.org/html/rfc3986)\n- [URI Options Specification](https://github.com/mongodb/specifications/blob/master/source/uri-options/uri-options.rst)\n\n### General Properties\n\n```javascript\nconst c = new Connection({ isSrvRecord: true });\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ns` | String | A valid [ns][ns] the user can read from | `undefined` |\n| `isSrvRecord` | Boolean | Indicates SRV record | `false` |\n| `auth` | Object | Authentication from driver (username, user, db, password) | `undefined` |\n| `hostname` | String | Hostname of a MongoDB Instance. In case of the replica set the first host and port will be taken | `localhost` |\n| `port` | Number | TCP port of a MongoDB Instance | `27017` |\n| `hosts` | Array | Contains all hosts and ports for replica set | `[{ host: 'localhost', port: 27017 }]` |\n| `extraOptions` | Object | Extra options passed to the node driver as part of `driverOptions` | `{}` |\n| `connectionType` | String | The desired connection type. Possible values: `NODE_DRIVER`, `STITCH_ON_PREM`, `STITCH_ATLAS` | `NODE_DRIVER` |\n| `authStrategy` | String | The desired authentication strategy. Possible values: `NONE`, `MONGODB`, `X509`, `KERBEROS`, `LDAP`, `SCRAM-SHA-256` | `NONE` |\n\n### Connection string options\n\n```javascript\nconst c = new Connection({ appname: 'My App', replicaSet: 'testing' });\n```\n\n#### General connection string options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `replicaSet` | String | Specifies the name of the replica set, if the mongod is a member of a replica set | `undefined` |\n| `connectTimeoutMS` | Number | The time in milliseconds to attempt a connection before timing out | `undefined` |\n| `socketTimeoutMS` | Number | The time in milliseconds to attempt a send or receive on a socket before the attempt times out | `undefined` |\n| `compression` | Object | Object includes compressors and a compression level. The following compressors can be specified: `snappy`, `zlib` (Available in MongoDB 3.6 or greater) | `undefined` |\n\n#### Connection Pool Option\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `maxPoolSize` | Number | The maximum number of connections in the connection pool | `undefined` |\n| `minPoolSize` | Number | The minimum number of connections in the connection pool | `undefined` |\n| `maxIdleTimeMS` | Number | The maximum number of milliseconds that a connection can remain idle in the pool before being removed and closed | `undefined` |\n| `waitQueueMultiple` | Number | A number that the driver multiples the maxPoolSize value to, to provide the maximum number of threads allowed to wait for a connection to become available from the pool | `undefined` |\n| `waitQueueTimeoutMS` | Number | The maximum time in milliseconds that a thread can wait for a connection to become available | `undefined` |\n\n#### Write Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `w` | Number/String | Corresponds to the write concern [w Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-w) | `undefined` |\n| `wTimeoutMS` | Number | Corresponds to the write concern [wtimeout](https://docs.mongodb.com/manual/reference/write-concern/#wc-wtimeout) | `undefined` |\n| `journal` | Boolean | Corresponds to the write concern [j Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-j) | `undefined` |\n\n#### Read Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readConcernLevel` | String | The level of isolation | `undefined` |\n\n#### Read Preference Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readPreference` | String | Specifies the read preferences for this connection. Possible values: `PRIMARY`, `PRIMARY_PREFERRED`, `SECONDARY`, `SECONDARY_PREFERRED`, `NEAREST` | `PRIMARY` |\n| `maxStalenessSeconds` | Number | Specifies, in seconds, how stale a secondary can be before the client stops using it for read operations | `undefined` |\n| `readPreferenceTags` | Object | Default read preference tags for the client | `undefined` |\n\n#### Authentication Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `authSource` | String | Specify the database name associated with the user’s credentials | `undefined` |\n| `authMechanism` | String | Specifies the authentication mechanism that MongoDB will use to authenticate the connection. Possible values: `DEFAULT`, `GSSAPI`, `MONGODB-X509`, `PLAIN`, `SCRAM-SHA-256` | `undefined` |\n| `authMechanismProperties` | Object | Additional options provided for authentication (e.g. to enable hostname canonicalization for GSSAPI) | `undefined` |\n| `gssapiServiceName` | String | Set the Kerberos service name when connecting to Kerberized MongoDB instances | `undefined` |\n| `gssapiServiceRealm` | String | Set the Realm service name | `undefined` |\n| `gssapiCanonicalizeHostName` | Boolean | Whether canonicalized hostname | `undefined` |\n\n#### Server Selection and Discovery Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `localThresholdMS` | Number | The size (in milliseconds) of the latency window for selecting among multiple suitable MongoDB instances | `undefined` |\n| `serverSelectionTimeoutMS` | Number | Specifies how long (in milliseconds) to block for server selection before throwing an exception | `undefined` |\n| `serverSelectionTryOnce` | Boolean | Instructs the driver to scan the MongoDB deployment exactly once after server selection fails and then either select a server or raise an error | `undefined` |\n| `heartbeatFrequencyMS` | Number | Controls when the driver checks the state of the MongoDB deployment | `undefined` |\n\n#### Miscellaneous Configuration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `appname` | String | An application name passed to server as client metadata | `undefined` |\n| `retryWrites` | Boolean | Enable retryable writes | `undefined` |\n| `uuidRepresentation` | String | The legacy representation of UUID. Possible values: `standard`, `csharpLegacy`, `javaLegacy`, `pythonLegacy` | `undefined` |\n| `loadBalanced` | Boolean | Whether or not the server is running in load balanced mode | `undefined` |\n\n### Stitch attributes\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `stitchServiceName` | String | Stitch service name | `undefined` |\n| `stitchClientAppId` | String | Stitch сlient app ID | `undefined` |\n| `stitchGroupId` | String | Stitch group ID | `undefined` |\n| `stitchBaseUrl` | String | Stitch base Url | `undefined` |\n\n### MONGODB authentication\n\n```javascript\nconst c = new Connection({\n  mongodbUsername: 'arlo',\n  mongodbPassword: 'w@of'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/?slaveOk=true&authSource=admin'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `mongodbUsername` | String | MongoDB username | `undefined` |\n| `mongodbPassword` | String | MongoDB password | `undefined` |\n| `mongodbDatabaseName` | String | The database name associated with the user's credentials | `undefined` |\n| `promoteValues` | Boolean | Whether BSON values should be promoted to their JS type counterparts | `undefined` |\n\n### KERBEROS authentication\n\n```javascript\nconst c = new Connection({\n  kerberosServiceName: 'mongodb',\n  kerberosPrincipal: 'arlo/dog@krb5.mongodb.parts',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo%252Fdog%2540krb5.mongodb.parts@localhost:27017/toys?authMechanism=GSSAPI'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n> @note (imlucas): Kerberos on Windows is broken out as it's own state for UX consideration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `kerberosServiceName` | String | Any program or computer you access over a network | `undefined` |\n| `kerberosPrincipal` | String | The format of a typical Kerberos V5 principal is `primary/instance@REALM` | `undefined` |\n| `kerberosCanonicalizeHostname` | Boolean | Whether canonicalized kerberos hostname | `undefined` |\n\n#### See Also\n\n- [node.js driver Kerberos reference](http://bit.ly/mongodb-node-driver-kerberos)\n- [node.js driver Kerberos functional test][kerberos-functional]\n\n### LDAP authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  ldapUsername: 'arlo',\n  ldapPassword: 'w@of',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/toys?slaveOk=true&authMechanism=PLAIN'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ldapUsername` | String | LDAP username | `undefined` |\n| `ldapPassword` | String | LDAP password | `undefined` |\n\n#### See Also\n\n- [node.js driver LDAP reference](http://bit.ly/mongodb-node-driver-ldap)\n- [node.js driver X509 functional test][ldap-functional]\n\n### X509 authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  x509Username: 'CN=client,OU=arlo,O=MongoDB,L=Philadelphia,ST=Pennsylvania,C=US'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://CN%253Dclient%252COU%253Darlo%252CO%253DMongoDB%252CL%253DPhiladelphia%252CST%253DPennsylvania%252CC%253DUS@localhost:27017?slaveOk=true&authMechanism=MONGODB-X509'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `x509Username` | String | The x.509 certificate derived user name, e.g. `CN=user,OU=OrgUnit,O=myOrg,...` | `undefined` |\n\n#### See Also\n\n- [node.js driver X509 reference](http://bit.ly/mongodb-node-driver-x509)\n- [node.js driver X509 functional test][x509-functional]\n\n### SSL\n\n> **Note**: Not to be confused with `authentication=X509`\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ssl` | Number/String | A boolean to enable or disables TLS/SSL for the connection | `undefined` |\n| `sslMethod` | String | The desired ssl method. Possible values: `NONE`, `SYSTEMCA`, `IFAVAILABLE`, `UNVALIDATED`, `SERVER`, `ALL` | `NONE` |\n| `sslCA` | Buffer/String | Array of valid certificates | `undefined` |\n| `sslCert` | Buffer/String | The certificate | `undefined` |\n| `sslKey` | Buffer/String | The certificate private key | `undefined` |\n| `sslPass` | Buffer/String | The certificate password | `undefined` |\n\nDescription of `sslMethod` values:\n\n- `SYSTEMCA` - SSL required, validate using System CA, with host verification.\n- `IFAVAILABLE` - The driver should try SSL first, fall back to no SSL if unavailable, and use the system's Certificate Authority.\n- `SERVER` - The driver should validate the server certificate and fail to connect if validation fails. See also [node.js driver \"Validate Server Certificate\" docs][driver-ssl-server].\n- `ALL` - The driver must present a valid certificate and validate the server certificate. See also [node.js driver \"Validate Server Certificate and Present Valid Certificate\" docs][driver-ssl-all].\n- `NONE` - No SSL (Not recommended).\n- `UNVALIDATED` - Use SSL but do not perform any validation of the certificate chain. See also [node.js driver \"No Certificate Validation\" docs][driver-ssl-none]. **Very** not recommended and likely to be deprecated in future releases because it exposes potential Man-In-The-Middle attack vectors.\n\n#### See also\n\n- [node.js driver SSL implementation][driver-ssl-impl]\n- [node.js driver SSL tutorial][driver-ssl-tutorial]\n\n### SSH TUNNEL\n\n> New in mongodb-connection-model@5.0.0\n\nBecause [authentication](#authentication) is quite difficult for operators to migrate to, the most common method of securing a MongoDB deployment is to use an [SSH tunnel][sf-ssh-tunnel].  This allows operators to leverage their existing SSH security infrastructure to also provide secure access to MongoDB.  For a standard deployment of MongoDB on AWS, this is almost always to strategy.  Because of this, we now support creating SSH tunnels automatically when connecting to MongoDB.\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options, (connectionError, client) => {\n  if (connectionError) {\n    return console.log(connectionError);\n  }\n\n  client.db('mongodb').collection('fanclub').count((countingError, count) => {\n    console.log('counted:', countingError, count);\n    client.close();\n  });\n});\n```\n\nThe above provides the same functionality as creating the tunnel using the bash\ncommand below and connecting to MongoDB via another terminal. Notice that\nconnection-model uses a random local port each time it creates a tunnel.\nUsing the command line, you'd have to replace `<random port>` with an actual\nport number.\n\n```bash\nssh -i ~/.ssh/my-key-aws-pair.pem -L <random port>:localhost:27017 ubuntu@ec2-11-111-111-111.compute-1.amazonaws.com\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `sshTunnel` | String | The desired SSH tunnel strategy. Possible values: `NONE`, `USER_PASSWORD`, `IDENTITY_FILE` | `undefined` |\n| `sshTunnelHostname` | String | The hostname of the SSH remote host | `undefined` |\n| `sshTunnelPort` | Port | The SSH port of the remote host | `22` |\n| `sshTunnelBindToLocalPort` | Port | Bind the localhost endpoint of the SSH Tunnel to this port | `undefined` |\n| `sshTunnelUsername` | String | The optional SSH username for the remote host | `undefined` |\n| `sshTunnelPassword` | String | The optional SSH password for the remote host | `undefined` |\n| `sshTunnelIdentityFile` | String/Array | The optional path to the SSH identity file for the remote host | `undefined` |\n| `sshTunnelPassphrase` | String | The optional passphrase for `sshTunnelIdentityFile` | `undefined` |\n\nDescription of `sshTunnel` values:\n\n- `NONE` - Do not use SSH tunneling.\n- `USER_PASSWORD` - The tunnel is created with SSH username and password only.\n- `IDENTITY_FILE` - The tunnel is created using an identity file.\n\n## Derived Properties\n\nDerived properties (also known as computed properties) are properties of the state object that depend on other properties to determine their value.\n\n```javascript\nconst c = new Connection();\nconst derivedProps = c.getAttributes({ derived: true });\n```\n\n| Derived Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `instanceId` | String | The mongoscope | `localhost:27017` |\n| `driverAuthMechanism` | String | Converts the value of `authStrategy` for humans into the `authMechanism` value for the driver | `undefined` |\n| `safeUrl` | String | The URL where a password is replaced with stars | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrl` | String | Use this URL in order to connect via DataService | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrlWithSsh` | String | Use this URL in order to connect via connection model itself | `mongodb://localhost:29201/?readPreference=primary&ssl=false` |\n| `driverOptions` | String | The second argument `mongoscope-server` passes to `mongodb.connect` | `{}` |\n\n## Events\n\n> New in mongodb-connection-model@5.0.0\n\n#### Example: SSH Tunnel\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', skipped: true,\n  reason: 'The selected SSL mode does not need to load any files.' }\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', complete: true}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n#### Example: SSL\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  ssl: 'ALL',\n  sslCA: '~/.ssl/my-ca.pem',\n  sslCert: '~/.ssl/my-server.pem',\n  sslKey: '~/.ssl/my-server.pem'\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', complete: true}\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', skipped: true,\n  reason: 'The selected SSH Tunnel mode is NONE.'}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n[workflow_img]: https://github.com/mongodb-js/connection-model/workflows/Check%20and%20Test/badge.svg?event=push\n[workflow_url]: https://github.com/mongodb-js/connection-model/actions?query=workflow%3A%22Check+and+Test%22\n[npm_img]: https://img.shields.io/npm/v/mongodb-connection-model.svg?style=flat-square\n[npm_url]: https://www.npmjs.org/package/mongodb-connection-model\n[gitter_img]: https://badges.gitter.im/Join%20Chat.svg\n[gitter_url]: http://gitter.im/mongodb-js/mongodb-js\n[enterprise_img]: https://img.shields.io/badge/MongoDB-Enterprise-blue.svg?style=flat-square\n[coming_soon_img]: https://img.shields.io/badge/-Coming%20Soon-ff69b4.svg?style=flat-square\n[kerberos-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/kerberos_tests.js\n[ldap-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ldap_tests.js\n[x509-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ssl_x509_tests.js\n[ns]: https://github.com/mongodb-js/ns\n[sf-ssh-tunnel]: http://serverfault.com/questions/597765/how-to-connect-to-mongodb-server-via-ssh-tunnel\n[ec2-key-pairs]: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html\n[driver-ssl-impl]: https://github.com/christkv/mongodb-core/blob/c3d21cb636d74d7a68134ecd3b9f6af536311279/lib/connection/connection.js#L365-L407\n[driver-ssl-tutorial]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/\n[driver-ssl-none]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#no-certificate-validation\n[driver-ssl-server]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate\n[driver-ssl-all]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate-and-present-valid-certificate\n","gitHead":"288585a9b69e86c5bb1bfcf4b6df1f5db45ad7bf","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","test":"mocha","check":"npm run lint && npm run depcheck","pretest":"mongodb-runner install && mongodb-runner start --port=27018","test-ci":"npm run test","depcheck":"depcheck","posttest":"mongodb-runner stop --port=27018","posttest-ci":"node ../../scripts/killall-mongo.js","test-check-ci":"npm run check && npm test"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.17.0+x64 (linux)","description":"MongoDB connection model","directories":{},"_nodeVersion":"16.17.0","compass:main":"index.js","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","debug":"^4.2.0","lodash":"^4.17.15","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.2.0","storage-mixin":"0.0.0-next-288585a9b69e86c5bb1bfcf4b6df1f5db45ad7bf","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.2","@mongodb-js/ssh-tunnel":"0.0.0-next-288585a9b69e86c5bb1bfcf4b6df1f5db45ad7bf","@mongodb-js/compass-utils":"0.0.0-next-288585a9b69e86c5bb1bfcf4b6df1f5db45ad7bf","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.6.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"^4.13.0","depcheck":"^1.4.1","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.9.0","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^4.13.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_0.0.0-next-288585a9b69e86c5bb1bfcf4b6df1f5db45ad7bf_1674699870247_0.443603023591302","host":"s3://npm-registry-packages"}},"22.2.0":{"name":"mongodb-connection-model","version":"22.2.0","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@22.2.0","maintainers":[{"name":"mongo-j","email":"james.wang@mongodb.com"},{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"iteng@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"3a4fb21b873162e45a6440cd31dd481dc3836a64","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-22.2.0.tgz","fileCount":20,"integrity":"sha512-cJaMk9v81E6nHRNP2Lk8vo8ybwZqJc0z79FGv8APF9JlqApf+rsS1thDNqJLy36xH4wiXDT+JqrEmX1oP0hvWA==","signatures":[{"sig":"MEUCICezayv/ve2Nlp5D1sOw0J8+q1PBnP7UR5YBWPnXR+oYAiEA9S0Jv5sDFfxrLREtqWuOtF65knR5rxX4qd5EEVZB5AE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":107972,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj24RHACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrO7g//f6KRmYKlkkA9V9cx3gkLNM3Bye1N/9QzVucSXx/Hd3snCjzX\r\ns+dTnx4DT96r49stCBQCCKkfOqAkVmjLQSn2ZCuZd1zFlvRKMfZzHJGIDWXx\r\npv+WDJlQaq6D2mY2DUSmObhEhurXj0+TEgg8HsIOuPnQXIvpphR5Ev+WW8we\r\nNYB7J49/lNyKXgjzkthEPtkto6VzmJmnE7CB87v+BkQEmkeO+DRPCQejEI+w\r\nwk2pyMTxi7A56pAqTI1qNGpXzqIykmV1N5pq/l82cmCV1pYMcJkBp5qIGqg4\r\n4huA86jfrz9rvj+vNozOSw1Pq5b3VyC7OGsSqe5A3jDdfPWfzYSiKCy1kS/R\r\nj4ZvaF4/97McHpNdY7J+mybyXsCRUmwx5XxbzsmOzOoKlthengi9uOP9/ALb\r\nPcHx85O9JaWWWpEpKuzL5iSmk9veU6Ss7pX/M70VqJ1X/MHU30AdOInat4cw\r\nLMZjb3fmOLysrXekdEhXgksAv0TY3leXcCqe2N6l8iDJaTLzY9F+IScpErPV\r\n4swY+GbiAlE+xxk2dirqtmYSfwsahwP4GpAIOSzRws4gtCKbmrf/L91hGw7c\r\nvqu5uryAUh8RSQoBorqYL5CwshHNlibatwSEGp8EOa6ENAkz83Fna7OoXyG+\r\nTJMoP4Y0iTPlAm8n8uePvLaE8XzfIDA0u5o=\r\n=Kzva\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","gitHead":"cfe9a829fd77fc84e090f2c7b38663167071ebc5","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","test":"mocha","check":"npm run lint && npm run depcheck","pretest":"mongodb-runner install && mongodb-runner start --port=27018","test-ci":"npm run test","depcheck":"depcheck","posttest":"mongodb-runner stop --port=27018","posttest-ci":"node ../../scripts/killall-mongo.js","test-check-ci":"npm run check && npm test"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.19.0+x64 (linux)","description":"MongoDB connection model","directories":{},"_nodeVersion":"16.19.0","compass:main":"index.js","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","debug":"^4.2.0","lodash":"^4.17.15","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.2.0","storage-mixin":"^5.1.1","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.2","@mongodb-js/ssh-tunnel":"^2.0.2","@mongodb-js/compass-utils":"^0.2.0","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.6.0"},"_hasShrinkwrap":false,"devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"^4.13.0","depcheck":"^1.4.1","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.10.0","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^4.13.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_22.2.0_1675330631634_0.19058186442391634","host":"s3://npm-registry-packages"}},"0.0.0-next-cfe9a829fd77fc84e090f2c7b38663167071ebc5":{"name":"mongodb-connection-model","version":"0.0.0-next-cfe9a829fd77fc84e090f2c7b38663167071ebc5","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@0.0.0-next-cfe9a829fd77fc84e090f2c7b38663167071ebc5","maintainers":[{"name":"mongo-j","email":"james.wang@mongodb.com"},{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"iteng@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"c0c0cd96288ae9b23cec3231ba8da35f093481ef","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-0.0.0-next-cfe9a829fd77fc84e090f2c7b38663167071ebc5.tgz","fileCount":20,"integrity":"sha512-xccbrZQ+uKSthqLFxoG8qlSyHD5W41q1XLhCgQeXG9Vp+4zfycWfCT9RXo3kyukHXarNdKpOmifoR93VjdFnnQ==","signatures":[{"sig":"MEYCIQD7jP9y2FvtTP0LV1HTTmI6QbDxn5xxDS09I238v/fI9wIhAIe025jI+S6d4cfNDzjsbOuQWDhht7U3bsXqBqbKlgEK","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":108152,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj3DwjACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpiNg/+JwsPyLLI9sLagxesREe+OYIp2xkUWvZf5BQuTG2FkieHQ8EZ\r\nVRaBEALBmI9JWRibpeDw3YqoqN66EWA8i6/oMA5+CUiaTzngZm85EAZWyvdm\r\nwd2GFNM9+4fsqFIB4c+J/9THuDwoIyX/EhDKcrgLsITUzzj3sJ/GdfLe6SVE\r\nJ0oQeGfSTwW1eM5jlkI2dQTPswwS1cSd8h8RIdOSAtWbt0ibQC1i/Tj90F84\r\n1EVQ+o7V+u1VGB9UuOnuaF8k/y/M1fl3UTyfHOW6Zp4LtGMEFGuajqnRV14w\r\nrkfmMPy0MJ79jQUoejh5Ba6uH76x8SF5ZuzwfCDEcfrg9fqZ+F3mYkcaKXVE\r\n8nn+Z4FcGzEJtsoqdulh9jejW5l4VTypzAbxDNAuG/gfzhZARZHDY/LDXXTR\r\n7DjPZAMHFeBxScTgv3n8+4jgnru3GsH8qVo80DxWiUcvwlotv0dEpc5j63oH\r\ngui1wiCCzZdYxbWnJ00K1RErQVBQMcC6GJ4jb3jQ6oylOY0vffcgfAzlK6rT\r\nvIK8Kutoxz1A21nDimdPRiIzFgA5UHrdWDttDwJ9lU+kW8cC5XPvuH5WTV4d\r\nXCCgsS1x4iQCUC52IgwoglacQv9ziP93BKOmDjzHyRCLqaMygtFnnVTONQw4\r\n4DmjBg0+YucDCYeSjjgj+erkOhwXHZ1DNvU=\r\n=Tjz1\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","readme":"# mongodb-connection-model [![][workflow_img]][workflow_url] [![][npm_img]][npm_url]\n\n> MongoDB connection model\n\nThe main purpose of the MongoDB connection model is to be a domain model around a MongoDB connection. It encapsulates generating a [Connection String URI](https://docs.mongodb.com/manual/reference/connection-string/) from a group of attributes and parses URI using the [MongoDB Node.JS Driver URI Parser](https://github.com/mongodb-js/mongodb-core/blob/master/lib/uri_parser.js).\n\n## Installation\n\n```\nnpm install --save mongodb-connection-model\n```\n\n## Usage\n\n### Building URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\nconst c = new Connection({ appname: 'My App Name' });\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://localhost:27017/?readPreference=primary&appname=My%20App&ssl=false'\n```\n\n### Parsing URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\n\nConnection.from(\n  'mongodb://someUsername:testPassword@localhost',\n  (error, result) => {\n    console.log(result);\n    >>> `{\n      hosts: [{ host: 'localhost', port: 27017 }],\n      hostname: 'localhost',\n      port: 27017,\n      auth: {\n        username: 'someUsername',\n        password: 'testPassword',\n        db: 'admin'\n      },\n      isSrvRecord: false,\n      authStrategy: 'MONGODB',\n      mongodbUsername: 'someUsername',\n      mongodbPassword: 'testPassword',\n      mongodbDatabaseName: 'admin',\n      extraOptions: {},\n      connectionType: 'NODE_DRIVER',\n      readPreference: 'primary',\n      kerberosCanonicalizeHostname: false,\n      sslMethod: 'NONE',\n      sshTunnel: 'NONE',\n      sshTunnelPort: 22\n    }`\n  }\n);\n```\n\n## Properties\n\nMongoDB connection model is based on Ampersand.js framework and consist of [props](https://ampersandjs.com/docs/#ampersand-state-props) and [derived props](https://ampersandjs.com/docs/#ampersand-state-derived). The props object describes the observable properties that MongoDB connection model gets from the Node.js Driver API.\n\n```javascript\nconst с = new Connection();\nconst props = с.getAttributes({ props: true });\n```\n\n#### See Also\n\n- [URI Generic Syntax](https://tools.ietf.org/html/rfc3986)\n- [URI Options Specification](https://github.com/mongodb/specifications/blob/master/source/uri-options/uri-options.rst)\n\n### General Properties\n\n```javascript\nconst c = new Connection({ isSrvRecord: true });\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ns` | String | A valid [ns][ns] the user can read from | `undefined` |\n| `isSrvRecord` | Boolean | Indicates SRV record | `false` |\n| `auth` | Object | Authentication from driver (username, user, db, password) | `undefined` |\n| `hostname` | String | Hostname of a MongoDB Instance. In case of the replica set the first host and port will be taken | `localhost` |\n| `port` | Number | TCP port of a MongoDB Instance | `27017` |\n| `hosts` | Array | Contains all hosts and ports for replica set | `[{ host: 'localhost', port: 27017 }]` |\n| `extraOptions` | Object | Extra options passed to the node driver as part of `driverOptions` | `{}` |\n| `connectionType` | String | The desired connection type. Possible values: `NODE_DRIVER`, `STITCH_ON_PREM`, `STITCH_ATLAS` | `NODE_DRIVER` |\n| `authStrategy` | String | The desired authentication strategy. Possible values: `NONE`, `MONGODB`, `X509`, `KERBEROS`, `LDAP`, `SCRAM-SHA-256` | `NONE` |\n\n### Connection string options\n\n```javascript\nconst c = new Connection({ appname: 'My App', replicaSet: 'testing' });\n```\n\n#### General connection string options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `replicaSet` | String | Specifies the name of the replica set, if the mongod is a member of a replica set | `undefined` |\n| `connectTimeoutMS` | Number | The time in milliseconds to attempt a connection before timing out | `undefined` |\n| `socketTimeoutMS` | Number | The time in milliseconds to attempt a send or receive on a socket before the attempt times out | `undefined` |\n| `compression` | Object | Object includes compressors and a compression level. The following compressors can be specified: `snappy`, `zlib` (Available in MongoDB 3.6 or greater) | `undefined` |\n\n#### Connection Pool Option\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `maxPoolSize` | Number | The maximum number of connections in the connection pool | `undefined` |\n| `minPoolSize` | Number | The minimum number of connections in the connection pool | `undefined` |\n| `maxIdleTimeMS` | Number | The maximum number of milliseconds that a connection can remain idle in the pool before being removed and closed | `undefined` |\n| `waitQueueMultiple` | Number | A number that the driver multiples the maxPoolSize value to, to provide the maximum number of threads allowed to wait for a connection to become available from the pool | `undefined` |\n| `waitQueueTimeoutMS` | Number | The maximum time in milliseconds that a thread can wait for a connection to become available | `undefined` |\n\n#### Write Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `w` | Number/String | Corresponds to the write concern [w Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-w) | `undefined` |\n| `wTimeoutMS` | Number | Corresponds to the write concern [wtimeout](https://docs.mongodb.com/manual/reference/write-concern/#wc-wtimeout) | `undefined` |\n| `journal` | Boolean | Corresponds to the write concern [j Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-j) | `undefined` |\n\n#### Read Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readConcernLevel` | String | The level of isolation | `undefined` |\n\n#### Read Preference Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readPreference` | String | Specifies the read preferences for this connection. Possible values: `PRIMARY`, `PRIMARY_PREFERRED`, `SECONDARY`, `SECONDARY_PREFERRED`, `NEAREST` | `PRIMARY` |\n| `maxStalenessSeconds` | Number | Specifies, in seconds, how stale a secondary can be before the client stops using it for read operations | `undefined` |\n| `readPreferenceTags` | Object | Default read preference tags for the client | `undefined` |\n\n#### Authentication Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `authSource` | String | Specify the database name associated with the user’s credentials | `undefined` |\n| `authMechanism` | String | Specifies the authentication mechanism that MongoDB will use to authenticate the connection. Possible values: `DEFAULT`, `GSSAPI`, `MONGODB-X509`, `PLAIN`, `SCRAM-SHA-256` | `undefined` |\n| `authMechanismProperties` | Object | Additional options provided for authentication (e.g. to enable hostname canonicalization for GSSAPI) | `undefined` |\n| `gssapiServiceName` | String | Set the Kerberos service name when connecting to Kerberized MongoDB instances | `undefined` |\n| `gssapiServiceRealm` | String | Set the Realm service name | `undefined` |\n| `gssapiCanonicalizeHostName` | Boolean | Whether canonicalized hostname | `undefined` |\n\n#### Server Selection and Discovery Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `localThresholdMS` | Number | The size (in milliseconds) of the latency window for selecting among multiple suitable MongoDB instances | `undefined` |\n| `serverSelectionTimeoutMS` | Number | Specifies how long (in milliseconds) to block for server selection before throwing an exception | `undefined` |\n| `serverSelectionTryOnce` | Boolean | Instructs the driver to scan the MongoDB deployment exactly once after server selection fails and then either select a server or raise an error | `undefined` |\n| `heartbeatFrequencyMS` | Number | Controls when the driver checks the state of the MongoDB deployment | `undefined` |\n\n#### Miscellaneous Configuration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `appname` | String | An application name passed to server as client metadata | `undefined` |\n| `retryWrites` | Boolean | Enable retryable writes | `undefined` |\n| `uuidRepresentation` | String | The legacy representation of UUID. Possible values: `standard`, `csharpLegacy`, `javaLegacy`, `pythonLegacy` | `undefined` |\n| `loadBalanced` | Boolean | Whether or not the server is running in load balanced mode | `undefined` |\n\n### Stitch attributes\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `stitchServiceName` | String | Stitch service name | `undefined` |\n| `stitchClientAppId` | String | Stitch сlient app ID | `undefined` |\n| `stitchGroupId` | String | Stitch group ID | `undefined` |\n| `stitchBaseUrl` | String | Stitch base Url | `undefined` |\n\n### MONGODB authentication\n\n```javascript\nconst c = new Connection({\n  mongodbUsername: 'arlo',\n  mongodbPassword: 'w@of'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/?slaveOk=true&authSource=admin'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `mongodbUsername` | String | MongoDB username | `undefined` |\n| `mongodbPassword` | String | MongoDB password | `undefined` |\n| `mongodbDatabaseName` | String | The database name associated with the user's credentials | `undefined` |\n| `promoteValues` | Boolean | Whether BSON values should be promoted to their JS type counterparts | `undefined` |\n\n### KERBEROS authentication\n\n```javascript\nconst c = new Connection({\n  kerberosServiceName: 'mongodb',\n  kerberosPrincipal: 'arlo/dog@krb5.mongodb.parts',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo%252Fdog%2540krb5.mongodb.parts@localhost:27017/toys?authMechanism=GSSAPI'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n> @note (imlucas): Kerberos on Windows is broken out as it's own state for UX consideration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `kerberosServiceName` | String | Any program or computer you access over a network | `undefined` |\n| `kerberosPrincipal` | String | The format of a typical Kerberos V5 principal is `primary/instance@REALM` | `undefined` |\n| `kerberosCanonicalizeHostname` | Boolean | Whether canonicalized kerberos hostname | `undefined` |\n\n#### See Also\n\n- [node.js driver Kerberos reference](http://bit.ly/mongodb-node-driver-kerberos)\n- [node.js driver Kerberos functional test][kerberos-functional]\n\n### LDAP authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  ldapUsername: 'arlo',\n  ldapPassword: 'w@of',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/toys?slaveOk=true&authMechanism=PLAIN'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ldapUsername` | String | LDAP username | `undefined` |\n| `ldapPassword` | String | LDAP password | `undefined` |\n\n#### See Also\n\n- [node.js driver LDAP reference](http://bit.ly/mongodb-node-driver-ldap)\n- [node.js driver X509 functional test][ldap-functional]\n\n### X509 authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  x509Username: 'CN=client,OU=arlo,O=MongoDB,L=Philadelphia,ST=Pennsylvania,C=US'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://CN%253Dclient%252COU%253Darlo%252CO%253DMongoDB%252CL%253DPhiladelphia%252CST%253DPennsylvania%252CC%253DUS@localhost:27017?slaveOk=true&authMechanism=MONGODB-X509'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `x509Username` | String | The x.509 certificate derived user name, e.g. `CN=user,OU=OrgUnit,O=myOrg,...` | `undefined` |\n\n#### See Also\n\n- [node.js driver X509 reference](http://bit.ly/mongodb-node-driver-x509)\n- [node.js driver X509 functional test][x509-functional]\n\n### SSL\n\n> **Note**: Not to be confused with `authentication=X509`\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ssl` | Number/String | A boolean to enable or disables TLS/SSL for the connection | `undefined` |\n| `sslMethod` | String | The desired ssl method. Possible values: `NONE`, `SYSTEMCA`, `IFAVAILABLE`, `UNVALIDATED`, `SERVER`, `ALL` | `NONE` |\n| `sslCA` | Buffer/String | Array of valid certificates | `undefined` |\n| `sslCert` | Buffer/String | The certificate | `undefined` |\n| `sslKey` | Buffer/String | The certificate private key | `undefined` |\n| `sslPass` | Buffer/String | The certificate password | `undefined` |\n\nDescription of `sslMethod` values:\n\n- `SYSTEMCA` - SSL required, validate using System CA, with host verification.\n- `IFAVAILABLE` - The driver should try SSL first, fall back to no SSL if unavailable, and use the system's Certificate Authority.\n- `SERVER` - The driver should validate the server certificate and fail to connect if validation fails. See also [node.js driver \"Validate Server Certificate\" docs][driver-ssl-server].\n- `ALL` - The driver must present a valid certificate and validate the server certificate. See also [node.js driver \"Validate Server Certificate and Present Valid Certificate\" docs][driver-ssl-all].\n- `NONE` - No SSL (Not recommended).\n- `UNVALIDATED` - Use SSL but do not perform any validation of the certificate chain. See also [node.js driver \"No Certificate Validation\" docs][driver-ssl-none]. **Very** not recommended and likely to be deprecated in future releases because it exposes potential Man-In-The-Middle attack vectors.\n\n#### See also\n\n- [node.js driver SSL implementation][driver-ssl-impl]\n- [node.js driver SSL tutorial][driver-ssl-tutorial]\n\n### SSH TUNNEL\n\n> New in mongodb-connection-model@5.0.0\n\nBecause [authentication](#authentication) is quite difficult for operators to migrate to, the most common method of securing a MongoDB deployment is to use an [SSH tunnel][sf-ssh-tunnel].  This allows operators to leverage their existing SSH security infrastructure to also provide secure access to MongoDB.  For a standard deployment of MongoDB on AWS, this is almost always to strategy.  Because of this, we now support creating SSH tunnels automatically when connecting to MongoDB.\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options, (connectionError, client) => {\n  if (connectionError) {\n    return console.log(connectionError);\n  }\n\n  client.db('mongodb').collection('fanclub').count((countingError, count) => {\n    console.log('counted:', countingError, count);\n    client.close();\n  });\n});\n```\n\nThe above provides the same functionality as creating the tunnel using the bash\ncommand below and connecting to MongoDB via another terminal. Notice that\nconnection-model uses a random local port each time it creates a tunnel.\nUsing the command line, you'd have to replace `<random port>` with an actual\nport number.\n\n```bash\nssh -i ~/.ssh/my-key-aws-pair.pem -L <random port>:localhost:27017 ubuntu@ec2-11-111-111-111.compute-1.amazonaws.com\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `sshTunnel` | String | The desired SSH tunnel strategy. Possible values: `NONE`, `USER_PASSWORD`, `IDENTITY_FILE` | `undefined` |\n| `sshTunnelHostname` | String | The hostname of the SSH remote host | `undefined` |\n| `sshTunnelPort` | Port | The SSH port of the remote host | `22` |\n| `sshTunnelBindToLocalPort` | Port | Bind the localhost endpoint of the SSH Tunnel to this port | `undefined` |\n| `sshTunnelUsername` | String | The optional SSH username for the remote host | `undefined` |\n| `sshTunnelPassword` | String | The optional SSH password for the remote host | `undefined` |\n| `sshTunnelIdentityFile` | String/Array | The optional path to the SSH identity file for the remote host | `undefined` |\n| `sshTunnelPassphrase` | String | The optional passphrase for `sshTunnelIdentityFile` | `undefined` |\n\nDescription of `sshTunnel` values:\n\n- `NONE` - Do not use SSH tunneling.\n- `USER_PASSWORD` - The tunnel is created with SSH username and password only.\n- `IDENTITY_FILE` - The tunnel is created using an identity file.\n\n## Derived Properties\n\nDerived properties (also known as computed properties) are properties of the state object that depend on other properties to determine their value.\n\n```javascript\nconst c = new Connection();\nconst derivedProps = c.getAttributes({ derived: true });\n```\n\n| Derived Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `instanceId` | String | The mongoscope | `localhost:27017` |\n| `driverAuthMechanism` | String | Converts the value of `authStrategy` for humans into the `authMechanism` value for the driver | `undefined` |\n| `safeUrl` | String | The URL where a password is replaced with stars | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrl` | String | Use this URL in order to connect via DataService | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrlWithSsh` | String | Use this URL in order to connect via connection model itself | `mongodb://localhost:29201/?readPreference=primary&ssl=false` |\n| `driverOptions` | String | The second argument `mongoscope-server` passes to `mongodb.connect` | `{}` |\n\n## Events\n\n> New in mongodb-connection-model@5.0.0\n\n#### Example: SSH Tunnel\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', skipped: true,\n  reason: 'The selected SSL mode does not need to load any files.' }\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', complete: true}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n#### Example: SSL\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  ssl: 'ALL',\n  sslCA: '~/.ssl/my-ca.pem',\n  sslCert: '~/.ssl/my-server.pem',\n  sslKey: '~/.ssl/my-server.pem'\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', complete: true}\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', skipped: true,\n  reason: 'The selected SSH Tunnel mode is NONE.'}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n[workflow_img]: https://github.com/mongodb-js/connection-model/workflows/Check%20and%20Test/badge.svg?event=push\n[workflow_url]: https://github.com/mongodb-js/connection-model/actions?query=workflow%3A%22Check+and+Test%22\n[npm_img]: https://img.shields.io/npm/v/mongodb-connection-model.svg?style=flat-square\n[npm_url]: https://www.npmjs.org/package/mongodb-connection-model\n[gitter_img]: https://badges.gitter.im/Join%20Chat.svg\n[gitter_url]: http://gitter.im/mongodb-js/mongodb-js\n[enterprise_img]: https://img.shields.io/badge/MongoDB-Enterprise-blue.svg?style=flat-square\n[coming_soon_img]: https://img.shields.io/badge/-Coming%20Soon-ff69b4.svg?style=flat-square\n[kerberos-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/kerberos_tests.js\n[ldap-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ldap_tests.js\n[x509-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ssl_x509_tests.js\n[ns]: https://github.com/mongodb-js/ns\n[sf-ssh-tunnel]: http://serverfault.com/questions/597765/how-to-connect-to-mongodb-server-via-ssh-tunnel\n[ec2-key-pairs]: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html\n[driver-ssl-impl]: https://github.com/christkv/mongodb-core/blob/c3d21cb636d74d7a68134ecd3b9f6af536311279/lib/connection/connection.js#L365-L407\n[driver-ssl-tutorial]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/\n[driver-ssl-none]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#no-certificate-validation\n[driver-ssl-server]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate\n[driver-ssl-all]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate-and-present-valid-certificate\n","gitHead":"cfe9a829fd77fc84e090f2c7b38663167071ebc5","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","test":"mocha","check":"npm run lint && npm run depcheck","pretest":"mongodb-runner install && mongodb-runner start --port=27018","test-ci":"npm run test","depcheck":"depcheck","posttest":"mongodb-runner stop --port=27018","posttest-ci":"node ../../scripts/killall-mongo.js","test-check-ci":"npm run check && npm test"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.17.0+x64 (linux)","description":"MongoDB connection model","directories":{},"_nodeVersion":"16.17.0","compass:main":"index.js","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","debug":"^4.2.0","lodash":"^4.17.15","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.2.0","storage-mixin":"0.0.0-next-cfe9a829fd77fc84e090f2c7b38663167071ebc5","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.2","@mongodb-js/ssh-tunnel":"0.0.0-next-cfe9a829fd77fc84e090f2c7b38663167071ebc5","@mongodb-js/compass-utils":"0.0.0-next-cfe9a829fd77fc84e090f2c7b38663167071ebc5","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.6.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"^4.13.0","depcheck":"^1.4.1","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.10.0","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^4.13.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_0.0.0-next-cfe9a829fd77fc84e090f2c7b38663167071ebc5_1675377699512_0.8508088729675181","host":"s3://npm-registry-packages"}},"0.0.0-next-6e4c984eb458cbfc675ec138ae979303ef32bcb5":{"name":"mongodb-connection-model","version":"0.0.0-next-6e4c984eb458cbfc675ec138ae979303ef32bcb5","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@0.0.0-next-6e4c984eb458cbfc675ec138ae979303ef32bcb5","maintainers":[{"name":"mongo-j","email":"james.wang@mongodb.com"},{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"iteng@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"4953657992c5b6aafd6cd805fe53e377d2a77097","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-0.0.0-next-6e4c984eb458cbfc675ec138ae979303ef32bcb5.tgz","fileCount":20,"integrity":"sha512-c/fBxD++W5F5GfQjxJEAdB2QrwURiBik+zNU+fRg2cfTaHqXhmtCNZUP8OeP/1369QPM+OgOzxGMN5ymYKuG2w==","signatures":[{"sig":"MEUCIQD/qAtt0JdphZc5mYz3o7bkKvRQ1bbSlIzTWbeIQCPwAQIgfzOdckpokauUeXDx4SDUGSivv/i+b86Wb5JVhQqr+fM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":108152,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj3EZPACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpQUhAAkseGMfdqg4zXtUbzPn0c0b9L2ktWoZh/qpN5hLQOCWZIOLZ9\r\nXfZ9b5+T/aDolBCR4LcgHyTFhHpanCSrJlVvWKZzVASJf3IRBg6uVhmle463\r\ngCJOBOmkoflCZeh9PY2hlF0m+dnaNgdhj3iSqigZcZxyB8LseCU6ZXRGqOJO\r\n4R46WD9+bbbKh5zHnMdk5z1MxfuA/hS07qtgeeTAPup9MlHFXojuu5P5wIYW\r\nZRoLoo/1cs+TB/L9sMEo3sJNgh+d0cJwvo7pdA0i3TwpANSNfog39ZrlcbFt\r\n7EvvlRV7FvcK51Yt4CXnKjDwZqQUEjVvsHpXz9TSFjRNkEz3RoetgSqte3DH\r\ndYfnbCuVbfqzgxO+vyylL0YkbOodZ+OTpA2FuZptxf00VIaSfsWIMud8bGHl\r\nbRsgS6qiRakWe0CFjMZqZLVVNa5SrhSPOUUK7bcGItJ7fgdv6dZ57+UtJ/TG\r\nCp8dspwP9dLOb4PyqGDcqubVG5qH1aGYKLU0tsQ0or3zXOCQ8Me9L1g6EHQJ\r\n89Xw6+ARL3uQhRR2o/loSRmuqJ8tqR5/8U7d+0FU4hlxTAPhSpZYSHQvCyRv\r\nRWTn//A3Xg0CHZaGDFn2p0+qT2YQZ6PPv37mLa+n0TzbfGiVnmGZzEQFQBTZ\r\nxLrDK/LQ5RlDGSHQvAfoCHwY5acUIsjOl8w=\r\n=Fh4K\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","readme":"# mongodb-connection-model [![][workflow_img]][workflow_url] [![][npm_img]][npm_url]\n\n> MongoDB connection model\n\nThe main purpose of the MongoDB connection model is to be a domain model around a MongoDB connection. It encapsulates generating a [Connection String URI](https://docs.mongodb.com/manual/reference/connection-string/) from a group of attributes and parses URI using the [MongoDB Node.JS Driver URI Parser](https://github.com/mongodb-js/mongodb-core/blob/master/lib/uri_parser.js).\n\n## Installation\n\n```\nnpm install --save mongodb-connection-model\n```\n\n## Usage\n\n### Building URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\nconst c = new Connection({ appname: 'My App Name' });\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://localhost:27017/?readPreference=primary&appname=My%20App&ssl=false'\n```\n\n### Parsing URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\n\nConnection.from(\n  'mongodb://someUsername:testPassword@localhost',\n  (error, result) => {\n    console.log(result);\n    >>> `{\n      hosts: [{ host: 'localhost', port: 27017 }],\n      hostname: 'localhost',\n      port: 27017,\n      auth: {\n        username: 'someUsername',\n        password: 'testPassword',\n        db: 'admin'\n      },\n      isSrvRecord: false,\n      authStrategy: 'MONGODB',\n      mongodbUsername: 'someUsername',\n      mongodbPassword: 'testPassword',\n      mongodbDatabaseName: 'admin',\n      extraOptions: {},\n      connectionType: 'NODE_DRIVER',\n      readPreference: 'primary',\n      kerberosCanonicalizeHostname: false,\n      sslMethod: 'NONE',\n      sshTunnel: 'NONE',\n      sshTunnelPort: 22\n    }`\n  }\n);\n```\n\n## Properties\n\nMongoDB connection model is based on Ampersand.js framework and consist of [props](https://ampersandjs.com/docs/#ampersand-state-props) and [derived props](https://ampersandjs.com/docs/#ampersand-state-derived). The props object describes the observable properties that MongoDB connection model gets from the Node.js Driver API.\n\n```javascript\nconst с = new Connection();\nconst props = с.getAttributes({ props: true });\n```\n\n#### See Also\n\n- [URI Generic Syntax](https://tools.ietf.org/html/rfc3986)\n- [URI Options Specification](https://github.com/mongodb/specifications/blob/master/source/uri-options/uri-options.rst)\n\n### General Properties\n\n```javascript\nconst c = new Connection({ isSrvRecord: true });\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ns` | String | A valid [ns][ns] the user can read from | `undefined` |\n| `isSrvRecord` | Boolean | Indicates SRV record | `false` |\n| `auth` | Object | Authentication from driver (username, user, db, password) | `undefined` |\n| `hostname` | String | Hostname of a MongoDB Instance. In case of the replica set the first host and port will be taken | `localhost` |\n| `port` | Number | TCP port of a MongoDB Instance | `27017` |\n| `hosts` | Array | Contains all hosts and ports for replica set | `[{ host: 'localhost', port: 27017 }]` |\n| `extraOptions` | Object | Extra options passed to the node driver as part of `driverOptions` | `{}` |\n| `connectionType` | String | The desired connection type. Possible values: `NODE_DRIVER`, `STITCH_ON_PREM`, `STITCH_ATLAS` | `NODE_DRIVER` |\n| `authStrategy` | String | The desired authentication strategy. Possible values: `NONE`, `MONGODB`, `X509`, `KERBEROS`, `LDAP`, `SCRAM-SHA-256` | `NONE` |\n\n### Connection string options\n\n```javascript\nconst c = new Connection({ appname: 'My App', replicaSet: 'testing' });\n```\n\n#### General connection string options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `replicaSet` | String | Specifies the name of the replica set, if the mongod is a member of a replica set | `undefined` |\n| `connectTimeoutMS` | Number | The time in milliseconds to attempt a connection before timing out | `undefined` |\n| `socketTimeoutMS` | Number | The time in milliseconds to attempt a send or receive on a socket before the attempt times out | `undefined` |\n| `compression` | Object | Object includes compressors and a compression level. The following compressors can be specified: `snappy`, `zlib` (Available in MongoDB 3.6 or greater) | `undefined` |\n\n#### Connection Pool Option\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `maxPoolSize` | Number | The maximum number of connections in the connection pool | `undefined` |\n| `minPoolSize` | Number | The minimum number of connections in the connection pool | `undefined` |\n| `maxIdleTimeMS` | Number | The maximum number of milliseconds that a connection can remain idle in the pool before being removed and closed | `undefined` |\n| `waitQueueMultiple` | Number | A number that the driver multiples the maxPoolSize value to, to provide the maximum number of threads allowed to wait for a connection to become available from the pool | `undefined` |\n| `waitQueueTimeoutMS` | Number | The maximum time in milliseconds that a thread can wait for a connection to become available | `undefined` |\n\n#### Write Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `w` | Number/String | Corresponds to the write concern [w Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-w) | `undefined` |\n| `wTimeoutMS` | Number | Corresponds to the write concern [wtimeout](https://docs.mongodb.com/manual/reference/write-concern/#wc-wtimeout) | `undefined` |\n| `journal` | Boolean | Corresponds to the write concern [j Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-j) | `undefined` |\n\n#### Read Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readConcernLevel` | String | The level of isolation | `undefined` |\n\n#### Read Preference Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readPreference` | String | Specifies the read preferences for this connection. Possible values: `PRIMARY`, `PRIMARY_PREFERRED`, `SECONDARY`, `SECONDARY_PREFERRED`, `NEAREST` | `PRIMARY` |\n| `maxStalenessSeconds` | Number | Specifies, in seconds, how stale a secondary can be before the client stops using it for read operations | `undefined` |\n| `readPreferenceTags` | Object | Default read preference tags for the client | `undefined` |\n\n#### Authentication Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `authSource` | String | Specify the database name associated with the user’s credentials | `undefined` |\n| `authMechanism` | String | Specifies the authentication mechanism that MongoDB will use to authenticate the connection. Possible values: `DEFAULT`, `GSSAPI`, `MONGODB-X509`, `PLAIN`, `SCRAM-SHA-256` | `undefined` |\n| `authMechanismProperties` | Object | Additional options provided for authentication (e.g. to enable hostname canonicalization for GSSAPI) | `undefined` |\n| `gssapiServiceName` | String | Set the Kerberos service name when connecting to Kerberized MongoDB instances | `undefined` |\n| `gssapiServiceRealm` | String | Set the Realm service name | `undefined` |\n| `gssapiCanonicalizeHostName` | Boolean | Whether canonicalized hostname | `undefined` |\n\n#### Server Selection and Discovery Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `localThresholdMS` | Number | The size (in milliseconds) of the latency window for selecting among multiple suitable MongoDB instances | `undefined` |\n| `serverSelectionTimeoutMS` | Number | Specifies how long (in milliseconds) to block for server selection before throwing an exception | `undefined` |\n| `serverSelectionTryOnce` | Boolean | Instructs the driver to scan the MongoDB deployment exactly once after server selection fails and then either select a server or raise an error | `undefined` |\n| `heartbeatFrequencyMS` | Number | Controls when the driver checks the state of the MongoDB deployment | `undefined` |\n\n#### Miscellaneous Configuration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `appname` | String | An application name passed to server as client metadata | `undefined` |\n| `retryWrites` | Boolean | Enable retryable writes | `undefined` |\n| `uuidRepresentation` | String | The legacy representation of UUID. Possible values: `standard`, `csharpLegacy`, `javaLegacy`, `pythonLegacy` | `undefined` |\n| `loadBalanced` | Boolean | Whether or not the server is running in load balanced mode | `undefined` |\n\n### Stitch attributes\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `stitchServiceName` | String | Stitch service name | `undefined` |\n| `stitchClientAppId` | String | Stitch сlient app ID | `undefined` |\n| `stitchGroupId` | String | Stitch group ID | `undefined` |\n| `stitchBaseUrl` | String | Stitch base Url | `undefined` |\n\n### MONGODB authentication\n\n```javascript\nconst c = new Connection({\n  mongodbUsername: 'arlo',\n  mongodbPassword: 'w@of'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/?slaveOk=true&authSource=admin'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `mongodbUsername` | String | MongoDB username | `undefined` |\n| `mongodbPassword` | String | MongoDB password | `undefined` |\n| `mongodbDatabaseName` | String | The database name associated with the user's credentials | `undefined` |\n| `promoteValues` | Boolean | Whether BSON values should be promoted to their JS type counterparts | `undefined` |\n\n### KERBEROS authentication\n\n```javascript\nconst c = new Connection({\n  kerberosServiceName: 'mongodb',\n  kerberosPrincipal: 'arlo/dog@krb5.mongodb.parts',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo%252Fdog%2540krb5.mongodb.parts@localhost:27017/toys?authMechanism=GSSAPI'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n> @note (imlucas): Kerberos on Windows is broken out as it's own state for UX consideration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `kerberosServiceName` | String | Any program or computer you access over a network | `undefined` |\n| `kerberosPrincipal` | String | The format of a typical Kerberos V5 principal is `primary/instance@REALM` | `undefined` |\n| `kerberosCanonicalizeHostname` | Boolean | Whether canonicalized kerberos hostname | `undefined` |\n\n#### See Also\n\n- [node.js driver Kerberos reference](http://bit.ly/mongodb-node-driver-kerberos)\n- [node.js driver Kerberos functional test][kerberos-functional]\n\n### LDAP authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  ldapUsername: 'arlo',\n  ldapPassword: 'w@of',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/toys?slaveOk=true&authMechanism=PLAIN'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ldapUsername` | String | LDAP username | `undefined` |\n| `ldapPassword` | String | LDAP password | `undefined` |\n\n#### See Also\n\n- [node.js driver LDAP reference](http://bit.ly/mongodb-node-driver-ldap)\n- [node.js driver X509 functional test][ldap-functional]\n\n### X509 authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  x509Username: 'CN=client,OU=arlo,O=MongoDB,L=Philadelphia,ST=Pennsylvania,C=US'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://CN%253Dclient%252COU%253Darlo%252CO%253DMongoDB%252CL%253DPhiladelphia%252CST%253DPennsylvania%252CC%253DUS@localhost:27017?slaveOk=true&authMechanism=MONGODB-X509'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `x509Username` | String | The x.509 certificate derived user name, e.g. `CN=user,OU=OrgUnit,O=myOrg,...` | `undefined` |\n\n#### See Also\n\n- [node.js driver X509 reference](http://bit.ly/mongodb-node-driver-x509)\n- [node.js driver X509 functional test][x509-functional]\n\n### SSL\n\n> **Note**: Not to be confused with `authentication=X509`\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ssl` | Number/String | A boolean to enable or disables TLS/SSL for the connection | `undefined` |\n| `sslMethod` | String | The desired ssl method. Possible values: `NONE`, `SYSTEMCA`, `IFAVAILABLE`, `UNVALIDATED`, `SERVER`, `ALL` | `NONE` |\n| `sslCA` | Buffer/String | Array of valid certificates | `undefined` |\n| `sslCert` | Buffer/String | The certificate | `undefined` |\n| `sslKey` | Buffer/String | The certificate private key | `undefined` |\n| `sslPass` | Buffer/String | The certificate password | `undefined` |\n\nDescription of `sslMethod` values:\n\n- `SYSTEMCA` - SSL required, validate using System CA, with host verification.\n- `IFAVAILABLE` - The driver should try SSL first, fall back to no SSL if unavailable, and use the system's Certificate Authority.\n- `SERVER` - The driver should validate the server certificate and fail to connect if validation fails. See also [node.js driver \"Validate Server Certificate\" docs][driver-ssl-server].\n- `ALL` - The driver must present a valid certificate and validate the server certificate. See also [node.js driver \"Validate Server Certificate and Present Valid Certificate\" docs][driver-ssl-all].\n- `NONE` - No SSL (Not recommended).\n- `UNVALIDATED` - Use SSL but do not perform any validation of the certificate chain. See also [node.js driver \"No Certificate Validation\" docs][driver-ssl-none]. **Very** not recommended and likely to be deprecated in future releases because it exposes potential Man-In-The-Middle attack vectors.\n\n#### See also\n\n- [node.js driver SSL implementation][driver-ssl-impl]\n- [node.js driver SSL tutorial][driver-ssl-tutorial]\n\n### SSH TUNNEL\n\n> New in mongodb-connection-model@5.0.0\n\nBecause [authentication](#authentication) is quite difficult for operators to migrate to, the most common method of securing a MongoDB deployment is to use an [SSH tunnel][sf-ssh-tunnel].  This allows operators to leverage their existing SSH security infrastructure to also provide secure access to MongoDB.  For a standard deployment of MongoDB on AWS, this is almost always to strategy.  Because of this, we now support creating SSH tunnels automatically when connecting to MongoDB.\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options, (connectionError, client) => {\n  if (connectionError) {\n    return console.log(connectionError);\n  }\n\n  client.db('mongodb').collection('fanclub').count((countingError, count) => {\n    console.log('counted:', countingError, count);\n    client.close();\n  });\n});\n```\n\nThe above provides the same functionality as creating the tunnel using the bash\ncommand below and connecting to MongoDB via another terminal. Notice that\nconnection-model uses a random local port each time it creates a tunnel.\nUsing the command line, you'd have to replace `<random port>` with an actual\nport number.\n\n```bash\nssh -i ~/.ssh/my-key-aws-pair.pem -L <random port>:localhost:27017 ubuntu@ec2-11-111-111-111.compute-1.amazonaws.com\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `sshTunnel` | String | The desired SSH tunnel strategy. Possible values: `NONE`, `USER_PASSWORD`, `IDENTITY_FILE` | `undefined` |\n| `sshTunnelHostname` | String | The hostname of the SSH remote host | `undefined` |\n| `sshTunnelPort` | Port | The SSH port of the remote host | `22` |\n| `sshTunnelBindToLocalPort` | Port | Bind the localhost endpoint of the SSH Tunnel to this port | `undefined` |\n| `sshTunnelUsername` | String | The optional SSH username for the remote host | `undefined` |\n| `sshTunnelPassword` | String | The optional SSH password for the remote host | `undefined` |\n| `sshTunnelIdentityFile` | String/Array | The optional path to the SSH identity file for the remote host | `undefined` |\n| `sshTunnelPassphrase` | String | The optional passphrase for `sshTunnelIdentityFile` | `undefined` |\n\nDescription of `sshTunnel` values:\n\n- `NONE` - Do not use SSH tunneling.\n- `USER_PASSWORD` - The tunnel is created with SSH username and password only.\n- `IDENTITY_FILE` - The tunnel is created using an identity file.\n\n## Derived Properties\n\nDerived properties (also known as computed properties) are properties of the state object that depend on other properties to determine their value.\n\n```javascript\nconst c = new Connection();\nconst derivedProps = c.getAttributes({ derived: true });\n```\n\n| Derived Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `instanceId` | String | The mongoscope | `localhost:27017` |\n| `driverAuthMechanism` | String | Converts the value of `authStrategy` for humans into the `authMechanism` value for the driver | `undefined` |\n| `safeUrl` | String | The URL where a password is replaced with stars | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrl` | String | Use this URL in order to connect via DataService | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrlWithSsh` | String | Use this URL in order to connect via connection model itself | `mongodb://localhost:29201/?readPreference=primary&ssl=false` |\n| `driverOptions` | String | The second argument `mongoscope-server` passes to `mongodb.connect` | `{}` |\n\n## Events\n\n> New in mongodb-connection-model@5.0.0\n\n#### Example: SSH Tunnel\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', skipped: true,\n  reason: 'The selected SSL mode does not need to load any files.' }\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', complete: true}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n#### Example: SSL\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  ssl: 'ALL',\n  sslCA: '~/.ssl/my-ca.pem',\n  sslCert: '~/.ssl/my-server.pem',\n  sslKey: '~/.ssl/my-server.pem'\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', complete: true}\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', skipped: true,\n  reason: 'The selected SSH Tunnel mode is NONE.'}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n[workflow_img]: https://github.com/mongodb-js/connection-model/workflows/Check%20and%20Test/badge.svg?event=push\n[workflow_url]: https://github.com/mongodb-js/connection-model/actions?query=workflow%3A%22Check+and+Test%22\n[npm_img]: https://img.shields.io/npm/v/mongodb-connection-model.svg?style=flat-square\n[npm_url]: https://www.npmjs.org/package/mongodb-connection-model\n[gitter_img]: https://badges.gitter.im/Join%20Chat.svg\n[gitter_url]: http://gitter.im/mongodb-js/mongodb-js\n[enterprise_img]: https://img.shields.io/badge/MongoDB-Enterprise-blue.svg?style=flat-square\n[coming_soon_img]: https://img.shields.io/badge/-Coming%20Soon-ff69b4.svg?style=flat-square\n[kerberos-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/kerberos_tests.js\n[ldap-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ldap_tests.js\n[x509-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ssl_x509_tests.js\n[ns]: https://github.com/mongodb-js/ns\n[sf-ssh-tunnel]: http://serverfault.com/questions/597765/how-to-connect-to-mongodb-server-via-ssh-tunnel\n[ec2-key-pairs]: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html\n[driver-ssl-impl]: https://github.com/christkv/mongodb-core/blob/c3d21cb636d74d7a68134ecd3b9f6af536311279/lib/connection/connection.js#L365-L407\n[driver-ssl-tutorial]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/\n[driver-ssl-none]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#no-certificate-validation\n[driver-ssl-server]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate\n[driver-ssl-all]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate-and-present-valid-certificate\n","gitHead":"6e4c984eb458cbfc675ec138ae979303ef32bcb5","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","test":"mocha","check":"npm run lint && npm run depcheck","pretest":"mongodb-runner install && mongodb-runner start --port=27018","test-ci":"npm run test","depcheck":"depcheck","posttest":"mongodb-runner stop --port=27018","posttest-ci":"node ../../scripts/killall-mongo.js","test-check-ci":"npm run check && npm test"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.17.0+x64 (linux)","description":"MongoDB connection model","directories":{},"_nodeVersion":"16.17.0","compass:main":"index.js","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","debug":"^4.2.0","lodash":"^4.17.15","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.2.0","storage-mixin":"0.0.0-next-6e4c984eb458cbfc675ec138ae979303ef32bcb5","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.2","@mongodb-js/ssh-tunnel":"0.0.0-next-6e4c984eb458cbfc675ec138ae979303ef32bcb5","@mongodb-js/compass-utils":"0.0.0-next-6e4c984eb458cbfc675ec138ae979303ef32bcb5","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.6.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"^4.13.0","depcheck":"^1.4.1","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.10.0","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^4.13.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_0.0.0-next-6e4c984eb458cbfc675ec138ae979303ef32bcb5_1675380303193_0.07719731688638531","host":"s3://npm-registry-packages"}},"0.0.0-next-3e67b8063fbcd84b0bfd6451e2568968fbdba25a":{"name":"mongodb-connection-model","version":"0.0.0-next-3e67b8063fbcd84b0bfd6451e2568968fbdba25a","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@0.0.0-next-3e67b8063fbcd84b0bfd6451e2568968fbdba25a","maintainers":[{"name":"mongo-j","email":"james.wang@mongodb.com"},{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"iteng@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"8807357e3083f4105bf83572d81fb3575a083bc9","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-0.0.0-next-3e67b8063fbcd84b0bfd6451e2568968fbdba25a.tgz","fileCount":20,"integrity":"sha512-eewJGzRiJuqFWIL/d7hAJ663gdqeOMWDQZLyjeOTvusCwZOHquFHIvqGOzdC7UySEcG0tiGOXHuMVWUTWGTIVw==","signatures":[{"sig":"MEYCIQDiCT5kqFaZ/s2xt8G9n+b9zjav18gm//xANGx1w1E0KQIhAIVF8K1FZuNLVlc5dcSinv6R2Wdk5LGL2yX2UNphbogj","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":108152,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj4WRfACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmppkQ/9FtNUajbeuj1nMIqnH3t4nW41md1FsngfutdpkldzmF+sR6Xq\r\n5bUEZ3EhgZrZ1/5Bxp37iofnCzVrJyKlpi8bJIOCEBI4s43Q3oAmBDvBOgaQ\r\ntK+paG0spa5AJb926zsIQDktrmzwjl6QLfoyCxZMJhMI+du3XHtmcI7uj8c6\r\nWlJlXyHFqdwQtLycjivqQZ8pLqGeC/+eZb0JAnSNwxgoqGrBh9MEb2Z1hHfk\r\nK0c1Uv8lxr1H5re2VU4A9FvlbqzvMWeLr00b7E8MoaF6tn1zAgZT2EvrLUxR\r\nYZnzEoHmFKNf/6yXqRFytGuLfnk6CUrua6m7KjTBI1FUajVO2de1FowbRN5S\r\nMD0dc9qJiVgzzxsW4c92JUo1tBp3SkUrGemLQYYkS4nOeGYEQls0SHQXSM1z\r\nxVEwVpurG2vre/1STCAtR3a7fdABiTbqURjzWnCOWdz+AqUVyEzVZCIJ9BpV\r\nReIW+8KG3AUUcpx/v5PaoNoCRpBgmXdZl3LmE42vFtSgaGhXznmIWgNWkETn\r\ndHJ9DwaEc7zrw19KkREXN8XLJU3QEC+gHDZ5lej1E3ixMQUovoo3JDioo1jK\r\n92HXGyuRSWfy4D3Y234xQkeVZKSRSPb2GU6U9Jju+Q/g6jAp+MO41KQjKDLZ\r\nfGh00ZZ9xju3JRQBNeopaWdfnji12TVuKNs=\r\n=Qn2Z\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","readme":"# mongodb-connection-model [![][workflow_img]][workflow_url] [![][npm_img]][npm_url]\n\n> MongoDB connection model\n\nThe main purpose of the MongoDB connection model is to be a domain model around a MongoDB connection. It encapsulates generating a [Connection String URI](https://docs.mongodb.com/manual/reference/connection-string/) from a group of attributes and parses URI using the [MongoDB Node.JS Driver URI Parser](https://github.com/mongodb-js/mongodb-core/blob/master/lib/uri_parser.js).\n\n## Installation\n\n```\nnpm install --save mongodb-connection-model\n```\n\n## Usage\n\n### Building URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\nconst c = new Connection({ appname: 'My App Name' });\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://localhost:27017/?readPreference=primary&appname=My%20App&ssl=false'\n```\n\n### Parsing URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\n\nConnection.from(\n  'mongodb://someUsername:testPassword@localhost',\n  (error, result) => {\n    console.log(result);\n    >>> `{\n      hosts: [{ host: 'localhost', port: 27017 }],\n      hostname: 'localhost',\n      port: 27017,\n      auth: {\n        username: 'someUsername',\n        password: 'testPassword',\n        db: 'admin'\n      },\n      isSrvRecord: false,\n      authStrategy: 'MONGODB',\n      mongodbUsername: 'someUsername',\n      mongodbPassword: 'testPassword',\n      mongodbDatabaseName: 'admin',\n      extraOptions: {},\n      connectionType: 'NODE_DRIVER',\n      readPreference: 'primary',\n      kerberosCanonicalizeHostname: false,\n      sslMethod: 'NONE',\n      sshTunnel: 'NONE',\n      sshTunnelPort: 22\n    }`\n  }\n);\n```\n\n## Properties\n\nMongoDB connection model is based on Ampersand.js framework and consist of [props](https://ampersandjs.com/docs/#ampersand-state-props) and [derived props](https://ampersandjs.com/docs/#ampersand-state-derived). The props object describes the observable properties that MongoDB connection model gets from the Node.js Driver API.\n\n```javascript\nconst с = new Connection();\nconst props = с.getAttributes({ props: true });\n```\n\n#### See Also\n\n- [URI Generic Syntax](https://tools.ietf.org/html/rfc3986)\n- [URI Options Specification](https://github.com/mongodb/specifications/blob/master/source/uri-options/uri-options.rst)\n\n### General Properties\n\n```javascript\nconst c = new Connection({ isSrvRecord: true });\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ns` | String | A valid [ns][ns] the user can read from | `undefined` |\n| `isSrvRecord` | Boolean | Indicates SRV record | `false` |\n| `auth` | Object | Authentication from driver (username, user, db, password) | `undefined` |\n| `hostname` | String | Hostname of a MongoDB Instance. In case of the replica set the first host and port will be taken | `localhost` |\n| `port` | Number | TCP port of a MongoDB Instance | `27017` |\n| `hosts` | Array | Contains all hosts and ports for replica set | `[{ host: 'localhost', port: 27017 }]` |\n| `extraOptions` | Object | Extra options passed to the node driver as part of `driverOptions` | `{}` |\n| `connectionType` | String | The desired connection type. Possible values: `NODE_DRIVER`, `STITCH_ON_PREM`, `STITCH_ATLAS` | `NODE_DRIVER` |\n| `authStrategy` | String | The desired authentication strategy. Possible values: `NONE`, `MONGODB`, `X509`, `KERBEROS`, `LDAP`, `SCRAM-SHA-256` | `NONE` |\n\n### Connection string options\n\n```javascript\nconst c = new Connection({ appname: 'My App', replicaSet: 'testing' });\n```\n\n#### General connection string options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `replicaSet` | String | Specifies the name of the replica set, if the mongod is a member of a replica set | `undefined` |\n| `connectTimeoutMS` | Number | The time in milliseconds to attempt a connection before timing out | `undefined` |\n| `socketTimeoutMS` | Number | The time in milliseconds to attempt a send or receive on a socket before the attempt times out | `undefined` |\n| `compression` | Object | Object includes compressors and a compression level. The following compressors can be specified: `snappy`, `zlib` (Available in MongoDB 3.6 or greater) | `undefined` |\n\n#### Connection Pool Option\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `maxPoolSize` | Number | The maximum number of connections in the connection pool | `undefined` |\n| `minPoolSize` | Number | The minimum number of connections in the connection pool | `undefined` |\n| `maxIdleTimeMS` | Number | The maximum number of milliseconds that a connection can remain idle in the pool before being removed and closed | `undefined` |\n| `waitQueueMultiple` | Number | A number that the driver multiples the maxPoolSize value to, to provide the maximum number of threads allowed to wait for a connection to become available from the pool | `undefined` |\n| `waitQueueTimeoutMS` | Number | The maximum time in milliseconds that a thread can wait for a connection to become available | `undefined` |\n\n#### Write Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `w` | Number/String | Corresponds to the write concern [w Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-w) | `undefined` |\n| `wTimeoutMS` | Number | Corresponds to the write concern [wtimeout](https://docs.mongodb.com/manual/reference/write-concern/#wc-wtimeout) | `undefined` |\n| `journal` | Boolean | Corresponds to the write concern [j Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-j) | `undefined` |\n\n#### Read Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readConcernLevel` | String | The level of isolation | `undefined` |\n\n#### Read Preference Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readPreference` | String | Specifies the read preferences for this connection. Possible values: `PRIMARY`, `PRIMARY_PREFERRED`, `SECONDARY`, `SECONDARY_PREFERRED`, `NEAREST` | `PRIMARY` |\n| `maxStalenessSeconds` | Number | Specifies, in seconds, how stale a secondary can be before the client stops using it for read operations | `undefined` |\n| `readPreferenceTags` | Object | Default read preference tags for the client | `undefined` |\n\n#### Authentication Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `authSource` | String | Specify the database name associated with the user’s credentials | `undefined` |\n| `authMechanism` | String | Specifies the authentication mechanism that MongoDB will use to authenticate the connection. Possible values: `DEFAULT`, `GSSAPI`, `MONGODB-X509`, `PLAIN`, `SCRAM-SHA-256` | `undefined` |\n| `authMechanismProperties` | Object | Additional options provided for authentication (e.g. to enable hostname canonicalization for GSSAPI) | `undefined` |\n| `gssapiServiceName` | String | Set the Kerberos service name when connecting to Kerberized MongoDB instances | `undefined` |\n| `gssapiServiceRealm` | String | Set the Realm service name | `undefined` |\n| `gssapiCanonicalizeHostName` | Boolean | Whether canonicalized hostname | `undefined` |\n\n#### Server Selection and Discovery Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `localThresholdMS` | Number | The size (in milliseconds) of the latency window for selecting among multiple suitable MongoDB instances | `undefined` |\n| `serverSelectionTimeoutMS` | Number | Specifies how long (in milliseconds) to block for server selection before throwing an exception | `undefined` |\n| `serverSelectionTryOnce` | Boolean | Instructs the driver to scan the MongoDB deployment exactly once after server selection fails and then either select a server or raise an error | `undefined` |\n| `heartbeatFrequencyMS` | Number | Controls when the driver checks the state of the MongoDB deployment | `undefined` |\n\n#### Miscellaneous Configuration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `appname` | String | An application name passed to server as client metadata | `undefined` |\n| `retryWrites` | Boolean | Enable retryable writes | `undefined` |\n| `uuidRepresentation` | String | The legacy representation of UUID. Possible values: `standard`, `csharpLegacy`, `javaLegacy`, `pythonLegacy` | `undefined` |\n| `loadBalanced` | Boolean | Whether or not the server is running in load balanced mode | `undefined` |\n\n### Stitch attributes\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `stitchServiceName` | String | Stitch service name | `undefined` |\n| `stitchClientAppId` | String | Stitch сlient app ID | `undefined` |\n| `stitchGroupId` | String | Stitch group ID | `undefined` |\n| `stitchBaseUrl` | String | Stitch base Url | `undefined` |\n\n### MONGODB authentication\n\n```javascript\nconst c = new Connection({\n  mongodbUsername: 'arlo',\n  mongodbPassword: 'w@of'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/?slaveOk=true&authSource=admin'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `mongodbUsername` | String | MongoDB username | `undefined` |\n| `mongodbPassword` | String | MongoDB password | `undefined` |\n| `mongodbDatabaseName` | String | The database name associated with the user's credentials | `undefined` |\n| `promoteValues` | Boolean | Whether BSON values should be promoted to their JS type counterparts | `undefined` |\n\n### KERBEROS authentication\n\n```javascript\nconst c = new Connection({\n  kerberosServiceName: 'mongodb',\n  kerberosPrincipal: 'arlo/dog@krb5.mongodb.parts',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo%252Fdog%2540krb5.mongodb.parts@localhost:27017/toys?authMechanism=GSSAPI'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n> @note (imlucas): Kerberos on Windows is broken out as it's own state for UX consideration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `kerberosServiceName` | String | Any program or computer you access over a network | `undefined` |\n| `kerberosPrincipal` | String | The format of a typical Kerberos V5 principal is `primary/instance@REALM` | `undefined` |\n| `kerberosCanonicalizeHostname` | Boolean | Whether canonicalized kerberos hostname | `undefined` |\n\n#### See Also\n\n- [node.js driver Kerberos reference](http://bit.ly/mongodb-node-driver-kerberos)\n- [node.js driver Kerberos functional test][kerberos-functional]\n\n### LDAP authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  ldapUsername: 'arlo',\n  ldapPassword: 'w@of',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/toys?slaveOk=true&authMechanism=PLAIN'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ldapUsername` | String | LDAP username | `undefined` |\n| `ldapPassword` | String | LDAP password | `undefined` |\n\n#### See Also\n\n- [node.js driver LDAP reference](http://bit.ly/mongodb-node-driver-ldap)\n- [node.js driver X509 functional test][ldap-functional]\n\n### X509 authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  x509Username: 'CN=client,OU=arlo,O=MongoDB,L=Philadelphia,ST=Pennsylvania,C=US'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://CN%253Dclient%252COU%253Darlo%252CO%253DMongoDB%252CL%253DPhiladelphia%252CST%253DPennsylvania%252CC%253DUS@localhost:27017?slaveOk=true&authMechanism=MONGODB-X509'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `x509Username` | String | The x.509 certificate derived user name, e.g. `CN=user,OU=OrgUnit,O=myOrg,...` | `undefined` |\n\n#### See Also\n\n- [node.js driver X509 reference](http://bit.ly/mongodb-node-driver-x509)\n- [node.js driver X509 functional test][x509-functional]\n\n### SSL\n\n> **Note**: Not to be confused with `authentication=X509`\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ssl` | Number/String | A boolean to enable or disables TLS/SSL for the connection | `undefined` |\n| `sslMethod` | String | The desired ssl method. Possible values: `NONE`, `SYSTEMCA`, `IFAVAILABLE`, `UNVALIDATED`, `SERVER`, `ALL` | `NONE` |\n| `sslCA` | Buffer/String | Array of valid certificates | `undefined` |\n| `sslCert` | Buffer/String | The certificate | `undefined` |\n| `sslKey` | Buffer/String | The certificate private key | `undefined` |\n| `sslPass` | Buffer/String | The certificate password | `undefined` |\n\nDescription of `sslMethod` values:\n\n- `SYSTEMCA` - SSL required, validate using System CA, with host verification.\n- `IFAVAILABLE` - The driver should try SSL first, fall back to no SSL if unavailable, and use the system's Certificate Authority.\n- `SERVER` - The driver should validate the server certificate and fail to connect if validation fails. See also [node.js driver \"Validate Server Certificate\" docs][driver-ssl-server].\n- `ALL` - The driver must present a valid certificate and validate the server certificate. See also [node.js driver \"Validate Server Certificate and Present Valid Certificate\" docs][driver-ssl-all].\n- `NONE` - No SSL (Not recommended).\n- `UNVALIDATED` - Use SSL but do not perform any validation of the certificate chain. See also [node.js driver \"No Certificate Validation\" docs][driver-ssl-none]. **Very** not recommended and likely to be deprecated in future releases because it exposes potential Man-In-The-Middle attack vectors.\n\n#### See also\n\n- [node.js driver SSL implementation][driver-ssl-impl]\n- [node.js driver SSL tutorial][driver-ssl-tutorial]\n\n### SSH TUNNEL\n\n> New in mongodb-connection-model@5.0.0\n\nBecause [authentication](#authentication) is quite difficult for operators to migrate to, the most common method of securing a MongoDB deployment is to use an [SSH tunnel][sf-ssh-tunnel].  This allows operators to leverage their existing SSH security infrastructure to also provide secure access to MongoDB.  For a standard deployment of MongoDB on AWS, this is almost always to strategy.  Because of this, we now support creating SSH tunnels automatically when connecting to MongoDB.\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options, (connectionError, client) => {\n  if (connectionError) {\n    return console.log(connectionError);\n  }\n\n  client.db('mongodb').collection('fanclub').count((countingError, count) => {\n    console.log('counted:', countingError, count);\n    client.close();\n  });\n});\n```\n\nThe above provides the same functionality as creating the tunnel using the bash\ncommand below and connecting to MongoDB via another terminal. Notice that\nconnection-model uses a random local port each time it creates a tunnel.\nUsing the command line, you'd have to replace `<random port>` with an actual\nport number.\n\n```bash\nssh -i ~/.ssh/my-key-aws-pair.pem -L <random port>:localhost:27017 ubuntu@ec2-11-111-111-111.compute-1.amazonaws.com\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `sshTunnel` | String | The desired SSH tunnel strategy. Possible values: `NONE`, `USER_PASSWORD`, `IDENTITY_FILE` | `undefined` |\n| `sshTunnelHostname` | String | The hostname of the SSH remote host | `undefined` |\n| `sshTunnelPort` | Port | The SSH port of the remote host | `22` |\n| `sshTunnelBindToLocalPort` | Port | Bind the localhost endpoint of the SSH Tunnel to this port | `undefined` |\n| `sshTunnelUsername` | String | The optional SSH username for the remote host | `undefined` |\n| `sshTunnelPassword` | String | The optional SSH password for the remote host | `undefined` |\n| `sshTunnelIdentityFile` | String/Array | The optional path to the SSH identity file for the remote host | `undefined` |\n| `sshTunnelPassphrase` | String | The optional passphrase for `sshTunnelIdentityFile` | `undefined` |\n\nDescription of `sshTunnel` values:\n\n- `NONE` - Do not use SSH tunneling.\n- `USER_PASSWORD` - The tunnel is created with SSH username and password only.\n- `IDENTITY_FILE` - The tunnel is created using an identity file.\n\n## Derived Properties\n\nDerived properties (also known as computed properties) are properties of the state object that depend on other properties to determine their value.\n\n```javascript\nconst c = new Connection();\nconst derivedProps = c.getAttributes({ derived: true });\n```\n\n| Derived Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `instanceId` | String | The mongoscope | `localhost:27017` |\n| `driverAuthMechanism` | String | Converts the value of `authStrategy` for humans into the `authMechanism` value for the driver | `undefined` |\n| `safeUrl` | String | The URL where a password is replaced with stars | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrl` | String | Use this URL in order to connect via DataService | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrlWithSsh` | String | Use this URL in order to connect via connection model itself | `mongodb://localhost:29201/?readPreference=primary&ssl=false` |\n| `driverOptions` | String | The second argument `mongoscope-server` passes to `mongodb.connect` | `{}` |\n\n## Events\n\n> New in mongodb-connection-model@5.0.0\n\n#### Example: SSH Tunnel\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', skipped: true,\n  reason: 'The selected SSL mode does not need to load any files.' }\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', complete: true}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n#### Example: SSL\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  ssl: 'ALL',\n  sslCA: '~/.ssl/my-ca.pem',\n  sslCert: '~/.ssl/my-server.pem',\n  sslKey: '~/.ssl/my-server.pem'\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', complete: true}\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', skipped: true,\n  reason: 'The selected SSH Tunnel mode is NONE.'}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n[workflow_img]: https://github.com/mongodb-js/connection-model/workflows/Check%20and%20Test/badge.svg?event=push\n[workflow_url]: https://github.com/mongodb-js/connection-model/actions?query=workflow%3A%22Check+and+Test%22\n[npm_img]: https://img.shields.io/npm/v/mongodb-connection-model.svg?style=flat-square\n[npm_url]: https://www.npmjs.org/package/mongodb-connection-model\n[gitter_img]: https://badges.gitter.im/Join%20Chat.svg\n[gitter_url]: http://gitter.im/mongodb-js/mongodb-js\n[enterprise_img]: https://img.shields.io/badge/MongoDB-Enterprise-blue.svg?style=flat-square\n[coming_soon_img]: https://img.shields.io/badge/-Coming%20Soon-ff69b4.svg?style=flat-square\n[kerberos-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/kerberos_tests.js\n[ldap-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ldap_tests.js\n[x509-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ssl_x509_tests.js\n[ns]: https://github.com/mongodb-js/ns\n[sf-ssh-tunnel]: http://serverfault.com/questions/597765/how-to-connect-to-mongodb-server-via-ssh-tunnel\n[ec2-key-pairs]: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html\n[driver-ssl-impl]: https://github.com/christkv/mongodb-core/blob/c3d21cb636d74d7a68134ecd3b9f6af536311279/lib/connection/connection.js#L365-L407\n[driver-ssl-tutorial]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/\n[driver-ssl-none]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#no-certificate-validation\n[driver-ssl-server]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate\n[driver-ssl-all]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate-and-present-valid-certificate\n","gitHead":"3e67b8063fbcd84b0bfd6451e2568968fbdba25a","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","test":"mocha","check":"npm run lint && npm run depcheck","pretest":"mongodb-runner install && mongodb-runner start --port=27018","test-ci":"npm run test","depcheck":"depcheck","posttest":"mongodb-runner stop --port=27018","posttest-ci":"node ../../scripts/killall-mongo.js","test-check-ci":"npm run check && npm test"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.17.0+x64 (linux)","description":"MongoDB connection model","directories":{},"_nodeVersion":"16.17.0","compass:main":"index.js","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","debug":"^4.2.0","lodash":"^4.17.15","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.2.0","storage-mixin":"0.0.0-next-3e67b8063fbcd84b0bfd6451e2568968fbdba25a","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.2","@mongodb-js/ssh-tunnel":"0.0.0-next-3e67b8063fbcd84b0bfd6451e2568968fbdba25a","@mongodb-js/compass-utils":"0.0.0-next-3e67b8063fbcd84b0bfd6451e2568968fbdba25a","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.6.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"^4.13.0","depcheck":"^1.4.1","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.10.0","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^4.13.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_0.0.0-next-3e67b8063fbcd84b0bfd6451e2568968fbdba25a_1675715679724_0.7598741108536864","host":"s3://npm-registry-packages"}},"0.0.0-next-7bfb57937adf16eda85ca92547ea5711d120b4c1":{"name":"mongodb-connection-model","version":"0.0.0-next-7bfb57937adf16eda85ca92547ea5711d120b4c1","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@0.0.0-next-7bfb57937adf16eda85ca92547ea5711d120b4c1","maintainers":[{"name":"mongo-j","email":"james.wang@mongodb.com"},{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"iteng@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"4640072de079f2d343be182f6fa9088aff12c600","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-0.0.0-next-7bfb57937adf16eda85ca92547ea5711d120b4c1.tgz","fileCount":20,"integrity":"sha512-uvqJm6cB4sF0lPMa6KfUibbVzQbB3CNbplfwdEw0hD5WSUkx55NJgZPwctdymGaNDDhIKZAGJdc1b4I/Y/fGsw==","signatures":[{"sig":"MEYCIQDe4jCj3Y9hNseG37UJtx7858hgM1W+sWZKkXnLLoWgSQIhAPPkjOKWVnhY1B4cVB0/F2d/6azBw7EQquN73vwk7wBW","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":108152,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj4WVUACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqahRAApESWtcHeX7CbXQqHCQlkhhSXb2HnrSbPP+bBYKmYItvrqSHN\r\nKc5bwlo2QyaDI14tz/F9B4jHanxF/gGFKYQh00Z+ezwjYTvuzuVCwyT5/QOY\r\nfYEq4kAQeiNWa65aWlREseKQYm/I88BujtP0XJuaezQeo5Gjc4ZGlLf5amXP\r\nDI4tAi+cRzqSLFp/LGEvh42Hplj8fsMFcWtFyD87a+uMAttn50d+ikvdanHZ\r\n/6nnVmjvflhryUhRwmpfxbRqlhXN8oABpuSAbYM8xVDMDY4I2RktF+UfgI06\r\nPBdOOrIz2Z7Kbb1N7g9+uO8/c7XP1/EnRl+JG9e0PTpe+PumGheZ/LRUawo5\r\nFq7KCFD8+Nm9GGlJJnw2WZlfe3MFMxB3PD01+Ll4+mywZ1aDy4QNCJJbeC3T\r\nQaEaxc86gr5UsKSfaEOT6ekWkPttocws2VRBjRHXPs0sm6ik3B/zdiVE+3hD\r\nKsli+4zi+Ey5ZaOxN4LFZ6zdFBcxDgUZpCNxpuOKm7z/x7vxb4rBEnBV3LdH\r\nVAD6Jyzv5giclnX6sQB3oZowpvnddVhQEY2pwO93MO5sAAgLwwS0a4HNMyaN\r\n4OuCCgwaTMEyOrss6eBXoSY02bGS3S44qny0PMhhd4/FU2jBEp+SFRd25b+I\r\n/GI+SqZVQEQ3ODk99On35vzeycnMHWNxYhI=\r\n=tU6s\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","readme":"# mongodb-connection-model [![][workflow_img]][workflow_url] [![][npm_img]][npm_url]\n\n> MongoDB connection model\n\nThe main purpose of the MongoDB connection model is to be a domain model around a MongoDB connection. It encapsulates generating a [Connection String URI](https://docs.mongodb.com/manual/reference/connection-string/) from a group of attributes and parses URI using the [MongoDB Node.JS Driver URI Parser](https://github.com/mongodb-js/mongodb-core/blob/master/lib/uri_parser.js).\n\n## Installation\n\n```\nnpm install --save mongodb-connection-model\n```\n\n## Usage\n\n### Building URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\nconst c = new Connection({ appname: 'My App Name' });\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://localhost:27017/?readPreference=primary&appname=My%20App&ssl=false'\n```\n\n### Parsing URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\n\nConnection.from(\n  'mongodb://someUsername:testPassword@localhost',\n  (error, result) => {\n    console.log(result);\n    >>> `{\n      hosts: [{ host: 'localhost', port: 27017 }],\n      hostname: 'localhost',\n      port: 27017,\n      auth: {\n        username: 'someUsername',\n        password: 'testPassword',\n        db: 'admin'\n      },\n      isSrvRecord: false,\n      authStrategy: 'MONGODB',\n      mongodbUsername: 'someUsername',\n      mongodbPassword: 'testPassword',\n      mongodbDatabaseName: 'admin',\n      extraOptions: {},\n      connectionType: 'NODE_DRIVER',\n      readPreference: 'primary',\n      kerberosCanonicalizeHostname: false,\n      sslMethod: 'NONE',\n      sshTunnel: 'NONE',\n      sshTunnelPort: 22\n    }`\n  }\n);\n```\n\n## Properties\n\nMongoDB connection model is based on Ampersand.js framework and consist of [props](https://ampersandjs.com/docs/#ampersand-state-props) and [derived props](https://ampersandjs.com/docs/#ampersand-state-derived). The props object describes the observable properties that MongoDB connection model gets from the Node.js Driver API.\n\n```javascript\nconst с = new Connection();\nconst props = с.getAttributes({ props: true });\n```\n\n#### See Also\n\n- [URI Generic Syntax](https://tools.ietf.org/html/rfc3986)\n- [URI Options Specification](https://github.com/mongodb/specifications/blob/master/source/uri-options/uri-options.rst)\n\n### General Properties\n\n```javascript\nconst c = new Connection({ isSrvRecord: true });\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ns` | String | A valid [ns][ns] the user can read from | `undefined` |\n| `isSrvRecord` | Boolean | Indicates SRV record | `false` |\n| `auth` | Object | Authentication from driver (username, user, db, password) | `undefined` |\n| `hostname` | String | Hostname of a MongoDB Instance. In case of the replica set the first host and port will be taken | `localhost` |\n| `port` | Number | TCP port of a MongoDB Instance | `27017` |\n| `hosts` | Array | Contains all hosts and ports for replica set | `[{ host: 'localhost', port: 27017 }]` |\n| `extraOptions` | Object | Extra options passed to the node driver as part of `driverOptions` | `{}` |\n| `connectionType` | String | The desired connection type. Possible values: `NODE_DRIVER`, `STITCH_ON_PREM`, `STITCH_ATLAS` | `NODE_DRIVER` |\n| `authStrategy` | String | The desired authentication strategy. Possible values: `NONE`, `MONGODB`, `X509`, `KERBEROS`, `LDAP`, `SCRAM-SHA-256` | `NONE` |\n\n### Connection string options\n\n```javascript\nconst c = new Connection({ appname: 'My App', replicaSet: 'testing' });\n```\n\n#### General connection string options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `replicaSet` | String | Specifies the name of the replica set, if the mongod is a member of a replica set | `undefined` |\n| `connectTimeoutMS` | Number | The time in milliseconds to attempt a connection before timing out | `undefined` |\n| `socketTimeoutMS` | Number | The time in milliseconds to attempt a send or receive on a socket before the attempt times out | `undefined` |\n| `compression` | Object | Object includes compressors and a compression level. The following compressors can be specified: `snappy`, `zlib` (Available in MongoDB 3.6 or greater) | `undefined` |\n\n#### Connection Pool Option\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `maxPoolSize` | Number | The maximum number of connections in the connection pool | `undefined` |\n| `minPoolSize` | Number | The minimum number of connections in the connection pool | `undefined` |\n| `maxIdleTimeMS` | Number | The maximum number of milliseconds that a connection can remain idle in the pool before being removed and closed | `undefined` |\n| `waitQueueMultiple` | Number | A number that the driver multiples the maxPoolSize value to, to provide the maximum number of threads allowed to wait for a connection to become available from the pool | `undefined` |\n| `waitQueueTimeoutMS` | Number | The maximum time in milliseconds that a thread can wait for a connection to become available | `undefined` |\n\n#### Write Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `w` | Number/String | Corresponds to the write concern [w Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-w) | `undefined` |\n| `wTimeoutMS` | Number | Corresponds to the write concern [wtimeout](https://docs.mongodb.com/manual/reference/write-concern/#wc-wtimeout) | `undefined` |\n| `journal` | Boolean | Corresponds to the write concern [j Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-j) | `undefined` |\n\n#### Read Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readConcernLevel` | String | The level of isolation | `undefined` |\n\n#### Read Preference Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readPreference` | String | Specifies the read preferences for this connection. Possible values: `PRIMARY`, `PRIMARY_PREFERRED`, `SECONDARY`, `SECONDARY_PREFERRED`, `NEAREST` | `PRIMARY` |\n| `maxStalenessSeconds` | Number | Specifies, in seconds, how stale a secondary can be before the client stops using it for read operations | `undefined` |\n| `readPreferenceTags` | Object | Default read preference tags for the client | `undefined` |\n\n#### Authentication Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `authSource` | String | Specify the database name associated with the user’s credentials | `undefined` |\n| `authMechanism` | String | Specifies the authentication mechanism that MongoDB will use to authenticate the connection. Possible values: `DEFAULT`, `GSSAPI`, `MONGODB-X509`, `PLAIN`, `SCRAM-SHA-256` | `undefined` |\n| `authMechanismProperties` | Object | Additional options provided for authentication (e.g. to enable hostname canonicalization for GSSAPI) | `undefined` |\n| `gssapiServiceName` | String | Set the Kerberos service name when connecting to Kerberized MongoDB instances | `undefined` |\n| `gssapiServiceRealm` | String | Set the Realm service name | `undefined` |\n| `gssapiCanonicalizeHostName` | Boolean | Whether canonicalized hostname | `undefined` |\n\n#### Server Selection and Discovery Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `localThresholdMS` | Number | The size (in milliseconds) of the latency window for selecting among multiple suitable MongoDB instances | `undefined` |\n| `serverSelectionTimeoutMS` | Number | Specifies how long (in milliseconds) to block for server selection before throwing an exception | `undefined` |\n| `serverSelectionTryOnce` | Boolean | Instructs the driver to scan the MongoDB deployment exactly once after server selection fails and then either select a server or raise an error | `undefined` |\n| `heartbeatFrequencyMS` | Number | Controls when the driver checks the state of the MongoDB deployment | `undefined` |\n\n#### Miscellaneous Configuration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `appname` | String | An application name passed to server as client metadata | `undefined` |\n| `retryWrites` | Boolean | Enable retryable writes | `undefined` |\n| `uuidRepresentation` | String | The legacy representation of UUID. Possible values: `standard`, `csharpLegacy`, `javaLegacy`, `pythonLegacy` | `undefined` |\n| `loadBalanced` | Boolean | Whether or not the server is running in load balanced mode | `undefined` |\n\n### Stitch attributes\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `stitchServiceName` | String | Stitch service name | `undefined` |\n| `stitchClientAppId` | String | Stitch сlient app ID | `undefined` |\n| `stitchGroupId` | String | Stitch group ID | `undefined` |\n| `stitchBaseUrl` | String | Stitch base Url | `undefined` |\n\n### MONGODB authentication\n\n```javascript\nconst c = new Connection({\n  mongodbUsername: 'arlo',\n  mongodbPassword: 'w@of'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/?slaveOk=true&authSource=admin'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `mongodbUsername` | String | MongoDB username | `undefined` |\n| `mongodbPassword` | String | MongoDB password | `undefined` |\n| `mongodbDatabaseName` | String | The database name associated with the user's credentials | `undefined` |\n| `promoteValues` | Boolean | Whether BSON values should be promoted to their JS type counterparts | `undefined` |\n\n### KERBEROS authentication\n\n```javascript\nconst c = new Connection({\n  kerberosServiceName: 'mongodb',\n  kerberosPrincipal: 'arlo/dog@krb5.mongodb.parts',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo%252Fdog%2540krb5.mongodb.parts@localhost:27017/toys?authMechanism=GSSAPI'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n> @note (imlucas): Kerberos on Windows is broken out as it's own state for UX consideration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `kerberosServiceName` | String | Any program or computer you access over a network | `undefined` |\n| `kerberosPrincipal` | String | The format of a typical Kerberos V5 principal is `primary/instance@REALM` | `undefined` |\n| `kerberosCanonicalizeHostname` | Boolean | Whether canonicalized kerberos hostname | `undefined` |\n\n#### See Also\n\n- [node.js driver Kerberos reference](http://bit.ly/mongodb-node-driver-kerberos)\n- [node.js driver Kerberos functional test][kerberos-functional]\n\n### LDAP authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  ldapUsername: 'arlo',\n  ldapPassword: 'w@of',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/toys?slaveOk=true&authMechanism=PLAIN'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ldapUsername` | String | LDAP username | `undefined` |\n| `ldapPassword` | String | LDAP password | `undefined` |\n\n#### See Also\n\n- [node.js driver LDAP reference](http://bit.ly/mongodb-node-driver-ldap)\n- [node.js driver X509 functional test][ldap-functional]\n\n### X509 authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  x509Username: 'CN=client,OU=arlo,O=MongoDB,L=Philadelphia,ST=Pennsylvania,C=US'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://CN%253Dclient%252COU%253Darlo%252CO%253DMongoDB%252CL%253DPhiladelphia%252CST%253DPennsylvania%252CC%253DUS@localhost:27017?slaveOk=true&authMechanism=MONGODB-X509'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `x509Username` | String | The x.509 certificate derived user name, e.g. `CN=user,OU=OrgUnit,O=myOrg,...` | `undefined` |\n\n#### See Also\n\n- [node.js driver X509 reference](http://bit.ly/mongodb-node-driver-x509)\n- [node.js driver X509 functional test][x509-functional]\n\n### SSL\n\n> **Note**: Not to be confused with `authentication=X509`\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ssl` | Number/String | A boolean to enable or disables TLS/SSL for the connection | `undefined` |\n| `sslMethod` | String | The desired ssl method. Possible values: `NONE`, `SYSTEMCA`, `IFAVAILABLE`, `UNVALIDATED`, `SERVER`, `ALL` | `NONE` |\n| `sslCA` | Buffer/String | Array of valid certificates | `undefined` |\n| `sslCert` | Buffer/String | The certificate | `undefined` |\n| `sslKey` | Buffer/String | The certificate private key | `undefined` |\n| `sslPass` | Buffer/String | The certificate password | `undefined` |\n\nDescription of `sslMethod` values:\n\n- `SYSTEMCA` - SSL required, validate using System CA, with host verification.\n- `IFAVAILABLE` - The driver should try SSL first, fall back to no SSL if unavailable, and use the system's Certificate Authority.\n- `SERVER` - The driver should validate the server certificate and fail to connect if validation fails. See also [node.js driver \"Validate Server Certificate\" docs][driver-ssl-server].\n- `ALL` - The driver must present a valid certificate and validate the server certificate. See also [node.js driver \"Validate Server Certificate and Present Valid Certificate\" docs][driver-ssl-all].\n- `NONE` - No SSL (Not recommended).\n- `UNVALIDATED` - Use SSL but do not perform any validation of the certificate chain. See also [node.js driver \"No Certificate Validation\" docs][driver-ssl-none]. **Very** not recommended and likely to be deprecated in future releases because it exposes potential Man-In-The-Middle attack vectors.\n\n#### See also\n\n- [node.js driver SSL implementation][driver-ssl-impl]\n- [node.js driver SSL tutorial][driver-ssl-tutorial]\n\n### SSH TUNNEL\n\n> New in mongodb-connection-model@5.0.0\n\nBecause [authentication](#authentication) is quite difficult for operators to migrate to, the most common method of securing a MongoDB deployment is to use an [SSH tunnel][sf-ssh-tunnel].  This allows operators to leverage their existing SSH security infrastructure to also provide secure access to MongoDB.  For a standard deployment of MongoDB on AWS, this is almost always to strategy.  Because of this, we now support creating SSH tunnels automatically when connecting to MongoDB.\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options, (connectionError, client) => {\n  if (connectionError) {\n    return console.log(connectionError);\n  }\n\n  client.db('mongodb').collection('fanclub').count((countingError, count) => {\n    console.log('counted:', countingError, count);\n    client.close();\n  });\n});\n```\n\nThe above provides the same functionality as creating the tunnel using the bash\ncommand below and connecting to MongoDB via another terminal. Notice that\nconnection-model uses a random local port each time it creates a tunnel.\nUsing the command line, you'd have to replace `<random port>` with an actual\nport number.\n\n```bash\nssh -i ~/.ssh/my-key-aws-pair.pem -L <random port>:localhost:27017 ubuntu@ec2-11-111-111-111.compute-1.amazonaws.com\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `sshTunnel` | String | The desired SSH tunnel strategy. Possible values: `NONE`, `USER_PASSWORD`, `IDENTITY_FILE` | `undefined` |\n| `sshTunnelHostname` | String | The hostname of the SSH remote host | `undefined` |\n| `sshTunnelPort` | Port | The SSH port of the remote host | `22` |\n| `sshTunnelBindToLocalPort` | Port | Bind the localhost endpoint of the SSH Tunnel to this port | `undefined` |\n| `sshTunnelUsername` | String | The optional SSH username for the remote host | `undefined` |\n| `sshTunnelPassword` | String | The optional SSH password for the remote host | `undefined` |\n| `sshTunnelIdentityFile` | String/Array | The optional path to the SSH identity file for the remote host | `undefined` |\n| `sshTunnelPassphrase` | String | The optional passphrase for `sshTunnelIdentityFile` | `undefined` |\n\nDescription of `sshTunnel` values:\n\n- `NONE` - Do not use SSH tunneling.\n- `USER_PASSWORD` - The tunnel is created with SSH username and password only.\n- `IDENTITY_FILE` - The tunnel is created using an identity file.\n\n## Derived Properties\n\nDerived properties (also known as computed properties) are properties of the state object that depend on other properties to determine their value.\n\n```javascript\nconst c = new Connection();\nconst derivedProps = c.getAttributes({ derived: true });\n```\n\n| Derived Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `instanceId` | String | The mongoscope | `localhost:27017` |\n| `driverAuthMechanism` | String | Converts the value of `authStrategy` for humans into the `authMechanism` value for the driver | `undefined` |\n| `safeUrl` | String | The URL where a password is replaced with stars | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrl` | String | Use this URL in order to connect via DataService | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrlWithSsh` | String | Use this URL in order to connect via connection model itself | `mongodb://localhost:29201/?readPreference=primary&ssl=false` |\n| `driverOptions` | String | The second argument `mongoscope-server` passes to `mongodb.connect` | `{}` |\n\n## Events\n\n> New in mongodb-connection-model@5.0.0\n\n#### Example: SSH Tunnel\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', skipped: true,\n  reason: 'The selected SSL mode does not need to load any files.' }\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', complete: true}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n#### Example: SSL\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  ssl: 'ALL',\n  sslCA: '~/.ssl/my-ca.pem',\n  sslCert: '~/.ssl/my-server.pem',\n  sslKey: '~/.ssl/my-server.pem'\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', complete: true}\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', skipped: true,\n  reason: 'The selected SSH Tunnel mode is NONE.'}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n[workflow_img]: https://github.com/mongodb-js/connection-model/workflows/Check%20and%20Test/badge.svg?event=push\n[workflow_url]: https://github.com/mongodb-js/connection-model/actions?query=workflow%3A%22Check+and+Test%22\n[npm_img]: https://img.shields.io/npm/v/mongodb-connection-model.svg?style=flat-square\n[npm_url]: https://www.npmjs.org/package/mongodb-connection-model\n[gitter_img]: https://badges.gitter.im/Join%20Chat.svg\n[gitter_url]: http://gitter.im/mongodb-js/mongodb-js\n[enterprise_img]: https://img.shields.io/badge/MongoDB-Enterprise-blue.svg?style=flat-square\n[coming_soon_img]: https://img.shields.io/badge/-Coming%20Soon-ff69b4.svg?style=flat-square\n[kerberos-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/kerberos_tests.js\n[ldap-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ldap_tests.js\n[x509-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ssl_x509_tests.js\n[ns]: https://github.com/mongodb-js/ns\n[sf-ssh-tunnel]: http://serverfault.com/questions/597765/how-to-connect-to-mongodb-server-via-ssh-tunnel\n[ec2-key-pairs]: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html\n[driver-ssl-impl]: https://github.com/christkv/mongodb-core/blob/c3d21cb636d74d7a68134ecd3b9f6af536311279/lib/connection/connection.js#L365-L407\n[driver-ssl-tutorial]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/\n[driver-ssl-none]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#no-certificate-validation\n[driver-ssl-server]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate\n[driver-ssl-all]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate-and-present-valid-certificate\n","gitHead":"7bfb57937adf16eda85ca92547ea5711d120b4c1","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","test":"mocha","check":"npm run lint && npm run depcheck","pretest":"mongodb-runner install && mongodb-runner start --port=27018","test-ci":"npm run test","depcheck":"depcheck","posttest":"mongodb-runner stop --port=27018","posttest-ci":"node ../../scripts/killall-mongo.js","test-check-ci":"npm run check && npm test"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.17.0+x64 (linux)","description":"MongoDB connection model","directories":{},"_nodeVersion":"16.17.0","compass:main":"index.js","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","debug":"^4.2.0","lodash":"^4.17.15","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.2.0","storage-mixin":"0.0.0-next-7bfb57937adf16eda85ca92547ea5711d120b4c1","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.2","@mongodb-js/ssh-tunnel":"0.0.0-next-7bfb57937adf16eda85ca92547ea5711d120b4c1","@mongodb-js/compass-utils":"0.0.0-next-7bfb57937adf16eda85ca92547ea5711d120b4c1","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.6.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"^4.13.0","depcheck":"^1.4.1","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.10.0","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^4.13.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_0.0.0-next-7bfb57937adf16eda85ca92547ea5711d120b4c1_1675715924831_0.9274044508212174","host":"s3://npm-registry-packages"}},"0.0.0-next-3b389244f7eb06219ec1e923cac29b45a6ec3e84":{"name":"mongodb-connection-model","version":"0.0.0-next-3b389244f7eb06219ec1e923cac29b45a6ec3e84","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@0.0.0-next-3b389244f7eb06219ec1e923cac29b45a6ec3e84","maintainers":[{"name":"mongo-j","email":"james.wang@mongodb.com"},{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"iteng@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"f5a6b99e059746c559b5031e6f1601aae92ce35c","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-0.0.0-next-3b389244f7eb06219ec1e923cac29b45a6ec3e84.tgz","fileCount":20,"integrity":"sha512-9Tkya68mDW6rmHf2HzB1h2q7GSzdiyhCHg8yuS4pyaGRwsaNRrD2qXb2E+8VvXXnbUjygHsceLGYl5YSGuNHrA==","signatures":[{"sig":"MEUCIEGdHZC4RluvQw41NjsQ2XUqImCbFHJnwGrtb/89SfeYAiEAgPQkGGOeSo76mRaj0ZIXCz2f0vKM96vKaNh2HpWHKBA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":108152,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj4WWjACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmogyBAAoR8V+weByWvWAb2DXYk8IIsK7YpdLZvs+3b8OMV4sqxIrJvQ\r\nJQwJBiFlNGUkZCJjRAPYPv0KugdvHxmQo6v5zxJuPi3u8wR4KRY+vfJPqeHh\r\nQa46cR2rjc+InuOb0Yq3PsSwazDjeUDEXfwrpKdDq4MCNtoh6XMgSvz/n32Q\r\nNKw46kFn/k4xE1HcPATsOndMks4mj0zjsHZcLdgkPtIXoYjY7RS2TrY2duFE\r\nq5m5IYWFcz47QHa0D3hwlyXlgNynkY9l+llFGa+Igxj1EPLjO1Vr/Qqfx7Tf\r\nrzu0lTGQvFc6kazumhJmjj4hMNLm59M7QTepYisHrHbwFxciRxKWn6T7oF3b\r\naP8R4jsSvoAEgHdOaHk/y3+WhPtM/eS22/qJZk5qpAmsx1OXQsIHxSFIJQC4\r\nNJvARkGJZyHO5AIp1RrqwidtDZzWGTdrXDRU6N/HajgKOEYWQzCq1Q9eqZfw\r\nN+ueuLKRXUfXJcdpd5o5lgADjtOkRRyocw8EcRvZBbRnI+B9pL30SebzQwIF\r\nmOVHjqEiRHdzXLU0YOa1+3fmfW28ojQP65Ho68mQ25cjdkAaoSQBhKq4kdzS\r\nsnrApW8AV09mkCznpz4OwuR8S20OWybhZYHQymN1p3NRhPNkeW0eg7mK0pNv\r\nloeA0dVq8oCk819dkjk5pOighFVGkPfJQXY=\r\n=TBsr\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","readme":"# mongodb-connection-model [![][workflow_img]][workflow_url] [![][npm_img]][npm_url]\n\n> MongoDB connection model\n\nThe main purpose of the MongoDB connection model is to be a domain model around a MongoDB connection. It encapsulates generating a [Connection String URI](https://docs.mongodb.com/manual/reference/connection-string/) from a group of attributes and parses URI using the [MongoDB Node.JS Driver URI Parser](https://github.com/mongodb-js/mongodb-core/blob/master/lib/uri_parser.js).\n\n## Installation\n\n```\nnpm install --save mongodb-connection-model\n```\n\n## Usage\n\n### Building URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\nconst c = new Connection({ appname: 'My App Name' });\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://localhost:27017/?readPreference=primary&appname=My%20App&ssl=false'\n```\n\n### Parsing URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\n\nConnection.from(\n  'mongodb://someUsername:testPassword@localhost',\n  (error, result) => {\n    console.log(result);\n    >>> `{\n      hosts: [{ host: 'localhost', port: 27017 }],\n      hostname: 'localhost',\n      port: 27017,\n      auth: {\n        username: 'someUsername',\n        password: 'testPassword',\n        db: 'admin'\n      },\n      isSrvRecord: false,\n      authStrategy: 'MONGODB',\n      mongodbUsername: 'someUsername',\n      mongodbPassword: 'testPassword',\n      mongodbDatabaseName: 'admin',\n      extraOptions: {},\n      connectionType: 'NODE_DRIVER',\n      readPreference: 'primary',\n      kerberosCanonicalizeHostname: false,\n      sslMethod: 'NONE',\n      sshTunnel: 'NONE',\n      sshTunnelPort: 22\n    }`\n  }\n);\n```\n\n## Properties\n\nMongoDB connection model is based on Ampersand.js framework and consist of [props](https://ampersandjs.com/docs/#ampersand-state-props) and [derived props](https://ampersandjs.com/docs/#ampersand-state-derived). The props object describes the observable properties that MongoDB connection model gets from the Node.js Driver API.\n\n```javascript\nconst с = new Connection();\nconst props = с.getAttributes({ props: true });\n```\n\n#### See Also\n\n- [URI Generic Syntax](https://tools.ietf.org/html/rfc3986)\n- [URI Options Specification](https://github.com/mongodb/specifications/blob/master/source/uri-options/uri-options.rst)\n\n### General Properties\n\n```javascript\nconst c = new Connection({ isSrvRecord: true });\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ns` | String | A valid [ns][ns] the user can read from | `undefined` |\n| `isSrvRecord` | Boolean | Indicates SRV record | `false` |\n| `auth` | Object | Authentication from driver (username, user, db, password) | `undefined` |\n| `hostname` | String | Hostname of a MongoDB Instance. In case of the replica set the first host and port will be taken | `localhost` |\n| `port` | Number | TCP port of a MongoDB Instance | `27017` |\n| `hosts` | Array | Contains all hosts and ports for replica set | `[{ host: 'localhost', port: 27017 }]` |\n| `extraOptions` | Object | Extra options passed to the node driver as part of `driverOptions` | `{}` |\n| `connectionType` | String | The desired connection type. Possible values: `NODE_DRIVER`, `STITCH_ON_PREM`, `STITCH_ATLAS` | `NODE_DRIVER` |\n| `authStrategy` | String | The desired authentication strategy. Possible values: `NONE`, `MONGODB`, `X509`, `KERBEROS`, `LDAP`, `SCRAM-SHA-256` | `NONE` |\n\n### Connection string options\n\n```javascript\nconst c = new Connection({ appname: 'My App', replicaSet: 'testing' });\n```\n\n#### General connection string options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `replicaSet` | String | Specifies the name of the replica set, if the mongod is a member of a replica set | `undefined` |\n| `connectTimeoutMS` | Number | The time in milliseconds to attempt a connection before timing out | `undefined` |\n| `socketTimeoutMS` | Number | The time in milliseconds to attempt a send or receive on a socket before the attempt times out | `undefined` |\n| `compression` | Object | Object includes compressors and a compression level. The following compressors can be specified: `snappy`, `zlib` (Available in MongoDB 3.6 or greater) | `undefined` |\n\n#### Connection Pool Option\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `maxPoolSize` | Number | The maximum number of connections in the connection pool | `undefined` |\n| `minPoolSize` | Number | The minimum number of connections in the connection pool | `undefined` |\n| `maxIdleTimeMS` | Number | The maximum number of milliseconds that a connection can remain idle in the pool before being removed and closed | `undefined` |\n| `waitQueueMultiple` | Number | A number that the driver multiples the maxPoolSize value to, to provide the maximum number of threads allowed to wait for a connection to become available from the pool | `undefined` |\n| `waitQueueTimeoutMS` | Number | The maximum time in milliseconds that a thread can wait for a connection to become available | `undefined` |\n\n#### Write Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `w` | Number/String | Corresponds to the write concern [w Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-w) | `undefined` |\n| `wTimeoutMS` | Number | Corresponds to the write concern [wtimeout](https://docs.mongodb.com/manual/reference/write-concern/#wc-wtimeout) | `undefined` |\n| `journal` | Boolean | Corresponds to the write concern [j Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-j) | `undefined` |\n\n#### Read Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readConcernLevel` | String | The level of isolation | `undefined` |\n\n#### Read Preference Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readPreference` | String | Specifies the read preferences for this connection. Possible values: `PRIMARY`, `PRIMARY_PREFERRED`, `SECONDARY`, `SECONDARY_PREFERRED`, `NEAREST` | `PRIMARY` |\n| `maxStalenessSeconds` | Number | Specifies, in seconds, how stale a secondary can be before the client stops using it for read operations | `undefined` |\n| `readPreferenceTags` | Object | Default read preference tags for the client | `undefined` |\n\n#### Authentication Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `authSource` | String | Specify the database name associated with the user’s credentials | `undefined` |\n| `authMechanism` | String | Specifies the authentication mechanism that MongoDB will use to authenticate the connection. Possible values: `DEFAULT`, `GSSAPI`, `MONGODB-X509`, `PLAIN`, `SCRAM-SHA-256` | `undefined` |\n| `authMechanismProperties` | Object | Additional options provided for authentication (e.g. to enable hostname canonicalization for GSSAPI) | `undefined` |\n| `gssapiServiceName` | String | Set the Kerberos service name when connecting to Kerberized MongoDB instances | `undefined` |\n| `gssapiServiceRealm` | String | Set the Realm service name | `undefined` |\n| `gssapiCanonicalizeHostName` | Boolean | Whether canonicalized hostname | `undefined` |\n\n#### Server Selection and Discovery Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `localThresholdMS` | Number | The size (in milliseconds) of the latency window for selecting among multiple suitable MongoDB instances | `undefined` |\n| `serverSelectionTimeoutMS` | Number | Specifies how long (in milliseconds) to block for server selection before throwing an exception | `undefined` |\n| `serverSelectionTryOnce` | Boolean | Instructs the driver to scan the MongoDB deployment exactly once after server selection fails and then either select a server or raise an error | `undefined` |\n| `heartbeatFrequencyMS` | Number | Controls when the driver checks the state of the MongoDB deployment | `undefined` |\n\n#### Miscellaneous Configuration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `appname` | String | An application name passed to server as client metadata | `undefined` |\n| `retryWrites` | Boolean | Enable retryable writes | `undefined` |\n| `uuidRepresentation` | String | The legacy representation of UUID. Possible values: `standard`, `csharpLegacy`, `javaLegacy`, `pythonLegacy` | `undefined` |\n| `loadBalanced` | Boolean | Whether or not the server is running in load balanced mode | `undefined` |\n\n### Stitch attributes\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `stitchServiceName` | String | Stitch service name | `undefined` |\n| `stitchClientAppId` | String | Stitch сlient app ID | `undefined` |\n| `stitchGroupId` | String | Stitch group ID | `undefined` |\n| `stitchBaseUrl` | String | Stitch base Url | `undefined` |\n\n### MONGODB authentication\n\n```javascript\nconst c = new Connection({\n  mongodbUsername: 'arlo',\n  mongodbPassword: 'w@of'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/?slaveOk=true&authSource=admin'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `mongodbUsername` | String | MongoDB username | `undefined` |\n| `mongodbPassword` | String | MongoDB password | `undefined` |\n| `mongodbDatabaseName` | String | The database name associated with the user's credentials | `undefined` |\n| `promoteValues` | Boolean | Whether BSON values should be promoted to their JS type counterparts | `undefined` |\n\n### KERBEROS authentication\n\n```javascript\nconst c = new Connection({\n  kerberosServiceName: 'mongodb',\n  kerberosPrincipal: 'arlo/dog@krb5.mongodb.parts',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo%252Fdog%2540krb5.mongodb.parts@localhost:27017/toys?authMechanism=GSSAPI'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n> @note (imlucas): Kerberos on Windows is broken out as it's own state for UX consideration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `kerberosServiceName` | String | Any program or computer you access over a network | `undefined` |\n| `kerberosPrincipal` | String | The format of a typical Kerberos V5 principal is `primary/instance@REALM` | `undefined` |\n| `kerberosCanonicalizeHostname` | Boolean | Whether canonicalized kerberos hostname | `undefined` |\n\n#### See Also\n\n- [node.js driver Kerberos reference](http://bit.ly/mongodb-node-driver-kerberos)\n- [node.js driver Kerberos functional test][kerberos-functional]\n\n### LDAP authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  ldapUsername: 'arlo',\n  ldapPassword: 'w@of',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/toys?slaveOk=true&authMechanism=PLAIN'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ldapUsername` | String | LDAP username | `undefined` |\n| `ldapPassword` | String | LDAP password | `undefined` |\n\n#### See Also\n\n- [node.js driver LDAP reference](http://bit.ly/mongodb-node-driver-ldap)\n- [node.js driver X509 functional test][ldap-functional]\n\n### X509 authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  x509Username: 'CN=client,OU=arlo,O=MongoDB,L=Philadelphia,ST=Pennsylvania,C=US'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://CN%253Dclient%252COU%253Darlo%252CO%253DMongoDB%252CL%253DPhiladelphia%252CST%253DPennsylvania%252CC%253DUS@localhost:27017?slaveOk=true&authMechanism=MONGODB-X509'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `x509Username` | String | The x.509 certificate derived user name, e.g. `CN=user,OU=OrgUnit,O=myOrg,...` | `undefined` |\n\n#### See Also\n\n- [node.js driver X509 reference](http://bit.ly/mongodb-node-driver-x509)\n- [node.js driver X509 functional test][x509-functional]\n\n### SSL\n\n> **Note**: Not to be confused with `authentication=X509`\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ssl` | Number/String | A boolean to enable or disables TLS/SSL for the connection | `undefined` |\n| `sslMethod` | String | The desired ssl method. Possible values: `NONE`, `SYSTEMCA`, `IFAVAILABLE`, `UNVALIDATED`, `SERVER`, `ALL` | `NONE` |\n| `sslCA` | Buffer/String | Array of valid certificates | `undefined` |\n| `sslCert` | Buffer/String | The certificate | `undefined` |\n| `sslKey` | Buffer/String | The certificate private key | `undefined` |\n| `sslPass` | Buffer/String | The certificate password | `undefined` |\n\nDescription of `sslMethod` values:\n\n- `SYSTEMCA` - SSL required, validate using System CA, with host verification.\n- `IFAVAILABLE` - The driver should try SSL first, fall back to no SSL if unavailable, and use the system's Certificate Authority.\n- `SERVER` - The driver should validate the server certificate and fail to connect if validation fails. See also [node.js driver \"Validate Server Certificate\" docs][driver-ssl-server].\n- `ALL` - The driver must present a valid certificate and validate the server certificate. See also [node.js driver \"Validate Server Certificate and Present Valid Certificate\" docs][driver-ssl-all].\n- `NONE` - No SSL (Not recommended).\n- `UNVALIDATED` - Use SSL but do not perform any validation of the certificate chain. See also [node.js driver \"No Certificate Validation\" docs][driver-ssl-none]. **Very** not recommended and likely to be deprecated in future releases because it exposes potential Man-In-The-Middle attack vectors.\n\n#### See also\n\n- [node.js driver SSL implementation][driver-ssl-impl]\n- [node.js driver SSL tutorial][driver-ssl-tutorial]\n\n### SSH TUNNEL\n\n> New in mongodb-connection-model@5.0.0\n\nBecause [authentication](#authentication) is quite difficult for operators to migrate to, the most common method of securing a MongoDB deployment is to use an [SSH tunnel][sf-ssh-tunnel].  This allows operators to leverage their existing SSH security infrastructure to also provide secure access to MongoDB.  For a standard deployment of MongoDB on AWS, this is almost always to strategy.  Because of this, we now support creating SSH tunnels automatically when connecting to MongoDB.\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options, (connectionError, client) => {\n  if (connectionError) {\n    return console.log(connectionError);\n  }\n\n  client.db('mongodb').collection('fanclub').count((countingError, count) => {\n    console.log('counted:', countingError, count);\n    client.close();\n  });\n});\n```\n\nThe above provides the same functionality as creating the tunnel using the bash\ncommand below and connecting to MongoDB via another terminal. Notice that\nconnection-model uses a random local port each time it creates a tunnel.\nUsing the command line, you'd have to replace `<random port>` with an actual\nport number.\n\n```bash\nssh -i ~/.ssh/my-key-aws-pair.pem -L <random port>:localhost:27017 ubuntu@ec2-11-111-111-111.compute-1.amazonaws.com\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `sshTunnel` | String | The desired SSH tunnel strategy. Possible values: `NONE`, `USER_PASSWORD`, `IDENTITY_FILE` | `undefined` |\n| `sshTunnelHostname` | String | The hostname of the SSH remote host | `undefined` |\n| `sshTunnelPort` | Port | The SSH port of the remote host | `22` |\n| `sshTunnelBindToLocalPort` | Port | Bind the localhost endpoint of the SSH Tunnel to this port | `undefined` |\n| `sshTunnelUsername` | String | The optional SSH username for the remote host | `undefined` |\n| `sshTunnelPassword` | String | The optional SSH password for the remote host | `undefined` |\n| `sshTunnelIdentityFile` | String/Array | The optional path to the SSH identity file for the remote host | `undefined` |\n| `sshTunnelPassphrase` | String | The optional passphrase for `sshTunnelIdentityFile` | `undefined` |\n\nDescription of `sshTunnel` values:\n\n- `NONE` - Do not use SSH tunneling.\n- `USER_PASSWORD` - The tunnel is created with SSH username and password only.\n- `IDENTITY_FILE` - The tunnel is created using an identity file.\n\n## Derived Properties\n\nDerived properties (also known as computed properties) are properties of the state object that depend on other properties to determine their value.\n\n```javascript\nconst c = new Connection();\nconst derivedProps = c.getAttributes({ derived: true });\n```\n\n| Derived Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `instanceId` | String | The mongoscope | `localhost:27017` |\n| `driverAuthMechanism` | String | Converts the value of `authStrategy` for humans into the `authMechanism` value for the driver | `undefined` |\n| `safeUrl` | String | The URL where a password is replaced with stars | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrl` | String | Use this URL in order to connect via DataService | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrlWithSsh` | String | Use this URL in order to connect via connection model itself | `mongodb://localhost:29201/?readPreference=primary&ssl=false` |\n| `driverOptions` | String | The second argument `mongoscope-server` passes to `mongodb.connect` | `{}` |\n\n## Events\n\n> New in mongodb-connection-model@5.0.0\n\n#### Example: SSH Tunnel\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', skipped: true,\n  reason: 'The selected SSL mode does not need to load any files.' }\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', complete: true}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n#### Example: SSL\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  ssl: 'ALL',\n  sslCA: '~/.ssl/my-ca.pem',\n  sslCert: '~/.ssl/my-server.pem',\n  sslKey: '~/.ssl/my-server.pem'\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', complete: true}\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', skipped: true,\n  reason: 'The selected SSH Tunnel mode is NONE.'}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n[workflow_img]: https://github.com/mongodb-js/connection-model/workflows/Check%20and%20Test/badge.svg?event=push\n[workflow_url]: https://github.com/mongodb-js/connection-model/actions?query=workflow%3A%22Check+and+Test%22\n[npm_img]: https://img.shields.io/npm/v/mongodb-connection-model.svg?style=flat-square\n[npm_url]: https://www.npmjs.org/package/mongodb-connection-model\n[gitter_img]: https://badges.gitter.im/Join%20Chat.svg\n[gitter_url]: http://gitter.im/mongodb-js/mongodb-js\n[enterprise_img]: https://img.shields.io/badge/MongoDB-Enterprise-blue.svg?style=flat-square\n[coming_soon_img]: https://img.shields.io/badge/-Coming%20Soon-ff69b4.svg?style=flat-square\n[kerberos-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/kerberos_tests.js\n[ldap-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ldap_tests.js\n[x509-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ssl_x509_tests.js\n[ns]: https://github.com/mongodb-js/ns\n[sf-ssh-tunnel]: http://serverfault.com/questions/597765/how-to-connect-to-mongodb-server-via-ssh-tunnel\n[ec2-key-pairs]: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html\n[driver-ssl-impl]: https://github.com/christkv/mongodb-core/blob/c3d21cb636d74d7a68134ecd3b9f6af536311279/lib/connection/connection.js#L365-L407\n[driver-ssl-tutorial]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/\n[driver-ssl-none]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#no-certificate-validation\n[driver-ssl-server]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate\n[driver-ssl-all]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate-and-present-valid-certificate\n","gitHead":"3b389244f7eb06219ec1e923cac29b45a6ec3e84","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","test":"mocha","check":"npm run lint && npm run depcheck","pretest":"mongodb-runner install && mongodb-runner start --port=27018","test-ci":"npm run test","depcheck":"depcheck","posttest":"mongodb-runner stop --port=27018","posttest-ci":"node ../../scripts/killall-mongo.js","test-check-ci":"npm run check && npm test"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.17.0+x64 (linux)","description":"MongoDB connection model","directories":{},"_nodeVersion":"16.17.0","compass:main":"index.js","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","debug":"^4.2.0","lodash":"^4.17.15","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.2.0","storage-mixin":"0.0.0-next-3b389244f7eb06219ec1e923cac29b45a6ec3e84","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.2","@mongodb-js/ssh-tunnel":"0.0.0-next-3b389244f7eb06219ec1e923cac29b45a6ec3e84","@mongodb-js/compass-utils":"0.0.0-next-3b389244f7eb06219ec1e923cac29b45a6ec3e84","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.6.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"^4.13.0","depcheck":"^1.4.1","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.10.0","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^4.13.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_0.0.0-next-3b389244f7eb06219ec1e923cac29b45a6ec3e84_1675716002809_0.8568591887401042","host":"s3://npm-registry-packages"}},"22.2.1":{"name":"mongodb-connection-model","version":"22.2.1","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@22.2.1","maintainers":[{"name":"mongo-j","email":"james.wang@mongodb.com"},{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"iteng@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"e3ba3d0750769bf04bd54bed39d4353839ba40b5","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-22.2.1.tgz","fileCount":20,"integrity":"sha512-CGJ8zFNTfP2EOpoV36MHl767dkMDt4o+HIsxGWtUi7BSSieAJF0t4EE8fleInfJLQueD/Qaiq4zAGgwBjl+lgg==","signatures":[{"sig":"MEQCIGaOX4mgnrtYFcrE0PAUf1CWkCn3jDUvRbD3d9Y9Vvv3AiBsGvZHvK655zBF1NOuwPXszOkpHHMsuhL7UE+lbNneYA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":107972,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj4lA6ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoVJw/+JVUPTpUfcEk5v893gqKujg1HvT11mImynz6Yh4nzvWXGdsjT\r\nVXCOHTpaVyveCusOqxhZzWPStUhdIwKHKJn6qDydvCqdqprFyyHPJeBeGmoo\r\n+fZyWg1U2HMyQ63ylKQWpXZHkYMGw8n2BbakNvTDDC4HP0JZ42gmdvjjERgU\r\nwNfNva95E0sq0ZEv1KQeSfT5DgMEFIPf7W/nbVyqjZSQ0NBCE7/Agb7vv5qE\r\nPFaWqYGbspl0sNppk89L2pys/YmWT50Uga+2It2GIpskX3Ck+ajmwdjNmn33\r\nd5S5SNAsRJqSVij7pSCdCs4bKSm5Z63DU0jkIyB8nwOix8NaFcGU10LQAamq\r\nkjfJNdFcvK9Kud96O6pFCV0ibPtJD/2Cmuz5H/GFPngmoJMyct8Dzr0SrcIB\r\n7MbfhlUStrM6wkMSw0vKcC+AGt9QhXqTVbnI1fhMIBj5Hf2Yw5/dfpQ9lQqO\r\nSjRa+oeNjVs1MYATwfqrSPPAVUTE0wKHOtAGvGIV7io9YpCiTHAFhu6Pj67a\r\nV4COlhnKU7pSiD1SNEymuVvz5KKKHqbl5YbdUq8beRmD9k6+KQ1W3kcM7Olz\r\n9KT12hfmcuiV9EPjm2s95VXCVuQbn/ZDoSHJYfASteemyCJD4mCvhInf9yyp\r\nMvNHKPK+y3r6fBDJJ0hCXfP+oSmynyTsZa4=\r\n=i3h7\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","gitHead":"b625bfb4b1c028513e232069ca2f56b14ffa5422","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","test":"mocha","check":"npm run lint && npm run depcheck","pretest":"mongodb-runner install && mongodb-runner start --port=27018","test-ci":"npm run test","depcheck":"depcheck","posttest":"mongodb-runner stop --port=27018","posttest-ci":"node ../../scripts/killall-mongo.js","test-check-ci":"npm run check && npm test"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.19.0+x64 (linux)","description":"MongoDB connection model","directories":{},"_nodeVersion":"16.19.0","compass:main":"index.js","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","debug":"^4.2.0","lodash":"^4.17.15","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.2.0","storage-mixin":"^5.1.1","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.2","@mongodb-js/ssh-tunnel":"^2.0.2","@mongodb-js/compass-utils":"^0.2.1","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.6.0"},"_hasShrinkwrap":false,"devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"^4.13.0","depcheck":"^1.4.1","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.10.0","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^4.13.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_22.2.1_1675776058599_0.9226946457514722","host":"s3://npm-registry-packages"}},"0.0.0-next-014cd3f52319f9c3e62d458f4c10e0af7ae98052":{"name":"mongodb-connection-model","version":"0.0.0-next-014cd3f52319f9c3e62d458f4c10e0af7ae98052","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@0.0.0-next-014cd3f52319f9c3e62d458f4c10e0af7ae98052","maintainers":[{"name":"mongo-j","email":"james.wang@mongodb.com"},{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"iteng@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"21c9e74468456ae94b896611f1736afb5b85bbf8","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-0.0.0-next-014cd3f52319f9c3e62d458f4c10e0af7ae98052.tgz","fileCount":20,"integrity":"sha512-j50pu7b54CMW/XSG1owTejndtOJHw1I7JshfJ32kiJ2dhnj3VP7wB+hxhiiDxaGx7NF4zmc+68pNAGz7cNSu/Q==","signatures":[{"sig":"MEUCIHgK9FUIHKOPYX+wf7uvE4ho+wrM4QzrrlzpGv5or1ETAiEA8VrSrxGiAxRSItm2b7AosXEh4AC9iXphuSHy6l3CkDw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":108152,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj6siXACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpiBQ//bM0r38DWGD6KXxUFcK79VwSFJqtvQUSckMqVzSDJE1rnfkWg\r\ngCG3QSVHFWS+L9przRjkSOZliUvE0UdcjRbHO/gph3/ImeU9ixhskKcBdSos\r\nqrjnF0QknZ3VSjbCp50brBQbOLoQ/SLcfYQ5ujZkGTdIdQ/a01hnR2dKk5B/\r\nkr7ovkCxm4lKAPa88t55quFlvfc+cHHUJfaAQBRnohnf5MA3TV3coog4B24Y\r\naWWhrdEX4pZUCmPm7gzlQYYilJYi1MTi2eDPWA2H/pm1G9K26ty4wUs1i2d3\r\nbazNOKDH1H5cqeigrfzQ/nGRwJkaRhw2ETuxd2hPcFV5iql9yc/2U4aTwK1O\r\n3r55tzDkDYXQqmiTSG7k1GuhMftXU826VK15A+Avs3EmidIQdS+uCdjGH/80\r\nf1ppil5RSynhrdYB6lkItpmGeNhkKPE4hjaAY9z0yfx5TqniwvL3IEKV4Vrh\r\nMhLVJCtfXP7EJBFLjwPskxMSuKNzpg6afRFt9R8WYpY2zsvWIFSYvfoxe4c7\r\nJpcbxy2Epl7oysLHQzwmsgZTGjW2X2EHeoBLFrXWg+ctUIcid6IbgzlMV2Es\r\nVTBP5buYbt1HZdqxIWCtKbmQNCyVdoPB4A50sssGpQuUM1M4uZKE7mF6OVr3\r\nxxc92fXMNAWWBMqQOtpdY0pYlumuSVidpF0=\r\n=akAU\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","readme":"# mongodb-connection-model [![][workflow_img]][workflow_url] [![][npm_img]][npm_url]\n\n> MongoDB connection model\n\nThe main purpose of the MongoDB connection model is to be a domain model around a MongoDB connection. It encapsulates generating a [Connection String URI](https://docs.mongodb.com/manual/reference/connection-string/) from a group of attributes and parses URI using the [MongoDB Node.JS Driver URI Parser](https://github.com/mongodb-js/mongodb-core/blob/master/lib/uri_parser.js).\n\n## Installation\n\n```\nnpm install --save mongodb-connection-model\n```\n\n## Usage\n\n### Building URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\nconst c = new Connection({ appname: 'My App Name' });\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://localhost:27017/?readPreference=primary&appname=My%20App&ssl=false'\n```\n\n### Parsing URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\n\nConnection.from(\n  'mongodb://someUsername:testPassword@localhost',\n  (error, result) => {\n    console.log(result);\n    >>> `{\n      hosts: [{ host: 'localhost', port: 27017 }],\n      hostname: 'localhost',\n      port: 27017,\n      auth: {\n        username: 'someUsername',\n        password: 'testPassword',\n        db: 'admin'\n      },\n      isSrvRecord: false,\n      authStrategy: 'MONGODB',\n      mongodbUsername: 'someUsername',\n      mongodbPassword: 'testPassword',\n      mongodbDatabaseName: 'admin',\n      extraOptions: {},\n      connectionType: 'NODE_DRIVER',\n      readPreference: 'primary',\n      kerberosCanonicalizeHostname: false,\n      sslMethod: 'NONE',\n      sshTunnel: 'NONE',\n      sshTunnelPort: 22\n    }`\n  }\n);\n```\n\n## Properties\n\nMongoDB connection model is based on Ampersand.js framework and consist of [props](https://ampersandjs.com/docs/#ampersand-state-props) and [derived props](https://ampersandjs.com/docs/#ampersand-state-derived). The props object describes the observable properties that MongoDB connection model gets from the Node.js Driver API.\n\n```javascript\nconst с = new Connection();\nconst props = с.getAttributes({ props: true });\n```\n\n#### See Also\n\n- [URI Generic Syntax](https://tools.ietf.org/html/rfc3986)\n- [URI Options Specification](https://github.com/mongodb/specifications/blob/master/source/uri-options/uri-options.rst)\n\n### General Properties\n\n```javascript\nconst c = new Connection({ isSrvRecord: true });\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ns` | String | A valid [ns][ns] the user can read from | `undefined` |\n| `isSrvRecord` | Boolean | Indicates SRV record | `false` |\n| `auth` | Object | Authentication from driver (username, user, db, password) | `undefined` |\n| `hostname` | String | Hostname of a MongoDB Instance. In case of the replica set the first host and port will be taken | `localhost` |\n| `port` | Number | TCP port of a MongoDB Instance | `27017` |\n| `hosts` | Array | Contains all hosts and ports for replica set | `[{ host: 'localhost', port: 27017 }]` |\n| `extraOptions` | Object | Extra options passed to the node driver as part of `driverOptions` | `{}` |\n| `connectionType` | String | The desired connection type. Possible values: `NODE_DRIVER`, `STITCH_ON_PREM`, `STITCH_ATLAS` | `NODE_DRIVER` |\n| `authStrategy` | String | The desired authentication strategy. Possible values: `NONE`, `MONGODB`, `X509`, `KERBEROS`, `LDAP`, `SCRAM-SHA-256` | `NONE` |\n\n### Connection string options\n\n```javascript\nconst c = new Connection({ appname: 'My App', replicaSet: 'testing' });\n```\n\n#### General connection string options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `replicaSet` | String | Specifies the name of the replica set, if the mongod is a member of a replica set | `undefined` |\n| `connectTimeoutMS` | Number | The time in milliseconds to attempt a connection before timing out | `undefined` |\n| `socketTimeoutMS` | Number | The time in milliseconds to attempt a send or receive on a socket before the attempt times out | `undefined` |\n| `compression` | Object | Object includes compressors and a compression level. The following compressors can be specified: `snappy`, `zlib` (Available in MongoDB 3.6 or greater) | `undefined` |\n\n#### Connection Pool Option\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `maxPoolSize` | Number | The maximum number of connections in the connection pool | `undefined` |\n| `minPoolSize` | Number | The minimum number of connections in the connection pool | `undefined` |\n| `maxIdleTimeMS` | Number | The maximum number of milliseconds that a connection can remain idle in the pool before being removed and closed | `undefined` |\n| `waitQueueMultiple` | Number | A number that the driver multiples the maxPoolSize value to, to provide the maximum number of threads allowed to wait for a connection to become available from the pool | `undefined` |\n| `waitQueueTimeoutMS` | Number | The maximum time in milliseconds that a thread can wait for a connection to become available | `undefined` |\n\n#### Write Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `w` | Number/String | Corresponds to the write concern [w Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-w) | `undefined` |\n| `wTimeoutMS` | Number | Corresponds to the write concern [wtimeout](https://docs.mongodb.com/manual/reference/write-concern/#wc-wtimeout) | `undefined` |\n| `journal` | Boolean | Corresponds to the write concern [j Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-j) | `undefined` |\n\n#### Read Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readConcernLevel` | String | The level of isolation | `undefined` |\n\n#### Read Preference Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readPreference` | String | Specifies the read preferences for this connection. Possible values: `PRIMARY`, `PRIMARY_PREFERRED`, `SECONDARY`, `SECONDARY_PREFERRED`, `NEAREST` | `PRIMARY` |\n| `maxStalenessSeconds` | Number | Specifies, in seconds, how stale a secondary can be before the client stops using it for read operations | `undefined` |\n| `readPreferenceTags` | Object | Default read preference tags for the client | `undefined` |\n\n#### Authentication Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `authSource` | String | Specify the database name associated with the user’s credentials | `undefined` |\n| `authMechanism` | String | Specifies the authentication mechanism that MongoDB will use to authenticate the connection. Possible values: `DEFAULT`, `GSSAPI`, `MONGODB-X509`, `PLAIN`, `SCRAM-SHA-256` | `undefined` |\n| `authMechanismProperties` | Object | Additional options provided for authentication (e.g. to enable hostname canonicalization for GSSAPI) | `undefined` |\n| `gssapiServiceName` | String | Set the Kerberos service name when connecting to Kerberized MongoDB instances | `undefined` |\n| `gssapiServiceRealm` | String | Set the Realm service name | `undefined` |\n| `gssapiCanonicalizeHostName` | Boolean | Whether canonicalized hostname | `undefined` |\n\n#### Server Selection and Discovery Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `localThresholdMS` | Number | The size (in milliseconds) of the latency window for selecting among multiple suitable MongoDB instances | `undefined` |\n| `serverSelectionTimeoutMS` | Number | Specifies how long (in milliseconds) to block for server selection before throwing an exception | `undefined` |\n| `serverSelectionTryOnce` | Boolean | Instructs the driver to scan the MongoDB deployment exactly once after server selection fails and then either select a server or raise an error | `undefined` |\n| `heartbeatFrequencyMS` | Number | Controls when the driver checks the state of the MongoDB deployment | `undefined` |\n\n#### Miscellaneous Configuration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `appname` | String | An application name passed to server as client metadata | `undefined` |\n| `retryWrites` | Boolean | Enable retryable writes | `undefined` |\n| `uuidRepresentation` | String | The legacy representation of UUID. Possible values: `standard`, `csharpLegacy`, `javaLegacy`, `pythonLegacy` | `undefined` |\n| `loadBalanced` | Boolean | Whether or not the server is running in load balanced mode | `undefined` |\n\n### Stitch attributes\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `stitchServiceName` | String | Stitch service name | `undefined` |\n| `stitchClientAppId` | String | Stitch сlient app ID | `undefined` |\n| `stitchGroupId` | String | Stitch group ID | `undefined` |\n| `stitchBaseUrl` | String | Stitch base Url | `undefined` |\n\n### MONGODB authentication\n\n```javascript\nconst c = new Connection({\n  mongodbUsername: 'arlo',\n  mongodbPassword: 'w@of'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/?slaveOk=true&authSource=admin'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `mongodbUsername` | String | MongoDB username | `undefined` |\n| `mongodbPassword` | String | MongoDB password | `undefined` |\n| `mongodbDatabaseName` | String | The database name associated with the user's credentials | `undefined` |\n| `promoteValues` | Boolean | Whether BSON values should be promoted to their JS type counterparts | `undefined` |\n\n### KERBEROS authentication\n\n```javascript\nconst c = new Connection({\n  kerberosServiceName: 'mongodb',\n  kerberosPrincipal: 'arlo/dog@krb5.mongodb.parts',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo%252Fdog%2540krb5.mongodb.parts@localhost:27017/toys?authMechanism=GSSAPI'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n> @note (imlucas): Kerberos on Windows is broken out as it's own state for UX consideration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `kerberosServiceName` | String | Any program or computer you access over a network | `undefined` |\n| `kerberosPrincipal` | String | The format of a typical Kerberos V5 principal is `primary/instance@REALM` | `undefined` |\n| `kerberosCanonicalizeHostname` | Boolean | Whether canonicalized kerberos hostname | `undefined` |\n\n#### See Also\n\n- [node.js driver Kerberos reference](http://bit.ly/mongodb-node-driver-kerberos)\n- [node.js driver Kerberos functional test][kerberos-functional]\n\n### LDAP authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  ldapUsername: 'arlo',\n  ldapPassword: 'w@of',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/toys?slaveOk=true&authMechanism=PLAIN'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ldapUsername` | String | LDAP username | `undefined` |\n| `ldapPassword` | String | LDAP password | `undefined` |\n\n#### See Also\n\n- [node.js driver LDAP reference](http://bit.ly/mongodb-node-driver-ldap)\n- [node.js driver X509 functional test][ldap-functional]\n\n### X509 authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  x509Username: 'CN=client,OU=arlo,O=MongoDB,L=Philadelphia,ST=Pennsylvania,C=US'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://CN%253Dclient%252COU%253Darlo%252CO%253DMongoDB%252CL%253DPhiladelphia%252CST%253DPennsylvania%252CC%253DUS@localhost:27017?slaveOk=true&authMechanism=MONGODB-X509'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `x509Username` | String | The x.509 certificate derived user name, e.g. `CN=user,OU=OrgUnit,O=myOrg,...` | `undefined` |\n\n#### See Also\n\n- [node.js driver X509 reference](http://bit.ly/mongodb-node-driver-x509)\n- [node.js driver X509 functional test][x509-functional]\n\n### SSL\n\n> **Note**: Not to be confused with `authentication=X509`\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ssl` | Number/String | A boolean to enable or disables TLS/SSL for the connection | `undefined` |\n| `sslMethod` | String | The desired ssl method. Possible values: `NONE`, `SYSTEMCA`, `IFAVAILABLE`, `UNVALIDATED`, `SERVER`, `ALL` | `NONE` |\n| `sslCA` | Buffer/String | Array of valid certificates | `undefined` |\n| `sslCert` | Buffer/String | The certificate | `undefined` |\n| `sslKey` | Buffer/String | The certificate private key | `undefined` |\n| `sslPass` | Buffer/String | The certificate password | `undefined` |\n\nDescription of `sslMethod` values:\n\n- `SYSTEMCA` - SSL required, validate using System CA, with host verification.\n- `IFAVAILABLE` - The driver should try SSL first, fall back to no SSL if unavailable, and use the system's Certificate Authority.\n- `SERVER` - The driver should validate the server certificate and fail to connect if validation fails. See also [node.js driver \"Validate Server Certificate\" docs][driver-ssl-server].\n- `ALL` - The driver must present a valid certificate and validate the server certificate. See also [node.js driver \"Validate Server Certificate and Present Valid Certificate\" docs][driver-ssl-all].\n- `NONE` - No SSL (Not recommended).\n- `UNVALIDATED` - Use SSL but do not perform any validation of the certificate chain. See also [node.js driver \"No Certificate Validation\" docs][driver-ssl-none]. **Very** not recommended and likely to be deprecated in future releases because it exposes potential Man-In-The-Middle attack vectors.\n\n#### See also\n\n- [node.js driver SSL implementation][driver-ssl-impl]\n- [node.js driver SSL tutorial][driver-ssl-tutorial]\n\n### SSH TUNNEL\n\n> New in mongodb-connection-model@5.0.0\n\nBecause [authentication](#authentication) is quite difficult for operators to migrate to, the most common method of securing a MongoDB deployment is to use an [SSH tunnel][sf-ssh-tunnel].  This allows operators to leverage their existing SSH security infrastructure to also provide secure access to MongoDB.  For a standard deployment of MongoDB on AWS, this is almost always to strategy.  Because of this, we now support creating SSH tunnels automatically when connecting to MongoDB.\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options, (connectionError, client) => {\n  if (connectionError) {\n    return console.log(connectionError);\n  }\n\n  client.db('mongodb').collection('fanclub').count((countingError, count) => {\n    console.log('counted:', countingError, count);\n    client.close();\n  });\n});\n```\n\nThe above provides the same functionality as creating the tunnel using the bash\ncommand below and connecting to MongoDB via another terminal. Notice that\nconnection-model uses a random local port each time it creates a tunnel.\nUsing the command line, you'd have to replace `<random port>` with an actual\nport number.\n\n```bash\nssh -i ~/.ssh/my-key-aws-pair.pem -L <random port>:localhost:27017 ubuntu@ec2-11-111-111-111.compute-1.amazonaws.com\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `sshTunnel` | String | The desired SSH tunnel strategy. Possible values: `NONE`, `USER_PASSWORD`, `IDENTITY_FILE` | `undefined` |\n| `sshTunnelHostname` | String | The hostname of the SSH remote host | `undefined` |\n| `sshTunnelPort` | Port | The SSH port of the remote host | `22` |\n| `sshTunnelBindToLocalPort` | Port | Bind the localhost endpoint of the SSH Tunnel to this port | `undefined` |\n| `sshTunnelUsername` | String | The optional SSH username for the remote host | `undefined` |\n| `sshTunnelPassword` | String | The optional SSH password for the remote host | `undefined` |\n| `sshTunnelIdentityFile` | String/Array | The optional path to the SSH identity file for the remote host | `undefined` |\n| `sshTunnelPassphrase` | String | The optional passphrase for `sshTunnelIdentityFile` | `undefined` |\n\nDescription of `sshTunnel` values:\n\n- `NONE` - Do not use SSH tunneling.\n- `USER_PASSWORD` - The tunnel is created with SSH username and password only.\n- `IDENTITY_FILE` - The tunnel is created using an identity file.\n\n## Derived Properties\n\nDerived properties (also known as computed properties) are properties of the state object that depend on other properties to determine their value.\n\n```javascript\nconst c = new Connection();\nconst derivedProps = c.getAttributes({ derived: true });\n```\n\n| Derived Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `instanceId` | String | The mongoscope | `localhost:27017` |\n| `driverAuthMechanism` | String | Converts the value of `authStrategy` for humans into the `authMechanism` value for the driver | `undefined` |\n| `safeUrl` | String | The URL where a password is replaced with stars | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrl` | String | Use this URL in order to connect via DataService | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrlWithSsh` | String | Use this URL in order to connect via connection model itself | `mongodb://localhost:29201/?readPreference=primary&ssl=false` |\n| `driverOptions` | String | The second argument `mongoscope-server` passes to `mongodb.connect` | `{}` |\n\n## Events\n\n> New in mongodb-connection-model@5.0.0\n\n#### Example: SSH Tunnel\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', skipped: true,\n  reason: 'The selected SSL mode does not need to load any files.' }\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', complete: true}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n#### Example: SSL\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  ssl: 'ALL',\n  sslCA: '~/.ssl/my-ca.pem',\n  sslCert: '~/.ssl/my-server.pem',\n  sslKey: '~/.ssl/my-server.pem'\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', complete: true}\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', skipped: true,\n  reason: 'The selected SSH Tunnel mode is NONE.'}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n[workflow_img]: https://github.com/mongodb-js/connection-model/workflows/Check%20and%20Test/badge.svg?event=push\n[workflow_url]: https://github.com/mongodb-js/connection-model/actions?query=workflow%3A%22Check+and+Test%22\n[npm_img]: https://img.shields.io/npm/v/mongodb-connection-model.svg?style=flat-square\n[npm_url]: https://www.npmjs.org/package/mongodb-connection-model\n[gitter_img]: https://badges.gitter.im/Join%20Chat.svg\n[gitter_url]: http://gitter.im/mongodb-js/mongodb-js\n[enterprise_img]: https://img.shields.io/badge/MongoDB-Enterprise-blue.svg?style=flat-square\n[coming_soon_img]: https://img.shields.io/badge/-Coming%20Soon-ff69b4.svg?style=flat-square\n[kerberos-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/kerberos_tests.js\n[ldap-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ldap_tests.js\n[x509-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ssl_x509_tests.js\n[ns]: https://github.com/mongodb-js/ns\n[sf-ssh-tunnel]: http://serverfault.com/questions/597765/how-to-connect-to-mongodb-server-via-ssh-tunnel\n[ec2-key-pairs]: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html\n[driver-ssl-impl]: https://github.com/christkv/mongodb-core/blob/c3d21cb636d74d7a68134ecd3b9f6af536311279/lib/connection/connection.js#L365-L407\n[driver-ssl-tutorial]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/\n[driver-ssl-none]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#no-certificate-validation\n[driver-ssl-server]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate\n[driver-ssl-all]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate-and-present-valid-certificate\n","gitHead":"014cd3f52319f9c3e62d458f4c10e0af7ae98052","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","test":"mocha","check":"npm run lint && npm run depcheck","pretest":"mongodb-runner install && mongodb-runner start --port=27018","test-ci":"npm run test","depcheck":"depcheck","posttest":"mongodb-runner stop --port=27018","posttest-ci":"node ../../scripts/killall-mongo.js","test-check-ci":"npm run check && npm test"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.17.0+x64 (linux)","description":"MongoDB connection model","directories":{},"_nodeVersion":"16.17.0","compass:main":"index.js","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","debug":"^4.2.0","lodash":"^4.17.15","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.2.0","storage-mixin":"0.0.0-next-014cd3f52319f9c3e62d458f4c10e0af7ae98052","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.2","@mongodb-js/ssh-tunnel":"0.0.0-next-014cd3f52319f9c3e62d458f4c10e0af7ae98052","@mongodb-js/compass-utils":"0.0.0-next-014cd3f52319f9c3e62d458f4c10e0af7ae98052","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.6.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"^4.13.0","depcheck":"^1.4.1","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.10.0","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^4.13.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_0.0.0-next-014cd3f52319f9c3e62d458f4c10e0af7ae98052_1676331159667_0.8626352705208176","host":"s3://npm-registry-packages"}},"0.0.0-next-c5eba7335c2da0b9754b4e52495c98f48ec15463":{"name":"mongodb-connection-model","version":"0.0.0-next-c5eba7335c2da0b9754b4e52495c98f48ec15463","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@0.0.0-next-c5eba7335c2da0b9754b4e52495c98f48ec15463","maintainers":[{"name":"mongo-j","email":"james.wang@mongodb.com"},{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"iteng@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"ab5151ed590f3a4aa60bf11e35595c5377fc10f2","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-0.0.0-next-c5eba7335c2da0b9754b4e52495c98f48ec15463.tgz","fileCount":20,"integrity":"sha512-8/WvlrGWjWtHAmwb7qKVIyJaWI8KzdllbjzZ78hwM0TTK+2rKQa05y8pfsVqE8fQihUN+ABop1kYFx3lxFYLFg==","signatures":[{"sig":"MEUCICBAkI0EoQLKF30zmHLcelha/qXU1mtx7bN1WX4AyBmsAiEAxILMpImFpwsGq+m7TuOweGy9gYS0Gm/t+AJd2WXVriU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":108150,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj7LixACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqbeg/8Dpo1aVHIpOszRcGuXkesjt+7gpqfELbfFo8xKZ2P0cE8+WXW\r\nkZSj8frRQXERr0jt+exZXiFC/RYl6E172RDVGpDFJU2Su0rzPctFMMO5ss7S\r\nr9pkKhur38UpTIvC2JxlClRA6tRLbofWsHMP1P3VCYDJzrZeZi9oY2J6in+h\r\nK25VE/lOVw2cYF10NcsHCPB4V0Fcbhx5m2ntjEMdgpTuyp6AX+8WLuu2feL3\r\n0btn9d0ATwmRjqnF5Xh+010sGCUzz3C9f+494SADzLDIz1NtVg2b3X8cpkVz\r\nXldGYUCOXsDYphk9NzG2U9VDIRtO7YT8ePFeMcwixLOIxxiTfqk13kzeO4o3\r\n79bS3c3khOqMUVlBql6cTzLErozblMCy6XsXzTl4ImwgTT3bDQyNX8JwcOCd\r\nI9kxNfRmO3DCr9mlkpOFjPR8GoPSsj/IWyAsT9bNPjUj2Nb5BRRE5saDYxVH\r\nM5VBYqNnPCi/2vx0muxIs7KY/xaov1H4xf85G4fxZyBpIvWp70VCP0CA5wPh\r\nRmCm78gRqAbXnNbt4m/vbXhe3X+0O20fDjhQ931MWV+4p2MD58cef3jTd+p+\r\n9YsL09CUsxGGaHCmSzntYbpRLA1Keft8w9ghstDwie1Q5I+xKFstqBimjjIZ\r\nkC+4IvdG4aGbTaCn0rUI+gt/sJFywxG/6xE=\r\n=BlkX\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","readme":"# mongodb-connection-model [![][workflow_img]][workflow_url] [![][npm_img]][npm_url]\n\n> MongoDB connection model\n\nThe main purpose of the MongoDB connection model is to be a domain model around a MongoDB connection. It encapsulates generating a [Connection String URI](https://docs.mongodb.com/manual/reference/connection-string/) from a group of attributes and parses URI using the [MongoDB Node.JS Driver URI Parser](https://github.com/mongodb-js/mongodb-core/blob/master/lib/uri_parser.js).\n\n## Installation\n\n```\nnpm install --save mongodb-connection-model\n```\n\n## Usage\n\n### Building URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\nconst c = new Connection({ appname: 'My App Name' });\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://localhost:27017/?readPreference=primary&appname=My%20App&ssl=false'\n```\n\n### Parsing URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\n\nConnection.from(\n  'mongodb://someUsername:testPassword@localhost',\n  (error, result) => {\n    console.log(result);\n    >>> `{\n      hosts: [{ host: 'localhost', port: 27017 }],\n      hostname: 'localhost',\n      port: 27017,\n      auth: {\n        username: 'someUsername',\n        password: 'testPassword',\n        db: 'admin'\n      },\n      isSrvRecord: false,\n      authStrategy: 'MONGODB',\n      mongodbUsername: 'someUsername',\n      mongodbPassword: 'testPassword',\n      mongodbDatabaseName: 'admin',\n      extraOptions: {},\n      connectionType: 'NODE_DRIVER',\n      readPreference: 'primary',\n      kerberosCanonicalizeHostname: false,\n      sslMethod: 'NONE',\n      sshTunnel: 'NONE',\n      sshTunnelPort: 22\n    }`\n  }\n);\n```\n\n## Properties\n\nMongoDB connection model is based on Ampersand.js framework and consist of [props](https://ampersandjs.com/docs/#ampersand-state-props) and [derived props](https://ampersandjs.com/docs/#ampersand-state-derived). The props object describes the observable properties that MongoDB connection model gets from the Node.js Driver API.\n\n```javascript\nconst с = new Connection();\nconst props = с.getAttributes({ props: true });\n```\n\n#### See Also\n\n- [URI Generic Syntax](https://tools.ietf.org/html/rfc3986)\n- [URI Options Specification](https://github.com/mongodb/specifications/blob/master/source/uri-options/uri-options.rst)\n\n### General Properties\n\n```javascript\nconst c = new Connection({ isSrvRecord: true });\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ns` | String | A valid [ns][ns] the user can read from | `undefined` |\n| `isSrvRecord` | Boolean | Indicates SRV record | `false` |\n| `auth` | Object | Authentication from driver (username, user, db, password) | `undefined` |\n| `hostname` | String | Hostname of a MongoDB Instance. In case of the replica set the first host and port will be taken | `localhost` |\n| `port` | Number | TCP port of a MongoDB Instance | `27017` |\n| `hosts` | Array | Contains all hosts and ports for replica set | `[{ host: 'localhost', port: 27017 }]` |\n| `extraOptions` | Object | Extra options passed to the node driver as part of `driverOptions` | `{}` |\n| `connectionType` | String | The desired connection type. Possible values: `NODE_DRIVER`, `STITCH_ON_PREM`, `STITCH_ATLAS` | `NODE_DRIVER` |\n| `authStrategy` | String | The desired authentication strategy. Possible values: `NONE`, `MONGODB`, `X509`, `KERBEROS`, `LDAP`, `SCRAM-SHA-256` | `NONE` |\n\n### Connection string options\n\n```javascript\nconst c = new Connection({ appname: 'My App', replicaSet: 'testing' });\n```\n\n#### General connection string options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `replicaSet` | String | Specifies the name of the replica set, if the mongod is a member of a replica set | `undefined` |\n| `connectTimeoutMS` | Number | The time in milliseconds to attempt a connection before timing out | `undefined` |\n| `socketTimeoutMS` | Number | The time in milliseconds to attempt a send or receive on a socket before the attempt times out | `undefined` |\n| `compression` | Object | Object includes compressors and a compression level. The following compressors can be specified: `snappy`, `zlib` (Available in MongoDB 3.6 or greater) | `undefined` |\n\n#### Connection Pool Option\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `maxPoolSize` | Number | The maximum number of connections in the connection pool | `undefined` |\n| `minPoolSize` | Number | The minimum number of connections in the connection pool | `undefined` |\n| `maxIdleTimeMS` | Number | The maximum number of milliseconds that a connection can remain idle in the pool before being removed and closed | `undefined` |\n| `waitQueueMultiple` | Number | A number that the driver multiples the maxPoolSize value to, to provide the maximum number of threads allowed to wait for a connection to become available from the pool | `undefined` |\n| `waitQueueTimeoutMS` | Number | The maximum time in milliseconds that a thread can wait for a connection to become available | `undefined` |\n\n#### Write Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `w` | Number/String | Corresponds to the write concern [w Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-w) | `undefined` |\n| `wTimeoutMS` | Number | Corresponds to the write concern [wtimeout](https://docs.mongodb.com/manual/reference/write-concern/#wc-wtimeout) | `undefined` |\n| `journal` | Boolean | Corresponds to the write concern [j Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-j) | `undefined` |\n\n#### Read Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readConcernLevel` | String | The level of isolation | `undefined` |\n\n#### Read Preference Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readPreference` | String | Specifies the read preferences for this connection. Possible values: `PRIMARY`, `PRIMARY_PREFERRED`, `SECONDARY`, `SECONDARY_PREFERRED`, `NEAREST` | `PRIMARY` |\n| `maxStalenessSeconds` | Number | Specifies, in seconds, how stale a secondary can be before the client stops using it for read operations | `undefined` |\n| `readPreferenceTags` | Object | Default read preference tags for the client | `undefined` |\n\n#### Authentication Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `authSource` | String | Specify the database name associated with the user’s credentials | `undefined` |\n| `authMechanism` | String | Specifies the authentication mechanism that MongoDB will use to authenticate the connection. Possible values: `DEFAULT`, `GSSAPI`, `MONGODB-X509`, `PLAIN`, `SCRAM-SHA-256` | `undefined` |\n| `authMechanismProperties` | Object | Additional options provided for authentication (e.g. to enable hostname canonicalization for GSSAPI) | `undefined` |\n| `gssapiServiceName` | String | Set the Kerberos service name when connecting to Kerberized MongoDB instances | `undefined` |\n| `gssapiServiceRealm` | String | Set the Realm service name | `undefined` |\n| `gssapiCanonicalizeHostName` | Boolean | Whether canonicalized hostname | `undefined` |\n\n#### Server Selection and Discovery Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `localThresholdMS` | Number | The size (in milliseconds) of the latency window for selecting among multiple suitable MongoDB instances | `undefined` |\n| `serverSelectionTimeoutMS` | Number | Specifies how long (in milliseconds) to block for server selection before throwing an exception | `undefined` |\n| `serverSelectionTryOnce` | Boolean | Instructs the driver to scan the MongoDB deployment exactly once after server selection fails and then either select a server or raise an error | `undefined` |\n| `heartbeatFrequencyMS` | Number | Controls when the driver checks the state of the MongoDB deployment | `undefined` |\n\n#### Miscellaneous Configuration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `appname` | String | An application name passed to server as client metadata | `undefined` |\n| `retryWrites` | Boolean | Enable retryable writes | `undefined` |\n| `uuidRepresentation` | String | The legacy representation of UUID. Possible values: `standard`, `csharpLegacy`, `javaLegacy`, `pythonLegacy` | `undefined` |\n| `loadBalanced` | Boolean | Whether or not the server is running in load balanced mode | `undefined` |\n\n### Stitch attributes\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `stitchServiceName` | String | Stitch service name | `undefined` |\n| `stitchClientAppId` | String | Stitch сlient app ID | `undefined` |\n| `stitchGroupId` | String | Stitch group ID | `undefined` |\n| `stitchBaseUrl` | String | Stitch base Url | `undefined` |\n\n### MONGODB authentication\n\n```javascript\nconst c = new Connection({\n  mongodbUsername: 'arlo',\n  mongodbPassword: 'w@of'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/?slaveOk=true&authSource=admin'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `mongodbUsername` | String | MongoDB username | `undefined` |\n| `mongodbPassword` | String | MongoDB password | `undefined` |\n| `mongodbDatabaseName` | String | The database name associated with the user's credentials | `undefined` |\n| `promoteValues` | Boolean | Whether BSON values should be promoted to their JS type counterparts | `undefined` |\n\n### KERBEROS authentication\n\n```javascript\nconst c = new Connection({\n  kerberosServiceName: 'mongodb',\n  kerberosPrincipal: 'arlo/dog@krb5.mongodb.parts',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo%252Fdog%2540krb5.mongodb.parts@localhost:27017/toys?authMechanism=GSSAPI'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n> @note (imlucas): Kerberos on Windows is broken out as it's own state for UX consideration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `kerberosServiceName` | String | Any program or computer you access over a network | `undefined` |\n| `kerberosPrincipal` | String | The format of a typical Kerberos V5 principal is `primary/instance@REALM` | `undefined` |\n| `kerberosCanonicalizeHostname` | Boolean | Whether canonicalized kerberos hostname | `undefined` |\n\n#### See Also\n\n- [node.js driver Kerberos reference](http://bit.ly/mongodb-node-driver-kerberos)\n- [node.js driver Kerberos functional test][kerberos-functional]\n\n### LDAP authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  ldapUsername: 'arlo',\n  ldapPassword: 'w@of',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/toys?slaveOk=true&authMechanism=PLAIN'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ldapUsername` | String | LDAP username | `undefined` |\n| `ldapPassword` | String | LDAP password | `undefined` |\n\n#### See Also\n\n- [node.js driver LDAP reference](http://bit.ly/mongodb-node-driver-ldap)\n- [node.js driver X509 functional test][ldap-functional]\n\n### X509 authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  x509Username: 'CN=client,OU=arlo,O=MongoDB,L=Philadelphia,ST=Pennsylvania,C=US'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://CN%253Dclient%252COU%253Darlo%252CO%253DMongoDB%252CL%253DPhiladelphia%252CST%253DPennsylvania%252CC%253DUS@localhost:27017?slaveOk=true&authMechanism=MONGODB-X509'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `x509Username` | String | The x.509 certificate derived user name, e.g. `CN=user,OU=OrgUnit,O=myOrg,...` | `undefined` |\n\n#### See Also\n\n- [node.js driver X509 reference](http://bit.ly/mongodb-node-driver-x509)\n- [node.js driver X509 functional test][x509-functional]\n\n### SSL\n\n> **Note**: Not to be confused with `authentication=X509`\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ssl` | Number/String | A boolean to enable or disables TLS/SSL for the connection | `undefined` |\n| `sslMethod` | String | The desired ssl method. Possible values: `NONE`, `SYSTEMCA`, `IFAVAILABLE`, `UNVALIDATED`, `SERVER`, `ALL` | `NONE` |\n| `sslCA` | Buffer/String | Array of valid certificates | `undefined` |\n| `sslCert` | Buffer/String | The certificate | `undefined` |\n| `sslKey` | Buffer/String | The certificate private key | `undefined` |\n| `sslPass` | Buffer/String | The certificate password | `undefined` |\n\nDescription of `sslMethod` values:\n\n- `SYSTEMCA` - SSL required, validate using System CA, with host verification.\n- `IFAVAILABLE` - The driver should try SSL first, fall back to no SSL if unavailable, and use the system's Certificate Authority.\n- `SERVER` - The driver should validate the server certificate and fail to connect if validation fails. See also [node.js driver \"Validate Server Certificate\" docs][driver-ssl-server].\n- `ALL` - The driver must present a valid certificate and validate the server certificate. See also [node.js driver \"Validate Server Certificate and Present Valid Certificate\" docs][driver-ssl-all].\n- `NONE` - No SSL (Not recommended).\n- `UNVALIDATED` - Use SSL but do not perform any validation of the certificate chain. See also [node.js driver \"No Certificate Validation\" docs][driver-ssl-none]. **Very** not recommended and likely to be deprecated in future releases because it exposes potential Man-In-The-Middle attack vectors.\n\n#### See also\n\n- [node.js driver SSL implementation][driver-ssl-impl]\n- [node.js driver SSL tutorial][driver-ssl-tutorial]\n\n### SSH TUNNEL\n\n> New in mongodb-connection-model@5.0.0\n\nBecause [authentication](#authentication) is quite difficult for operators to migrate to, the most common method of securing a MongoDB deployment is to use an [SSH tunnel][sf-ssh-tunnel].  This allows operators to leverage their existing SSH security infrastructure to also provide secure access to MongoDB.  For a standard deployment of MongoDB on AWS, this is almost always to strategy.  Because of this, we now support creating SSH tunnels automatically when connecting to MongoDB.\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options, (connectionError, client) => {\n  if (connectionError) {\n    return console.log(connectionError);\n  }\n\n  client.db('mongodb').collection('fanclub').count((countingError, count) => {\n    console.log('counted:', countingError, count);\n    client.close();\n  });\n});\n```\n\nThe above provides the same functionality as creating the tunnel using the bash\ncommand below and connecting to MongoDB via another terminal. Notice that\nconnection-model uses a random local port each time it creates a tunnel.\nUsing the command line, you'd have to replace `<random port>` with an actual\nport number.\n\n```bash\nssh -i ~/.ssh/my-key-aws-pair.pem -L <random port>:localhost:27017 ubuntu@ec2-11-111-111-111.compute-1.amazonaws.com\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `sshTunnel` | String | The desired SSH tunnel strategy. Possible values: `NONE`, `USER_PASSWORD`, `IDENTITY_FILE` | `undefined` |\n| `sshTunnelHostname` | String | The hostname of the SSH remote host | `undefined` |\n| `sshTunnelPort` | Port | The SSH port of the remote host | `22` |\n| `sshTunnelBindToLocalPort` | Port | Bind the localhost endpoint of the SSH Tunnel to this port | `undefined` |\n| `sshTunnelUsername` | String | The optional SSH username for the remote host | `undefined` |\n| `sshTunnelPassword` | String | The optional SSH password for the remote host | `undefined` |\n| `sshTunnelIdentityFile` | String/Array | The optional path to the SSH identity file for the remote host | `undefined` |\n| `sshTunnelPassphrase` | String | The optional passphrase for `sshTunnelIdentityFile` | `undefined` |\n\nDescription of `sshTunnel` values:\n\n- `NONE` - Do not use SSH tunneling.\n- `USER_PASSWORD` - The tunnel is created with SSH username and password only.\n- `IDENTITY_FILE` - The tunnel is created using an identity file.\n\n## Derived Properties\n\nDerived properties (also known as computed properties) are properties of the state object that depend on other properties to determine their value.\n\n```javascript\nconst c = new Connection();\nconst derivedProps = c.getAttributes({ derived: true });\n```\n\n| Derived Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `instanceId` | String | The mongoscope | `localhost:27017` |\n| `driverAuthMechanism` | String | Converts the value of `authStrategy` for humans into the `authMechanism` value for the driver | `undefined` |\n| `safeUrl` | String | The URL where a password is replaced with stars | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrl` | String | Use this URL in order to connect via DataService | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrlWithSsh` | String | Use this URL in order to connect via connection model itself | `mongodb://localhost:29201/?readPreference=primary&ssl=false` |\n| `driverOptions` | String | The second argument `mongoscope-server` passes to `mongodb.connect` | `{}` |\n\n## Events\n\n> New in mongodb-connection-model@5.0.0\n\n#### Example: SSH Tunnel\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', skipped: true,\n  reason: 'The selected SSL mode does not need to load any files.' }\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', complete: true}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n#### Example: SSL\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  ssl: 'ALL',\n  sslCA: '~/.ssl/my-ca.pem',\n  sslCert: '~/.ssl/my-server.pem',\n  sslKey: '~/.ssl/my-server.pem'\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', complete: true}\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', skipped: true,\n  reason: 'The selected SSH Tunnel mode is NONE.'}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n[workflow_img]: https://github.com/mongodb-js/connection-model/workflows/Check%20and%20Test/badge.svg?event=push\n[workflow_url]: https://github.com/mongodb-js/connection-model/actions?query=workflow%3A%22Check+and+Test%22\n[npm_img]: https://img.shields.io/npm/v/mongodb-connection-model.svg?style=flat-square\n[npm_url]: https://www.npmjs.org/package/mongodb-connection-model\n[gitter_img]: https://badges.gitter.im/Join%20Chat.svg\n[gitter_url]: http://gitter.im/mongodb-js/mongodb-js\n[enterprise_img]: https://img.shields.io/badge/MongoDB-Enterprise-blue.svg?style=flat-square\n[coming_soon_img]: https://img.shields.io/badge/-Coming%20Soon-ff69b4.svg?style=flat-square\n[kerberos-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/kerberos_tests.js\n[ldap-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ldap_tests.js\n[x509-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ssl_x509_tests.js\n[ns]: https://github.com/mongodb-js/ns\n[sf-ssh-tunnel]: http://serverfault.com/questions/597765/how-to-connect-to-mongodb-server-via-ssh-tunnel\n[ec2-key-pairs]: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html\n[driver-ssl-impl]: https://github.com/christkv/mongodb-core/blob/c3d21cb636d74d7a68134ecd3b9f6af536311279/lib/connection/connection.js#L365-L407\n[driver-ssl-tutorial]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/\n[driver-ssl-none]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#no-certificate-validation\n[driver-ssl-server]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate\n[driver-ssl-all]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate-and-present-valid-certificate\n","gitHead":"c5eba7335c2da0b9754b4e52495c98f48ec15463","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","test":"mocha","check":"npm run lint && npm run depcheck","pretest":"mongodb-runner install && mongodb-runner start --port=27018","test-ci":"npm run test","depcheck":"depcheck","posttest":"mongodb-runner stop --port=27018","posttest-ci":"node ../../scripts/killall-mongo.js","test-check-ci":"npm run check && npm test"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.17.0+x64 (linux)","description":"MongoDB connection model","directories":{},"_nodeVersion":"16.17.0","compass:main":"index.js","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","debug":"^4.2.0","lodash":"^4.17.15","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.2.0","storage-mixin":"0.0.0-next-c5eba7335c2da0b9754b4e52495c98f48ec15463","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.2","@mongodb-js/ssh-tunnel":"0.0.0-next-c5eba7335c2da0b9754b4e52495c98f48ec15463","@mongodb-js/compass-utils":"0.0.0-next-c5eba7335c2da0b9754b4e52495c98f48ec15463","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.6.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"^5.0.0","depcheck":"^1.4.1","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.10.0","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^5.0.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_0.0.0-next-c5eba7335c2da0b9754b4e52495c98f48ec15463_1676458160884_0.9870386758003098","host":"s3://npm-registry-packages"}},"0.0.0-next-9acb1d074fcbf6aa34b275f617178f0f155ff495":{"name":"mongodb-connection-model","version":"0.0.0-next-9acb1d074fcbf6aa34b275f617178f0f155ff495","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@0.0.0-next-9acb1d074fcbf6aa34b275f617178f0f155ff495","maintainers":[{"name":"mongo-j","email":"james.wang@mongodb.com"},{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"iteng@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"fa31af509fb3352c45b10a1fc00910f869af7687","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-0.0.0-next-9acb1d074fcbf6aa34b275f617178f0f155ff495.tgz","fileCount":20,"integrity":"sha512-u0FPzdaOP9K4D+CaJXJxCh7FHohArGdLFr3xgVtKF/1A8WIzFpbVAD3BbPAFt5skRXywkhvFsb2bSJVsb43AKA==","signatures":[{"sig":"MEYCIQDPHHw4ec+24G66KMZ4/SJLUa2/DwuvfYLuzrmNQLk4UwIhANyf/wrZRvqQgQDU5Uz54qLXe54cnxsOAJ3YfGt2ClrY","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":108150,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj8+dNACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpcihAAlsqntST+JGxmAgvW5esFlJfv7jHn0MJAOFmLkpxM52TibBH4\r\nVHQlvW2hBWHqu3Wzj/PSVDqUnJ3y6ezadkcObXh2zwGAdwdEM31DlPWPn1y2\r\nZQJfSu5yRQWsg2yY+mhzasPwMkmV+SMn6jhPYjDk9IkhmcaX50ASKaw3MenQ\r\nQxYWTswQgtmGlYLjKQSIt6Q8W4UtZNpayHonJ63+zm9RxDUwvR2PSsuPPlCk\r\nscurkCqhSchkF6lmWOdg/vqSOtUtu+RWGhAj9njRTXr0N8sun5tlv1tUjy5q\r\nzh7QbJn5z2Z81TocJijJuddA/gNRssrwlrP0VCwkiJFASxNRdCXEPVGoAn+Y\r\nmB/6P/KPRRupIYnHIvKRivHobUaxDhnR9nGDV2oqouw2XnLrk2msvI5Y0bP4\r\nWY300p58Lc56YsoJK6Jx0YbXpwTghbXbkyXxtLmzPAXkdg2e0vPIUSz4ECM6\r\nH5eLg3xW0YowH7OF5TJtFdb2V1VoCWia7doMoBRgKk/6cYpY5IObZtrWCDqX\r\nvgvOqPapEXiLfxt1DLng8/L/4Ac7q7IP74jSxf7Taw0YroeKdmeiivcUqM5x\r\nhVER9geZOAvYNfeZoX8ETKXmmBdFh5si4au2505jivKAyYl6qRt1P1COjlpI\r\nVx/uqfmZ+gBiVyDY73JoLv0QxPME+A5S2/U=\r\n=HoCt\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","readme":"# mongodb-connection-model [![][workflow_img]][workflow_url] [![][npm_img]][npm_url]\n\n> MongoDB connection model\n\nThe main purpose of the MongoDB connection model is to be a domain model around a MongoDB connection. It encapsulates generating a [Connection String URI](https://docs.mongodb.com/manual/reference/connection-string/) from a group of attributes and parses URI using the [MongoDB Node.JS Driver URI Parser](https://github.com/mongodb-js/mongodb-core/blob/master/lib/uri_parser.js).\n\n## Installation\n\n```\nnpm install --save mongodb-connection-model\n```\n\n## Usage\n\n### Building URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\nconst c = new Connection({ appname: 'My App Name' });\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://localhost:27017/?readPreference=primary&appname=My%20App&ssl=false'\n```\n\n### Parsing URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\n\nConnection.from(\n  'mongodb://someUsername:testPassword@localhost',\n  (error, result) => {\n    console.log(result);\n    >>> `{\n      hosts: [{ host: 'localhost', port: 27017 }],\n      hostname: 'localhost',\n      port: 27017,\n      auth: {\n        username: 'someUsername',\n        password: 'testPassword',\n        db: 'admin'\n      },\n      isSrvRecord: false,\n      authStrategy: 'MONGODB',\n      mongodbUsername: 'someUsername',\n      mongodbPassword: 'testPassword',\n      mongodbDatabaseName: 'admin',\n      extraOptions: {},\n      connectionType: 'NODE_DRIVER',\n      readPreference: 'primary',\n      kerberosCanonicalizeHostname: false,\n      sslMethod: 'NONE',\n      sshTunnel: 'NONE',\n      sshTunnelPort: 22\n    }`\n  }\n);\n```\n\n## Properties\n\nMongoDB connection model is based on Ampersand.js framework and consist of [props](https://ampersandjs.com/docs/#ampersand-state-props) and [derived props](https://ampersandjs.com/docs/#ampersand-state-derived). The props object describes the observable properties that MongoDB connection model gets from the Node.js Driver API.\n\n```javascript\nconst с = new Connection();\nconst props = с.getAttributes({ props: true });\n```\n\n#### See Also\n\n- [URI Generic Syntax](https://tools.ietf.org/html/rfc3986)\n- [URI Options Specification](https://github.com/mongodb/specifications/blob/master/source/uri-options/uri-options.rst)\n\n### General Properties\n\n```javascript\nconst c = new Connection({ isSrvRecord: true });\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ns` | String | A valid [ns][ns] the user can read from | `undefined` |\n| `isSrvRecord` | Boolean | Indicates SRV record | `false` |\n| `auth` | Object | Authentication from driver (username, user, db, password) | `undefined` |\n| `hostname` | String | Hostname of a MongoDB Instance. In case of the replica set the first host and port will be taken | `localhost` |\n| `port` | Number | TCP port of a MongoDB Instance | `27017` |\n| `hosts` | Array | Contains all hosts and ports for replica set | `[{ host: 'localhost', port: 27017 }]` |\n| `extraOptions` | Object | Extra options passed to the node driver as part of `driverOptions` | `{}` |\n| `connectionType` | String | The desired connection type. Possible values: `NODE_DRIVER`, `STITCH_ON_PREM`, `STITCH_ATLAS` | `NODE_DRIVER` |\n| `authStrategy` | String | The desired authentication strategy. Possible values: `NONE`, `MONGODB`, `X509`, `KERBEROS`, `LDAP`, `SCRAM-SHA-256` | `NONE` |\n\n### Connection string options\n\n```javascript\nconst c = new Connection({ appname: 'My App', replicaSet: 'testing' });\n```\n\n#### General connection string options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `replicaSet` | String | Specifies the name of the replica set, if the mongod is a member of a replica set | `undefined` |\n| `connectTimeoutMS` | Number | The time in milliseconds to attempt a connection before timing out | `undefined` |\n| `socketTimeoutMS` | Number | The time in milliseconds to attempt a send or receive on a socket before the attempt times out | `undefined` |\n| `compression` | Object | Object includes compressors and a compression level. The following compressors can be specified: `snappy`, `zlib` (Available in MongoDB 3.6 or greater) | `undefined` |\n\n#### Connection Pool Option\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `maxPoolSize` | Number | The maximum number of connections in the connection pool | `undefined` |\n| `minPoolSize` | Number | The minimum number of connections in the connection pool | `undefined` |\n| `maxIdleTimeMS` | Number | The maximum number of milliseconds that a connection can remain idle in the pool before being removed and closed | `undefined` |\n| `waitQueueMultiple` | Number | A number that the driver multiples the maxPoolSize value to, to provide the maximum number of threads allowed to wait for a connection to become available from the pool | `undefined` |\n| `waitQueueTimeoutMS` | Number | The maximum time in milliseconds that a thread can wait for a connection to become available | `undefined` |\n\n#### Write Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `w` | Number/String | Corresponds to the write concern [w Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-w) | `undefined` |\n| `wTimeoutMS` | Number | Corresponds to the write concern [wtimeout](https://docs.mongodb.com/manual/reference/write-concern/#wc-wtimeout) | `undefined` |\n| `journal` | Boolean | Corresponds to the write concern [j Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-j) | `undefined` |\n\n#### Read Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readConcernLevel` | String | The level of isolation | `undefined` |\n\n#### Read Preference Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readPreference` | String | Specifies the read preferences for this connection. Possible values: `PRIMARY`, `PRIMARY_PREFERRED`, `SECONDARY`, `SECONDARY_PREFERRED`, `NEAREST` | `PRIMARY` |\n| `maxStalenessSeconds` | Number | Specifies, in seconds, how stale a secondary can be before the client stops using it for read operations | `undefined` |\n| `readPreferenceTags` | Object | Default read preference tags for the client | `undefined` |\n\n#### Authentication Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `authSource` | String | Specify the database name associated with the user’s credentials | `undefined` |\n| `authMechanism` | String | Specifies the authentication mechanism that MongoDB will use to authenticate the connection. Possible values: `DEFAULT`, `GSSAPI`, `MONGODB-X509`, `PLAIN`, `SCRAM-SHA-256` | `undefined` |\n| `authMechanismProperties` | Object | Additional options provided for authentication (e.g. to enable hostname canonicalization for GSSAPI) | `undefined` |\n| `gssapiServiceName` | String | Set the Kerberos service name when connecting to Kerberized MongoDB instances | `undefined` |\n| `gssapiServiceRealm` | String | Set the Realm service name | `undefined` |\n| `gssapiCanonicalizeHostName` | Boolean | Whether canonicalized hostname | `undefined` |\n\n#### Server Selection and Discovery Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `localThresholdMS` | Number | The size (in milliseconds) of the latency window for selecting among multiple suitable MongoDB instances | `undefined` |\n| `serverSelectionTimeoutMS` | Number | Specifies how long (in milliseconds) to block for server selection before throwing an exception | `undefined` |\n| `serverSelectionTryOnce` | Boolean | Instructs the driver to scan the MongoDB deployment exactly once after server selection fails and then either select a server or raise an error | `undefined` |\n| `heartbeatFrequencyMS` | Number | Controls when the driver checks the state of the MongoDB deployment | `undefined` |\n\n#### Miscellaneous Configuration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `appname` | String | An application name passed to server as client metadata | `undefined` |\n| `retryWrites` | Boolean | Enable retryable writes | `undefined` |\n| `uuidRepresentation` | String | The legacy representation of UUID. Possible values: `standard`, `csharpLegacy`, `javaLegacy`, `pythonLegacy` | `undefined` |\n| `loadBalanced` | Boolean | Whether or not the server is running in load balanced mode | `undefined` |\n\n### Stitch attributes\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `stitchServiceName` | String | Stitch service name | `undefined` |\n| `stitchClientAppId` | String | Stitch сlient app ID | `undefined` |\n| `stitchGroupId` | String | Stitch group ID | `undefined` |\n| `stitchBaseUrl` | String | Stitch base Url | `undefined` |\n\n### MONGODB authentication\n\n```javascript\nconst c = new Connection({\n  mongodbUsername: 'arlo',\n  mongodbPassword: 'w@of'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/?slaveOk=true&authSource=admin'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `mongodbUsername` | String | MongoDB username | `undefined` |\n| `mongodbPassword` | String | MongoDB password | `undefined` |\n| `mongodbDatabaseName` | String | The database name associated with the user's credentials | `undefined` |\n| `promoteValues` | Boolean | Whether BSON values should be promoted to their JS type counterparts | `undefined` |\n\n### KERBEROS authentication\n\n```javascript\nconst c = new Connection({\n  kerberosServiceName: 'mongodb',\n  kerberosPrincipal: 'arlo/dog@krb5.mongodb.parts',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo%252Fdog%2540krb5.mongodb.parts@localhost:27017/toys?authMechanism=GSSAPI'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n> @note (imlucas): Kerberos on Windows is broken out as it's own state for UX consideration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `kerberosServiceName` | String | Any program or computer you access over a network | `undefined` |\n| `kerberosPrincipal` | String | The format of a typical Kerberos V5 principal is `primary/instance@REALM` | `undefined` |\n| `kerberosCanonicalizeHostname` | Boolean | Whether canonicalized kerberos hostname | `undefined` |\n\n#### See Also\n\n- [node.js driver Kerberos reference](http://bit.ly/mongodb-node-driver-kerberos)\n- [node.js driver Kerberos functional test][kerberos-functional]\n\n### LDAP authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  ldapUsername: 'arlo',\n  ldapPassword: 'w@of',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/toys?slaveOk=true&authMechanism=PLAIN'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ldapUsername` | String | LDAP username | `undefined` |\n| `ldapPassword` | String | LDAP password | `undefined` |\n\n#### See Also\n\n- [node.js driver LDAP reference](http://bit.ly/mongodb-node-driver-ldap)\n- [node.js driver X509 functional test][ldap-functional]\n\n### X509 authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  x509Username: 'CN=client,OU=arlo,O=MongoDB,L=Philadelphia,ST=Pennsylvania,C=US'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://CN%253Dclient%252COU%253Darlo%252CO%253DMongoDB%252CL%253DPhiladelphia%252CST%253DPennsylvania%252CC%253DUS@localhost:27017?slaveOk=true&authMechanism=MONGODB-X509'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `x509Username` | String | The x.509 certificate derived user name, e.g. `CN=user,OU=OrgUnit,O=myOrg,...` | `undefined` |\n\n#### See Also\n\n- [node.js driver X509 reference](http://bit.ly/mongodb-node-driver-x509)\n- [node.js driver X509 functional test][x509-functional]\n\n### SSL\n\n> **Note**: Not to be confused with `authentication=X509`\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ssl` | Number/String | A boolean to enable or disables TLS/SSL for the connection | `undefined` |\n| `sslMethod` | String | The desired ssl method. Possible values: `NONE`, `SYSTEMCA`, `IFAVAILABLE`, `UNVALIDATED`, `SERVER`, `ALL` | `NONE` |\n| `sslCA` | Buffer/String | Array of valid certificates | `undefined` |\n| `sslCert` | Buffer/String | The certificate | `undefined` |\n| `sslKey` | Buffer/String | The certificate private key | `undefined` |\n| `sslPass` | Buffer/String | The certificate password | `undefined` |\n\nDescription of `sslMethod` values:\n\n- `SYSTEMCA` - SSL required, validate using System CA, with host verification.\n- `IFAVAILABLE` - The driver should try SSL first, fall back to no SSL if unavailable, and use the system's Certificate Authority.\n- `SERVER` - The driver should validate the server certificate and fail to connect if validation fails. See also [node.js driver \"Validate Server Certificate\" docs][driver-ssl-server].\n- `ALL` - The driver must present a valid certificate and validate the server certificate. See also [node.js driver \"Validate Server Certificate and Present Valid Certificate\" docs][driver-ssl-all].\n- `NONE` - No SSL (Not recommended).\n- `UNVALIDATED` - Use SSL but do not perform any validation of the certificate chain. See also [node.js driver \"No Certificate Validation\" docs][driver-ssl-none]. **Very** not recommended and likely to be deprecated in future releases because it exposes potential Man-In-The-Middle attack vectors.\n\n#### See also\n\n- [node.js driver SSL implementation][driver-ssl-impl]\n- [node.js driver SSL tutorial][driver-ssl-tutorial]\n\n### SSH TUNNEL\n\n> New in mongodb-connection-model@5.0.0\n\nBecause [authentication](#authentication) is quite difficult for operators to migrate to, the most common method of securing a MongoDB deployment is to use an [SSH tunnel][sf-ssh-tunnel].  This allows operators to leverage their existing SSH security infrastructure to also provide secure access to MongoDB.  For a standard deployment of MongoDB on AWS, this is almost always to strategy.  Because of this, we now support creating SSH tunnels automatically when connecting to MongoDB.\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options, (connectionError, client) => {\n  if (connectionError) {\n    return console.log(connectionError);\n  }\n\n  client.db('mongodb').collection('fanclub').count((countingError, count) => {\n    console.log('counted:', countingError, count);\n    client.close();\n  });\n});\n```\n\nThe above provides the same functionality as creating the tunnel using the bash\ncommand below and connecting to MongoDB via another terminal. Notice that\nconnection-model uses a random local port each time it creates a tunnel.\nUsing the command line, you'd have to replace `<random port>` with an actual\nport number.\n\n```bash\nssh -i ~/.ssh/my-key-aws-pair.pem -L <random port>:localhost:27017 ubuntu@ec2-11-111-111-111.compute-1.amazonaws.com\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `sshTunnel` | String | The desired SSH tunnel strategy. Possible values: `NONE`, `USER_PASSWORD`, `IDENTITY_FILE` | `undefined` |\n| `sshTunnelHostname` | String | The hostname of the SSH remote host | `undefined` |\n| `sshTunnelPort` | Port | The SSH port of the remote host | `22` |\n| `sshTunnelBindToLocalPort` | Port | Bind the localhost endpoint of the SSH Tunnel to this port | `undefined` |\n| `sshTunnelUsername` | String | The optional SSH username for the remote host | `undefined` |\n| `sshTunnelPassword` | String | The optional SSH password for the remote host | `undefined` |\n| `sshTunnelIdentityFile` | String/Array | The optional path to the SSH identity file for the remote host | `undefined` |\n| `sshTunnelPassphrase` | String | The optional passphrase for `sshTunnelIdentityFile` | `undefined` |\n\nDescription of `sshTunnel` values:\n\n- `NONE` - Do not use SSH tunneling.\n- `USER_PASSWORD` - The tunnel is created with SSH username and password only.\n- `IDENTITY_FILE` - The tunnel is created using an identity file.\n\n## Derived Properties\n\nDerived properties (also known as computed properties) are properties of the state object that depend on other properties to determine their value.\n\n```javascript\nconst c = new Connection();\nconst derivedProps = c.getAttributes({ derived: true });\n```\n\n| Derived Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `instanceId` | String | The mongoscope | `localhost:27017` |\n| `driverAuthMechanism` | String | Converts the value of `authStrategy` for humans into the `authMechanism` value for the driver | `undefined` |\n| `safeUrl` | String | The URL where a password is replaced with stars | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrl` | String | Use this URL in order to connect via DataService | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrlWithSsh` | String | Use this URL in order to connect via connection model itself | `mongodb://localhost:29201/?readPreference=primary&ssl=false` |\n| `driverOptions` | String | The second argument `mongoscope-server` passes to `mongodb.connect` | `{}` |\n\n## Events\n\n> New in mongodb-connection-model@5.0.0\n\n#### Example: SSH Tunnel\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', skipped: true,\n  reason: 'The selected SSL mode does not need to load any files.' }\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', complete: true}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n#### Example: SSL\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  ssl: 'ALL',\n  sslCA: '~/.ssl/my-ca.pem',\n  sslCert: '~/.ssl/my-server.pem',\n  sslKey: '~/.ssl/my-server.pem'\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', complete: true}\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', skipped: true,\n  reason: 'The selected SSH Tunnel mode is NONE.'}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n[workflow_img]: https://github.com/mongodb-js/connection-model/workflows/Check%20and%20Test/badge.svg?event=push\n[workflow_url]: https://github.com/mongodb-js/connection-model/actions?query=workflow%3A%22Check+and+Test%22\n[npm_img]: https://img.shields.io/npm/v/mongodb-connection-model.svg?style=flat-square\n[npm_url]: https://www.npmjs.org/package/mongodb-connection-model\n[gitter_img]: https://badges.gitter.im/Join%20Chat.svg\n[gitter_url]: http://gitter.im/mongodb-js/mongodb-js\n[enterprise_img]: https://img.shields.io/badge/MongoDB-Enterprise-blue.svg?style=flat-square\n[coming_soon_img]: https://img.shields.io/badge/-Coming%20Soon-ff69b4.svg?style=flat-square\n[kerberos-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/kerberos_tests.js\n[ldap-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ldap_tests.js\n[x509-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ssl_x509_tests.js\n[ns]: https://github.com/mongodb-js/ns\n[sf-ssh-tunnel]: http://serverfault.com/questions/597765/how-to-connect-to-mongodb-server-via-ssh-tunnel\n[ec2-key-pairs]: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html\n[driver-ssl-impl]: https://github.com/christkv/mongodb-core/blob/c3d21cb636d74d7a68134ecd3b9f6af536311279/lib/connection/connection.js#L365-L407\n[driver-ssl-tutorial]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/\n[driver-ssl-none]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#no-certificate-validation\n[driver-ssl-server]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate\n[driver-ssl-all]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate-and-present-valid-certificate\n","gitHead":"9acb1d074fcbf6aa34b275f617178f0f155ff495","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","test":"mocha","check":"npm run lint && npm run depcheck","pretest":"mongodb-runner install && mongodb-runner start --port=27018","test-ci":"npm run test","depcheck":"depcheck","posttest":"mongodb-runner stop --port=27018","posttest-ci":"node ../../scripts/killall-mongo.js","test-check-ci":"npm run check && npm test"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.17.0+x64 (linux)","description":"MongoDB connection model","directories":{},"_nodeVersion":"16.17.0","compass:main":"index.js","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","debug":"^4.2.0","lodash":"^4.17.15","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.2.0","storage-mixin":"0.0.0-next-9acb1d074fcbf6aa34b275f617178f0f155ff495","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.2","@mongodb-js/ssh-tunnel":"0.0.0-next-9acb1d074fcbf6aa34b275f617178f0f155ff495","@mongodb-js/compass-utils":"0.0.0-next-9acb1d074fcbf6aa34b275f617178f0f155ff495","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.6.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"^5.0.0","depcheck":"^1.4.1","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.10.0","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^5.0.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_0.0.0-next-9acb1d074fcbf6aa34b275f617178f0f155ff495_1676928845063_0.8682839130450573","host":"s3://npm-registry-packages"}},"22.2.2":{"name":"mongodb-connection-model","version":"22.2.2","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@22.2.2","maintainers":[{"name":"mongo-j","email":"james.wang@mongodb.com"},{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"iteng@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"8b29e34df9b351814840f13af749eb292032a72b","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-22.2.2.tgz","fileCount":20,"integrity":"sha512-iXeCemXE1htLrx/LtUzxMPMsjRSPEpW4BsAqM7I8HskrM68+le24eDBkrhvUP9aEOJL8Pk42ies7zlTLYJKL5Q==","signatures":[{"sig":"MEYCIQCdVWic0CXUGxgLFBEjbSVxKU1FBComEmiO2EpPpdG8LwIhALg6sPJF9E9xSVqnDQ88IDyjDDlylTJ6N1X7YKWGWVwT","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":107970,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj+SI5ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpKdg/+O5RiG2L5bFvZjSxJeMEPyOkIq291UaMk/3orVJUgBzr4arAT\r\nFVX7GeA04WN3E89zaSFLcPYdeD6E30gcTkLhaCTMjKb6BMxYWm2MSxns/VZA\r\nx1qEEqcB7QPMsb7dCPEUQP9+YHi0g8fXQtakyNAAzUa3ezl6Q9S+xeczHQis\r\n1Wyh/0p6yulQlrgqRIPAXVMfu/KLOEbXpOeTHluWJhuAItXVh3M56APwbTto\r\nUVkpspNrZTnSwyKXVVAcDh2eM1UxNDQJeOWrc7mP1XyPff0Aij0dSbfnKExF\r\nDuLEoXwaRW2eZffIF9PDGsI/UtENnj9fqlge76rMOOuZQZMdHfTKT3vDDA2+\r\nR7FmkIlJd5jjiyeJSlE9kxDQfSM4NP1CcVQygsrDrbqkDnBVOc0urwC8S+gY\r\n975uUOvLqFh3ZWeSfdnjoifGN/Egh54dK91hPi7aGeZMSqyPKnphyyus3Eot\r\nkVKicoI5QFmZWFoy9nbTKnWIuCABLL28krjTysaogWMKXY3398Uu8/o2QS8h\r\nqSN2ADjAe7u23fuJKI/2ca27Ckrxnrb+s9JCSkRqVkoCRY4zMbb2yODxpPAg\r\nNtMu00YElXmImmalDakxaBCPA3Ov2tPeTQtacAsX13lZY3unaI93ELew5+BH\r\nGtfk/D1bfpI3Na9IPXobn/5cakC48dwtJdU=\r\n=I3W1\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","gitHead":"96ec6b32140254def920e2b4a8dba9be56633f75","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","test":"mocha","check":"npm run lint && npm run depcheck","pretest":"mongodb-runner install && mongodb-runner start --port=27018","test-ci":"npm run test","depcheck":"depcheck","posttest":"mongodb-runner stop --port=27018","posttest-ci":"node ../../scripts/killall-mongo.js","test-check-ci":"npm run check && npm test"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.19.1+x64 (linux)","description":"MongoDB connection model","directories":{},"_nodeVersion":"16.19.1","compass:main":"index.js","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","debug":"^4.2.0","lodash":"^4.17.15","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.2.0","storage-mixin":"^5.1.2","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.2","@mongodb-js/ssh-tunnel":"^2.0.3","@mongodb-js/compass-utils":"^0.2.2","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.6.0"},"_hasShrinkwrap":false,"devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"^5.1.0","depcheck":"^1.4.1","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.10.0","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^5.1.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_22.2.2_1677271609070_0.9120371023934304","host":"s3://npm-registry-packages"}},"0.0.0-next-7675c98b3881009dcc19690b66a6e63e65e1a13c":{"name":"mongodb-connection-model","version":"0.0.0-next-7675c98b3881009dcc19690b66a6e63e65e1a13c","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@0.0.0-next-7675c98b3881009dcc19690b66a6e63e65e1a13c","maintainers":[{"name":"mongo-j","email":"james.wang@mongodb.com"},{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"iteng@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"bb7cade5e74046b16d9512330a73546f8d5fca3a","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-0.0.0-next-7675c98b3881009dcc19690b66a6e63e65e1a13c.tgz","fileCount":20,"integrity":"sha512-hWivxyFnP3r1rR9i7ZUmqT/imCGP8EaTbZ07Ko37H/EmVVXm8dLXqnv3qqg+8/O7Z8MW3c/cgDe4/6w5HaoOiQ==","signatures":[{"sig":"MEUCIEt5YnxzLPFn0QBj/NwOKFgzBiBu1u92auHnemat94y2AiEArirQr+KDeERPOyLYdAzMPMhoVLaitcVlsFoOdjRq6zU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":108150,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj+6oSACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr6zA//QCrRkC102zY3I4Vet7ZeqV5shuI1YeHvutsxGnqpOmA8A6Hp\r\nczualBjVVlDshmJhNbT6eG5gOgOBjT3DEdYkQyAsU0F/0kCLykSTPuUbRIQ6\r\nNeGR7ODIwOyVmqKmXuU/qu2juz8ILidZANKqvGFuzn6/5vrSHccc1yrfj1Wb\r\nMQUHs1FXPJK5/G4J2Y3TX/oxVqPG/e2AzTW+yDEs8m/ZzD6d+zcnDecw0olk\r\nNxbEKePlfQV2VP1DO91VSehKC5wlO/vWOTH5/kwmFGv0OaIUMrxr5waCGgld\r\ntW9seMHXz5rpmIXkPK0He4JPDAH74k5p9mX3mHTnuF9BGHHzoRXZTf+n14de\r\n7DRxOn5D6qoJXVePsMd4Rcov3MA6qFPhSJghGWdziq/NEH83wbGciNFeYPjN\r\nNK/bq1cIbvYeFxebGj1hyAZn01PqWyPCOTHsLFfBvcEfq4WIyvNRhxjwCMQk\r\nYU9bD/nysCV+94glMZNP1xGma4gKICY6fjPblWYjU1BvFE0HuxUG49eMelHz\r\nX+ajyxhBYnTTCq8Iz6yFFn49C7J43dwBFv0bdmGjdtDtyiSDJL/jb2KX3fOE\r\n4X9I4XgibaTm5PDTK2PHVsSfGRieYdwEhsTw9z0AWXCbcTIzATAyhZJdhiLa\r\nqTvrCWe/gEZ8hzPokXAtG5SRYX87Hfnvdss=\r\n=Isys\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","readme":"# mongodb-connection-model [![][workflow_img]][workflow_url] [![][npm_img]][npm_url]\n\n> MongoDB connection model\n\nThe main purpose of the MongoDB connection model is to be a domain model around a MongoDB connection. It encapsulates generating a [Connection String URI](https://docs.mongodb.com/manual/reference/connection-string/) from a group of attributes and parses URI using the [MongoDB Node.JS Driver URI Parser](https://github.com/mongodb-js/mongodb-core/blob/master/lib/uri_parser.js).\n\n## Installation\n\n```\nnpm install --save mongodb-connection-model\n```\n\n## Usage\n\n### Building URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\nconst c = new Connection({ appname: 'My App Name' });\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://localhost:27017/?readPreference=primary&appname=My%20App&ssl=false'\n```\n\n### Parsing URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\n\nConnection.from(\n  'mongodb://someUsername:testPassword@localhost',\n  (error, result) => {\n    console.log(result);\n    >>> `{\n      hosts: [{ host: 'localhost', port: 27017 }],\n      hostname: 'localhost',\n      port: 27017,\n      auth: {\n        username: 'someUsername',\n        password: 'testPassword',\n        db: 'admin'\n      },\n      isSrvRecord: false,\n      authStrategy: 'MONGODB',\n      mongodbUsername: 'someUsername',\n      mongodbPassword: 'testPassword',\n      mongodbDatabaseName: 'admin',\n      extraOptions: {},\n      connectionType: 'NODE_DRIVER',\n      readPreference: 'primary',\n      kerberosCanonicalizeHostname: false,\n      sslMethod: 'NONE',\n      sshTunnel: 'NONE',\n      sshTunnelPort: 22\n    }`\n  }\n);\n```\n\n## Properties\n\nMongoDB connection model is based on Ampersand.js framework and consist of [props](https://ampersandjs.com/docs/#ampersand-state-props) and [derived props](https://ampersandjs.com/docs/#ampersand-state-derived). The props object describes the observable properties that MongoDB connection model gets from the Node.js Driver API.\n\n```javascript\nconst с = new Connection();\nconst props = с.getAttributes({ props: true });\n```\n\n#### See Also\n\n- [URI Generic Syntax](https://tools.ietf.org/html/rfc3986)\n- [URI Options Specification](https://github.com/mongodb/specifications/blob/master/source/uri-options/uri-options.rst)\n\n### General Properties\n\n```javascript\nconst c = new Connection({ isSrvRecord: true });\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ns` | String | A valid [ns][ns] the user can read from | `undefined` |\n| `isSrvRecord` | Boolean | Indicates SRV record | `false` |\n| `auth` | Object | Authentication from driver (username, user, db, password) | `undefined` |\n| `hostname` | String | Hostname of a MongoDB Instance. In case of the replica set the first host and port will be taken | `localhost` |\n| `port` | Number | TCP port of a MongoDB Instance | `27017` |\n| `hosts` | Array | Contains all hosts and ports for replica set | `[{ host: 'localhost', port: 27017 }]` |\n| `extraOptions` | Object | Extra options passed to the node driver as part of `driverOptions` | `{}` |\n| `connectionType` | String | The desired connection type. Possible values: `NODE_DRIVER`, `STITCH_ON_PREM`, `STITCH_ATLAS` | `NODE_DRIVER` |\n| `authStrategy` | String | The desired authentication strategy. Possible values: `NONE`, `MONGODB`, `X509`, `KERBEROS`, `LDAP`, `SCRAM-SHA-256` | `NONE` |\n\n### Connection string options\n\n```javascript\nconst c = new Connection({ appname: 'My App', replicaSet: 'testing' });\n```\n\n#### General connection string options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `replicaSet` | String | Specifies the name of the replica set, if the mongod is a member of a replica set | `undefined` |\n| `connectTimeoutMS` | Number | The time in milliseconds to attempt a connection before timing out | `undefined` |\n| `socketTimeoutMS` | Number | The time in milliseconds to attempt a send or receive on a socket before the attempt times out | `undefined` |\n| `compression` | Object | Object includes compressors and a compression level. The following compressors can be specified: `snappy`, `zlib` (Available in MongoDB 3.6 or greater) | `undefined` |\n\n#### Connection Pool Option\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `maxPoolSize` | Number | The maximum number of connections in the connection pool | `undefined` |\n| `minPoolSize` | Number | The minimum number of connections in the connection pool | `undefined` |\n| `maxIdleTimeMS` | Number | The maximum number of milliseconds that a connection can remain idle in the pool before being removed and closed | `undefined` |\n| `waitQueueMultiple` | Number | A number that the driver multiples the maxPoolSize value to, to provide the maximum number of threads allowed to wait for a connection to become available from the pool | `undefined` |\n| `waitQueueTimeoutMS` | Number | The maximum time in milliseconds that a thread can wait for a connection to become available | `undefined` |\n\n#### Write Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `w` | Number/String | Corresponds to the write concern [w Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-w) | `undefined` |\n| `wTimeoutMS` | Number | Corresponds to the write concern [wtimeout](https://docs.mongodb.com/manual/reference/write-concern/#wc-wtimeout) | `undefined` |\n| `journal` | Boolean | Corresponds to the write concern [j Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-j) | `undefined` |\n\n#### Read Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readConcernLevel` | String | The level of isolation | `undefined` |\n\n#### Read Preference Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readPreference` | String | Specifies the read preferences for this connection. Possible values: `PRIMARY`, `PRIMARY_PREFERRED`, `SECONDARY`, `SECONDARY_PREFERRED`, `NEAREST` | `PRIMARY` |\n| `maxStalenessSeconds` | Number | Specifies, in seconds, how stale a secondary can be before the client stops using it for read operations | `undefined` |\n| `readPreferenceTags` | Object | Default read preference tags for the client | `undefined` |\n\n#### Authentication Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `authSource` | String | Specify the database name associated with the user’s credentials | `undefined` |\n| `authMechanism` | String | Specifies the authentication mechanism that MongoDB will use to authenticate the connection. Possible values: `DEFAULT`, `GSSAPI`, `MONGODB-X509`, `PLAIN`, `SCRAM-SHA-256` | `undefined` |\n| `authMechanismProperties` | Object | Additional options provided for authentication (e.g. to enable hostname canonicalization for GSSAPI) | `undefined` |\n| `gssapiServiceName` | String | Set the Kerberos service name when connecting to Kerberized MongoDB instances | `undefined` |\n| `gssapiServiceRealm` | String | Set the Realm service name | `undefined` |\n| `gssapiCanonicalizeHostName` | Boolean | Whether canonicalized hostname | `undefined` |\n\n#### Server Selection and Discovery Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `localThresholdMS` | Number | The size (in milliseconds) of the latency window for selecting among multiple suitable MongoDB instances | `undefined` |\n| `serverSelectionTimeoutMS` | Number | Specifies how long (in milliseconds) to block for server selection before throwing an exception | `undefined` |\n| `serverSelectionTryOnce` | Boolean | Instructs the driver to scan the MongoDB deployment exactly once after server selection fails and then either select a server or raise an error | `undefined` |\n| `heartbeatFrequencyMS` | Number | Controls when the driver checks the state of the MongoDB deployment | `undefined` |\n\n#### Miscellaneous Configuration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `appname` | String | An application name passed to server as client metadata | `undefined` |\n| `retryWrites` | Boolean | Enable retryable writes | `undefined` |\n| `uuidRepresentation` | String | The legacy representation of UUID. Possible values: `standard`, `csharpLegacy`, `javaLegacy`, `pythonLegacy` | `undefined` |\n| `loadBalanced` | Boolean | Whether or not the server is running in load balanced mode | `undefined` |\n\n### Stitch attributes\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `stitchServiceName` | String | Stitch service name | `undefined` |\n| `stitchClientAppId` | String | Stitch сlient app ID | `undefined` |\n| `stitchGroupId` | String | Stitch group ID | `undefined` |\n| `stitchBaseUrl` | String | Stitch base Url | `undefined` |\n\n### MONGODB authentication\n\n```javascript\nconst c = new Connection({\n  mongodbUsername: 'arlo',\n  mongodbPassword: 'w@of'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/?slaveOk=true&authSource=admin'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `mongodbUsername` | String | MongoDB username | `undefined` |\n| `mongodbPassword` | String | MongoDB password | `undefined` |\n| `mongodbDatabaseName` | String | The database name associated with the user's credentials | `undefined` |\n| `promoteValues` | Boolean | Whether BSON values should be promoted to their JS type counterparts | `undefined` |\n\n### KERBEROS authentication\n\n```javascript\nconst c = new Connection({\n  kerberosServiceName: 'mongodb',\n  kerberosPrincipal: 'arlo/dog@krb5.mongodb.parts',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo%252Fdog%2540krb5.mongodb.parts@localhost:27017/toys?authMechanism=GSSAPI'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n> @note (imlucas): Kerberos on Windows is broken out as it's own state for UX consideration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `kerberosServiceName` | String | Any program or computer you access over a network | `undefined` |\n| `kerberosPrincipal` | String | The format of a typical Kerberos V5 principal is `primary/instance@REALM` | `undefined` |\n| `kerberosCanonicalizeHostname` | Boolean | Whether canonicalized kerberos hostname | `undefined` |\n\n#### See Also\n\n- [node.js driver Kerberos reference](http://bit.ly/mongodb-node-driver-kerberos)\n- [node.js driver Kerberos functional test][kerberos-functional]\n\n### LDAP authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  ldapUsername: 'arlo',\n  ldapPassword: 'w@of',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/toys?slaveOk=true&authMechanism=PLAIN'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ldapUsername` | String | LDAP username | `undefined` |\n| `ldapPassword` | String | LDAP password | `undefined` |\n\n#### See Also\n\n- [node.js driver LDAP reference](http://bit.ly/mongodb-node-driver-ldap)\n- [node.js driver X509 functional test][ldap-functional]\n\n### X509 authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  x509Username: 'CN=client,OU=arlo,O=MongoDB,L=Philadelphia,ST=Pennsylvania,C=US'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://CN%253Dclient%252COU%253Darlo%252CO%253DMongoDB%252CL%253DPhiladelphia%252CST%253DPennsylvania%252CC%253DUS@localhost:27017?slaveOk=true&authMechanism=MONGODB-X509'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `x509Username` | String | The x.509 certificate derived user name, e.g. `CN=user,OU=OrgUnit,O=myOrg,...` | `undefined` |\n\n#### See Also\n\n- [node.js driver X509 reference](http://bit.ly/mongodb-node-driver-x509)\n- [node.js driver X509 functional test][x509-functional]\n\n### SSL\n\n> **Note**: Not to be confused with `authentication=X509`\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ssl` | Number/String | A boolean to enable or disables TLS/SSL for the connection | `undefined` |\n| `sslMethod` | String | The desired ssl method. Possible values: `NONE`, `SYSTEMCA`, `IFAVAILABLE`, `UNVALIDATED`, `SERVER`, `ALL` | `NONE` |\n| `sslCA` | Buffer/String | Array of valid certificates | `undefined` |\n| `sslCert` | Buffer/String | The certificate | `undefined` |\n| `sslKey` | Buffer/String | The certificate private key | `undefined` |\n| `sslPass` | Buffer/String | The certificate password | `undefined` |\n\nDescription of `sslMethod` values:\n\n- `SYSTEMCA` - SSL required, validate using System CA, with host verification.\n- `IFAVAILABLE` - The driver should try SSL first, fall back to no SSL if unavailable, and use the system's Certificate Authority.\n- `SERVER` - The driver should validate the server certificate and fail to connect if validation fails. See also [node.js driver \"Validate Server Certificate\" docs][driver-ssl-server].\n- `ALL` - The driver must present a valid certificate and validate the server certificate. See also [node.js driver \"Validate Server Certificate and Present Valid Certificate\" docs][driver-ssl-all].\n- `NONE` - No SSL (Not recommended).\n- `UNVALIDATED` - Use SSL but do not perform any validation of the certificate chain. See also [node.js driver \"No Certificate Validation\" docs][driver-ssl-none]. **Very** not recommended and likely to be deprecated in future releases because it exposes potential Man-In-The-Middle attack vectors.\n\n#### See also\n\n- [node.js driver SSL implementation][driver-ssl-impl]\n- [node.js driver SSL tutorial][driver-ssl-tutorial]\n\n### SSH TUNNEL\n\n> New in mongodb-connection-model@5.0.0\n\nBecause [authentication](#authentication) is quite difficult for operators to migrate to, the most common method of securing a MongoDB deployment is to use an [SSH tunnel][sf-ssh-tunnel].  This allows operators to leverage their existing SSH security infrastructure to also provide secure access to MongoDB.  For a standard deployment of MongoDB on AWS, this is almost always to strategy.  Because of this, we now support creating SSH tunnels automatically when connecting to MongoDB.\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options, (connectionError, client) => {\n  if (connectionError) {\n    return console.log(connectionError);\n  }\n\n  client.db('mongodb').collection('fanclub').count((countingError, count) => {\n    console.log('counted:', countingError, count);\n    client.close();\n  });\n});\n```\n\nThe above provides the same functionality as creating the tunnel using the bash\ncommand below and connecting to MongoDB via another terminal. Notice that\nconnection-model uses a random local port each time it creates a tunnel.\nUsing the command line, you'd have to replace `<random port>` with an actual\nport number.\n\n```bash\nssh -i ~/.ssh/my-key-aws-pair.pem -L <random port>:localhost:27017 ubuntu@ec2-11-111-111-111.compute-1.amazonaws.com\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `sshTunnel` | String | The desired SSH tunnel strategy. Possible values: `NONE`, `USER_PASSWORD`, `IDENTITY_FILE` | `undefined` |\n| `sshTunnelHostname` | String | The hostname of the SSH remote host | `undefined` |\n| `sshTunnelPort` | Port | The SSH port of the remote host | `22` |\n| `sshTunnelBindToLocalPort` | Port | Bind the localhost endpoint of the SSH Tunnel to this port | `undefined` |\n| `sshTunnelUsername` | String | The optional SSH username for the remote host | `undefined` |\n| `sshTunnelPassword` | String | The optional SSH password for the remote host | `undefined` |\n| `sshTunnelIdentityFile` | String/Array | The optional path to the SSH identity file for the remote host | `undefined` |\n| `sshTunnelPassphrase` | String | The optional passphrase for `sshTunnelIdentityFile` | `undefined` |\n\nDescription of `sshTunnel` values:\n\n- `NONE` - Do not use SSH tunneling.\n- `USER_PASSWORD` - The tunnel is created with SSH username and password only.\n- `IDENTITY_FILE` - The tunnel is created using an identity file.\n\n## Derived Properties\n\nDerived properties (also known as computed properties) are properties of the state object that depend on other properties to determine their value.\n\n```javascript\nconst c = new Connection();\nconst derivedProps = c.getAttributes({ derived: true });\n```\n\n| Derived Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `instanceId` | String | The mongoscope | `localhost:27017` |\n| `driverAuthMechanism` | String | Converts the value of `authStrategy` for humans into the `authMechanism` value for the driver | `undefined` |\n| `safeUrl` | String | The URL where a password is replaced with stars | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrl` | String | Use this URL in order to connect via DataService | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrlWithSsh` | String | Use this URL in order to connect via connection model itself | `mongodb://localhost:29201/?readPreference=primary&ssl=false` |\n| `driverOptions` | String | The second argument `mongoscope-server` passes to `mongodb.connect` | `{}` |\n\n## Events\n\n> New in mongodb-connection-model@5.0.0\n\n#### Example: SSH Tunnel\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', skipped: true,\n  reason: 'The selected SSL mode does not need to load any files.' }\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', complete: true}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n#### Example: SSL\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  ssl: 'ALL',\n  sslCA: '~/.ssl/my-ca.pem',\n  sslCert: '~/.ssl/my-server.pem',\n  sslKey: '~/.ssl/my-server.pem'\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', complete: true}\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', skipped: true,\n  reason: 'The selected SSH Tunnel mode is NONE.'}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n[workflow_img]: https://github.com/mongodb-js/connection-model/workflows/Check%20and%20Test/badge.svg?event=push\n[workflow_url]: https://github.com/mongodb-js/connection-model/actions?query=workflow%3A%22Check+and+Test%22\n[npm_img]: https://img.shields.io/npm/v/mongodb-connection-model.svg?style=flat-square\n[npm_url]: https://www.npmjs.org/package/mongodb-connection-model\n[gitter_img]: https://badges.gitter.im/Join%20Chat.svg\n[gitter_url]: http://gitter.im/mongodb-js/mongodb-js\n[enterprise_img]: https://img.shields.io/badge/MongoDB-Enterprise-blue.svg?style=flat-square\n[coming_soon_img]: https://img.shields.io/badge/-Coming%20Soon-ff69b4.svg?style=flat-square\n[kerberos-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/kerberos_tests.js\n[ldap-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ldap_tests.js\n[x509-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ssl_x509_tests.js\n[ns]: https://github.com/mongodb-js/ns\n[sf-ssh-tunnel]: http://serverfault.com/questions/597765/how-to-connect-to-mongodb-server-via-ssh-tunnel\n[ec2-key-pairs]: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html\n[driver-ssl-impl]: https://github.com/christkv/mongodb-core/blob/c3d21cb636d74d7a68134ecd3b9f6af536311279/lib/connection/connection.js#L365-L407\n[driver-ssl-tutorial]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/\n[driver-ssl-none]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#no-certificate-validation\n[driver-ssl-server]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate\n[driver-ssl-all]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate-and-present-valid-certificate\n","gitHead":"7675c98b3881009dcc19690b66a6e63e65e1a13c","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","test":"mocha","check":"npm run lint && npm run depcheck","pretest":"mongodb-runner install && mongodb-runner start --port=27018","test-ci":"npm run test","depcheck":"depcheck","posttest":"mongodb-runner stop --port=27018","posttest-ci":"node ../../scripts/killall-mongo.js","test-check-ci":"npm run check && npm test"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.17.0+x64 (linux)","description":"MongoDB connection model","directories":{},"_nodeVersion":"16.17.0","compass:main":"index.js","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","debug":"^4.2.0","lodash":"^4.17.15","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.2.0","storage-mixin":"0.0.0-next-7675c98b3881009dcc19690b66a6e63e65e1a13c","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.2","@mongodb-js/ssh-tunnel":"0.0.0-next-7675c98b3881009dcc19690b66a6e63e65e1a13c","@mongodb-js/compass-utils":"0.0.0-next-7675c98b3881009dcc19690b66a6e63e65e1a13c","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.6.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"^5.1.0","depcheck":"^1.4.1","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.10.0","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^5.1.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_0.0.0-next-7675c98b3881009dcc19690b66a6e63e65e1a13c_1677437458390_0.5505749267767104","host":"s3://npm-registry-packages"}},"22.2.3":{"name":"mongodb-connection-model","version":"22.2.3","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@22.2.3","maintainers":[{"name":"mongo-j","email":"james.wang@mongodb.com"},{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"iteng@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"98b3f8173fbeb6e9a07cedcbfeb952f1d11ea54b","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-22.2.3.tgz","fileCount":20,"integrity":"sha512-5wWIMmW1ThqARPN5e/Ub3SWTcfDAGSyZtDauT5PNsTVrb6LUJF9afZ5xP1MO0eOQbhT9KuNA4Poa+fQGEYK9aQ==","signatures":[{"sig":"MEYCIQC8ZRAKRD6xUBf36E4Cvvf7M00Brbvm+iHAgrrmj8OQEgIhAO28KqBkfdfbFb69NjmQeTpY/05DGJluClWS4Jh0h6PO","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":107970,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkAcDkACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpKvg//XZpoU4Qe7CmTBCfN5+sSWBUROXe0fAZVzKlXf+JA7kmhq3aY\r\nr3VfHIk1iZyrOPOme/Z/hnokltGqd2bGnOf6eoKa8YfmnQi9AmS8fqjguxDK\r\nR34dtrdXtsFOM6Q7K07bOR7dFm7MVsbYtiUnrk5qJpr+73ocaCZGLJDOrFvU\r\nf4oBPn7dIAZpwS2RLmPzhGCPl+YRcaRZctpcKZvArUZXVNxSx/ZXT33AXclB\r\nUZLI5VvB6iHpR7s2kNEEENUDzkuS5DvB+0Y++r2/7xFskEvviNWaNug+O1Nr\r\nOoePimox2shCphWJjf2sxcuBhgshfLs/1COZuQcxQRQ9h0HOaobKq/8ZfcEk\r\nwAc+nPtSb/OLUotsrIYSZBJlKTdDT+m5VOhb6yBsWztfUFZfm9ZF3OmzFHrc\r\nv+4gHvTQB07IfoQnUW5zGa382c5E+f8YZEpjs06sXmrm/DIUsrHABbmRaMW5\r\ncHZ2yuzJvWYwSX6xVMJjUf7Kad/RDdsJeH5C6cz65Vn91Gzr/GLFvkfpaSjo\r\nHHJo7l58znxmUR42J2VP3zK4+lHlb/tnnVzMxom092UeIWElG6bW40RGjXM/\r\n0s2aBWRU8S48dqVr1gKJOMGUrU7BlUfTInFRnsfKv9bUpfmAc3dt88pEVSoU\r\nPfPd1n9SAXRStBjI3k8W+ACG7bJl4QKlRT0=\r\n=onhJ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","gitHead":"fe181eedfcb07251b9b9a3dce8254a4941d74e42","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","test":"mocha","check":"npm run lint && npm run depcheck","pretest":"mongodb-runner install && mongodb-runner start --port=27018","test-ci":"npm run test","depcheck":"depcheck","posttest":"mongodb-runner stop --port=27018","posttest-ci":"node ../../scripts/killall-mongo.js","test-check-ci":"npm run check && npm test"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.19.1+x64 (linux)","description":"MongoDB connection model","directories":{},"_nodeVersion":"16.19.1","compass:main":"index.js","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","debug":"^4.2.0","lodash":"^4.17.15","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.2.0","storage-mixin":"^5.1.3","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.2","@mongodb-js/ssh-tunnel":"^2.0.4","@mongodb-js/compass-utils":"^0.2.3","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.6.0"},"_hasShrinkwrap":false,"devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"^5.1.0","depcheck":"^1.4.1","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.10.0","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^5.1.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_22.2.3_1677836516142_0.1499360606450395","host":"s3://npm-registry-packages"}},"0.0.0-next-e0e7275f55471eecce19ff3b75439fb06dce1fad":{"name":"mongodb-connection-model","version":"0.0.0-next-e0e7275f55471eecce19ff3b75439fb06dce1fad","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@0.0.0-next-e0e7275f55471eecce19ff3b75439fb06dce1fad","maintainers":[{"name":"mongo-j","email":"james.wang@mongodb.com"},{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satyendra.n.sinha@gmail.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"iteng@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"fa75d302b7c8ef418039ea14dc30fe44a3b8fafd","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-0.0.0-next-e0e7275f55471eecce19ff3b75439fb06dce1fad.tgz","fileCount":20,"integrity":"sha512-XQ6eRJTi8M6tk7Is21WQOEjwPFsZizEpN3DC/evNPPpBuaWpcR/ScRVEtn06J9JXYr2OZTmdvEflzpK4RRLXDg==","signatures":[{"sig":"MEUCIQDgJs/UOUNkM4MAN8XN+pfGTbzRcakJPD91HY/NSSLAmwIgCAmcKD9yxQoB79PaTmNp+nNxoWFUSrskBpI9FFrywPY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":108150,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkAegeACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmov2hAAjctyegPVhRs9+Wztf3EtANwK2Jra1PD96yq4CjrH46w7sFrS\r\neCh1ZMdQPD/1av3krX/x5mxcuIaLFicgkjOvGvNyz9imIqVO7x8uI0NvdSGN\r\nvlvmEghJU68uEbrXXiK5jZB+zJ1lUtd5cCQOPfzwp90ShL/RVXdcaX3cocET\r\nQGugDqjtcXJc8yebwAhoTAT/eZWb21rg0nJU6oW416TUuVm89KGKIFySf46U\r\nIi5Dtr6py8k9fTN05sB7jgpTL0w+vkuGUrWuZ4jMM/tJK2YFyd5wW7BOAF/T\r\nIC9ZS5cER+6kxB52jGuOCbPo+y95B9Uk1NGb/wgWbXKjQSNgQ9tDe8oUt72h\r\nmsnqv5IO/cHAkre+7NJdf2vEmB6A/UL9OF3qR383LfJ9pOXn98QSIKnpS1l5\r\n9lVk3qz/nqyQQdoz298lz2QpfJabNBNDby/R1TZ23E44F3odfzo2VOZ0vojp\r\nRW21/ZOO7uH/PW+yx/6abvlnABoXeDLjpOAmb7c9bEkcGQNrlNy3q9UR0FmC\r\nyzJGmqX0E65IlwU9aS8EqeDLTZlefOWUUAT06mcF1wgt6vxM+1VhVbBm1HfJ\r\nXCeHLDddfJ+avuRPR4Sv3dpZ9HIfLyUBtZdyPfnN2IrqKMrHq/NED/iZ8vFX\r\nhqt6ZVvXHRDHq9/k+4eaDljgdujEyi0cWNE=\r\n=zddx\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","readme":"# mongodb-connection-model [![][workflow_img]][workflow_url] [![][npm_img]][npm_url]\n\n> MongoDB connection model\n\nThe main purpose of the MongoDB connection model is to be a domain model around a MongoDB connection. It encapsulates generating a [Connection String URI](https://docs.mongodb.com/manual/reference/connection-string/) from a group of attributes and parses URI using the [MongoDB Node.JS Driver URI Parser](https://github.com/mongodb-js/mongodb-core/blob/master/lib/uri_parser.js).\n\n## Installation\n\n```\nnpm install --save mongodb-connection-model\n```\n\n## Usage\n\n### Building URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\nconst c = new Connection({ appname: 'My App Name' });\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://localhost:27017/?readPreference=primary&appname=My%20App&ssl=false'\n```\n\n### Parsing URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\n\nConnection.from(\n  'mongodb://someUsername:testPassword@localhost',\n  (error, result) => {\n    console.log(result);\n    >>> `{\n      hosts: [{ host: 'localhost', port: 27017 }],\n      hostname: 'localhost',\n      port: 27017,\n      auth: {\n        username: 'someUsername',\n        password: 'testPassword',\n        db: 'admin'\n      },\n      isSrvRecord: false,\n      authStrategy: 'MONGODB',\n      mongodbUsername: 'someUsername',\n      mongodbPassword: 'testPassword',\n      mongodbDatabaseName: 'admin',\n      extraOptions: {},\n      connectionType: 'NODE_DRIVER',\n      readPreference: 'primary',\n      kerberosCanonicalizeHostname: false,\n      sslMethod: 'NONE',\n      sshTunnel: 'NONE',\n      sshTunnelPort: 22\n    }`\n  }\n);\n```\n\n## Properties\n\nMongoDB connection model is based on Ampersand.js framework and consist of [props](https://ampersandjs.com/docs/#ampersand-state-props) and [derived props](https://ampersandjs.com/docs/#ampersand-state-derived). The props object describes the observable properties that MongoDB connection model gets from the Node.js Driver API.\n\n```javascript\nconst с = new Connection();\nconst props = с.getAttributes({ props: true });\n```\n\n#### See Also\n\n- [URI Generic Syntax](https://tools.ietf.org/html/rfc3986)\n- [URI Options Specification](https://github.com/mongodb/specifications/blob/master/source/uri-options/uri-options.rst)\n\n### General Properties\n\n```javascript\nconst c = new Connection({ isSrvRecord: true });\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ns` | String | A valid [ns][ns] the user can read from | `undefined` |\n| `isSrvRecord` | Boolean | Indicates SRV record | `false` |\n| `auth` | Object | Authentication from driver (username, user, db, password) | `undefined` |\n| `hostname` | String | Hostname of a MongoDB Instance. In case of the replica set the first host and port will be taken | `localhost` |\n| `port` | Number | TCP port of a MongoDB Instance | `27017` |\n| `hosts` | Array | Contains all hosts and ports for replica set | `[{ host: 'localhost', port: 27017 }]` |\n| `extraOptions` | Object | Extra options passed to the node driver as part of `driverOptions` | `{}` |\n| `connectionType` | String | The desired connection type. Possible values: `NODE_DRIVER`, `STITCH_ON_PREM`, `STITCH_ATLAS` | `NODE_DRIVER` |\n| `authStrategy` | String | The desired authentication strategy. Possible values: `NONE`, `MONGODB`, `X509`, `KERBEROS`, `LDAP`, `SCRAM-SHA-256` | `NONE` |\n\n### Connection string options\n\n```javascript\nconst c = new Connection({ appname: 'My App', replicaSet: 'testing' });\n```\n\n#### General connection string options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `replicaSet` | String | Specifies the name of the replica set, if the mongod is a member of a replica set | `undefined` |\n| `connectTimeoutMS` | Number | The time in milliseconds to attempt a connection before timing out | `undefined` |\n| `socketTimeoutMS` | Number | The time in milliseconds to attempt a send or receive on a socket before the attempt times out | `undefined` |\n| `compression` | Object | Object includes compressors and a compression level. The following compressors can be specified: `snappy`, `zlib` (Available in MongoDB 3.6 or greater) | `undefined` |\n\n#### Connection Pool Option\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `maxPoolSize` | Number | The maximum number of connections in the connection pool | `undefined` |\n| `minPoolSize` | Number | The minimum number of connections in the connection pool | `undefined` |\n| `maxIdleTimeMS` | Number | The maximum number of milliseconds that a connection can remain idle in the pool before being removed and closed | `undefined` |\n| `waitQueueMultiple` | Number | A number that the driver multiples the maxPoolSize value to, to provide the maximum number of threads allowed to wait for a connection to become available from the pool | `undefined` |\n| `waitQueueTimeoutMS` | Number | The maximum time in milliseconds that a thread can wait for a connection to become available | `undefined` |\n\n#### Write Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `w` | Number/String | Corresponds to the write concern [w Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-w) | `undefined` |\n| `wTimeoutMS` | Number | Corresponds to the write concern [wtimeout](https://docs.mongodb.com/manual/reference/write-concern/#wc-wtimeout) | `undefined` |\n| `journal` | Boolean | Corresponds to the write concern [j Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-j) | `undefined` |\n\n#### Read Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readConcernLevel` | String | The level of isolation | `undefined` |\n\n#### Read Preference Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readPreference` | String | Specifies the read preferences for this connection. Possible values: `PRIMARY`, `PRIMARY_PREFERRED`, `SECONDARY`, `SECONDARY_PREFERRED`, `NEAREST` | `PRIMARY` |\n| `maxStalenessSeconds` | Number | Specifies, in seconds, how stale a secondary can be before the client stops using it for read operations | `undefined` |\n| `readPreferenceTags` | Object | Default read preference tags for the client | `undefined` |\n\n#### Authentication Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `authSource` | String | Specify the database name associated with the user’s credentials | `undefined` |\n| `authMechanism` | String | Specifies the authentication mechanism that MongoDB will use to authenticate the connection. Possible values: `DEFAULT`, `GSSAPI`, `MONGODB-X509`, `PLAIN`, `SCRAM-SHA-256` | `undefined` |\n| `authMechanismProperties` | Object | Additional options provided for authentication (e.g. to enable hostname canonicalization for GSSAPI) | `undefined` |\n| `gssapiServiceName` | String | Set the Kerberos service name when connecting to Kerberized MongoDB instances | `undefined` |\n| `gssapiServiceRealm` | String | Set the Realm service name | `undefined` |\n| `gssapiCanonicalizeHostName` | Boolean | Whether canonicalized hostname | `undefined` |\n\n#### Server Selection and Discovery Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `localThresholdMS` | Number | The size (in milliseconds) of the latency window for selecting among multiple suitable MongoDB instances | `undefined` |\n| `serverSelectionTimeoutMS` | Number | Specifies how long (in milliseconds) to block for server selection before throwing an exception | `undefined` |\n| `serverSelectionTryOnce` | Boolean | Instructs the driver to scan the MongoDB deployment exactly once after server selection fails and then either select a server or raise an error | `undefined` |\n| `heartbeatFrequencyMS` | Number | Controls when the driver checks the state of the MongoDB deployment | `undefined` |\n\n#### Miscellaneous Configuration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `appname` | String | An application name passed to server as client metadata | `undefined` |\n| `retryWrites` | Boolean | Enable retryable writes | `undefined` |\n| `uuidRepresentation` | String | The legacy representation of UUID. Possible values: `standard`, `csharpLegacy`, `javaLegacy`, `pythonLegacy` | `undefined` |\n| `loadBalanced` | Boolean | Whether or not the server is running in load balanced mode | `undefined` |\n\n### Stitch attributes\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `stitchServiceName` | String | Stitch service name | `undefined` |\n| `stitchClientAppId` | String | Stitch сlient app ID | `undefined` |\n| `stitchGroupId` | String | Stitch group ID | `undefined` |\n| `stitchBaseUrl` | String | Stitch base Url | `undefined` |\n\n### MONGODB authentication\n\n```javascript\nconst c = new Connection({\n  mongodbUsername: 'arlo',\n  mongodbPassword: 'w@of'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/?slaveOk=true&authSource=admin'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `mongodbUsername` | String | MongoDB username | `undefined` |\n| `mongodbPassword` | String | MongoDB password | `undefined` |\n| `mongodbDatabaseName` | String | The database name associated with the user's credentials | `undefined` |\n| `promoteValues` | Boolean | Whether BSON values should be promoted to their JS type counterparts | `undefined` |\n\n### KERBEROS authentication\n\n```javascript\nconst c = new Connection({\n  kerberosServiceName: 'mongodb',\n  kerberosPrincipal: 'arlo/dog@krb5.mongodb.parts',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo%252Fdog%2540krb5.mongodb.parts@localhost:27017/toys?authMechanism=GSSAPI'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n> @note (imlucas): Kerberos on Windows is broken out as it's own state for UX consideration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `kerberosServiceName` | String | Any program or computer you access over a network | `undefined` |\n| `kerberosPrincipal` | String | The format of a typical Kerberos V5 principal is `primary/instance@REALM` | `undefined` |\n| `kerberosCanonicalizeHostname` | Boolean | Whether canonicalized kerberos hostname | `undefined` |\n\n#### See Also\n\n- [node.js driver Kerberos reference](http://bit.ly/mongodb-node-driver-kerberos)\n- [node.js driver Kerberos functional test][kerberos-functional]\n\n### LDAP authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  ldapUsername: 'arlo',\n  ldapPassword: 'w@of',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/toys?slaveOk=true&authMechanism=PLAIN'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ldapUsername` | String | LDAP username | `undefined` |\n| `ldapPassword` | String | LDAP password | `undefined` |\n\n#### See Also\n\n- [node.js driver LDAP reference](http://bit.ly/mongodb-node-driver-ldap)\n- [node.js driver X509 functional test][ldap-functional]\n\n### X509 authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  x509Username: 'CN=client,OU=arlo,O=MongoDB,L=Philadelphia,ST=Pennsylvania,C=US'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://CN%253Dclient%252COU%253Darlo%252CO%253DMongoDB%252CL%253DPhiladelphia%252CST%253DPennsylvania%252CC%253DUS@localhost:27017?slaveOk=true&authMechanism=MONGODB-X509'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `x509Username` | String | The x.509 certificate derived user name, e.g. `CN=user,OU=OrgUnit,O=myOrg,...` | `undefined` |\n\n#### See Also\n\n- [node.js driver X509 reference](http://bit.ly/mongodb-node-driver-x509)\n- [node.js driver X509 functional test][x509-functional]\n\n### SSL\n\n> **Note**: Not to be confused with `authentication=X509`\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ssl` | Number/String | A boolean to enable or disables TLS/SSL for the connection | `undefined` |\n| `sslMethod` | String | The desired ssl method. Possible values: `NONE`, `SYSTEMCA`, `IFAVAILABLE`, `UNVALIDATED`, `SERVER`, `ALL` | `NONE` |\n| `sslCA` | Buffer/String | Array of valid certificates | `undefined` |\n| `sslCert` | Buffer/String | The certificate | `undefined` |\n| `sslKey` | Buffer/String | The certificate private key | `undefined` |\n| `sslPass` | Buffer/String | The certificate password | `undefined` |\n\nDescription of `sslMethod` values:\n\n- `SYSTEMCA` - SSL required, validate using System CA, with host verification.\n- `IFAVAILABLE` - The driver should try SSL first, fall back to no SSL if unavailable, and use the system's Certificate Authority.\n- `SERVER` - The driver should validate the server certificate and fail to connect if validation fails. See also [node.js driver \"Validate Server Certificate\" docs][driver-ssl-server].\n- `ALL` - The driver must present a valid certificate and validate the server certificate. See also [node.js driver \"Validate Server Certificate and Present Valid Certificate\" docs][driver-ssl-all].\n- `NONE` - No SSL (Not recommended).\n- `UNVALIDATED` - Use SSL but do not perform any validation of the certificate chain. See also [node.js driver \"No Certificate Validation\" docs][driver-ssl-none]. **Very** not recommended and likely to be deprecated in future releases because it exposes potential Man-In-The-Middle attack vectors.\n\n#### See also\n\n- [node.js driver SSL implementation][driver-ssl-impl]\n- [node.js driver SSL tutorial][driver-ssl-tutorial]\n\n### SSH TUNNEL\n\n> New in mongodb-connection-model@5.0.0\n\nBecause [authentication](#authentication) is quite difficult for operators to migrate to, the most common method of securing a MongoDB deployment is to use an [SSH tunnel][sf-ssh-tunnel].  This allows operators to leverage their existing SSH security infrastructure to also provide secure access to MongoDB.  For a standard deployment of MongoDB on AWS, this is almost always to strategy.  Because of this, we now support creating SSH tunnels automatically when connecting to MongoDB.\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options, (connectionError, client) => {\n  if (connectionError) {\n    return console.log(connectionError);\n  }\n\n  client.db('mongodb').collection('fanclub').count((countingError, count) => {\n    console.log('counted:', countingError, count);\n    client.close();\n  });\n});\n```\n\nThe above provides the same functionality as creating the tunnel using the bash\ncommand below and connecting to MongoDB via another terminal. Notice that\nconnection-model uses a random local port each time it creates a tunnel.\nUsing the command line, you'd have to replace `<random port>` with an actual\nport number.\n\n```bash\nssh -i ~/.ssh/my-key-aws-pair.pem -L <random port>:localhost:27017 ubuntu@ec2-11-111-111-111.compute-1.amazonaws.com\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `sshTunnel` | String | The desired SSH tunnel strategy. Possible values: `NONE`, `USER_PASSWORD`, `IDENTITY_FILE` | `undefined` |\n| `sshTunnelHostname` | String | The hostname of the SSH remote host | `undefined` |\n| `sshTunnelPort` | Port | The SSH port of the remote host | `22` |\n| `sshTunnelBindToLocalPort` | Port | Bind the localhost endpoint of the SSH Tunnel to this port | `undefined` |\n| `sshTunnelUsername` | String | The optional SSH username for the remote host | `undefined` |\n| `sshTunnelPassword` | String | The optional SSH password for the remote host | `undefined` |\n| `sshTunnelIdentityFile` | String/Array | The optional path to the SSH identity file for the remote host | `undefined` |\n| `sshTunnelPassphrase` | String | The optional passphrase for `sshTunnelIdentityFile` | `undefined` |\n\nDescription of `sshTunnel` values:\n\n- `NONE` - Do not use SSH tunneling.\n- `USER_PASSWORD` - The tunnel is created with SSH username and password only.\n- `IDENTITY_FILE` - The tunnel is created using an identity file.\n\n## Derived Properties\n\nDerived properties (also known as computed properties) are properties of the state object that depend on other properties to determine their value.\n\n```javascript\nconst c = new Connection();\nconst derivedProps = c.getAttributes({ derived: true });\n```\n\n| Derived Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `instanceId` | String | The mongoscope | `localhost:27017` |\n| `driverAuthMechanism` | String | Converts the value of `authStrategy` for humans into the `authMechanism` value for the driver | `undefined` |\n| `safeUrl` | String | The URL where a password is replaced with stars | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrl` | String | Use this URL in order to connect via DataService | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrlWithSsh` | String | Use this URL in order to connect via connection model itself | `mongodb://localhost:29201/?readPreference=primary&ssl=false` |\n| `driverOptions` | String | The second argument `mongoscope-server` passes to `mongodb.connect` | `{}` |\n\n## Events\n\n> New in mongodb-connection-model@5.0.0\n\n#### Example: SSH Tunnel\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', skipped: true,\n  reason: 'The selected SSL mode does not need to load any files.' }\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', complete: true}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n#### Example: SSL\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  ssl: 'ALL',\n  sslCA: '~/.ssl/my-ca.pem',\n  sslCert: '~/.ssl/my-server.pem',\n  sslKey: '~/.ssl/my-server.pem'\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', complete: true}\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', skipped: true,\n  reason: 'The selected SSH Tunnel mode is NONE.'}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n[workflow_img]: https://github.com/mongodb-js/connection-model/workflows/Check%20and%20Test/badge.svg?event=push\n[workflow_url]: https://github.com/mongodb-js/connection-model/actions?query=workflow%3A%22Check+and+Test%22\n[npm_img]: https://img.shields.io/npm/v/mongodb-connection-model.svg?style=flat-square\n[npm_url]: https://www.npmjs.org/package/mongodb-connection-model\n[gitter_img]: https://badges.gitter.im/Join%20Chat.svg\n[gitter_url]: http://gitter.im/mongodb-js/mongodb-js\n[enterprise_img]: https://img.shields.io/badge/MongoDB-Enterprise-blue.svg?style=flat-square\n[coming_soon_img]: https://img.shields.io/badge/-Coming%20Soon-ff69b4.svg?style=flat-square\n[kerberos-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/kerberos_tests.js\n[ldap-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ldap_tests.js\n[x509-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ssl_x509_tests.js\n[ns]: https://github.com/mongodb-js/ns\n[sf-ssh-tunnel]: http://serverfault.com/questions/597765/how-to-connect-to-mongodb-server-via-ssh-tunnel\n[ec2-key-pairs]: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html\n[driver-ssl-impl]: https://github.com/christkv/mongodb-core/blob/c3d21cb636d74d7a68134ecd3b9f6af536311279/lib/connection/connection.js#L365-L407\n[driver-ssl-tutorial]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/\n[driver-ssl-none]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#no-certificate-validation\n[driver-ssl-server]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate\n[driver-ssl-all]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate-and-present-valid-certificate\n","gitHead":"e0e7275f55471eecce19ff3b75439fb06dce1fad","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","test":"mocha","check":"npm run lint && npm run depcheck","pretest":"mongodb-runner install && mongodb-runner start --port=27018","test-ci":"npm run test","depcheck":"depcheck","posttest":"mongodb-runner stop --port=27018","posttest-ci":"node ../../scripts/killall-mongo.js","test-check-ci":"npm run check && npm test"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.17.0+x64 (linux)","description":"MongoDB connection model","directories":{},"_nodeVersion":"16.17.0","compass:main":"index.js","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","debug":"^4.2.0","lodash":"^4.17.15","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.2.0","storage-mixin":"0.0.0-next-e0e7275f55471eecce19ff3b75439fb06dce1fad","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.2","@mongodb-js/ssh-tunnel":"0.0.0-next-e0e7275f55471eecce19ff3b75439fb06dce1fad","@mongodb-js/compass-utils":"0.0.0-next-e0e7275f55471eecce19ff3b75439fb06dce1fad","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.6.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^8.0.1","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"^5.1.0","depcheck":"^1.4.1","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.10.0","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^5.1.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_0.0.0-next-e0e7275f55471eecce19ff3b75439fb06dce1fad_1677846558520_0.1524986367693011","host":"s3://npm-registry-packages"}},"0.0.0-next-04ba59a8ace9d68fd90d540d8a8936985115e22e":{"name":"mongodb-connection-model","version":"0.0.0-next-04ba59a8ace9d68fd90d540d8a8936985115e22e","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@0.0.0-next-04ba59a8ace9d68fd90d540d8a8936985115e22e","maintainers":[{"name":"mongo-j","email":"james.wang@mongodb.com"},{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satya@mongodb.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"iteng@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"48d7a8e829c164de6897930fd49770b47af2e4c8","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-0.0.0-next-04ba59a8ace9d68fd90d540d8a8936985115e22e.tgz","fileCount":20,"integrity":"sha512-8pUtdtsTjcxr/0GmovvpiDls5MuCE/5ToyV9C/UAAsFtofRNAKZII1zEKb6rSXwPunmXSurUBoE+u1h48bnxBw==","signatures":[{"sig":"MEUCIQCNfixzCOF5VBM7d5DwQwglGq8rZFtqN5IArclwX2QCfQIgdrr+J4pgRaqDrVpHt8Ik6YaGfDPAj4lUey/xEI6T0Aw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":108151,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkFa+hACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqROQ//U5Ri87cOTwoRbyAVY0Wkuect3RpOox7ldj3u/rQARZ7IDp8I\r\n6UOoXlwaVWbEWE5bWM1ULoO08XESsoMhBevRIX8EaQyz3sPNl7FYtqkPaMN/\r\naewCuvtOWepNmWGZoySqWyvuyudq4mg0jeaifUCmFgp+zhxky5WMzQnif3Va\r\n1Ue4FwW4N4TUURqWDTN5crmArnEv6jVgjtF15jVn+BanEKqpBvUXomZuHQEQ\r\ncxvkv1qi4PEMUtiMUC2MkTAj+eueuS4eRsCDlqXgf5O4S3DRxpLqInaSeoPD\r\nC93WOQ9egPuAXj5GI3MQ3ya+IuFp7Rta6C1xYtMMxRZEoWTMscxlhAHX2WLB\r\nyY8yQQ3SOyYmHYhIGFIIMaNnOsKao5HCxyPdQtDkLalVVephkH+rsD3K43fQ\r\nwfpSV829CMViV6jgwESgHpa42mznMIFCGQcH+eWgbMFgp95OnzYNXo++oytq\r\nMkMx0wRNP4M/M4dwe7/8pncTVF09d7RMya2kF897e5u1Zdk9BrZFKjpx3dZ4\r\nJkdsSas2VZgk5CRHC7UomCjNMiVb5/z4jcrWq+coXSei3HxdWQJLFg/S103p\r\nYbwnsA8VN115Ij5Q7hw36rxe/fDvK22sONWMY+BAbZ9Qmrb2QWl01LTUMIHM\r\ntAJHT+PHKzrTihiZQBm+R40q3c7tBYhRUHo=\r\n=Qd62\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","readme":"# mongodb-connection-model [![][workflow_img]][workflow_url] [![][npm_img]][npm_url]\n\n> MongoDB connection model\n\nThe main purpose of the MongoDB connection model is to be a domain model around a MongoDB connection. It encapsulates generating a [Connection String URI](https://docs.mongodb.com/manual/reference/connection-string/) from a group of attributes and parses URI using the [MongoDB Node.JS Driver URI Parser](https://github.com/mongodb-js/mongodb-core/blob/master/lib/uri_parser.js).\n\n## Installation\n\n```\nnpm install --save mongodb-connection-model\n```\n\n## Usage\n\n### Building URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\nconst c = new Connection({ appname: 'My App Name' });\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://localhost:27017/?readPreference=primary&appname=My%20App&ssl=false'\n```\n\n### Parsing URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\n\nConnection.from(\n  'mongodb://someUsername:testPassword@localhost',\n  (error, result) => {\n    console.log(result);\n    >>> `{\n      hosts: [{ host: 'localhost', port: 27017 }],\n      hostname: 'localhost',\n      port: 27017,\n      auth: {\n        username: 'someUsername',\n        password: 'testPassword',\n        db: 'admin'\n      },\n      isSrvRecord: false,\n      authStrategy: 'MONGODB',\n      mongodbUsername: 'someUsername',\n      mongodbPassword: 'testPassword',\n      mongodbDatabaseName: 'admin',\n      extraOptions: {},\n      connectionType: 'NODE_DRIVER',\n      readPreference: 'primary',\n      kerberosCanonicalizeHostname: false,\n      sslMethod: 'NONE',\n      sshTunnel: 'NONE',\n      sshTunnelPort: 22\n    }`\n  }\n);\n```\n\n## Properties\n\nMongoDB connection model is based on Ampersand.js framework and consist of [props](https://ampersandjs.com/docs/#ampersand-state-props) and [derived props](https://ampersandjs.com/docs/#ampersand-state-derived). The props object describes the observable properties that MongoDB connection model gets from the Node.js Driver API.\n\n```javascript\nconst с = new Connection();\nconst props = с.getAttributes({ props: true });\n```\n\n#### See Also\n\n- [URI Generic Syntax](https://tools.ietf.org/html/rfc3986)\n- [URI Options Specification](https://github.com/mongodb/specifications/blob/master/source/uri-options/uri-options.rst)\n\n### General Properties\n\n```javascript\nconst c = new Connection({ isSrvRecord: true });\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ns` | String | A valid [ns][ns] the user can read from | `undefined` |\n| `isSrvRecord` | Boolean | Indicates SRV record | `false` |\n| `auth` | Object | Authentication from driver (username, user, db, password) | `undefined` |\n| `hostname` | String | Hostname of a MongoDB Instance. In case of the replica set the first host and port will be taken | `localhost` |\n| `port` | Number | TCP port of a MongoDB Instance | `27017` |\n| `hosts` | Array | Contains all hosts and ports for replica set | `[{ host: 'localhost', port: 27017 }]` |\n| `extraOptions` | Object | Extra options passed to the node driver as part of `driverOptions` | `{}` |\n| `connectionType` | String | The desired connection type. Possible values: `NODE_DRIVER`, `STITCH_ON_PREM`, `STITCH_ATLAS` | `NODE_DRIVER` |\n| `authStrategy` | String | The desired authentication strategy. Possible values: `NONE`, `MONGODB`, `X509`, `KERBEROS`, `LDAP`, `SCRAM-SHA-256` | `NONE` |\n\n### Connection string options\n\n```javascript\nconst c = new Connection({ appname: 'My App', replicaSet: 'testing' });\n```\n\n#### General connection string options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `replicaSet` | String | Specifies the name of the replica set, if the mongod is a member of a replica set | `undefined` |\n| `connectTimeoutMS` | Number | The time in milliseconds to attempt a connection before timing out | `undefined` |\n| `socketTimeoutMS` | Number | The time in milliseconds to attempt a send or receive on a socket before the attempt times out | `undefined` |\n| `compression` | Object | Object includes compressors and a compression level. The following compressors can be specified: `snappy`, `zlib` (Available in MongoDB 3.6 or greater) | `undefined` |\n\n#### Connection Pool Option\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `maxPoolSize` | Number | The maximum number of connections in the connection pool | `undefined` |\n| `minPoolSize` | Number | The minimum number of connections in the connection pool | `undefined` |\n| `maxIdleTimeMS` | Number | The maximum number of milliseconds that a connection can remain idle in the pool before being removed and closed | `undefined` |\n| `waitQueueMultiple` | Number | A number that the driver multiples the maxPoolSize value to, to provide the maximum number of threads allowed to wait for a connection to become available from the pool | `undefined` |\n| `waitQueueTimeoutMS` | Number | The maximum time in milliseconds that a thread can wait for a connection to become available | `undefined` |\n\n#### Write Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `w` | Number/String | Corresponds to the write concern [w Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-w) | `undefined` |\n| `wTimeoutMS` | Number | Corresponds to the write concern [wtimeout](https://docs.mongodb.com/manual/reference/write-concern/#wc-wtimeout) | `undefined` |\n| `journal` | Boolean | Corresponds to the write concern [j Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-j) | `undefined` |\n\n#### Read Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readConcernLevel` | String | The level of isolation | `undefined` |\n\n#### Read Preference Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readPreference` | String | Specifies the read preferences for this connection. Possible values: `PRIMARY`, `PRIMARY_PREFERRED`, `SECONDARY`, `SECONDARY_PREFERRED`, `NEAREST` | `PRIMARY` |\n| `maxStalenessSeconds` | Number | Specifies, in seconds, how stale a secondary can be before the client stops using it for read operations | `undefined` |\n| `readPreferenceTags` | Object | Default read preference tags for the client | `undefined` |\n\n#### Authentication Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `authSource` | String | Specify the database name associated with the user’s credentials | `undefined` |\n| `authMechanism` | String | Specifies the authentication mechanism that MongoDB will use to authenticate the connection. Possible values: `DEFAULT`, `GSSAPI`, `MONGODB-X509`, `PLAIN`, `SCRAM-SHA-256` | `undefined` |\n| `authMechanismProperties` | Object | Additional options provided for authentication (e.g. to enable hostname canonicalization for GSSAPI) | `undefined` |\n| `gssapiServiceName` | String | Set the Kerberos service name when connecting to Kerberized MongoDB instances | `undefined` |\n| `gssapiServiceRealm` | String | Set the Realm service name | `undefined` |\n| `gssapiCanonicalizeHostName` | Boolean | Whether canonicalized hostname | `undefined` |\n\n#### Server Selection and Discovery Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `localThresholdMS` | Number | The size (in milliseconds) of the latency window for selecting among multiple suitable MongoDB instances | `undefined` |\n| `serverSelectionTimeoutMS` | Number | Specifies how long (in milliseconds) to block for server selection before throwing an exception | `undefined` |\n| `serverSelectionTryOnce` | Boolean | Instructs the driver to scan the MongoDB deployment exactly once after server selection fails and then either select a server or raise an error | `undefined` |\n| `heartbeatFrequencyMS` | Number | Controls when the driver checks the state of the MongoDB deployment | `undefined` |\n\n#### Miscellaneous Configuration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `appname` | String | An application name passed to server as client metadata | `undefined` |\n| `retryWrites` | Boolean | Enable retryable writes | `undefined` |\n| `uuidRepresentation` | String | The legacy representation of UUID. Possible values: `standard`, `csharpLegacy`, `javaLegacy`, `pythonLegacy` | `undefined` |\n| `loadBalanced` | Boolean | Whether or not the server is running in load balanced mode | `undefined` |\n\n### Stitch attributes\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `stitchServiceName` | String | Stitch service name | `undefined` |\n| `stitchClientAppId` | String | Stitch сlient app ID | `undefined` |\n| `stitchGroupId` | String | Stitch group ID | `undefined` |\n| `stitchBaseUrl` | String | Stitch base Url | `undefined` |\n\n### MONGODB authentication\n\n```javascript\nconst c = new Connection({\n  mongodbUsername: 'arlo',\n  mongodbPassword: 'w@of'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/?slaveOk=true&authSource=admin'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `mongodbUsername` | String | MongoDB username | `undefined` |\n| `mongodbPassword` | String | MongoDB password | `undefined` |\n| `mongodbDatabaseName` | String | The database name associated with the user's credentials | `undefined` |\n| `promoteValues` | Boolean | Whether BSON values should be promoted to their JS type counterparts | `undefined` |\n\n### KERBEROS authentication\n\n```javascript\nconst c = new Connection({\n  kerberosServiceName: 'mongodb',\n  kerberosPrincipal: 'arlo/dog@krb5.mongodb.parts',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo%252Fdog%2540krb5.mongodb.parts@localhost:27017/toys?authMechanism=GSSAPI'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n> @note (imlucas): Kerberos on Windows is broken out as it's own state for UX consideration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `kerberosServiceName` | String | Any program or computer you access over a network | `undefined` |\n| `kerberosPrincipal` | String | The format of a typical Kerberos V5 principal is `primary/instance@REALM` | `undefined` |\n| `kerberosCanonicalizeHostname` | Boolean | Whether canonicalized kerberos hostname | `undefined` |\n\n#### See Also\n\n- [node.js driver Kerberos reference](http://bit.ly/mongodb-node-driver-kerberos)\n- [node.js driver Kerberos functional test][kerberos-functional]\n\n### LDAP authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  ldapUsername: 'arlo',\n  ldapPassword: 'w@of',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/toys?slaveOk=true&authMechanism=PLAIN'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ldapUsername` | String | LDAP username | `undefined` |\n| `ldapPassword` | String | LDAP password | `undefined` |\n\n#### See Also\n\n- [node.js driver LDAP reference](http://bit.ly/mongodb-node-driver-ldap)\n- [node.js driver X509 functional test][ldap-functional]\n\n### X509 authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  x509Username: 'CN=client,OU=arlo,O=MongoDB,L=Philadelphia,ST=Pennsylvania,C=US'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://CN%253Dclient%252COU%253Darlo%252CO%253DMongoDB%252CL%253DPhiladelphia%252CST%253DPennsylvania%252CC%253DUS@localhost:27017?slaveOk=true&authMechanism=MONGODB-X509'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `x509Username` | String | The x.509 certificate derived user name, e.g. `CN=user,OU=OrgUnit,O=myOrg,...` | `undefined` |\n\n#### See Also\n\n- [node.js driver X509 reference](http://bit.ly/mongodb-node-driver-x509)\n- [node.js driver X509 functional test][x509-functional]\n\n### SSL\n\n> **Note**: Not to be confused with `authentication=X509`\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ssl` | Number/String | A boolean to enable or disables TLS/SSL for the connection | `undefined` |\n| `sslMethod` | String | The desired ssl method. Possible values: `NONE`, `SYSTEMCA`, `IFAVAILABLE`, `UNVALIDATED`, `SERVER`, `ALL` | `NONE` |\n| `sslCA` | Buffer/String | Array of valid certificates | `undefined` |\n| `sslCert` | Buffer/String | The certificate | `undefined` |\n| `sslKey` | Buffer/String | The certificate private key | `undefined` |\n| `sslPass` | Buffer/String | The certificate password | `undefined` |\n\nDescription of `sslMethod` values:\n\n- `SYSTEMCA` - SSL required, validate using System CA, with host verification.\n- `IFAVAILABLE` - The driver should try SSL first, fall back to no SSL if unavailable, and use the system's Certificate Authority.\n- `SERVER` - The driver should validate the server certificate and fail to connect if validation fails. See also [node.js driver \"Validate Server Certificate\" docs][driver-ssl-server].\n- `ALL` - The driver must present a valid certificate and validate the server certificate. See also [node.js driver \"Validate Server Certificate and Present Valid Certificate\" docs][driver-ssl-all].\n- `NONE` - No SSL (Not recommended).\n- `UNVALIDATED` - Use SSL but do not perform any validation of the certificate chain. See also [node.js driver \"No Certificate Validation\" docs][driver-ssl-none]. **Very** not recommended and likely to be deprecated in future releases because it exposes potential Man-In-The-Middle attack vectors.\n\n#### See also\n\n- [node.js driver SSL implementation][driver-ssl-impl]\n- [node.js driver SSL tutorial][driver-ssl-tutorial]\n\n### SSH TUNNEL\n\n> New in mongodb-connection-model@5.0.0\n\nBecause [authentication](#authentication) is quite difficult for operators to migrate to, the most common method of securing a MongoDB deployment is to use an [SSH tunnel][sf-ssh-tunnel].  This allows operators to leverage their existing SSH security infrastructure to also provide secure access to MongoDB.  For a standard deployment of MongoDB on AWS, this is almost always to strategy.  Because of this, we now support creating SSH tunnels automatically when connecting to MongoDB.\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options, (connectionError, client) => {\n  if (connectionError) {\n    return console.log(connectionError);\n  }\n\n  client.db('mongodb').collection('fanclub').count((countingError, count) => {\n    console.log('counted:', countingError, count);\n    client.close();\n  });\n});\n```\n\nThe above provides the same functionality as creating the tunnel using the bash\ncommand below and connecting to MongoDB via another terminal. Notice that\nconnection-model uses a random local port each time it creates a tunnel.\nUsing the command line, you'd have to replace `<random port>` with an actual\nport number.\n\n```bash\nssh -i ~/.ssh/my-key-aws-pair.pem -L <random port>:localhost:27017 ubuntu@ec2-11-111-111-111.compute-1.amazonaws.com\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `sshTunnel` | String | The desired SSH tunnel strategy. Possible values: `NONE`, `USER_PASSWORD`, `IDENTITY_FILE` | `undefined` |\n| `sshTunnelHostname` | String | The hostname of the SSH remote host | `undefined` |\n| `sshTunnelPort` | Port | The SSH port of the remote host | `22` |\n| `sshTunnelBindToLocalPort` | Port | Bind the localhost endpoint of the SSH Tunnel to this port | `undefined` |\n| `sshTunnelUsername` | String | The optional SSH username for the remote host | `undefined` |\n| `sshTunnelPassword` | String | The optional SSH password for the remote host | `undefined` |\n| `sshTunnelIdentityFile` | String/Array | The optional path to the SSH identity file for the remote host | `undefined` |\n| `sshTunnelPassphrase` | String | The optional passphrase for `sshTunnelIdentityFile` | `undefined` |\n\nDescription of `sshTunnel` values:\n\n- `NONE` - Do not use SSH tunneling.\n- `USER_PASSWORD` - The tunnel is created with SSH username and password only.\n- `IDENTITY_FILE` - The tunnel is created using an identity file.\n\n## Derived Properties\n\nDerived properties (also known as computed properties) are properties of the state object that depend on other properties to determine their value.\n\n```javascript\nconst c = new Connection();\nconst derivedProps = c.getAttributes({ derived: true });\n```\n\n| Derived Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `instanceId` | String | The mongoscope | `localhost:27017` |\n| `driverAuthMechanism` | String | Converts the value of `authStrategy` for humans into the `authMechanism` value for the driver | `undefined` |\n| `safeUrl` | String | The URL where a password is replaced with stars | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrl` | String | Use this URL in order to connect via DataService | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrlWithSsh` | String | Use this URL in order to connect via connection model itself | `mongodb://localhost:29201/?readPreference=primary&ssl=false` |\n| `driverOptions` | String | The second argument `mongoscope-server` passes to `mongodb.connect` | `{}` |\n\n## Events\n\n> New in mongodb-connection-model@5.0.0\n\n#### Example: SSH Tunnel\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', skipped: true,\n  reason: 'The selected SSL mode does not need to load any files.' }\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', complete: true}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n#### Example: SSL\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  ssl: 'ALL',\n  sslCA: '~/.ssl/my-ca.pem',\n  sslCert: '~/.ssl/my-server.pem',\n  sslKey: '~/.ssl/my-server.pem'\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', complete: true}\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', skipped: true,\n  reason: 'The selected SSH Tunnel mode is NONE.'}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n[workflow_img]: https://github.com/mongodb-js/connection-model/workflows/Check%20and%20Test/badge.svg?event=push\n[workflow_url]: https://github.com/mongodb-js/connection-model/actions?query=workflow%3A%22Check+and+Test%22\n[npm_img]: https://img.shields.io/npm/v/mongodb-connection-model.svg?style=flat-square\n[npm_url]: https://www.npmjs.org/package/mongodb-connection-model\n[gitter_img]: https://badges.gitter.im/Join%20Chat.svg\n[gitter_url]: http://gitter.im/mongodb-js/mongodb-js\n[enterprise_img]: https://img.shields.io/badge/MongoDB-Enterprise-blue.svg?style=flat-square\n[coming_soon_img]: https://img.shields.io/badge/-Coming%20Soon-ff69b4.svg?style=flat-square\n[kerberos-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/kerberos_tests.js\n[ldap-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ldap_tests.js\n[x509-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ssl_x509_tests.js\n[ns]: https://github.com/mongodb-js/ns\n[sf-ssh-tunnel]: http://serverfault.com/questions/597765/how-to-connect-to-mongodb-server-via-ssh-tunnel\n[ec2-key-pairs]: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html\n[driver-ssl-impl]: https://github.com/christkv/mongodb-core/blob/c3d21cb636d74d7a68134ecd3b9f6af536311279/lib/connection/connection.js#L365-L407\n[driver-ssl-tutorial]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/\n[driver-ssl-none]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#no-certificate-validation\n[driver-ssl-server]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate\n[driver-ssl-all]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate-and-present-valid-certificate\n","gitHead":"04ba59a8ace9d68fd90d540d8a8936985115e22e","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","test":"mocha","check":"npm run lint && npm run depcheck","pretest":"mongodb-runner install && mongodb-runner start --port=27018","test-ci":"npm run test","depcheck":"depcheck","posttest":"mongodb-runner stop --port=27018","posttest-ci":"node ../../scripts/killall-mongo.js","test-check-ci":"npm run check && npm test"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.17.0+x64 (linux)","description":"MongoDB connection model","directories":{},"_nodeVersion":"16.17.0","compass:main":"index.js","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","debug":"^4.2.0","lodash":"^4.17.15","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.2.0","storage-mixin":"0.0.0-next-04ba59a8ace9d68fd90d540d8a8936985115e22e","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.2","@mongodb-js/ssh-tunnel":"0.0.0-next-04ba59a8ace9d68fd90d540d8a8936985115e22e","@mongodb-js/compass-utils":"0.0.0-next-04ba59a8ace9d68fd90d540d8a8936985115e22e","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.6.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^10.2.0","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"^5.1.0","depcheck":"^1.4.1","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.10.0","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^5.1.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_0.0.0-next-04ba59a8ace9d68fd90d540d8a8936985115e22e_1679142816918_0.7517755479424828","host":"s3://npm-registry-packages"}},"0.0.0-next-ed8f90bd71f084cb541f99b15caf3833ec6a953c":{"name":"mongodb-connection-model","version":"0.0.0-next-ed8f90bd71f084cb541f99b15caf3833ec6a953c","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@0.0.0-next-ed8f90bd71f084cb541f99b15caf3833ec6a953c","maintainers":[{"name":"mongo-j","email":"james.wang@mongodb.com"},{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satya@mongodb.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"iteng@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"686d46ceefc31889b510635d246aabbac2c1542f","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-0.0.0-next-ed8f90bd71f084cb541f99b15caf3833ec6a953c.tgz","fileCount":20,"integrity":"sha512-zNOtzTui0ggGCNo7Wl3UyBaPTUMCmWpqJ76LICged0h25tr70VUClk9ppfQwrVUdZYUpdFA9zt6ztYEYhpPwmg==","signatures":[{"sig":"MEQCIFvKfdD+l5Xqz38i6gorlxoyf3CpbsmzLz+dtyhDyYQGAiBn0X+jfb2lliiaCR9jdjRnQtAAAzxVpREzK3JVRDngsA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":108151,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkGMiaACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpzURAAmBWD4MNqOAurXN3uqyzuA+QAzBbIKfB3dVQ6lt4O7I2X7AU5\r\nZ0quHf9JsTFuHgBpB2XjR0uKXOia7MlecvNLiTblQVVSKMz6JpZ/ED6IqZ0x\r\nsPRXN2TbhCRoW9N55VMs6WJaSywKHqf3TCe4BeqIRzF0lk0ZENGCgeGoNvXY\r\nD93Ys3n87bjihN5FzNMJj4DKQP7VltTqwlxGwCwvm2n9oMeguUOiMGc5Mf2n\r\nTZSbjmIX4yKZ3xmx/aSc5FeAL5lY/NVCcPMeElrrksQFepzm56qVrN7IgWHk\r\nNmysXphD0BqOTR3bdK+Gg4BJCGwtHLX8SfscWCBOvPWKMmIObRWhpDic8qua\r\nSxgsSA7PihugbrZNvYSfCw0v3bSokRK2iMZrCQA8/Ir+NIE+V1dPI+h+NG2O\r\nXbx7ThXkNxgdRMEi1NtNL6NQk5ky9THZ79GrgxiBgQNnIFWpuH7KdjPOjT0h\r\n+qNDqT8mD1LmK6dyL1Jk8AJ8k4GqPIsh1wis2XIsfzXTzdbfk4tObs7IEIED\r\nfGj8bA+4qQdslGs6KdeO+jMjrExvIdT++9amA0xbyUtnwyvLUY/T42WIOLYL\r\nkNeUF5awM6T7cpt1hBXCn+Aotvo6yuD5kv0iJCWCARnWJRLBt0qIqqMoWaX2\r\nqHOjw5Xje08viKNKwwpXfanPYfeUsbO0pjw=\r\n=ivJG\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","readme":"# mongodb-connection-model [![][workflow_img]][workflow_url] [![][npm_img]][npm_url]\n\n> MongoDB connection model\n\nThe main purpose of the MongoDB connection model is to be a domain model around a MongoDB connection. It encapsulates generating a [Connection String URI](https://docs.mongodb.com/manual/reference/connection-string/) from a group of attributes and parses URI using the [MongoDB Node.JS Driver URI Parser](https://github.com/mongodb-js/mongodb-core/blob/master/lib/uri_parser.js).\n\n## Installation\n\n```\nnpm install --save mongodb-connection-model\n```\n\n## Usage\n\n### Building URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\nconst c = new Connection({ appname: 'My App Name' });\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://localhost:27017/?readPreference=primary&appname=My%20App&ssl=false'\n```\n\n### Parsing URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\n\nConnection.from(\n  'mongodb://someUsername:testPassword@localhost',\n  (error, result) => {\n    console.log(result);\n    >>> `{\n      hosts: [{ host: 'localhost', port: 27017 }],\n      hostname: 'localhost',\n      port: 27017,\n      auth: {\n        username: 'someUsername',\n        password: 'testPassword',\n        db: 'admin'\n      },\n      isSrvRecord: false,\n      authStrategy: 'MONGODB',\n      mongodbUsername: 'someUsername',\n      mongodbPassword: 'testPassword',\n      mongodbDatabaseName: 'admin',\n      extraOptions: {},\n      connectionType: 'NODE_DRIVER',\n      readPreference: 'primary',\n      kerberosCanonicalizeHostname: false,\n      sslMethod: 'NONE',\n      sshTunnel: 'NONE',\n      sshTunnelPort: 22\n    }`\n  }\n);\n```\n\n## Properties\n\nMongoDB connection model is based on Ampersand.js framework and consist of [props](https://ampersandjs.com/docs/#ampersand-state-props) and [derived props](https://ampersandjs.com/docs/#ampersand-state-derived). The props object describes the observable properties that MongoDB connection model gets from the Node.js Driver API.\n\n```javascript\nconst с = new Connection();\nconst props = с.getAttributes({ props: true });\n```\n\n#### See Also\n\n- [URI Generic Syntax](https://tools.ietf.org/html/rfc3986)\n- [URI Options Specification](https://github.com/mongodb/specifications/blob/master/source/uri-options/uri-options.rst)\n\n### General Properties\n\n```javascript\nconst c = new Connection({ isSrvRecord: true });\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ns` | String | A valid [ns][ns] the user can read from | `undefined` |\n| `isSrvRecord` | Boolean | Indicates SRV record | `false` |\n| `auth` | Object | Authentication from driver (username, user, db, password) | `undefined` |\n| `hostname` | String | Hostname of a MongoDB Instance. In case of the replica set the first host and port will be taken | `localhost` |\n| `port` | Number | TCP port of a MongoDB Instance | `27017` |\n| `hosts` | Array | Contains all hosts and ports for replica set | `[{ host: 'localhost', port: 27017 }]` |\n| `extraOptions` | Object | Extra options passed to the node driver as part of `driverOptions` | `{}` |\n| `connectionType` | String | The desired connection type. Possible values: `NODE_DRIVER`, `STITCH_ON_PREM`, `STITCH_ATLAS` | `NODE_DRIVER` |\n| `authStrategy` | String | The desired authentication strategy. Possible values: `NONE`, `MONGODB`, `X509`, `KERBEROS`, `LDAP`, `SCRAM-SHA-256` | `NONE` |\n\n### Connection string options\n\n```javascript\nconst c = new Connection({ appname: 'My App', replicaSet: 'testing' });\n```\n\n#### General connection string options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `replicaSet` | String | Specifies the name of the replica set, if the mongod is a member of a replica set | `undefined` |\n| `connectTimeoutMS` | Number | The time in milliseconds to attempt a connection before timing out | `undefined` |\n| `socketTimeoutMS` | Number | The time in milliseconds to attempt a send or receive on a socket before the attempt times out | `undefined` |\n| `compression` | Object | Object includes compressors and a compression level. The following compressors can be specified: `snappy`, `zlib` (Available in MongoDB 3.6 or greater) | `undefined` |\n\n#### Connection Pool Option\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `maxPoolSize` | Number | The maximum number of connections in the connection pool | `undefined` |\n| `minPoolSize` | Number | The minimum number of connections in the connection pool | `undefined` |\n| `maxIdleTimeMS` | Number | The maximum number of milliseconds that a connection can remain idle in the pool before being removed and closed | `undefined` |\n| `waitQueueMultiple` | Number | A number that the driver multiples the maxPoolSize value to, to provide the maximum number of threads allowed to wait for a connection to become available from the pool | `undefined` |\n| `waitQueueTimeoutMS` | Number | The maximum time in milliseconds that a thread can wait for a connection to become available | `undefined` |\n\n#### Write Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `w` | Number/String | Corresponds to the write concern [w Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-w) | `undefined` |\n| `wTimeoutMS` | Number | Corresponds to the write concern [wtimeout](https://docs.mongodb.com/manual/reference/write-concern/#wc-wtimeout) | `undefined` |\n| `journal` | Boolean | Corresponds to the write concern [j Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-j) | `undefined` |\n\n#### Read Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readConcernLevel` | String | The level of isolation | `undefined` |\n\n#### Read Preference Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readPreference` | String | Specifies the read preferences for this connection. Possible values: `PRIMARY`, `PRIMARY_PREFERRED`, `SECONDARY`, `SECONDARY_PREFERRED`, `NEAREST` | `PRIMARY` |\n| `maxStalenessSeconds` | Number | Specifies, in seconds, how stale a secondary can be before the client stops using it for read operations | `undefined` |\n| `readPreferenceTags` | Object | Default read preference tags for the client | `undefined` |\n\n#### Authentication Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `authSource` | String | Specify the database name associated with the user’s credentials | `undefined` |\n| `authMechanism` | String | Specifies the authentication mechanism that MongoDB will use to authenticate the connection. Possible values: `DEFAULT`, `GSSAPI`, `MONGODB-X509`, `PLAIN`, `SCRAM-SHA-256` | `undefined` |\n| `authMechanismProperties` | Object | Additional options provided for authentication (e.g. to enable hostname canonicalization for GSSAPI) | `undefined` |\n| `gssapiServiceName` | String | Set the Kerberos service name when connecting to Kerberized MongoDB instances | `undefined` |\n| `gssapiServiceRealm` | String | Set the Realm service name | `undefined` |\n| `gssapiCanonicalizeHostName` | Boolean | Whether canonicalized hostname | `undefined` |\n\n#### Server Selection and Discovery Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `localThresholdMS` | Number | The size (in milliseconds) of the latency window for selecting among multiple suitable MongoDB instances | `undefined` |\n| `serverSelectionTimeoutMS` | Number | Specifies how long (in milliseconds) to block for server selection before throwing an exception | `undefined` |\n| `serverSelectionTryOnce` | Boolean | Instructs the driver to scan the MongoDB deployment exactly once after server selection fails and then either select a server or raise an error | `undefined` |\n| `heartbeatFrequencyMS` | Number | Controls when the driver checks the state of the MongoDB deployment | `undefined` |\n\n#### Miscellaneous Configuration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `appname` | String | An application name passed to server as client metadata | `undefined` |\n| `retryWrites` | Boolean | Enable retryable writes | `undefined` |\n| `uuidRepresentation` | String | The legacy representation of UUID. Possible values: `standard`, `csharpLegacy`, `javaLegacy`, `pythonLegacy` | `undefined` |\n| `loadBalanced` | Boolean | Whether or not the server is running in load balanced mode | `undefined` |\n\n### Stitch attributes\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `stitchServiceName` | String | Stitch service name | `undefined` |\n| `stitchClientAppId` | String | Stitch сlient app ID | `undefined` |\n| `stitchGroupId` | String | Stitch group ID | `undefined` |\n| `stitchBaseUrl` | String | Stitch base Url | `undefined` |\n\n### MONGODB authentication\n\n```javascript\nconst c = new Connection({\n  mongodbUsername: 'arlo',\n  mongodbPassword: 'w@of'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/?slaveOk=true&authSource=admin'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `mongodbUsername` | String | MongoDB username | `undefined` |\n| `mongodbPassword` | String | MongoDB password | `undefined` |\n| `mongodbDatabaseName` | String | The database name associated with the user's credentials | `undefined` |\n| `promoteValues` | Boolean | Whether BSON values should be promoted to their JS type counterparts | `undefined` |\n\n### KERBEROS authentication\n\n```javascript\nconst c = new Connection({\n  kerberosServiceName: 'mongodb',\n  kerberosPrincipal: 'arlo/dog@krb5.mongodb.parts',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo%252Fdog%2540krb5.mongodb.parts@localhost:27017/toys?authMechanism=GSSAPI'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n> @note (imlucas): Kerberos on Windows is broken out as it's own state for UX consideration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `kerberosServiceName` | String | Any program or computer you access over a network | `undefined` |\n| `kerberosPrincipal` | String | The format of a typical Kerberos V5 principal is `primary/instance@REALM` | `undefined` |\n| `kerberosCanonicalizeHostname` | Boolean | Whether canonicalized kerberos hostname | `undefined` |\n\n#### See Also\n\n- [node.js driver Kerberos reference](http://bit.ly/mongodb-node-driver-kerberos)\n- [node.js driver Kerberos functional test][kerberos-functional]\n\n### LDAP authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  ldapUsername: 'arlo',\n  ldapPassword: 'w@of',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/toys?slaveOk=true&authMechanism=PLAIN'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ldapUsername` | String | LDAP username | `undefined` |\n| `ldapPassword` | String | LDAP password | `undefined` |\n\n#### See Also\n\n- [node.js driver LDAP reference](http://bit.ly/mongodb-node-driver-ldap)\n- [node.js driver X509 functional test][ldap-functional]\n\n### X509 authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  x509Username: 'CN=client,OU=arlo,O=MongoDB,L=Philadelphia,ST=Pennsylvania,C=US'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://CN%253Dclient%252COU%253Darlo%252CO%253DMongoDB%252CL%253DPhiladelphia%252CST%253DPennsylvania%252CC%253DUS@localhost:27017?slaveOk=true&authMechanism=MONGODB-X509'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `x509Username` | String | The x.509 certificate derived user name, e.g. `CN=user,OU=OrgUnit,O=myOrg,...` | `undefined` |\n\n#### See Also\n\n- [node.js driver X509 reference](http://bit.ly/mongodb-node-driver-x509)\n- [node.js driver X509 functional test][x509-functional]\n\n### SSL\n\n> **Note**: Not to be confused with `authentication=X509`\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ssl` | Number/String | A boolean to enable or disables TLS/SSL for the connection | `undefined` |\n| `sslMethod` | String | The desired ssl method. Possible values: `NONE`, `SYSTEMCA`, `IFAVAILABLE`, `UNVALIDATED`, `SERVER`, `ALL` | `NONE` |\n| `sslCA` | Buffer/String | Array of valid certificates | `undefined` |\n| `sslCert` | Buffer/String | The certificate | `undefined` |\n| `sslKey` | Buffer/String | The certificate private key | `undefined` |\n| `sslPass` | Buffer/String | The certificate password | `undefined` |\n\nDescription of `sslMethod` values:\n\n- `SYSTEMCA` - SSL required, validate using System CA, with host verification.\n- `IFAVAILABLE` - The driver should try SSL first, fall back to no SSL if unavailable, and use the system's Certificate Authority.\n- `SERVER` - The driver should validate the server certificate and fail to connect if validation fails. See also [node.js driver \"Validate Server Certificate\" docs][driver-ssl-server].\n- `ALL` - The driver must present a valid certificate and validate the server certificate. See also [node.js driver \"Validate Server Certificate and Present Valid Certificate\" docs][driver-ssl-all].\n- `NONE` - No SSL (Not recommended).\n- `UNVALIDATED` - Use SSL but do not perform any validation of the certificate chain. See also [node.js driver \"No Certificate Validation\" docs][driver-ssl-none]. **Very** not recommended and likely to be deprecated in future releases because it exposes potential Man-In-The-Middle attack vectors.\n\n#### See also\n\n- [node.js driver SSL implementation][driver-ssl-impl]\n- [node.js driver SSL tutorial][driver-ssl-tutorial]\n\n### SSH TUNNEL\n\n> New in mongodb-connection-model@5.0.0\n\nBecause [authentication](#authentication) is quite difficult for operators to migrate to, the most common method of securing a MongoDB deployment is to use an [SSH tunnel][sf-ssh-tunnel].  This allows operators to leverage their existing SSH security infrastructure to also provide secure access to MongoDB.  For a standard deployment of MongoDB on AWS, this is almost always to strategy.  Because of this, we now support creating SSH tunnels automatically when connecting to MongoDB.\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options, (connectionError, client) => {\n  if (connectionError) {\n    return console.log(connectionError);\n  }\n\n  client.db('mongodb').collection('fanclub').count((countingError, count) => {\n    console.log('counted:', countingError, count);\n    client.close();\n  });\n});\n```\n\nThe above provides the same functionality as creating the tunnel using the bash\ncommand below and connecting to MongoDB via another terminal. Notice that\nconnection-model uses a random local port each time it creates a tunnel.\nUsing the command line, you'd have to replace `<random port>` with an actual\nport number.\n\n```bash\nssh -i ~/.ssh/my-key-aws-pair.pem -L <random port>:localhost:27017 ubuntu@ec2-11-111-111-111.compute-1.amazonaws.com\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `sshTunnel` | String | The desired SSH tunnel strategy. Possible values: `NONE`, `USER_PASSWORD`, `IDENTITY_FILE` | `undefined` |\n| `sshTunnelHostname` | String | The hostname of the SSH remote host | `undefined` |\n| `sshTunnelPort` | Port | The SSH port of the remote host | `22` |\n| `sshTunnelBindToLocalPort` | Port | Bind the localhost endpoint of the SSH Tunnel to this port | `undefined` |\n| `sshTunnelUsername` | String | The optional SSH username for the remote host | `undefined` |\n| `sshTunnelPassword` | String | The optional SSH password for the remote host | `undefined` |\n| `sshTunnelIdentityFile` | String/Array | The optional path to the SSH identity file for the remote host | `undefined` |\n| `sshTunnelPassphrase` | String | The optional passphrase for `sshTunnelIdentityFile` | `undefined` |\n\nDescription of `sshTunnel` values:\n\n- `NONE` - Do not use SSH tunneling.\n- `USER_PASSWORD` - The tunnel is created with SSH username and password only.\n- `IDENTITY_FILE` - The tunnel is created using an identity file.\n\n## Derived Properties\n\nDerived properties (also known as computed properties) are properties of the state object that depend on other properties to determine their value.\n\n```javascript\nconst c = new Connection();\nconst derivedProps = c.getAttributes({ derived: true });\n```\n\n| Derived Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `instanceId` | String | The mongoscope | `localhost:27017` |\n| `driverAuthMechanism` | String | Converts the value of `authStrategy` for humans into the `authMechanism` value for the driver | `undefined` |\n| `safeUrl` | String | The URL where a password is replaced with stars | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrl` | String | Use this URL in order to connect via DataService | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrlWithSsh` | String | Use this URL in order to connect via connection model itself | `mongodb://localhost:29201/?readPreference=primary&ssl=false` |\n| `driverOptions` | String | The second argument `mongoscope-server` passes to `mongodb.connect` | `{}` |\n\n## Events\n\n> New in mongodb-connection-model@5.0.0\n\n#### Example: SSH Tunnel\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', skipped: true,\n  reason: 'The selected SSL mode does not need to load any files.' }\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', complete: true}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n#### Example: SSL\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  ssl: 'ALL',\n  sslCA: '~/.ssl/my-ca.pem',\n  sslCert: '~/.ssl/my-server.pem',\n  sslKey: '~/.ssl/my-server.pem'\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', complete: true}\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', skipped: true,\n  reason: 'The selected SSH Tunnel mode is NONE.'}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n[workflow_img]: https://github.com/mongodb-js/connection-model/workflows/Check%20and%20Test/badge.svg?event=push\n[workflow_url]: https://github.com/mongodb-js/connection-model/actions?query=workflow%3A%22Check+and+Test%22\n[npm_img]: https://img.shields.io/npm/v/mongodb-connection-model.svg?style=flat-square\n[npm_url]: https://www.npmjs.org/package/mongodb-connection-model\n[gitter_img]: https://badges.gitter.im/Join%20Chat.svg\n[gitter_url]: http://gitter.im/mongodb-js/mongodb-js\n[enterprise_img]: https://img.shields.io/badge/MongoDB-Enterprise-blue.svg?style=flat-square\n[coming_soon_img]: https://img.shields.io/badge/-Coming%20Soon-ff69b4.svg?style=flat-square\n[kerberos-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/kerberos_tests.js\n[ldap-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ldap_tests.js\n[x509-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ssl_x509_tests.js\n[ns]: https://github.com/mongodb-js/ns\n[sf-ssh-tunnel]: http://serverfault.com/questions/597765/how-to-connect-to-mongodb-server-via-ssh-tunnel\n[ec2-key-pairs]: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html\n[driver-ssl-impl]: https://github.com/christkv/mongodb-core/blob/c3d21cb636d74d7a68134ecd3b9f6af536311279/lib/connection/connection.js#L365-L407\n[driver-ssl-tutorial]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/\n[driver-ssl-none]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#no-certificate-validation\n[driver-ssl-server]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate\n[driver-ssl-all]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate-and-present-valid-certificate\n","gitHead":"ed8f90bd71f084cb541f99b15caf3833ec6a953c","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","test":"mocha","check":"npm run lint && npm run depcheck","pretest":"mongodb-runner install && mongodb-runner start --port=27018","test-ci":"npm run test","depcheck":"depcheck","posttest":"mongodb-runner stop --port=27018","posttest-ci":"node ../../scripts/killall-mongo.js","test-check-ci":"npm run check && npm test"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.17.0+x64 (linux)","description":"MongoDB connection model","directories":{},"_nodeVersion":"16.17.0","compass:main":"index.js","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","debug":"^4.2.0","lodash":"^4.17.15","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.2.0","storage-mixin":"0.0.0-next-ed8f90bd71f084cb541f99b15caf3833ec6a953c","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.2","@mongodb-js/ssh-tunnel":"0.0.0-next-ed8f90bd71f084cb541f99b15caf3833ec6a953c","@mongodb-js/compass-utils":"0.0.0-next-ed8f90bd71f084cb541f99b15caf3833ec6a953c","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.6.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^10.2.0","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"^5.1.0","depcheck":"^1.4.1","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.10.0","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^5.1.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_0.0.0-next-ed8f90bd71f084cb541f99b15caf3833ec6a953c_1679345817985_0.3310193428801811","host":"s3://npm-registry-packages"}},"0.0.0-next-97c3945c3938ec09f9aa141b791f53d15bd47600":{"name":"mongodb-connection-model","version":"0.0.0-next-97c3945c3938ec09f9aa141b791f53d15bd47600","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@0.0.0-next-97c3945c3938ec09f9aa141b791f53d15bd47600","maintainers":[{"name":"mongo-j","email":"james.wang@mongodb.com"},{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satya@mongodb.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"iteng@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"f49ec58ddc5bd51aa05de59d7d85167ff4d1c301","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-0.0.0-next-97c3945c3938ec09f9aa141b791f53d15bd47600.tgz","fileCount":20,"integrity":"sha512-bMMEJGz5gDynnk/uAbvFH/+3jjKpaGgbis5NkDJ6pa90K+9iPoYNUqIVpw1C0rmfsxs9YmR1Z6/kgZOgZNdRSA==","signatures":[{"sig":"MEQCIGGyQMdfn+Ruxo/Fs9rkEh01FHja5qR6ltzV5EhTZR7MAiAfA9SKnj7OJtQfBC0bDMwneFK/WZXyvMnxfEbr0DJVQw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":108151,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkGMjFACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrSLg//QU3Pt5rOJMmK9DFGH6dowahZEj6vKf+iGm9YcJ8dXasFJekT\r\n1g/TqxGMZ/KcurCcthqC1NT2WVl9l7Zgh08wp85F3m/PXSO43jTUtP0ZBNd1\r\n2DtMK4PBifZPTsvWux7nGb08+OBvLtE4PArjxKat4oCprHIXT7gCgcm4wky+\r\nzdOvaJCyTORVz8l/XX9EO2/yJtBvmzbZrd/2Sj/kDN8HwUrN5LP1A56dHYso\r\nqxNH0m5gl+LI/kc63BYA197zqum5yXfMZ2BCJ2dGtDt1MFa9+r4z/zrFDxMx\r\nW0YT4i6asAX+rd7gRU74l2qQu/GA7Na4TvRWU1T63yYDrSsL7XDMnxnHO3ff\r\ni8t1KxB4zqIbZ6Pc+LWmK6P4HMUI9ZR7N6seWt0xildWDz4MNMfd57aVdQZr\r\n+wYYk+IWcrWx182XpYQxfkoohsQ7ec1wGyVIEVd2T96gcydID0mJ+Dvw7jXz\r\nEOmBdMa1sXgydbriHcljbjDAnHGRnrZLXmPlJphXVFR6DJEVYo0BxC0Xtsc+\r\nlj90I0LWOHuFDKCO6O2460f2WwsGb0wZesYM/Yfs2w6SDgQSNnSq1Aun2va6\r\nynZqeNVOssc4BWUp8BYT3rSncz1TAIQSP0BXRsAnUpvq4G4FFu9c9VF4a5qd\r\nibkbEytOAbUwmTebqto3IXgcsIe2SWFGg5A=\r\n=iRpY\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","readme":"# mongodb-connection-model [![][workflow_img]][workflow_url] [![][npm_img]][npm_url]\n\n> MongoDB connection model\n\nThe main purpose of the MongoDB connection model is to be a domain model around a MongoDB connection. It encapsulates generating a [Connection String URI](https://docs.mongodb.com/manual/reference/connection-string/) from a group of attributes and parses URI using the [MongoDB Node.JS Driver URI Parser](https://github.com/mongodb-js/mongodb-core/blob/master/lib/uri_parser.js).\n\n## Installation\n\n```\nnpm install --save mongodb-connection-model\n```\n\n## Usage\n\n### Building URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\nconst c = new Connection({ appname: 'My App Name' });\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://localhost:27017/?readPreference=primary&appname=My%20App&ssl=false'\n```\n\n### Parsing URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\n\nConnection.from(\n  'mongodb://someUsername:testPassword@localhost',\n  (error, result) => {\n    console.log(result);\n    >>> `{\n      hosts: [{ host: 'localhost', port: 27017 }],\n      hostname: 'localhost',\n      port: 27017,\n      auth: {\n        username: 'someUsername',\n        password: 'testPassword',\n        db: 'admin'\n      },\n      isSrvRecord: false,\n      authStrategy: 'MONGODB',\n      mongodbUsername: 'someUsername',\n      mongodbPassword: 'testPassword',\n      mongodbDatabaseName: 'admin',\n      extraOptions: {},\n      connectionType: 'NODE_DRIVER',\n      readPreference: 'primary',\n      kerberosCanonicalizeHostname: false,\n      sslMethod: 'NONE',\n      sshTunnel: 'NONE',\n      sshTunnelPort: 22\n    }`\n  }\n);\n```\n\n## Properties\n\nMongoDB connection model is based on Ampersand.js framework and consist of [props](https://ampersandjs.com/docs/#ampersand-state-props) and [derived props](https://ampersandjs.com/docs/#ampersand-state-derived). The props object describes the observable properties that MongoDB connection model gets from the Node.js Driver API.\n\n```javascript\nconst с = new Connection();\nconst props = с.getAttributes({ props: true });\n```\n\n#### See Also\n\n- [URI Generic Syntax](https://tools.ietf.org/html/rfc3986)\n- [URI Options Specification](https://github.com/mongodb/specifications/blob/master/source/uri-options/uri-options.rst)\n\n### General Properties\n\n```javascript\nconst c = new Connection({ isSrvRecord: true });\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ns` | String | A valid [ns][ns] the user can read from | `undefined` |\n| `isSrvRecord` | Boolean | Indicates SRV record | `false` |\n| `auth` | Object | Authentication from driver (username, user, db, password) | `undefined` |\n| `hostname` | String | Hostname of a MongoDB Instance. In case of the replica set the first host and port will be taken | `localhost` |\n| `port` | Number | TCP port of a MongoDB Instance | `27017` |\n| `hosts` | Array | Contains all hosts and ports for replica set | `[{ host: 'localhost', port: 27017 }]` |\n| `extraOptions` | Object | Extra options passed to the node driver as part of `driverOptions` | `{}` |\n| `connectionType` | String | The desired connection type. Possible values: `NODE_DRIVER`, `STITCH_ON_PREM`, `STITCH_ATLAS` | `NODE_DRIVER` |\n| `authStrategy` | String | The desired authentication strategy. Possible values: `NONE`, `MONGODB`, `X509`, `KERBEROS`, `LDAP`, `SCRAM-SHA-256` | `NONE` |\n\n### Connection string options\n\n```javascript\nconst c = new Connection({ appname: 'My App', replicaSet: 'testing' });\n```\n\n#### General connection string options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `replicaSet` | String | Specifies the name of the replica set, if the mongod is a member of a replica set | `undefined` |\n| `connectTimeoutMS` | Number | The time in milliseconds to attempt a connection before timing out | `undefined` |\n| `socketTimeoutMS` | Number | The time in milliseconds to attempt a send or receive on a socket before the attempt times out | `undefined` |\n| `compression` | Object | Object includes compressors and a compression level. The following compressors can be specified: `snappy`, `zlib` (Available in MongoDB 3.6 or greater) | `undefined` |\n\n#### Connection Pool Option\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `maxPoolSize` | Number | The maximum number of connections in the connection pool | `undefined` |\n| `minPoolSize` | Number | The minimum number of connections in the connection pool | `undefined` |\n| `maxIdleTimeMS` | Number | The maximum number of milliseconds that a connection can remain idle in the pool before being removed and closed | `undefined` |\n| `waitQueueMultiple` | Number | A number that the driver multiples the maxPoolSize value to, to provide the maximum number of threads allowed to wait for a connection to become available from the pool | `undefined` |\n| `waitQueueTimeoutMS` | Number | The maximum time in milliseconds that a thread can wait for a connection to become available | `undefined` |\n\n#### Write Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `w` | Number/String | Corresponds to the write concern [w Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-w) | `undefined` |\n| `wTimeoutMS` | Number | Corresponds to the write concern [wtimeout](https://docs.mongodb.com/manual/reference/write-concern/#wc-wtimeout) | `undefined` |\n| `journal` | Boolean | Corresponds to the write concern [j Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-j) | `undefined` |\n\n#### Read Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readConcernLevel` | String | The level of isolation | `undefined` |\n\n#### Read Preference Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readPreference` | String | Specifies the read preferences for this connection. Possible values: `PRIMARY`, `PRIMARY_PREFERRED`, `SECONDARY`, `SECONDARY_PREFERRED`, `NEAREST` | `PRIMARY` |\n| `maxStalenessSeconds` | Number | Specifies, in seconds, how stale a secondary can be before the client stops using it for read operations | `undefined` |\n| `readPreferenceTags` | Object | Default read preference tags for the client | `undefined` |\n\n#### Authentication Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `authSource` | String | Specify the database name associated with the user’s credentials | `undefined` |\n| `authMechanism` | String | Specifies the authentication mechanism that MongoDB will use to authenticate the connection. Possible values: `DEFAULT`, `GSSAPI`, `MONGODB-X509`, `PLAIN`, `SCRAM-SHA-256` | `undefined` |\n| `authMechanismProperties` | Object | Additional options provided for authentication (e.g. to enable hostname canonicalization for GSSAPI) | `undefined` |\n| `gssapiServiceName` | String | Set the Kerberos service name when connecting to Kerberized MongoDB instances | `undefined` |\n| `gssapiServiceRealm` | String | Set the Realm service name | `undefined` |\n| `gssapiCanonicalizeHostName` | Boolean | Whether canonicalized hostname | `undefined` |\n\n#### Server Selection and Discovery Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `localThresholdMS` | Number | The size (in milliseconds) of the latency window for selecting among multiple suitable MongoDB instances | `undefined` |\n| `serverSelectionTimeoutMS` | Number | Specifies how long (in milliseconds) to block for server selection before throwing an exception | `undefined` |\n| `serverSelectionTryOnce` | Boolean | Instructs the driver to scan the MongoDB deployment exactly once after server selection fails and then either select a server or raise an error | `undefined` |\n| `heartbeatFrequencyMS` | Number | Controls when the driver checks the state of the MongoDB deployment | `undefined` |\n\n#### Miscellaneous Configuration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `appname` | String | An application name passed to server as client metadata | `undefined` |\n| `retryWrites` | Boolean | Enable retryable writes | `undefined` |\n| `uuidRepresentation` | String | The legacy representation of UUID. Possible values: `standard`, `csharpLegacy`, `javaLegacy`, `pythonLegacy` | `undefined` |\n| `loadBalanced` | Boolean | Whether or not the server is running in load balanced mode | `undefined` |\n\n### Stitch attributes\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `stitchServiceName` | String | Stitch service name | `undefined` |\n| `stitchClientAppId` | String | Stitch сlient app ID | `undefined` |\n| `stitchGroupId` | String | Stitch group ID | `undefined` |\n| `stitchBaseUrl` | String | Stitch base Url | `undefined` |\n\n### MONGODB authentication\n\n```javascript\nconst c = new Connection({\n  mongodbUsername: 'arlo',\n  mongodbPassword: 'w@of'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/?slaveOk=true&authSource=admin'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `mongodbUsername` | String | MongoDB username | `undefined` |\n| `mongodbPassword` | String | MongoDB password | `undefined` |\n| `mongodbDatabaseName` | String | The database name associated with the user's credentials | `undefined` |\n| `promoteValues` | Boolean | Whether BSON values should be promoted to their JS type counterparts | `undefined` |\n\n### KERBEROS authentication\n\n```javascript\nconst c = new Connection({\n  kerberosServiceName: 'mongodb',\n  kerberosPrincipal: 'arlo/dog@krb5.mongodb.parts',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo%252Fdog%2540krb5.mongodb.parts@localhost:27017/toys?authMechanism=GSSAPI'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n> @note (imlucas): Kerberos on Windows is broken out as it's own state for UX consideration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `kerberosServiceName` | String | Any program or computer you access over a network | `undefined` |\n| `kerberosPrincipal` | String | The format of a typical Kerberos V5 principal is `primary/instance@REALM` | `undefined` |\n| `kerberosCanonicalizeHostname` | Boolean | Whether canonicalized kerberos hostname | `undefined` |\n\n#### See Also\n\n- [node.js driver Kerberos reference](http://bit.ly/mongodb-node-driver-kerberos)\n- [node.js driver Kerberos functional test][kerberos-functional]\n\n### LDAP authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  ldapUsername: 'arlo',\n  ldapPassword: 'w@of',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/toys?slaveOk=true&authMechanism=PLAIN'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ldapUsername` | String | LDAP username | `undefined` |\n| `ldapPassword` | String | LDAP password | `undefined` |\n\n#### See Also\n\n- [node.js driver LDAP reference](http://bit.ly/mongodb-node-driver-ldap)\n- [node.js driver X509 functional test][ldap-functional]\n\n### X509 authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  x509Username: 'CN=client,OU=arlo,O=MongoDB,L=Philadelphia,ST=Pennsylvania,C=US'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://CN%253Dclient%252COU%253Darlo%252CO%253DMongoDB%252CL%253DPhiladelphia%252CST%253DPennsylvania%252CC%253DUS@localhost:27017?slaveOk=true&authMechanism=MONGODB-X509'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `x509Username` | String | The x.509 certificate derived user name, e.g. `CN=user,OU=OrgUnit,O=myOrg,...` | `undefined` |\n\n#### See Also\n\n- [node.js driver X509 reference](http://bit.ly/mongodb-node-driver-x509)\n- [node.js driver X509 functional test][x509-functional]\n\n### SSL\n\n> **Note**: Not to be confused with `authentication=X509`\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ssl` | Number/String | A boolean to enable or disables TLS/SSL for the connection | `undefined` |\n| `sslMethod` | String | The desired ssl method. Possible values: `NONE`, `SYSTEMCA`, `IFAVAILABLE`, `UNVALIDATED`, `SERVER`, `ALL` | `NONE` |\n| `sslCA` | Buffer/String | Array of valid certificates | `undefined` |\n| `sslCert` | Buffer/String | The certificate | `undefined` |\n| `sslKey` | Buffer/String | The certificate private key | `undefined` |\n| `sslPass` | Buffer/String | The certificate password | `undefined` |\n\nDescription of `sslMethod` values:\n\n- `SYSTEMCA` - SSL required, validate using System CA, with host verification.\n- `IFAVAILABLE` - The driver should try SSL first, fall back to no SSL if unavailable, and use the system's Certificate Authority.\n- `SERVER` - The driver should validate the server certificate and fail to connect if validation fails. See also [node.js driver \"Validate Server Certificate\" docs][driver-ssl-server].\n- `ALL` - The driver must present a valid certificate and validate the server certificate. See also [node.js driver \"Validate Server Certificate and Present Valid Certificate\" docs][driver-ssl-all].\n- `NONE` - No SSL (Not recommended).\n- `UNVALIDATED` - Use SSL but do not perform any validation of the certificate chain. See also [node.js driver \"No Certificate Validation\" docs][driver-ssl-none]. **Very** not recommended and likely to be deprecated in future releases because it exposes potential Man-In-The-Middle attack vectors.\n\n#### See also\n\n- [node.js driver SSL implementation][driver-ssl-impl]\n- [node.js driver SSL tutorial][driver-ssl-tutorial]\n\n### SSH TUNNEL\n\n> New in mongodb-connection-model@5.0.0\n\nBecause [authentication](#authentication) is quite difficult for operators to migrate to, the most common method of securing a MongoDB deployment is to use an [SSH tunnel][sf-ssh-tunnel].  This allows operators to leverage their existing SSH security infrastructure to also provide secure access to MongoDB.  For a standard deployment of MongoDB on AWS, this is almost always to strategy.  Because of this, we now support creating SSH tunnels automatically when connecting to MongoDB.\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options, (connectionError, client) => {\n  if (connectionError) {\n    return console.log(connectionError);\n  }\n\n  client.db('mongodb').collection('fanclub').count((countingError, count) => {\n    console.log('counted:', countingError, count);\n    client.close();\n  });\n});\n```\n\nThe above provides the same functionality as creating the tunnel using the bash\ncommand below and connecting to MongoDB via another terminal. Notice that\nconnection-model uses a random local port each time it creates a tunnel.\nUsing the command line, you'd have to replace `<random port>` with an actual\nport number.\n\n```bash\nssh -i ~/.ssh/my-key-aws-pair.pem -L <random port>:localhost:27017 ubuntu@ec2-11-111-111-111.compute-1.amazonaws.com\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `sshTunnel` | String | The desired SSH tunnel strategy. Possible values: `NONE`, `USER_PASSWORD`, `IDENTITY_FILE` | `undefined` |\n| `sshTunnelHostname` | String | The hostname of the SSH remote host | `undefined` |\n| `sshTunnelPort` | Port | The SSH port of the remote host | `22` |\n| `sshTunnelBindToLocalPort` | Port | Bind the localhost endpoint of the SSH Tunnel to this port | `undefined` |\n| `sshTunnelUsername` | String | The optional SSH username for the remote host | `undefined` |\n| `sshTunnelPassword` | String | The optional SSH password for the remote host | `undefined` |\n| `sshTunnelIdentityFile` | String/Array | The optional path to the SSH identity file for the remote host | `undefined` |\n| `sshTunnelPassphrase` | String | The optional passphrase for `sshTunnelIdentityFile` | `undefined` |\n\nDescription of `sshTunnel` values:\n\n- `NONE` - Do not use SSH tunneling.\n- `USER_PASSWORD` - The tunnel is created with SSH username and password only.\n- `IDENTITY_FILE` - The tunnel is created using an identity file.\n\n## Derived Properties\n\nDerived properties (also known as computed properties) are properties of the state object that depend on other properties to determine their value.\n\n```javascript\nconst c = new Connection();\nconst derivedProps = c.getAttributes({ derived: true });\n```\n\n| Derived Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `instanceId` | String | The mongoscope | `localhost:27017` |\n| `driverAuthMechanism` | String | Converts the value of `authStrategy` for humans into the `authMechanism` value for the driver | `undefined` |\n| `safeUrl` | String | The URL where a password is replaced with stars | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrl` | String | Use this URL in order to connect via DataService | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrlWithSsh` | String | Use this URL in order to connect via connection model itself | `mongodb://localhost:29201/?readPreference=primary&ssl=false` |\n| `driverOptions` | String | The second argument `mongoscope-server` passes to `mongodb.connect` | `{}` |\n\n## Events\n\n> New in mongodb-connection-model@5.0.0\n\n#### Example: SSH Tunnel\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', skipped: true,\n  reason: 'The selected SSL mode does not need to load any files.' }\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', complete: true}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n#### Example: SSL\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  ssl: 'ALL',\n  sslCA: '~/.ssl/my-ca.pem',\n  sslCert: '~/.ssl/my-server.pem',\n  sslKey: '~/.ssl/my-server.pem'\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', complete: true}\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', skipped: true,\n  reason: 'The selected SSH Tunnel mode is NONE.'}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n[workflow_img]: https://github.com/mongodb-js/connection-model/workflows/Check%20and%20Test/badge.svg?event=push\n[workflow_url]: https://github.com/mongodb-js/connection-model/actions?query=workflow%3A%22Check+and+Test%22\n[npm_img]: https://img.shields.io/npm/v/mongodb-connection-model.svg?style=flat-square\n[npm_url]: https://www.npmjs.org/package/mongodb-connection-model\n[gitter_img]: https://badges.gitter.im/Join%20Chat.svg\n[gitter_url]: http://gitter.im/mongodb-js/mongodb-js\n[enterprise_img]: https://img.shields.io/badge/MongoDB-Enterprise-blue.svg?style=flat-square\n[coming_soon_img]: https://img.shields.io/badge/-Coming%20Soon-ff69b4.svg?style=flat-square\n[kerberos-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/kerberos_tests.js\n[ldap-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ldap_tests.js\n[x509-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ssl_x509_tests.js\n[ns]: https://github.com/mongodb-js/ns\n[sf-ssh-tunnel]: http://serverfault.com/questions/597765/how-to-connect-to-mongodb-server-via-ssh-tunnel\n[ec2-key-pairs]: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html\n[driver-ssl-impl]: https://github.com/christkv/mongodb-core/blob/c3d21cb636d74d7a68134ecd3b9f6af536311279/lib/connection/connection.js#L365-L407\n[driver-ssl-tutorial]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/\n[driver-ssl-none]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#no-certificate-validation\n[driver-ssl-server]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate\n[driver-ssl-all]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate-and-present-valid-certificate\n","gitHead":"97c3945c3938ec09f9aa141b791f53d15bd47600","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","test":"mocha","check":"npm run lint && npm run depcheck","pretest":"mongodb-runner install && mongodb-runner start --port=27018","test-ci":"npm run test","depcheck":"depcheck","posttest":"mongodb-runner stop --port=27018","posttest-ci":"node ../../scripts/killall-mongo.js","test-check-ci":"npm run check && npm test"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.17.0+x64 (linux)","description":"MongoDB connection model","directories":{},"_nodeVersion":"16.17.0","compass:main":"index.js","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","debug":"^4.2.0","lodash":"^4.17.15","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.2.0","storage-mixin":"0.0.0-next-97c3945c3938ec09f9aa141b791f53d15bd47600","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.2","@mongodb-js/ssh-tunnel":"0.0.0-next-97c3945c3938ec09f9aa141b791f53d15bd47600","@mongodb-js/compass-utils":"0.0.0-next-97c3945c3938ec09f9aa141b791f53d15bd47600","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.6.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^10.2.0","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"^5.1.0","depcheck":"^1.4.1","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.10.0","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^5.1.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_0.0.0-next-97c3945c3938ec09f9aa141b791f53d15bd47600_1679345861467_0.9873193170698944","host":"s3://npm-registry-packages"}},"0.0.0-next-a863ce6adfb98ced08f9644a294f5b63b110c7d8":{"name":"mongodb-connection-model","version":"0.0.0-next-a863ce6adfb98ced08f9644a294f5b63b110c7d8","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@0.0.0-next-a863ce6adfb98ced08f9644a294f5b63b110c7d8","maintainers":[{"name":"mongo-j","email":"james.wang@mongodb.com"},{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satya@mongodb.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"iteng@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"9867da2a7c74c4bee6a804b4339c3611c8d7c1c1","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-0.0.0-next-a863ce6adfb98ced08f9644a294f5b63b110c7d8.tgz","fileCount":20,"integrity":"sha512-p3FBbHE3iGZQQo12Q5oVKa2hj5pVE3rYW60alBNtnqGXDWvbYBMCmE3hwbaIirFkW61I+xQ59Fp+9V+QUcsv2g==","signatures":[{"sig":"MEQCIE/wbH5wU8HfIVoIC1vZYOOSq8zgUvto83EM9Fzm5xFlAiB3XNVtSri8iZfayhXJgB+72ikECeFtlejF/KCcPKNL1A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":108151,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkI0LXACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmopTQ/+OcWgy/qcoynggK2EjwiKLjCR5kpbyOOk6dgkW9HA7H1i//ho\r\nPtLjTDeNOPI2mvl2zQ5N7xBxnzvw2EVMaTChtCu5Z+T3K9VUNCRzqU/8Wbak\r\nN4tpbAlR5FCRBcs0bZLerQZ2pd5AKCl6uqgmKBmcBZv/5hRt3GNWxWOdxDdb\r\nFSFqpcvBbdDG4mZvuIWe5nrx+LwMYpVMSKQxdBoq1GI3ZhdDQddQHRJWJ9M3\r\nKDzC4aSIQcJnKLFoPhnrhaAAjKm56u/LEYvpEcgW3+rBFzHzlJix0dV/fHxG\r\ncKYMfvcOM2UmIHLofWaLqVrJA9e1kxgqkVUqS0WBl/a8gNYyfEUz2nXVodGK\r\nhN8WHWWzlKZLa15a+iIjPKOb0CXR5eqVaelaBwsOnk3EU1z9q6rEeD51I1+C\r\n0gY4ht5xMRVngdA6xcIsRGkQJphGMRnwOE8bx9PxOwJJU5BlrbPzLRWyaHK1\r\nqud1LLwUcg7MoJkwbWayODU5zXm0e/9ilo1Dajv5rXL30KUfcymCRxvWSksM\r\nnzcrkvttVDOJuCbg6hhyKM4ci1J9fDmVW3dnBpO9dqsr3eKBWEpAbQxIkGMv\r\n/+C/EVFlSBmGmhNPPzZqA3H0Onu5aJKIdD1NjHAuHbqQavlb1te+sEG+02TA\r\nz9HbDVSaEUMrTYWZHakmMg9dhyhlNWSM0hc=\r\n=OwQd\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","readme":"# mongodb-connection-model [![][workflow_img]][workflow_url] [![][npm_img]][npm_url]\n\n> MongoDB connection model\n\nThe main purpose of the MongoDB connection model is to be a domain model around a MongoDB connection. It encapsulates generating a [Connection String URI](https://docs.mongodb.com/manual/reference/connection-string/) from a group of attributes and parses URI using the [MongoDB Node.JS Driver URI Parser](https://github.com/mongodb-js/mongodb-core/blob/master/lib/uri_parser.js).\n\n## Installation\n\n```\nnpm install --save mongodb-connection-model\n```\n\n## Usage\n\n### Building URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\nconst c = new Connection({ appname: 'My App Name' });\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://localhost:27017/?readPreference=primary&appname=My%20App&ssl=false'\n```\n\n### Parsing URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\n\nConnection.from(\n  'mongodb://someUsername:testPassword@localhost',\n  (error, result) => {\n    console.log(result);\n    >>> `{\n      hosts: [{ host: 'localhost', port: 27017 }],\n      hostname: 'localhost',\n      port: 27017,\n      auth: {\n        username: 'someUsername',\n        password: 'testPassword',\n        db: 'admin'\n      },\n      isSrvRecord: false,\n      authStrategy: 'MONGODB',\n      mongodbUsername: 'someUsername',\n      mongodbPassword: 'testPassword',\n      mongodbDatabaseName: 'admin',\n      extraOptions: {},\n      connectionType: 'NODE_DRIVER',\n      readPreference: 'primary',\n      kerberosCanonicalizeHostname: false,\n      sslMethod: 'NONE',\n      sshTunnel: 'NONE',\n      sshTunnelPort: 22\n    }`\n  }\n);\n```\n\n## Properties\n\nMongoDB connection model is based on Ampersand.js framework and consist of [props](https://ampersandjs.com/docs/#ampersand-state-props) and [derived props](https://ampersandjs.com/docs/#ampersand-state-derived). The props object describes the observable properties that MongoDB connection model gets from the Node.js Driver API.\n\n```javascript\nconst с = new Connection();\nconst props = с.getAttributes({ props: true });\n```\n\n#### See Also\n\n- [URI Generic Syntax](https://tools.ietf.org/html/rfc3986)\n- [URI Options Specification](https://github.com/mongodb/specifications/blob/master/source/uri-options/uri-options.rst)\n\n### General Properties\n\n```javascript\nconst c = new Connection({ isSrvRecord: true });\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ns` | String | A valid [ns][ns] the user can read from | `undefined` |\n| `isSrvRecord` | Boolean | Indicates SRV record | `false` |\n| `auth` | Object | Authentication from driver (username, user, db, password) | `undefined` |\n| `hostname` | String | Hostname of a MongoDB Instance. In case of the replica set the first host and port will be taken | `localhost` |\n| `port` | Number | TCP port of a MongoDB Instance | `27017` |\n| `hosts` | Array | Contains all hosts and ports for replica set | `[{ host: 'localhost', port: 27017 }]` |\n| `extraOptions` | Object | Extra options passed to the node driver as part of `driverOptions` | `{}` |\n| `connectionType` | String | The desired connection type. Possible values: `NODE_DRIVER`, `STITCH_ON_PREM`, `STITCH_ATLAS` | `NODE_DRIVER` |\n| `authStrategy` | String | The desired authentication strategy. Possible values: `NONE`, `MONGODB`, `X509`, `KERBEROS`, `LDAP`, `SCRAM-SHA-256` | `NONE` |\n\n### Connection string options\n\n```javascript\nconst c = new Connection({ appname: 'My App', replicaSet: 'testing' });\n```\n\n#### General connection string options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `replicaSet` | String | Specifies the name of the replica set, if the mongod is a member of a replica set | `undefined` |\n| `connectTimeoutMS` | Number | The time in milliseconds to attempt a connection before timing out | `undefined` |\n| `socketTimeoutMS` | Number | The time in milliseconds to attempt a send or receive on a socket before the attempt times out | `undefined` |\n| `compression` | Object | Object includes compressors and a compression level. The following compressors can be specified: `snappy`, `zlib` (Available in MongoDB 3.6 or greater) | `undefined` |\n\n#### Connection Pool Option\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `maxPoolSize` | Number | The maximum number of connections in the connection pool | `undefined` |\n| `minPoolSize` | Number | The minimum number of connections in the connection pool | `undefined` |\n| `maxIdleTimeMS` | Number | The maximum number of milliseconds that a connection can remain idle in the pool before being removed and closed | `undefined` |\n| `waitQueueMultiple` | Number | A number that the driver multiples the maxPoolSize value to, to provide the maximum number of threads allowed to wait for a connection to become available from the pool | `undefined` |\n| `waitQueueTimeoutMS` | Number | The maximum time in milliseconds that a thread can wait for a connection to become available | `undefined` |\n\n#### Write Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `w` | Number/String | Corresponds to the write concern [w Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-w) | `undefined` |\n| `wTimeoutMS` | Number | Corresponds to the write concern [wtimeout](https://docs.mongodb.com/manual/reference/write-concern/#wc-wtimeout) | `undefined` |\n| `journal` | Boolean | Corresponds to the write concern [j Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-j) | `undefined` |\n\n#### Read Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readConcernLevel` | String | The level of isolation | `undefined` |\n\n#### Read Preference Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readPreference` | String | Specifies the read preferences for this connection. Possible values: `PRIMARY`, `PRIMARY_PREFERRED`, `SECONDARY`, `SECONDARY_PREFERRED`, `NEAREST` | `PRIMARY` |\n| `maxStalenessSeconds` | Number | Specifies, in seconds, how stale a secondary can be before the client stops using it for read operations | `undefined` |\n| `readPreferenceTags` | Object | Default read preference tags for the client | `undefined` |\n\n#### Authentication Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `authSource` | String | Specify the database name associated with the user’s credentials | `undefined` |\n| `authMechanism` | String | Specifies the authentication mechanism that MongoDB will use to authenticate the connection. Possible values: `DEFAULT`, `GSSAPI`, `MONGODB-X509`, `PLAIN`, `SCRAM-SHA-256` | `undefined` |\n| `authMechanismProperties` | Object | Additional options provided for authentication (e.g. to enable hostname canonicalization for GSSAPI) | `undefined` |\n| `gssapiServiceName` | String | Set the Kerberos service name when connecting to Kerberized MongoDB instances | `undefined` |\n| `gssapiServiceRealm` | String | Set the Realm service name | `undefined` |\n| `gssapiCanonicalizeHostName` | Boolean | Whether canonicalized hostname | `undefined` |\n\n#### Server Selection and Discovery Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `localThresholdMS` | Number | The size (in milliseconds) of the latency window for selecting among multiple suitable MongoDB instances | `undefined` |\n| `serverSelectionTimeoutMS` | Number | Specifies how long (in milliseconds) to block for server selection before throwing an exception | `undefined` |\n| `serverSelectionTryOnce` | Boolean | Instructs the driver to scan the MongoDB deployment exactly once after server selection fails and then either select a server or raise an error | `undefined` |\n| `heartbeatFrequencyMS` | Number | Controls when the driver checks the state of the MongoDB deployment | `undefined` |\n\n#### Miscellaneous Configuration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `appname` | String | An application name passed to server as client metadata | `undefined` |\n| `retryWrites` | Boolean | Enable retryable writes | `undefined` |\n| `uuidRepresentation` | String | The legacy representation of UUID. Possible values: `standard`, `csharpLegacy`, `javaLegacy`, `pythonLegacy` | `undefined` |\n| `loadBalanced` | Boolean | Whether or not the server is running in load balanced mode | `undefined` |\n\n### Stitch attributes\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `stitchServiceName` | String | Stitch service name | `undefined` |\n| `stitchClientAppId` | String | Stitch сlient app ID | `undefined` |\n| `stitchGroupId` | String | Stitch group ID | `undefined` |\n| `stitchBaseUrl` | String | Stitch base Url | `undefined` |\n\n### MONGODB authentication\n\n```javascript\nconst c = new Connection({\n  mongodbUsername: 'arlo',\n  mongodbPassword: 'w@of'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/?slaveOk=true&authSource=admin'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `mongodbUsername` | String | MongoDB username | `undefined` |\n| `mongodbPassword` | String | MongoDB password | `undefined` |\n| `mongodbDatabaseName` | String | The database name associated with the user's credentials | `undefined` |\n| `promoteValues` | Boolean | Whether BSON values should be promoted to their JS type counterparts | `undefined` |\n\n### KERBEROS authentication\n\n```javascript\nconst c = new Connection({\n  kerberosServiceName: 'mongodb',\n  kerberosPrincipal: 'arlo/dog@krb5.mongodb.parts',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo%252Fdog%2540krb5.mongodb.parts@localhost:27017/toys?authMechanism=GSSAPI'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n> @note (imlucas): Kerberos on Windows is broken out as it's own state for UX consideration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `kerberosServiceName` | String | Any program or computer you access over a network | `undefined` |\n| `kerberosPrincipal` | String | The format of a typical Kerberos V5 principal is `primary/instance@REALM` | `undefined` |\n| `kerberosCanonicalizeHostname` | Boolean | Whether canonicalized kerberos hostname | `undefined` |\n\n#### See Also\n\n- [node.js driver Kerberos reference](http://bit.ly/mongodb-node-driver-kerberos)\n- [node.js driver Kerberos functional test][kerberos-functional]\n\n### LDAP authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  ldapUsername: 'arlo',\n  ldapPassword: 'w@of',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/toys?slaveOk=true&authMechanism=PLAIN'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ldapUsername` | String | LDAP username | `undefined` |\n| `ldapPassword` | String | LDAP password | `undefined` |\n\n#### See Also\n\n- [node.js driver LDAP reference](http://bit.ly/mongodb-node-driver-ldap)\n- [node.js driver X509 functional test][ldap-functional]\n\n### X509 authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  x509Username: 'CN=client,OU=arlo,O=MongoDB,L=Philadelphia,ST=Pennsylvania,C=US'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://CN%253Dclient%252COU%253Darlo%252CO%253DMongoDB%252CL%253DPhiladelphia%252CST%253DPennsylvania%252CC%253DUS@localhost:27017?slaveOk=true&authMechanism=MONGODB-X509'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `x509Username` | String | The x.509 certificate derived user name, e.g. `CN=user,OU=OrgUnit,O=myOrg,...` | `undefined` |\n\n#### See Also\n\n- [node.js driver X509 reference](http://bit.ly/mongodb-node-driver-x509)\n- [node.js driver X509 functional test][x509-functional]\n\n### SSL\n\n> **Note**: Not to be confused with `authentication=X509`\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ssl` | Number/String | A boolean to enable or disables TLS/SSL for the connection | `undefined` |\n| `sslMethod` | String | The desired ssl method. Possible values: `NONE`, `SYSTEMCA`, `IFAVAILABLE`, `UNVALIDATED`, `SERVER`, `ALL` | `NONE` |\n| `sslCA` | Buffer/String | Array of valid certificates | `undefined` |\n| `sslCert` | Buffer/String | The certificate | `undefined` |\n| `sslKey` | Buffer/String | The certificate private key | `undefined` |\n| `sslPass` | Buffer/String | The certificate password | `undefined` |\n\nDescription of `sslMethod` values:\n\n- `SYSTEMCA` - SSL required, validate using System CA, with host verification.\n- `IFAVAILABLE` - The driver should try SSL first, fall back to no SSL if unavailable, and use the system's Certificate Authority.\n- `SERVER` - The driver should validate the server certificate and fail to connect if validation fails. See also [node.js driver \"Validate Server Certificate\" docs][driver-ssl-server].\n- `ALL` - The driver must present a valid certificate and validate the server certificate. See also [node.js driver \"Validate Server Certificate and Present Valid Certificate\" docs][driver-ssl-all].\n- `NONE` - No SSL (Not recommended).\n- `UNVALIDATED` - Use SSL but do not perform any validation of the certificate chain. See also [node.js driver \"No Certificate Validation\" docs][driver-ssl-none]. **Very** not recommended and likely to be deprecated in future releases because it exposes potential Man-In-The-Middle attack vectors.\n\n#### See also\n\n- [node.js driver SSL implementation][driver-ssl-impl]\n- [node.js driver SSL tutorial][driver-ssl-tutorial]\n\n### SSH TUNNEL\n\n> New in mongodb-connection-model@5.0.0\n\nBecause [authentication](#authentication) is quite difficult for operators to migrate to, the most common method of securing a MongoDB deployment is to use an [SSH tunnel][sf-ssh-tunnel].  This allows operators to leverage their existing SSH security infrastructure to also provide secure access to MongoDB.  For a standard deployment of MongoDB on AWS, this is almost always to strategy.  Because of this, we now support creating SSH tunnels automatically when connecting to MongoDB.\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options, (connectionError, client) => {\n  if (connectionError) {\n    return console.log(connectionError);\n  }\n\n  client.db('mongodb').collection('fanclub').count((countingError, count) => {\n    console.log('counted:', countingError, count);\n    client.close();\n  });\n});\n```\n\nThe above provides the same functionality as creating the tunnel using the bash\ncommand below and connecting to MongoDB via another terminal. Notice that\nconnection-model uses a random local port each time it creates a tunnel.\nUsing the command line, you'd have to replace `<random port>` with an actual\nport number.\n\n```bash\nssh -i ~/.ssh/my-key-aws-pair.pem -L <random port>:localhost:27017 ubuntu@ec2-11-111-111-111.compute-1.amazonaws.com\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `sshTunnel` | String | The desired SSH tunnel strategy. Possible values: `NONE`, `USER_PASSWORD`, `IDENTITY_FILE` | `undefined` |\n| `sshTunnelHostname` | String | The hostname of the SSH remote host | `undefined` |\n| `sshTunnelPort` | Port | The SSH port of the remote host | `22` |\n| `sshTunnelBindToLocalPort` | Port | Bind the localhost endpoint of the SSH Tunnel to this port | `undefined` |\n| `sshTunnelUsername` | String | The optional SSH username for the remote host | `undefined` |\n| `sshTunnelPassword` | String | The optional SSH password for the remote host | `undefined` |\n| `sshTunnelIdentityFile` | String/Array | The optional path to the SSH identity file for the remote host | `undefined` |\n| `sshTunnelPassphrase` | String | The optional passphrase for `sshTunnelIdentityFile` | `undefined` |\n\nDescription of `sshTunnel` values:\n\n- `NONE` - Do not use SSH tunneling.\n- `USER_PASSWORD` - The tunnel is created with SSH username and password only.\n- `IDENTITY_FILE` - The tunnel is created using an identity file.\n\n## Derived Properties\n\nDerived properties (also known as computed properties) are properties of the state object that depend on other properties to determine their value.\n\n```javascript\nconst c = new Connection();\nconst derivedProps = c.getAttributes({ derived: true });\n```\n\n| Derived Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `instanceId` | String | The mongoscope | `localhost:27017` |\n| `driverAuthMechanism` | String | Converts the value of `authStrategy` for humans into the `authMechanism` value for the driver | `undefined` |\n| `safeUrl` | String | The URL where a password is replaced with stars | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrl` | String | Use this URL in order to connect via DataService | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrlWithSsh` | String | Use this URL in order to connect via connection model itself | `mongodb://localhost:29201/?readPreference=primary&ssl=false` |\n| `driverOptions` | String | The second argument `mongoscope-server` passes to `mongodb.connect` | `{}` |\n\n## Events\n\n> New in mongodb-connection-model@5.0.0\n\n#### Example: SSH Tunnel\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', skipped: true,\n  reason: 'The selected SSL mode does not need to load any files.' }\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', complete: true}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n#### Example: SSL\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  ssl: 'ALL',\n  sslCA: '~/.ssl/my-ca.pem',\n  sslCert: '~/.ssl/my-server.pem',\n  sslKey: '~/.ssl/my-server.pem'\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', complete: true}\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', skipped: true,\n  reason: 'The selected SSH Tunnel mode is NONE.'}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n[workflow_img]: https://github.com/mongodb-js/connection-model/workflows/Check%20and%20Test/badge.svg?event=push\n[workflow_url]: https://github.com/mongodb-js/connection-model/actions?query=workflow%3A%22Check+and+Test%22\n[npm_img]: https://img.shields.io/npm/v/mongodb-connection-model.svg?style=flat-square\n[npm_url]: https://www.npmjs.org/package/mongodb-connection-model\n[gitter_img]: https://badges.gitter.im/Join%20Chat.svg\n[gitter_url]: http://gitter.im/mongodb-js/mongodb-js\n[enterprise_img]: https://img.shields.io/badge/MongoDB-Enterprise-blue.svg?style=flat-square\n[coming_soon_img]: https://img.shields.io/badge/-Coming%20Soon-ff69b4.svg?style=flat-square\n[kerberos-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/kerberos_tests.js\n[ldap-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ldap_tests.js\n[x509-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ssl_x509_tests.js\n[ns]: https://github.com/mongodb-js/ns\n[sf-ssh-tunnel]: http://serverfault.com/questions/597765/how-to-connect-to-mongodb-server-via-ssh-tunnel\n[ec2-key-pairs]: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html\n[driver-ssl-impl]: https://github.com/christkv/mongodb-core/blob/c3d21cb636d74d7a68134ecd3b9f6af536311279/lib/connection/connection.js#L365-L407\n[driver-ssl-tutorial]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/\n[driver-ssl-none]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#no-certificate-validation\n[driver-ssl-server]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate\n[driver-ssl-all]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate-and-present-valid-certificate\n","gitHead":"a863ce6adfb98ced08f9644a294f5b63b110c7d8","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","test":"mocha","check":"npm run lint && npm run depcheck","pretest":"mongodb-runner install && mongodb-runner start --port=27018","test-ci":"npm run test","depcheck":"depcheck","posttest":"mongodb-runner stop --port=27018","posttest-ci":"node ../../scripts/killall-mongo.js","test-check-ci":"npm run check && npm test"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.17.0+x64 (linux)","description":"MongoDB connection model","directories":{},"_nodeVersion":"16.17.0","compass:main":"index.js","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","debug":"^4.2.0","lodash":"^4.17.15","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.2.0","storage-mixin":"0.0.0-next-a863ce6adfb98ced08f9644a294f5b63b110c7d8","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.2","@mongodb-js/ssh-tunnel":"0.0.0-next-a863ce6adfb98ced08f9644a294f5b63b110c7d8","@mongodb-js/compass-utils":"0.0.0-next-a863ce6adfb98ced08f9644a294f5b63b110c7d8","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.6.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^10.2.0","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"^5.1.0","depcheck":"^1.4.1","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.10.0","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^5.1.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_0.0.0-next-a863ce6adfb98ced08f9644a294f5b63b110c7d8_1680032471085_0.11406917549621975","host":"s3://npm-registry-packages"}},"0.0.0-next-c3291a871fc2c07d3e2038cc1ad275c102e1d321":{"name":"mongodb-connection-model","version":"0.0.0-next-c3291a871fc2c07d3e2038cc1ad275c102e1d321","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@0.0.0-next-c3291a871fc2c07d3e2038cc1ad275c102e1d321","maintainers":[{"name":"mongo-j","email":"james.wang@mongodb.com"},{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satya@mongodb.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"iteng@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"f6a3732db28158ed38820c4b061e1d844d9300cb","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-0.0.0-next-c3291a871fc2c07d3e2038cc1ad275c102e1d321.tgz","fileCount":20,"integrity":"sha512-gp0P/nD2O2nVtx56KIw46xcifZwGw6u0C0TRpj3kcrmlOZoSDQ8sdSBv5pkDCAYxtsBkcfZUIJh1tYXkAUVvQQ==","signatures":[{"sig":"MEYCIQCMxAtEn1vefMuOzrQ+rbIq7wrtbLq4r2JKECC72DTvGAIhAM3hRK6il//PQokde7zv5AquwpajGRov60M1fNQTA0zO","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":108151,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkJVfeACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmremw/+J3kbKnsz5l3uKoyKNHYF6C5CCulRad4ynxXbBwVNq4/TWjU6\r\nrSJZNPioQvxDQVF0O3f5qHQiFQoGscCISkLl5BJ2p+Tr8ZIq4a35mnvQIWGc\r\nbjezgZeGkGLNzmfxsuEFC4EnUHD1JKsxdbiW3aw961hZD8obtLV6cDjtx6cU\r\nr1iTHY8H9PrDWl+ILtbuFH1KFjmcIsxxVoaj20qxVclALDI1qF8BxxuLi5D0\r\nEojkgHmUFqAvMDJRk/QaG2tPk5B75xhE/ICr/ascof37OOPn91aI9yDmgytc\r\nvLoSWgPeN580UBR1KJwx/iAa24H06DnnLfEdUwdquj2oHyw3aleDzuKuGWYb\r\nQBaRYPdV6Ue5ZpmQS0AmhGAUiGWcSeBLk3DtUWLBsjFu18lYn1zOSnktapaY\r\ngpLxuq6Jp8Vpu0td1Ym3kGKF1BVgPfqLfQfzGXMAWRjwZEZx3I2UHrjQqeAG\r\np1nMBo7XXsdEyaha1ZrGPRR7cemXxrD+q9BssEqsa30rSU32ciq1y8ucKfIQ\r\nF5/LZObIY+ZnTY2CWOU4YoprtyLq9AXumD9l+FXQIsiUIkNwjS1jgflrHAa9\r\nuU1PCuXnooTXthKHHOCPH/Ro27JVTT/d+81bFaBzwCOBjYIAZsU9GqX5GHTT\r\nnTWnVgWov2THF2lqbAk7dNnXXNgv1kLy8fM=\r\n=SBnR\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","readme":"# mongodb-connection-model [![][workflow_img]][workflow_url] [![][npm_img]][npm_url]\n\n> MongoDB connection model\n\nThe main purpose of the MongoDB connection model is to be a domain model around a MongoDB connection. It encapsulates generating a [Connection String URI](https://docs.mongodb.com/manual/reference/connection-string/) from a group of attributes and parses URI using the [MongoDB Node.JS Driver URI Parser](https://github.com/mongodb-js/mongodb-core/blob/master/lib/uri_parser.js).\n\n## Installation\n\n```\nnpm install --save mongodb-connection-model\n```\n\n## Usage\n\n### Building URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\nconst c = new Connection({ appname: 'My App Name' });\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://localhost:27017/?readPreference=primary&appname=My%20App&ssl=false'\n```\n\n### Parsing URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\n\nConnection.from(\n  'mongodb://someUsername:testPassword@localhost',\n  (error, result) => {\n    console.log(result);\n    >>> `{\n      hosts: [{ host: 'localhost', port: 27017 }],\n      hostname: 'localhost',\n      port: 27017,\n      auth: {\n        username: 'someUsername',\n        password: 'testPassword',\n        db: 'admin'\n      },\n      isSrvRecord: false,\n      authStrategy: 'MONGODB',\n      mongodbUsername: 'someUsername',\n      mongodbPassword: 'testPassword',\n      mongodbDatabaseName: 'admin',\n      extraOptions: {},\n      connectionType: 'NODE_DRIVER',\n      readPreference: 'primary',\n      kerberosCanonicalizeHostname: false,\n      sslMethod: 'NONE',\n      sshTunnel: 'NONE',\n      sshTunnelPort: 22\n    }`\n  }\n);\n```\n\n## Properties\n\nMongoDB connection model is based on Ampersand.js framework and consist of [props](https://ampersandjs.com/docs/#ampersand-state-props) and [derived props](https://ampersandjs.com/docs/#ampersand-state-derived). The props object describes the observable properties that MongoDB connection model gets from the Node.js Driver API.\n\n```javascript\nconst с = new Connection();\nconst props = с.getAttributes({ props: true });\n```\n\n#### See Also\n\n- [URI Generic Syntax](https://tools.ietf.org/html/rfc3986)\n- [URI Options Specification](https://github.com/mongodb/specifications/blob/master/source/uri-options/uri-options.rst)\n\n### General Properties\n\n```javascript\nconst c = new Connection({ isSrvRecord: true });\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ns` | String | A valid [ns][ns] the user can read from | `undefined` |\n| `isSrvRecord` | Boolean | Indicates SRV record | `false` |\n| `auth` | Object | Authentication from driver (username, user, db, password) | `undefined` |\n| `hostname` | String | Hostname of a MongoDB Instance. In case of the replica set the first host and port will be taken | `localhost` |\n| `port` | Number | TCP port of a MongoDB Instance | `27017` |\n| `hosts` | Array | Contains all hosts and ports for replica set | `[{ host: 'localhost', port: 27017 }]` |\n| `extraOptions` | Object | Extra options passed to the node driver as part of `driverOptions` | `{}` |\n| `connectionType` | String | The desired connection type. Possible values: `NODE_DRIVER`, `STITCH_ON_PREM`, `STITCH_ATLAS` | `NODE_DRIVER` |\n| `authStrategy` | String | The desired authentication strategy. Possible values: `NONE`, `MONGODB`, `X509`, `KERBEROS`, `LDAP`, `SCRAM-SHA-256` | `NONE` |\n\n### Connection string options\n\n```javascript\nconst c = new Connection({ appname: 'My App', replicaSet: 'testing' });\n```\n\n#### General connection string options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `replicaSet` | String | Specifies the name of the replica set, if the mongod is a member of a replica set | `undefined` |\n| `connectTimeoutMS` | Number | The time in milliseconds to attempt a connection before timing out | `undefined` |\n| `socketTimeoutMS` | Number | The time in milliseconds to attempt a send or receive on a socket before the attempt times out | `undefined` |\n| `compression` | Object | Object includes compressors and a compression level. The following compressors can be specified: `snappy`, `zlib` (Available in MongoDB 3.6 or greater) | `undefined` |\n\n#### Connection Pool Option\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `maxPoolSize` | Number | The maximum number of connections in the connection pool | `undefined` |\n| `minPoolSize` | Number | The minimum number of connections in the connection pool | `undefined` |\n| `maxIdleTimeMS` | Number | The maximum number of milliseconds that a connection can remain idle in the pool before being removed and closed | `undefined` |\n| `waitQueueMultiple` | Number | A number that the driver multiples the maxPoolSize value to, to provide the maximum number of threads allowed to wait for a connection to become available from the pool | `undefined` |\n| `waitQueueTimeoutMS` | Number | The maximum time in milliseconds that a thread can wait for a connection to become available | `undefined` |\n\n#### Write Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `w` | Number/String | Corresponds to the write concern [w Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-w) | `undefined` |\n| `wTimeoutMS` | Number | Corresponds to the write concern [wtimeout](https://docs.mongodb.com/manual/reference/write-concern/#wc-wtimeout) | `undefined` |\n| `journal` | Boolean | Corresponds to the write concern [j Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-j) | `undefined` |\n\n#### Read Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readConcernLevel` | String | The level of isolation | `undefined` |\n\n#### Read Preference Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readPreference` | String | Specifies the read preferences for this connection. Possible values: `PRIMARY`, `PRIMARY_PREFERRED`, `SECONDARY`, `SECONDARY_PREFERRED`, `NEAREST` | `PRIMARY` |\n| `maxStalenessSeconds` | Number | Specifies, in seconds, how stale a secondary can be before the client stops using it for read operations | `undefined` |\n| `readPreferenceTags` | Object | Default read preference tags for the client | `undefined` |\n\n#### Authentication Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `authSource` | String | Specify the database name associated with the user’s credentials | `undefined` |\n| `authMechanism` | String | Specifies the authentication mechanism that MongoDB will use to authenticate the connection. Possible values: `DEFAULT`, `GSSAPI`, `MONGODB-X509`, `PLAIN`, `SCRAM-SHA-256` | `undefined` |\n| `authMechanismProperties` | Object | Additional options provided for authentication (e.g. to enable hostname canonicalization for GSSAPI) | `undefined` |\n| `gssapiServiceName` | String | Set the Kerberos service name when connecting to Kerberized MongoDB instances | `undefined` |\n| `gssapiServiceRealm` | String | Set the Realm service name | `undefined` |\n| `gssapiCanonicalizeHostName` | Boolean | Whether canonicalized hostname | `undefined` |\n\n#### Server Selection and Discovery Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `localThresholdMS` | Number | The size (in milliseconds) of the latency window for selecting among multiple suitable MongoDB instances | `undefined` |\n| `serverSelectionTimeoutMS` | Number | Specifies how long (in milliseconds) to block for server selection before throwing an exception | `undefined` |\n| `serverSelectionTryOnce` | Boolean | Instructs the driver to scan the MongoDB deployment exactly once after server selection fails and then either select a server or raise an error | `undefined` |\n| `heartbeatFrequencyMS` | Number | Controls when the driver checks the state of the MongoDB deployment | `undefined` |\n\n#### Miscellaneous Configuration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `appname` | String | An application name passed to server as client metadata | `undefined` |\n| `retryWrites` | Boolean | Enable retryable writes | `undefined` |\n| `uuidRepresentation` | String | The legacy representation of UUID. Possible values: `standard`, `csharpLegacy`, `javaLegacy`, `pythonLegacy` | `undefined` |\n| `loadBalanced` | Boolean | Whether or not the server is running in load balanced mode | `undefined` |\n\n### Stitch attributes\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `stitchServiceName` | String | Stitch service name | `undefined` |\n| `stitchClientAppId` | String | Stitch сlient app ID | `undefined` |\n| `stitchGroupId` | String | Stitch group ID | `undefined` |\n| `stitchBaseUrl` | String | Stitch base Url | `undefined` |\n\n### MONGODB authentication\n\n```javascript\nconst c = new Connection({\n  mongodbUsername: 'arlo',\n  mongodbPassword: 'w@of'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/?slaveOk=true&authSource=admin'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `mongodbUsername` | String | MongoDB username | `undefined` |\n| `mongodbPassword` | String | MongoDB password | `undefined` |\n| `mongodbDatabaseName` | String | The database name associated with the user's credentials | `undefined` |\n| `promoteValues` | Boolean | Whether BSON values should be promoted to their JS type counterparts | `undefined` |\n\n### KERBEROS authentication\n\n```javascript\nconst c = new Connection({\n  kerberosServiceName: 'mongodb',\n  kerberosPrincipal: 'arlo/dog@krb5.mongodb.parts',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo%252Fdog%2540krb5.mongodb.parts@localhost:27017/toys?authMechanism=GSSAPI'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n> @note (imlucas): Kerberos on Windows is broken out as it's own state for UX consideration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `kerberosServiceName` | String | Any program or computer you access over a network | `undefined` |\n| `kerberosPrincipal` | String | The format of a typical Kerberos V5 principal is `primary/instance@REALM` | `undefined` |\n| `kerberosCanonicalizeHostname` | Boolean | Whether canonicalized kerberos hostname | `undefined` |\n\n#### See Also\n\n- [node.js driver Kerberos reference](http://bit.ly/mongodb-node-driver-kerberos)\n- [node.js driver Kerberos functional test][kerberos-functional]\n\n### LDAP authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  ldapUsername: 'arlo',\n  ldapPassword: 'w@of',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/toys?slaveOk=true&authMechanism=PLAIN'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ldapUsername` | String | LDAP username | `undefined` |\n| `ldapPassword` | String | LDAP password | `undefined` |\n\n#### See Also\n\n- [node.js driver LDAP reference](http://bit.ly/mongodb-node-driver-ldap)\n- [node.js driver X509 functional test][ldap-functional]\n\n### X509 authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  x509Username: 'CN=client,OU=arlo,O=MongoDB,L=Philadelphia,ST=Pennsylvania,C=US'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://CN%253Dclient%252COU%253Darlo%252CO%253DMongoDB%252CL%253DPhiladelphia%252CST%253DPennsylvania%252CC%253DUS@localhost:27017?slaveOk=true&authMechanism=MONGODB-X509'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `x509Username` | String | The x.509 certificate derived user name, e.g. `CN=user,OU=OrgUnit,O=myOrg,...` | `undefined` |\n\n#### See Also\n\n- [node.js driver X509 reference](http://bit.ly/mongodb-node-driver-x509)\n- [node.js driver X509 functional test][x509-functional]\n\n### SSL\n\n> **Note**: Not to be confused with `authentication=X509`\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ssl` | Number/String | A boolean to enable or disables TLS/SSL for the connection | `undefined` |\n| `sslMethod` | String | The desired ssl method. Possible values: `NONE`, `SYSTEMCA`, `IFAVAILABLE`, `UNVALIDATED`, `SERVER`, `ALL` | `NONE` |\n| `sslCA` | Buffer/String | Array of valid certificates | `undefined` |\n| `sslCert` | Buffer/String | The certificate | `undefined` |\n| `sslKey` | Buffer/String | The certificate private key | `undefined` |\n| `sslPass` | Buffer/String | The certificate password | `undefined` |\n\nDescription of `sslMethod` values:\n\n- `SYSTEMCA` - SSL required, validate using System CA, with host verification.\n- `IFAVAILABLE` - The driver should try SSL first, fall back to no SSL if unavailable, and use the system's Certificate Authority.\n- `SERVER` - The driver should validate the server certificate and fail to connect if validation fails. See also [node.js driver \"Validate Server Certificate\" docs][driver-ssl-server].\n- `ALL` - The driver must present a valid certificate and validate the server certificate. See also [node.js driver \"Validate Server Certificate and Present Valid Certificate\" docs][driver-ssl-all].\n- `NONE` - No SSL (Not recommended).\n- `UNVALIDATED` - Use SSL but do not perform any validation of the certificate chain. See also [node.js driver \"No Certificate Validation\" docs][driver-ssl-none]. **Very** not recommended and likely to be deprecated in future releases because it exposes potential Man-In-The-Middle attack vectors.\n\n#### See also\n\n- [node.js driver SSL implementation][driver-ssl-impl]\n- [node.js driver SSL tutorial][driver-ssl-tutorial]\n\n### SSH TUNNEL\n\n> New in mongodb-connection-model@5.0.0\n\nBecause [authentication](#authentication) is quite difficult for operators to migrate to, the most common method of securing a MongoDB deployment is to use an [SSH tunnel][sf-ssh-tunnel].  This allows operators to leverage their existing SSH security infrastructure to also provide secure access to MongoDB.  For a standard deployment of MongoDB on AWS, this is almost always to strategy.  Because of this, we now support creating SSH tunnels automatically when connecting to MongoDB.\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options, (connectionError, client) => {\n  if (connectionError) {\n    return console.log(connectionError);\n  }\n\n  client.db('mongodb').collection('fanclub').count((countingError, count) => {\n    console.log('counted:', countingError, count);\n    client.close();\n  });\n});\n```\n\nThe above provides the same functionality as creating the tunnel using the bash\ncommand below and connecting to MongoDB via another terminal. Notice that\nconnection-model uses a random local port each time it creates a tunnel.\nUsing the command line, you'd have to replace `<random port>` with an actual\nport number.\n\n```bash\nssh -i ~/.ssh/my-key-aws-pair.pem -L <random port>:localhost:27017 ubuntu@ec2-11-111-111-111.compute-1.amazonaws.com\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `sshTunnel` | String | The desired SSH tunnel strategy. Possible values: `NONE`, `USER_PASSWORD`, `IDENTITY_FILE` | `undefined` |\n| `sshTunnelHostname` | String | The hostname of the SSH remote host | `undefined` |\n| `sshTunnelPort` | Port | The SSH port of the remote host | `22` |\n| `sshTunnelBindToLocalPort` | Port | Bind the localhost endpoint of the SSH Tunnel to this port | `undefined` |\n| `sshTunnelUsername` | String | The optional SSH username for the remote host | `undefined` |\n| `sshTunnelPassword` | String | The optional SSH password for the remote host | `undefined` |\n| `sshTunnelIdentityFile` | String/Array | The optional path to the SSH identity file for the remote host | `undefined` |\n| `sshTunnelPassphrase` | String | The optional passphrase for `sshTunnelIdentityFile` | `undefined` |\n\nDescription of `sshTunnel` values:\n\n- `NONE` - Do not use SSH tunneling.\n- `USER_PASSWORD` - The tunnel is created with SSH username and password only.\n- `IDENTITY_FILE` - The tunnel is created using an identity file.\n\n## Derived Properties\n\nDerived properties (also known as computed properties) are properties of the state object that depend on other properties to determine their value.\n\n```javascript\nconst c = new Connection();\nconst derivedProps = c.getAttributes({ derived: true });\n```\n\n| Derived Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `instanceId` | String | The mongoscope | `localhost:27017` |\n| `driverAuthMechanism` | String | Converts the value of `authStrategy` for humans into the `authMechanism` value for the driver | `undefined` |\n| `safeUrl` | String | The URL where a password is replaced with stars | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrl` | String | Use this URL in order to connect via DataService | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrlWithSsh` | String | Use this URL in order to connect via connection model itself | `mongodb://localhost:29201/?readPreference=primary&ssl=false` |\n| `driverOptions` | String | The second argument `mongoscope-server` passes to `mongodb.connect` | `{}` |\n\n## Events\n\n> New in mongodb-connection-model@5.0.0\n\n#### Example: SSH Tunnel\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', skipped: true,\n  reason: 'The selected SSL mode does not need to load any files.' }\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', complete: true}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n#### Example: SSL\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  ssl: 'ALL',\n  sslCA: '~/.ssl/my-ca.pem',\n  sslCert: '~/.ssl/my-server.pem',\n  sslKey: '~/.ssl/my-server.pem'\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', complete: true}\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', skipped: true,\n  reason: 'The selected SSH Tunnel mode is NONE.'}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n[workflow_img]: https://github.com/mongodb-js/connection-model/workflows/Check%20and%20Test/badge.svg?event=push\n[workflow_url]: https://github.com/mongodb-js/connection-model/actions?query=workflow%3A%22Check+and+Test%22\n[npm_img]: https://img.shields.io/npm/v/mongodb-connection-model.svg?style=flat-square\n[npm_url]: https://www.npmjs.org/package/mongodb-connection-model\n[gitter_img]: https://badges.gitter.im/Join%20Chat.svg\n[gitter_url]: http://gitter.im/mongodb-js/mongodb-js\n[enterprise_img]: https://img.shields.io/badge/MongoDB-Enterprise-blue.svg?style=flat-square\n[coming_soon_img]: https://img.shields.io/badge/-Coming%20Soon-ff69b4.svg?style=flat-square\n[kerberos-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/kerberos_tests.js\n[ldap-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ldap_tests.js\n[x509-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ssl_x509_tests.js\n[ns]: https://github.com/mongodb-js/ns\n[sf-ssh-tunnel]: http://serverfault.com/questions/597765/how-to-connect-to-mongodb-server-via-ssh-tunnel\n[ec2-key-pairs]: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html\n[driver-ssl-impl]: https://github.com/christkv/mongodb-core/blob/c3d21cb636d74d7a68134ecd3b9f6af536311279/lib/connection/connection.js#L365-L407\n[driver-ssl-tutorial]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/\n[driver-ssl-none]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#no-certificate-validation\n[driver-ssl-server]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate\n[driver-ssl-all]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate-and-present-valid-certificate\n","gitHead":"c3291a871fc2c07d3e2038cc1ad275c102e1d321","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","test":"mocha","check":"npm run lint && npm run depcheck","pretest":"mongodb-runner install && mongodb-runner start --port=27018","test-ci":"npm run test","depcheck":"depcheck","posttest":"mongodb-runner stop --port=27018","posttest-ci":"node ../../scripts/killall-mongo.js","test-check-ci":"npm run check && npm test"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.17.0+x64 (linux)","description":"MongoDB connection model","directories":{},"_nodeVersion":"16.17.0","compass:main":"index.js","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","debug":"^4.2.0","lodash":"^4.17.15","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.2.0","storage-mixin":"0.0.0-next-c3291a871fc2c07d3e2038cc1ad275c102e1d321","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.2","@mongodb-js/ssh-tunnel":"0.0.0-next-c3291a871fc2c07d3e2038cc1ad275c102e1d321","@mongodb-js/compass-utils":"0.0.0-next-c3291a871fc2c07d3e2038cc1ad275c102e1d321","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.6.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^10.2.0","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"^5.1.0","depcheck":"^1.4.1","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.10.0","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^5.1.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_0.0.0-next-c3291a871fc2c07d3e2038cc1ad275c102e1d321_1680168925931_0.31173802793475613","host":"s3://npm-registry-packages"}},"0.0.0-next-da0d016fdae6992001ca3f3347c293c36815df43":{"name":"mongodb-connection-model","version":"0.0.0-next-da0d016fdae6992001ca3f3347c293c36815df43","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@0.0.0-next-da0d016fdae6992001ca3f3347c293c36815df43","maintainers":[{"name":"mongo-j","email":"james.wang@mongodb.com"},{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satya@mongodb.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"iteng@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"c0c9d6635f87bc75e5500265e6e7878987402911","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-0.0.0-next-da0d016fdae6992001ca3f3347c293c36815df43.tgz","fileCount":20,"integrity":"sha512-cGyqD6AGEcC9L6zm0nzzVECmgJPnGEHUqv7A71yzmHjb1ECliq2voDPYZOfvmD2DlFt5Ju9004xN3qvL02M/Fg==","signatures":[{"sig":"MEYCIQD/PxvvHwZcJJ1HS7CM8HHQD9kcQjjvEBaIR5IPvs0kzgIhAIzyAbC3gODTwmNqJUEoCi21WZY5/ZEOa1XSdxWC/zkF","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":108151,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkJ0lDACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqNIg//RaZQShZQ0oEyPstKVflmMZS/2cj99V5ofUZuMofX23Ymt3G2\r\nMuFkIj5YgMPjMtGaXFZ1peFpAfXvAPNadIkpGEiOV1pp94NQMK1PIUsxxWjJ\r\njHUM1hV6Dq/50SmO7hk8Qg8maru1Mjhq1neDigjEKl2YLIoFSg0f1wLMKP/l\r\nh6fnqQzLgwNoAe4ikTysCrn6iFMiAAT/Yc5qdn65eE+N7BGp42n34bpy8yop\r\ncmVI4YL0tuKu8MP8BcsKEgxcrzcCoxN3M0A2CtNZBXX+zYZtWJebvPuSy/MZ\r\nV1fogh/hDtrVKlqnOJIuBDdpWxCec5Lhy+jPpapN/FF+Hj+FDXE96rffy3Og\r\nShmEAB7UvpTeWGEFzLSkqSGmoxdE1jOtwhRXDzSUyhKpKOp8H8hhwhWVrHLg\r\ntaN2uwe0w2fM1TQjTLeO+wK/tTJp2h2GBG9GQQx3ifH7Vin+nsuGkfPCOyyh\r\nOxzkzkZaT+98t004nnkAiKeTCLl3c0QIF43QOpJqePhcMSzqiMD9nNTgNqlI\r\nNqqoU5XoZNLEGg5TGuIxSQXMyRApJ9xsmb0JULO9A+0MT5EMXdyA/TdkxkJO\r\nHGyi32ifHUgqXs6frdANouFF7y4JJW2lw5d/iBuPddcApfPZgPKUCfl2bKSD\r\nT/WVGtHla3CBalMm/SCDS86jKGxuYjU6R44=\r\n=ZBrI\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","readme":"# mongodb-connection-model [![][workflow_img]][workflow_url] [![][npm_img]][npm_url]\n\n> MongoDB connection model\n\nThe main purpose of the MongoDB connection model is to be a domain model around a MongoDB connection. It encapsulates generating a [Connection String URI](https://docs.mongodb.com/manual/reference/connection-string/) from a group of attributes and parses URI using the [MongoDB Node.JS Driver URI Parser](https://github.com/mongodb-js/mongodb-core/blob/master/lib/uri_parser.js).\n\n## Installation\n\n```\nnpm install --save mongodb-connection-model\n```\n\n## Usage\n\n### Building URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\nconst c = new Connection({ appname: 'My App Name' });\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://localhost:27017/?readPreference=primary&appname=My%20App&ssl=false'\n```\n\n### Parsing URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\n\nConnection.from(\n  'mongodb://someUsername:testPassword@localhost',\n  (error, result) => {\n    console.log(result);\n    >>> `{\n      hosts: [{ host: 'localhost', port: 27017 }],\n      hostname: 'localhost',\n      port: 27017,\n      auth: {\n        username: 'someUsername',\n        password: 'testPassword',\n        db: 'admin'\n      },\n      isSrvRecord: false,\n      authStrategy: 'MONGODB',\n      mongodbUsername: 'someUsername',\n      mongodbPassword: 'testPassword',\n      mongodbDatabaseName: 'admin',\n      extraOptions: {},\n      connectionType: 'NODE_DRIVER',\n      readPreference: 'primary',\n      kerberosCanonicalizeHostname: false,\n      sslMethod: 'NONE',\n      sshTunnel: 'NONE',\n      sshTunnelPort: 22\n    }`\n  }\n);\n```\n\n## Properties\n\nMongoDB connection model is based on Ampersand.js framework and consist of [props](https://ampersandjs.com/docs/#ampersand-state-props) and [derived props](https://ampersandjs.com/docs/#ampersand-state-derived). The props object describes the observable properties that MongoDB connection model gets from the Node.js Driver API.\n\n```javascript\nconst с = new Connection();\nconst props = с.getAttributes({ props: true });\n```\n\n#### See Also\n\n- [URI Generic Syntax](https://tools.ietf.org/html/rfc3986)\n- [URI Options Specification](https://github.com/mongodb/specifications/blob/master/source/uri-options/uri-options.rst)\n\n### General Properties\n\n```javascript\nconst c = new Connection({ isSrvRecord: true });\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ns` | String | A valid [ns][ns] the user can read from | `undefined` |\n| `isSrvRecord` | Boolean | Indicates SRV record | `false` |\n| `auth` | Object | Authentication from driver (username, user, db, password) | `undefined` |\n| `hostname` | String | Hostname of a MongoDB Instance. In case of the replica set the first host and port will be taken | `localhost` |\n| `port` | Number | TCP port of a MongoDB Instance | `27017` |\n| `hosts` | Array | Contains all hosts and ports for replica set | `[{ host: 'localhost', port: 27017 }]` |\n| `extraOptions` | Object | Extra options passed to the node driver as part of `driverOptions` | `{}` |\n| `connectionType` | String | The desired connection type. Possible values: `NODE_DRIVER`, `STITCH_ON_PREM`, `STITCH_ATLAS` | `NODE_DRIVER` |\n| `authStrategy` | String | The desired authentication strategy. Possible values: `NONE`, `MONGODB`, `X509`, `KERBEROS`, `LDAP`, `SCRAM-SHA-256` | `NONE` |\n\n### Connection string options\n\n```javascript\nconst c = new Connection({ appname: 'My App', replicaSet: 'testing' });\n```\n\n#### General connection string options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `replicaSet` | String | Specifies the name of the replica set, if the mongod is a member of a replica set | `undefined` |\n| `connectTimeoutMS` | Number | The time in milliseconds to attempt a connection before timing out | `undefined` |\n| `socketTimeoutMS` | Number | The time in milliseconds to attempt a send or receive on a socket before the attempt times out | `undefined` |\n| `compression` | Object | Object includes compressors and a compression level. The following compressors can be specified: `snappy`, `zlib` (Available in MongoDB 3.6 or greater) | `undefined` |\n\n#### Connection Pool Option\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `maxPoolSize` | Number | The maximum number of connections in the connection pool | `undefined` |\n| `minPoolSize` | Number | The minimum number of connections in the connection pool | `undefined` |\n| `maxIdleTimeMS` | Number | The maximum number of milliseconds that a connection can remain idle in the pool before being removed and closed | `undefined` |\n| `waitQueueMultiple` | Number | A number that the driver multiples the maxPoolSize value to, to provide the maximum number of threads allowed to wait for a connection to become available from the pool | `undefined` |\n| `waitQueueTimeoutMS` | Number | The maximum time in milliseconds that a thread can wait for a connection to become available | `undefined` |\n\n#### Write Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `w` | Number/String | Corresponds to the write concern [w Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-w) | `undefined` |\n| `wTimeoutMS` | Number | Corresponds to the write concern [wtimeout](https://docs.mongodb.com/manual/reference/write-concern/#wc-wtimeout) | `undefined` |\n| `journal` | Boolean | Corresponds to the write concern [j Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-j) | `undefined` |\n\n#### Read Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readConcernLevel` | String | The level of isolation | `undefined` |\n\n#### Read Preference Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readPreference` | String | Specifies the read preferences for this connection. Possible values: `PRIMARY`, `PRIMARY_PREFERRED`, `SECONDARY`, `SECONDARY_PREFERRED`, `NEAREST` | `PRIMARY` |\n| `maxStalenessSeconds` | Number | Specifies, in seconds, how stale a secondary can be before the client stops using it for read operations | `undefined` |\n| `readPreferenceTags` | Object | Default read preference tags for the client | `undefined` |\n\n#### Authentication Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `authSource` | String | Specify the database name associated with the user’s credentials | `undefined` |\n| `authMechanism` | String | Specifies the authentication mechanism that MongoDB will use to authenticate the connection. Possible values: `DEFAULT`, `GSSAPI`, `MONGODB-X509`, `PLAIN`, `SCRAM-SHA-256` | `undefined` |\n| `authMechanismProperties` | Object | Additional options provided for authentication (e.g. to enable hostname canonicalization for GSSAPI) | `undefined` |\n| `gssapiServiceName` | String | Set the Kerberos service name when connecting to Kerberized MongoDB instances | `undefined` |\n| `gssapiServiceRealm` | String | Set the Realm service name | `undefined` |\n| `gssapiCanonicalizeHostName` | Boolean | Whether canonicalized hostname | `undefined` |\n\n#### Server Selection and Discovery Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `localThresholdMS` | Number | The size (in milliseconds) of the latency window for selecting among multiple suitable MongoDB instances | `undefined` |\n| `serverSelectionTimeoutMS` | Number | Specifies how long (in milliseconds) to block for server selection before throwing an exception | `undefined` |\n| `serverSelectionTryOnce` | Boolean | Instructs the driver to scan the MongoDB deployment exactly once after server selection fails and then either select a server or raise an error | `undefined` |\n| `heartbeatFrequencyMS` | Number | Controls when the driver checks the state of the MongoDB deployment | `undefined` |\n\n#### Miscellaneous Configuration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `appname` | String | An application name passed to server as client metadata | `undefined` |\n| `retryWrites` | Boolean | Enable retryable writes | `undefined` |\n| `uuidRepresentation` | String | The legacy representation of UUID. Possible values: `standard`, `csharpLegacy`, `javaLegacy`, `pythonLegacy` | `undefined` |\n| `loadBalanced` | Boolean | Whether or not the server is running in load balanced mode | `undefined` |\n\n### Stitch attributes\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `stitchServiceName` | String | Stitch service name | `undefined` |\n| `stitchClientAppId` | String | Stitch сlient app ID | `undefined` |\n| `stitchGroupId` | String | Stitch group ID | `undefined` |\n| `stitchBaseUrl` | String | Stitch base Url | `undefined` |\n\n### MONGODB authentication\n\n```javascript\nconst c = new Connection({\n  mongodbUsername: 'arlo',\n  mongodbPassword: 'w@of'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/?slaveOk=true&authSource=admin'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `mongodbUsername` | String | MongoDB username | `undefined` |\n| `mongodbPassword` | String | MongoDB password | `undefined` |\n| `mongodbDatabaseName` | String | The database name associated with the user's credentials | `undefined` |\n| `promoteValues` | Boolean | Whether BSON values should be promoted to their JS type counterparts | `undefined` |\n\n### KERBEROS authentication\n\n```javascript\nconst c = new Connection({\n  kerberosServiceName: 'mongodb',\n  kerberosPrincipal: 'arlo/dog@krb5.mongodb.parts',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo%252Fdog%2540krb5.mongodb.parts@localhost:27017/toys?authMechanism=GSSAPI'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n> @note (imlucas): Kerberos on Windows is broken out as it's own state for UX consideration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `kerberosServiceName` | String | Any program or computer you access over a network | `undefined` |\n| `kerberosPrincipal` | String | The format of a typical Kerberos V5 principal is `primary/instance@REALM` | `undefined` |\n| `kerberosCanonicalizeHostname` | Boolean | Whether canonicalized kerberos hostname | `undefined` |\n\n#### See Also\n\n- [node.js driver Kerberos reference](http://bit.ly/mongodb-node-driver-kerberos)\n- [node.js driver Kerberos functional test][kerberos-functional]\n\n### LDAP authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  ldapUsername: 'arlo',\n  ldapPassword: 'w@of',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/toys?slaveOk=true&authMechanism=PLAIN'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ldapUsername` | String | LDAP username | `undefined` |\n| `ldapPassword` | String | LDAP password | `undefined` |\n\n#### See Also\n\n- [node.js driver LDAP reference](http://bit.ly/mongodb-node-driver-ldap)\n- [node.js driver X509 functional test][ldap-functional]\n\n### X509 authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  x509Username: 'CN=client,OU=arlo,O=MongoDB,L=Philadelphia,ST=Pennsylvania,C=US'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://CN%253Dclient%252COU%253Darlo%252CO%253DMongoDB%252CL%253DPhiladelphia%252CST%253DPennsylvania%252CC%253DUS@localhost:27017?slaveOk=true&authMechanism=MONGODB-X509'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `x509Username` | String | The x.509 certificate derived user name, e.g. `CN=user,OU=OrgUnit,O=myOrg,...` | `undefined` |\n\n#### See Also\n\n- [node.js driver X509 reference](http://bit.ly/mongodb-node-driver-x509)\n- [node.js driver X509 functional test][x509-functional]\n\n### SSL\n\n> **Note**: Not to be confused with `authentication=X509`\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ssl` | Number/String | A boolean to enable or disables TLS/SSL for the connection | `undefined` |\n| `sslMethod` | String | The desired ssl method. Possible values: `NONE`, `SYSTEMCA`, `IFAVAILABLE`, `UNVALIDATED`, `SERVER`, `ALL` | `NONE` |\n| `sslCA` | Buffer/String | Array of valid certificates | `undefined` |\n| `sslCert` | Buffer/String | The certificate | `undefined` |\n| `sslKey` | Buffer/String | The certificate private key | `undefined` |\n| `sslPass` | Buffer/String | The certificate password | `undefined` |\n\nDescription of `sslMethod` values:\n\n- `SYSTEMCA` - SSL required, validate using System CA, with host verification.\n- `IFAVAILABLE` - The driver should try SSL first, fall back to no SSL if unavailable, and use the system's Certificate Authority.\n- `SERVER` - The driver should validate the server certificate and fail to connect if validation fails. See also [node.js driver \"Validate Server Certificate\" docs][driver-ssl-server].\n- `ALL` - The driver must present a valid certificate and validate the server certificate. See also [node.js driver \"Validate Server Certificate and Present Valid Certificate\" docs][driver-ssl-all].\n- `NONE` - No SSL (Not recommended).\n- `UNVALIDATED` - Use SSL but do not perform any validation of the certificate chain. See also [node.js driver \"No Certificate Validation\" docs][driver-ssl-none]. **Very** not recommended and likely to be deprecated in future releases because it exposes potential Man-In-The-Middle attack vectors.\n\n#### See also\n\n- [node.js driver SSL implementation][driver-ssl-impl]\n- [node.js driver SSL tutorial][driver-ssl-tutorial]\n\n### SSH TUNNEL\n\n> New in mongodb-connection-model@5.0.0\n\nBecause [authentication](#authentication) is quite difficult for operators to migrate to, the most common method of securing a MongoDB deployment is to use an [SSH tunnel][sf-ssh-tunnel].  This allows operators to leverage their existing SSH security infrastructure to also provide secure access to MongoDB.  For a standard deployment of MongoDB on AWS, this is almost always to strategy.  Because of this, we now support creating SSH tunnels automatically when connecting to MongoDB.\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options, (connectionError, client) => {\n  if (connectionError) {\n    return console.log(connectionError);\n  }\n\n  client.db('mongodb').collection('fanclub').count((countingError, count) => {\n    console.log('counted:', countingError, count);\n    client.close();\n  });\n});\n```\n\nThe above provides the same functionality as creating the tunnel using the bash\ncommand below and connecting to MongoDB via another terminal. Notice that\nconnection-model uses a random local port each time it creates a tunnel.\nUsing the command line, you'd have to replace `<random port>` with an actual\nport number.\n\n```bash\nssh -i ~/.ssh/my-key-aws-pair.pem -L <random port>:localhost:27017 ubuntu@ec2-11-111-111-111.compute-1.amazonaws.com\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `sshTunnel` | String | The desired SSH tunnel strategy. Possible values: `NONE`, `USER_PASSWORD`, `IDENTITY_FILE` | `undefined` |\n| `sshTunnelHostname` | String | The hostname of the SSH remote host | `undefined` |\n| `sshTunnelPort` | Port | The SSH port of the remote host | `22` |\n| `sshTunnelBindToLocalPort` | Port | Bind the localhost endpoint of the SSH Tunnel to this port | `undefined` |\n| `sshTunnelUsername` | String | The optional SSH username for the remote host | `undefined` |\n| `sshTunnelPassword` | String | The optional SSH password for the remote host | `undefined` |\n| `sshTunnelIdentityFile` | String/Array | The optional path to the SSH identity file for the remote host | `undefined` |\n| `sshTunnelPassphrase` | String | The optional passphrase for `sshTunnelIdentityFile` | `undefined` |\n\nDescription of `sshTunnel` values:\n\n- `NONE` - Do not use SSH tunneling.\n- `USER_PASSWORD` - The tunnel is created with SSH username and password only.\n- `IDENTITY_FILE` - The tunnel is created using an identity file.\n\n## Derived Properties\n\nDerived properties (also known as computed properties) are properties of the state object that depend on other properties to determine their value.\n\n```javascript\nconst c = new Connection();\nconst derivedProps = c.getAttributes({ derived: true });\n```\n\n| Derived Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `instanceId` | String | The mongoscope | `localhost:27017` |\n| `driverAuthMechanism` | String | Converts the value of `authStrategy` for humans into the `authMechanism` value for the driver | `undefined` |\n| `safeUrl` | String | The URL where a password is replaced with stars | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrl` | String | Use this URL in order to connect via DataService | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrlWithSsh` | String | Use this URL in order to connect via connection model itself | `mongodb://localhost:29201/?readPreference=primary&ssl=false` |\n| `driverOptions` | String | The second argument `mongoscope-server` passes to `mongodb.connect` | `{}` |\n\n## Events\n\n> New in mongodb-connection-model@5.0.0\n\n#### Example: SSH Tunnel\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', skipped: true,\n  reason: 'The selected SSL mode does not need to load any files.' }\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', complete: true}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n#### Example: SSL\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  ssl: 'ALL',\n  sslCA: '~/.ssl/my-ca.pem',\n  sslCert: '~/.ssl/my-server.pem',\n  sslKey: '~/.ssl/my-server.pem'\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', complete: true}\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', skipped: true,\n  reason: 'The selected SSH Tunnel mode is NONE.'}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n[workflow_img]: https://github.com/mongodb-js/connection-model/workflows/Check%20and%20Test/badge.svg?event=push\n[workflow_url]: https://github.com/mongodb-js/connection-model/actions?query=workflow%3A%22Check+and+Test%22\n[npm_img]: https://img.shields.io/npm/v/mongodb-connection-model.svg?style=flat-square\n[npm_url]: https://www.npmjs.org/package/mongodb-connection-model\n[gitter_img]: https://badges.gitter.im/Join%20Chat.svg\n[gitter_url]: http://gitter.im/mongodb-js/mongodb-js\n[enterprise_img]: https://img.shields.io/badge/MongoDB-Enterprise-blue.svg?style=flat-square\n[coming_soon_img]: https://img.shields.io/badge/-Coming%20Soon-ff69b4.svg?style=flat-square\n[kerberos-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/kerberos_tests.js\n[ldap-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ldap_tests.js\n[x509-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ssl_x509_tests.js\n[ns]: https://github.com/mongodb-js/ns\n[sf-ssh-tunnel]: http://serverfault.com/questions/597765/how-to-connect-to-mongodb-server-via-ssh-tunnel\n[ec2-key-pairs]: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html\n[driver-ssl-impl]: https://github.com/christkv/mongodb-core/blob/c3d21cb636d74d7a68134ecd3b9f6af536311279/lib/connection/connection.js#L365-L407\n[driver-ssl-tutorial]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/\n[driver-ssl-none]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#no-certificate-validation\n[driver-ssl-server]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate\n[driver-ssl-all]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate-and-present-valid-certificate\n","gitHead":"da0d016fdae6992001ca3f3347c293c36815df43","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","test":"mocha","check":"npm run lint && npm run depcheck","pretest":"mongodb-runner install && mongodb-runner start --port=27018","test-ci":"npm run test","depcheck":"depcheck","posttest":"mongodb-runner stop --port=27018","posttest-ci":"node ../../scripts/killall-mongo.js","test-check-ci":"npm run check && npm test"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.17.0+x64 (linux)","description":"MongoDB connection model","directories":{},"_nodeVersion":"16.17.0","compass:main":"index.js","dependencies":{"raf":"^3.4.1","ssh2":"^0.8.7","debug":"^4.2.0","lodash":"^4.17.15","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.2.0","storage-mixin":"0.0.0-next-da0d016fdae6992001ca3f3347c293c36815df43","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.2","@mongodb-js/ssh-tunnel":"0.0.0-next-da0d016fdae6992001ca3f3347c293c36815df43","@mongodb-js/compass-utils":"0.0.0-next-da0d016fdae6992001ca3f3347c293c36815df43","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.6.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^10.2.0","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"^5.1.0","depcheck":"^1.4.1","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.10.0","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^5.1.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_0.0.0-next-da0d016fdae6992001ca3f3347c293c36815df43_1680296259500_0.40423091184606275","host":"s3://npm-registry-packages"}},"0.0.0-next-30478c108fea9fe7d84759fb032faee28e0bbfbb":{"name":"mongodb-connection-model","version":"0.0.0-next-30478c108fea9fe7d84759fb032faee28e0bbfbb","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@0.0.0-next-30478c108fea9fe7d84759fb032faee28e0bbfbb","maintainers":[{"name":"mongo-j","email":"james.wang@mongodb.com"},{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satya@mongodb.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"iteng@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"ab9b1c165a9ec6294a43f1c740f54bce7fab3190","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-0.0.0-next-30478c108fea9fe7d84759fb032faee28e0bbfbb.tgz","fileCount":20,"integrity":"sha512-wAsQ86j1gOqmCoTBjNWJ4bC+dmwnHjDhzrjO1KI6twH/7Z6NRRslvR2KY74nhO3RQrQLkwPVkXnzpBp/pp7uxg==","signatures":[{"sig":"MEQCIFmN1m9kAB5as3fM0PIRWXe8cO6aFsfI+/fztg9cnJ1qAiAVzIshvMBzRnWFcQXskuJ1xNIYofhDbn4wwinFcN9Vkg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":108119,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkP977ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrjPg//Y7aL8726Fn9KVdWc33Sewmq8cgyoWkGoWz3KfOSb4wULw/cv\r\n1HcWmCRsPA/RmGH5w72kg6w0tO2Jtd0+LDNz6DLLy2RPN2Jig3lzJDmbfwDf\r\nQxTz7L853OKTatc0igiyDJRRlyZn7x+6RNkvbJGVXOEHBSGzJ/xee6Jv0tWF\r\nvvCrca0YgBW6GiaJtKwMjelazhZNNl29tkH4H4UTIUq19Bh/XOTHSdw4Cmpt\r\n8HaZu9NYLlSYC1oN3S1x0Od20K9uae4irZ5GO34tUHm8yfvNvsjhk9M955qT\r\n1Oeo1NDgtcWOANsoYKRR4A1sctvGP6+Ln2ZEkYbT71YQ2fmBQ0gBed2yCcUc\r\neoETEuBfamTV8PoGviyaI89y9opI9Lsvx5kZarB2HAo0W7nsfuw3ilN5aYtw\r\neYVUqoPOPd2qb+ERGDlZueOp/CwBgRaQSDwRRib+SG2j0qjwFL6BG+9GUCEX\r\nYa9X9kdsLt7g9dha9u+YujLZ66ote7U8mOI8keeQSLVktr1hItl+rOoK9fLy\r\n/wUDs44X7qIrWStk8ST0n529+S44WKYIg6N+b59IrTMF1jj0zd3yjZZSdEWy\r\n3Xv5E0y/QCeqeh7cYBzj+q+2XJlHRWF1rHpo4ur3DGmadxezDl3SiubYvHxS\r\nyiYgCcy0FKuYY4YZ5imRZVkLtJJM8ZFEnb0=\r\n=0iOV\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","readme":"# mongodb-connection-model [![][workflow_img]][workflow_url] [![][npm_img]][npm_url]\n\n> MongoDB connection model\n\nThe main purpose of the MongoDB connection model is to be a domain model around a MongoDB connection. It encapsulates generating a [Connection String URI](https://docs.mongodb.com/manual/reference/connection-string/) from a group of attributes and parses URI using the [MongoDB Node.JS Driver URI Parser](https://github.com/mongodb-js/mongodb-core/blob/master/lib/uri_parser.js).\n\n## Installation\n\n```\nnpm install --save mongodb-connection-model\n```\n\n## Usage\n\n### Building URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\nconst c = new Connection({ appname: 'My App Name' });\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://localhost:27017/?readPreference=primary&appname=My%20App&ssl=false'\n```\n\n### Parsing URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\n\nConnection.from(\n  'mongodb://someUsername:testPassword@localhost',\n  (error, result) => {\n    console.log(result);\n    >>> `{\n      hosts: [{ host: 'localhost', port: 27017 }],\n      hostname: 'localhost',\n      port: 27017,\n      auth: {\n        username: 'someUsername',\n        password: 'testPassword',\n        db: 'admin'\n      },\n      isSrvRecord: false,\n      authStrategy: 'MONGODB',\n      mongodbUsername: 'someUsername',\n      mongodbPassword: 'testPassword',\n      mongodbDatabaseName: 'admin',\n      extraOptions: {},\n      connectionType: 'NODE_DRIVER',\n      readPreference: 'primary',\n      kerberosCanonicalizeHostname: false,\n      sslMethod: 'NONE',\n      sshTunnel: 'NONE',\n      sshTunnelPort: 22\n    }`\n  }\n);\n```\n\n## Properties\n\nMongoDB connection model is based on Ampersand.js framework and consist of [props](https://ampersandjs.com/docs/#ampersand-state-props) and [derived props](https://ampersandjs.com/docs/#ampersand-state-derived). The props object describes the observable properties that MongoDB connection model gets from the Node.js Driver API.\n\n```javascript\nconst с = new Connection();\nconst props = с.getAttributes({ props: true });\n```\n\n#### See Also\n\n- [URI Generic Syntax](https://tools.ietf.org/html/rfc3986)\n- [URI Options Specification](https://github.com/mongodb/specifications/blob/master/source/uri-options/uri-options.rst)\n\n### General Properties\n\n```javascript\nconst c = new Connection({ isSrvRecord: true });\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ns` | String | A valid [ns][ns] the user can read from | `undefined` |\n| `isSrvRecord` | Boolean | Indicates SRV record | `false` |\n| `auth` | Object | Authentication from driver (username, user, db, password) | `undefined` |\n| `hostname` | String | Hostname of a MongoDB Instance. In case of the replica set the first host and port will be taken | `localhost` |\n| `port` | Number | TCP port of a MongoDB Instance | `27017` |\n| `hosts` | Array | Contains all hosts and ports for replica set | `[{ host: 'localhost', port: 27017 }]` |\n| `extraOptions` | Object | Extra options passed to the node driver as part of `driverOptions` | `{}` |\n| `connectionType` | String | The desired connection type. Possible values: `NODE_DRIVER`, `STITCH_ON_PREM`, `STITCH_ATLAS` | `NODE_DRIVER` |\n| `authStrategy` | String | The desired authentication strategy. Possible values: `NONE`, `MONGODB`, `X509`, `KERBEROS`, `LDAP`, `SCRAM-SHA-256` | `NONE` |\n\n### Connection string options\n\n```javascript\nconst c = new Connection({ appname: 'My App', replicaSet: 'testing' });\n```\n\n#### General connection string options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `replicaSet` | String | Specifies the name of the replica set, if the mongod is a member of a replica set | `undefined` |\n| `connectTimeoutMS` | Number | The time in milliseconds to attempt a connection before timing out | `undefined` |\n| `socketTimeoutMS` | Number | The time in milliseconds to attempt a send or receive on a socket before the attempt times out | `undefined` |\n| `compression` | Object | Object includes compressors and a compression level. The following compressors can be specified: `snappy`, `zlib` (Available in MongoDB 3.6 or greater) | `undefined` |\n\n#### Connection Pool Option\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `maxPoolSize` | Number | The maximum number of connections in the connection pool | `undefined` |\n| `minPoolSize` | Number | The minimum number of connections in the connection pool | `undefined` |\n| `maxIdleTimeMS` | Number | The maximum number of milliseconds that a connection can remain idle in the pool before being removed and closed | `undefined` |\n| `waitQueueMultiple` | Number | A number that the driver multiples the maxPoolSize value to, to provide the maximum number of threads allowed to wait for a connection to become available from the pool | `undefined` |\n| `waitQueueTimeoutMS` | Number | The maximum time in milliseconds that a thread can wait for a connection to become available | `undefined` |\n\n#### Write Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `w` | Number/String | Corresponds to the write concern [w Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-w) | `undefined` |\n| `wTimeoutMS` | Number | Corresponds to the write concern [wtimeout](https://docs.mongodb.com/manual/reference/write-concern/#wc-wtimeout) | `undefined` |\n| `journal` | Boolean | Corresponds to the write concern [j Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-j) | `undefined` |\n\n#### Read Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readConcernLevel` | String | The level of isolation | `undefined` |\n\n#### Read Preference Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readPreference` | String | Specifies the read preferences for this connection. Possible values: `PRIMARY`, `PRIMARY_PREFERRED`, `SECONDARY`, `SECONDARY_PREFERRED`, `NEAREST` | `PRIMARY` |\n| `maxStalenessSeconds` | Number | Specifies, in seconds, how stale a secondary can be before the client stops using it for read operations | `undefined` |\n| `readPreferenceTags` | Object | Default read preference tags for the client | `undefined` |\n\n#### Authentication Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `authSource` | String | Specify the database name associated with the user’s credentials | `undefined` |\n| `authMechanism` | String | Specifies the authentication mechanism that MongoDB will use to authenticate the connection. Possible values: `DEFAULT`, `GSSAPI`, `MONGODB-X509`, `PLAIN`, `SCRAM-SHA-256` | `undefined` |\n| `authMechanismProperties` | Object | Additional options provided for authentication (e.g. to enable hostname canonicalization for GSSAPI) | `undefined` |\n| `gssapiServiceName` | String | Set the Kerberos service name when connecting to Kerberized MongoDB instances | `undefined` |\n| `gssapiServiceRealm` | String | Set the Realm service name | `undefined` |\n| `gssapiCanonicalizeHostName` | Boolean | Whether canonicalized hostname | `undefined` |\n\n#### Server Selection and Discovery Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `localThresholdMS` | Number | The size (in milliseconds) of the latency window for selecting among multiple suitable MongoDB instances | `undefined` |\n| `serverSelectionTimeoutMS` | Number | Specifies how long (in milliseconds) to block for server selection before throwing an exception | `undefined` |\n| `serverSelectionTryOnce` | Boolean | Instructs the driver to scan the MongoDB deployment exactly once after server selection fails and then either select a server or raise an error | `undefined` |\n| `heartbeatFrequencyMS` | Number | Controls when the driver checks the state of the MongoDB deployment | `undefined` |\n\n#### Miscellaneous Configuration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `appname` | String | An application name passed to server as client metadata | `undefined` |\n| `retryWrites` | Boolean | Enable retryable writes | `undefined` |\n| `uuidRepresentation` | String | The legacy representation of UUID. Possible values: `standard`, `csharpLegacy`, `javaLegacy`, `pythonLegacy` | `undefined` |\n| `loadBalanced` | Boolean | Whether or not the server is running in load balanced mode | `undefined` |\n\n### Stitch attributes\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `stitchServiceName` | String | Stitch service name | `undefined` |\n| `stitchClientAppId` | String | Stitch сlient app ID | `undefined` |\n| `stitchGroupId` | String | Stitch group ID | `undefined` |\n| `stitchBaseUrl` | String | Stitch base Url | `undefined` |\n\n### MONGODB authentication\n\n```javascript\nconst c = new Connection({\n  mongodbUsername: 'arlo',\n  mongodbPassword: 'w@of'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/?slaveOk=true&authSource=admin'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `mongodbUsername` | String | MongoDB username | `undefined` |\n| `mongodbPassword` | String | MongoDB password | `undefined` |\n| `mongodbDatabaseName` | String | The database name associated with the user's credentials | `undefined` |\n| `promoteValues` | Boolean | Whether BSON values should be promoted to their JS type counterparts | `undefined` |\n\n### KERBEROS authentication\n\n```javascript\nconst c = new Connection({\n  kerberosServiceName: 'mongodb',\n  kerberosPrincipal: 'arlo/dog@krb5.mongodb.parts',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo%252Fdog%2540krb5.mongodb.parts@localhost:27017/toys?authMechanism=GSSAPI'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n> @note (imlucas): Kerberos on Windows is broken out as it's own state for UX consideration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `kerberosServiceName` | String | Any program or computer you access over a network | `undefined` |\n| `kerberosPrincipal` | String | The format of a typical Kerberos V5 principal is `primary/instance@REALM` | `undefined` |\n| `kerberosCanonicalizeHostname` | Boolean | Whether canonicalized kerberos hostname | `undefined` |\n\n#### See Also\n\n- [node.js driver Kerberos reference](http://bit.ly/mongodb-node-driver-kerberos)\n- [node.js driver Kerberos functional test][kerberos-functional]\n\n### LDAP authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  ldapUsername: 'arlo',\n  ldapPassword: 'w@of',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/toys?slaveOk=true&authMechanism=PLAIN'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ldapUsername` | String | LDAP username | `undefined` |\n| `ldapPassword` | String | LDAP password | `undefined` |\n\n#### See Also\n\n- [node.js driver LDAP reference](http://bit.ly/mongodb-node-driver-ldap)\n- [node.js driver X509 functional test][ldap-functional]\n\n### X509 authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  x509Username: 'CN=client,OU=arlo,O=MongoDB,L=Philadelphia,ST=Pennsylvania,C=US'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://CN%253Dclient%252COU%253Darlo%252CO%253DMongoDB%252CL%253DPhiladelphia%252CST%253DPennsylvania%252CC%253DUS@localhost:27017?slaveOk=true&authMechanism=MONGODB-X509'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `x509Username` | String | The x.509 certificate derived user name, e.g. `CN=user,OU=OrgUnit,O=myOrg,...` | `undefined` |\n\n#### See Also\n\n- [node.js driver X509 reference](http://bit.ly/mongodb-node-driver-x509)\n- [node.js driver X509 functional test][x509-functional]\n\n### SSL\n\n> **Note**: Not to be confused with `authentication=X509`\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ssl` | Number/String | A boolean to enable or disables TLS/SSL for the connection | `undefined` |\n| `sslMethod` | String | The desired ssl method. Possible values: `NONE`, `SYSTEMCA`, `IFAVAILABLE`, `UNVALIDATED`, `SERVER`, `ALL` | `NONE` |\n| `sslCA` | Buffer/String | Array of valid certificates | `undefined` |\n| `sslCert` | Buffer/String | The certificate | `undefined` |\n| `sslKey` | Buffer/String | The certificate private key | `undefined` |\n| `sslPass` | Buffer/String | The certificate password | `undefined` |\n\nDescription of `sslMethod` values:\n\n- `SYSTEMCA` - SSL required, validate using System CA, with host verification.\n- `IFAVAILABLE` - The driver should try SSL first, fall back to no SSL if unavailable, and use the system's Certificate Authority.\n- `SERVER` - The driver should validate the server certificate and fail to connect if validation fails. See also [node.js driver \"Validate Server Certificate\" docs][driver-ssl-server].\n- `ALL` - The driver must present a valid certificate and validate the server certificate. See also [node.js driver \"Validate Server Certificate and Present Valid Certificate\" docs][driver-ssl-all].\n- `NONE` - No SSL (Not recommended).\n- `UNVALIDATED` - Use SSL but do not perform any validation of the certificate chain. See also [node.js driver \"No Certificate Validation\" docs][driver-ssl-none]. **Very** not recommended and likely to be deprecated in future releases because it exposes potential Man-In-The-Middle attack vectors.\n\n#### See also\n\n- [node.js driver SSL implementation][driver-ssl-impl]\n- [node.js driver SSL tutorial][driver-ssl-tutorial]\n\n### SSH TUNNEL\n\n> New in mongodb-connection-model@5.0.0\n\nBecause [authentication](#authentication) is quite difficult for operators to migrate to, the most common method of securing a MongoDB deployment is to use an [SSH tunnel][sf-ssh-tunnel].  This allows operators to leverage their existing SSH security infrastructure to also provide secure access to MongoDB.  For a standard deployment of MongoDB on AWS, this is almost always to strategy.  Because of this, we now support creating SSH tunnels automatically when connecting to MongoDB.\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options, (connectionError, client) => {\n  if (connectionError) {\n    return console.log(connectionError);\n  }\n\n  client.db('mongodb').collection('fanclub').count((countingError, count) => {\n    console.log('counted:', countingError, count);\n    client.close();\n  });\n});\n```\n\nThe above provides the same functionality as creating the tunnel using the bash\ncommand below and connecting to MongoDB via another terminal. Notice that\nconnection-model uses a random local port each time it creates a tunnel.\nUsing the command line, you'd have to replace `<random port>` with an actual\nport number.\n\n```bash\nssh -i ~/.ssh/my-key-aws-pair.pem -L <random port>:localhost:27017 ubuntu@ec2-11-111-111-111.compute-1.amazonaws.com\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `sshTunnel` | String | The desired SSH tunnel strategy. Possible values: `NONE`, `USER_PASSWORD`, `IDENTITY_FILE` | `undefined` |\n| `sshTunnelHostname` | String | The hostname of the SSH remote host | `undefined` |\n| `sshTunnelPort` | Port | The SSH port of the remote host | `22` |\n| `sshTunnelBindToLocalPort` | Port | Bind the localhost endpoint of the SSH Tunnel to this port | `undefined` |\n| `sshTunnelUsername` | String | The optional SSH username for the remote host | `undefined` |\n| `sshTunnelPassword` | String | The optional SSH password for the remote host | `undefined` |\n| `sshTunnelIdentityFile` | String/Array | The optional path to the SSH identity file for the remote host | `undefined` |\n| `sshTunnelPassphrase` | String | The optional passphrase for `sshTunnelIdentityFile` | `undefined` |\n\nDescription of `sshTunnel` values:\n\n- `NONE` - Do not use SSH tunneling.\n- `USER_PASSWORD` - The tunnel is created with SSH username and password only.\n- `IDENTITY_FILE` - The tunnel is created using an identity file.\n\n## Derived Properties\n\nDerived properties (also known as computed properties) are properties of the state object that depend on other properties to determine their value.\n\n```javascript\nconst c = new Connection();\nconst derivedProps = c.getAttributes({ derived: true });\n```\n\n| Derived Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `instanceId` | String | The mongoscope | `localhost:27017` |\n| `driverAuthMechanism` | String | Converts the value of `authStrategy` for humans into the `authMechanism` value for the driver | `undefined` |\n| `safeUrl` | String | The URL where a password is replaced with stars | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrl` | String | Use this URL in order to connect via DataService | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrlWithSsh` | String | Use this URL in order to connect via connection model itself | `mongodb://localhost:29201/?readPreference=primary&ssl=false` |\n| `driverOptions` | String | The second argument `mongoscope-server` passes to `mongodb.connect` | `{}` |\n\n## Events\n\n> New in mongodb-connection-model@5.0.0\n\n#### Example: SSH Tunnel\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', skipped: true,\n  reason: 'The selected SSL mode does not need to load any files.' }\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', complete: true}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n#### Example: SSL\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  ssl: 'ALL',\n  sslCA: '~/.ssl/my-ca.pem',\n  sslCert: '~/.ssl/my-server.pem',\n  sslKey: '~/.ssl/my-server.pem'\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', complete: true}\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', skipped: true,\n  reason: 'The selected SSH Tunnel mode is NONE.'}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n[workflow_img]: https://github.com/mongodb-js/connection-model/workflows/Check%20and%20Test/badge.svg?event=push\n[workflow_url]: https://github.com/mongodb-js/connection-model/actions?query=workflow%3A%22Check+and+Test%22\n[npm_img]: https://img.shields.io/npm/v/mongodb-connection-model.svg?style=flat-square\n[npm_url]: https://www.npmjs.org/package/mongodb-connection-model\n[gitter_img]: https://badges.gitter.im/Join%20Chat.svg\n[gitter_url]: http://gitter.im/mongodb-js/mongodb-js\n[enterprise_img]: https://img.shields.io/badge/MongoDB-Enterprise-blue.svg?style=flat-square\n[coming_soon_img]: https://img.shields.io/badge/-Coming%20Soon-ff69b4.svg?style=flat-square\n[kerberos-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/kerberos_tests.js\n[ldap-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ldap_tests.js\n[x509-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ssl_x509_tests.js\n[ns]: https://github.com/mongodb-js/ns\n[sf-ssh-tunnel]: http://serverfault.com/questions/597765/how-to-connect-to-mongodb-server-via-ssh-tunnel\n[ec2-key-pairs]: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html\n[driver-ssl-impl]: https://github.com/christkv/mongodb-core/blob/c3d21cb636d74d7a68134ecd3b9f6af536311279/lib/connection/connection.js#L365-L407\n[driver-ssl-tutorial]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/\n[driver-ssl-none]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#no-certificate-validation\n[driver-ssl-server]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate\n[driver-ssl-all]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate-and-present-valid-certificate\n","gitHead":"30478c108fea9fe7d84759fb032faee28e0bbfbb","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","test":"mocha","check":"npm run lint && npm run depcheck","pretest":"mongodb-runner install && mongodb-runner start --port=27018","test-ci":"npm run test","depcheck":"depcheck","posttest":"mongodb-runner stop --port=27018","posttest-ci":"node ../../scripts/killall-mongo.js","test-check-ci":"npm run check && npm test"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.17.0+x64 (linux)","description":"MongoDB connection model","directories":{},"_nodeVersion":"16.17.0","compass:main":"index.js","dependencies":{"raf":"^3.4.1","debug":"^4.2.0","lodash":"^4.17.15","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.2.0","storage-mixin":"0.0.0-next-30478c108fea9fe7d84759fb032faee28e0bbfbb","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.2","@mongodb-js/ssh-tunnel":"0.0.0-next-30478c108fea9fe7d84759fb032faee28e0bbfbb","@mongodb-js/compass-utils":"0.0.0-next-30478c108fea9fe7d84759fb032faee28e0bbfbb","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.6.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^10.2.0","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"^5.1.0","depcheck":"^1.4.1","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.10.0","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^5.1.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_0.0.0-next-30478c108fea9fe7d84759fb032faee28e0bbfbb_1681907451696_0.5466610429473988","host":"s3://npm-registry-packages"}},"0.0.0-next-1f064ba7669c838cc646f440aedd0cf45c4df973":{"name":"mongodb-connection-model","version":"0.0.0-next-1f064ba7669c838cc646f440aedd0cf45c4df973","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@0.0.0-next-1f064ba7669c838cc646f440aedd0cf45c4df973","maintainers":[{"name":"mongo-j","email":"james.wang@mongodb.com"},{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satya@mongodb.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"iteng@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"e668561dfd2a583fe6b7658c33eed09440b932d3","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-0.0.0-next-1f064ba7669c838cc646f440aedd0cf45c4df973.tgz","fileCount":20,"integrity":"sha512-qHUvo71F46/TyZafGWc9eKFC20zeM8qdU4YRXyjV8DHVYQz3n/O9ioMaENKfmyGsV+Ihsubj1Bwa20BvN/7j8g==","signatures":[{"sig":"MEUCIQDEVY/vpHI1Mtc24Z7AyvOXKY9yGJHDvTbHNiS0s+nlKgIgd4e5HcL6czNRN4zxYdgknKPhaFa5akfzuhQn+zOLPsI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":108119,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkQFSRACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmrs/BAAoOrnA06xx0RBy2cgALsdubTYwnFTftvDFzN7ul7vvE6bWGb1\r\n8PuhadXUNJtFdlsYVUyQgrINnVyr4MPqDTz80YP6VwAdZIpa5SxvMeSvf0Al\r\nGlAmmzFoEyQ8Z5lPFZLlRbNBEer5Xeud3ZELqhzwcw2+5iaahaqybBxwLJ0j\r\nFD+WuTwv6zSFDjlbhxuTamRosdfx23rQ3cayMurYsFaqKF+l4LAiRQYFsVSC\r\ncTAZNlChWgIVwB1qFDaWKA0ZQ8+eHkxsYMfZ24HXL8bDY8xw4UA1xNQhtXhM\r\niKUKZwxeBFaAQ/17HYPp9eqjRJ2G6qVtIzL5NrHRTAsprUgnBiQwvk55cikI\r\nr1ZGV078ROl6bZQxmchAWDo95icD1dty6sXCGyXpivvqasZei162i2G4+gCY\r\nHqv4306anRYJCOfdvuvxQIL+3aDWZ0M3i1HmwO8YiPq+xc7QQiivyZ7h/UrT\r\noiz2VSO7361B4A3Wu+Fz+d8k2lZ7/79uFZV61/PNluy7pyednENG3FP35ALl\r\nCJaKvAbFX7JSegla+TdhziyLC1urIPPqEdL6exQNmfMH8e4W7MzSiUoU8GpE\r\ngW8GhwSTqLiU3eGwijxlxUPma5t8OCHghE6UvyGo7iGP4l2Z9+FfP49PISwQ\r\nnHoVaqgl5DQ8kDhtYE6CIhVtzWocFZ+ehiA=\r\n=M/zO\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","readme":"# mongodb-connection-model [![][workflow_img]][workflow_url] [![][npm_img]][npm_url]\n\n> MongoDB connection model\n\nThe main purpose of the MongoDB connection model is to be a domain model around a MongoDB connection. It encapsulates generating a [Connection String URI](https://docs.mongodb.com/manual/reference/connection-string/) from a group of attributes and parses URI using the [MongoDB Node.JS Driver URI Parser](https://github.com/mongodb-js/mongodb-core/blob/master/lib/uri_parser.js).\n\n## Installation\n\n```\nnpm install --save mongodb-connection-model\n```\n\n## Usage\n\n### Building URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\nconst c = new Connection({ appname: 'My App Name' });\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://localhost:27017/?readPreference=primary&appname=My%20App&ssl=false'\n```\n\n### Parsing URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\n\nConnection.from(\n  'mongodb://someUsername:testPassword@localhost',\n  (error, result) => {\n    console.log(result);\n    >>> `{\n      hosts: [{ host: 'localhost', port: 27017 }],\n      hostname: 'localhost',\n      port: 27017,\n      auth: {\n        username: 'someUsername',\n        password: 'testPassword',\n        db: 'admin'\n      },\n      isSrvRecord: false,\n      authStrategy: 'MONGODB',\n      mongodbUsername: 'someUsername',\n      mongodbPassword: 'testPassword',\n      mongodbDatabaseName: 'admin',\n      extraOptions: {},\n      connectionType: 'NODE_DRIVER',\n      readPreference: 'primary',\n      kerberosCanonicalizeHostname: false,\n      sslMethod: 'NONE',\n      sshTunnel: 'NONE',\n      sshTunnelPort: 22\n    }`\n  }\n);\n```\n\n## Properties\n\nMongoDB connection model is based on Ampersand.js framework and consist of [props](https://ampersandjs.com/docs/#ampersand-state-props) and [derived props](https://ampersandjs.com/docs/#ampersand-state-derived). The props object describes the observable properties that MongoDB connection model gets from the Node.js Driver API.\n\n```javascript\nconst с = new Connection();\nconst props = с.getAttributes({ props: true });\n```\n\n#### See Also\n\n- [URI Generic Syntax](https://tools.ietf.org/html/rfc3986)\n- [URI Options Specification](https://github.com/mongodb/specifications/blob/master/source/uri-options/uri-options.rst)\n\n### General Properties\n\n```javascript\nconst c = new Connection({ isSrvRecord: true });\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ns` | String | A valid [ns][ns] the user can read from | `undefined` |\n| `isSrvRecord` | Boolean | Indicates SRV record | `false` |\n| `auth` | Object | Authentication from driver (username, user, db, password) | `undefined` |\n| `hostname` | String | Hostname of a MongoDB Instance. In case of the replica set the first host and port will be taken | `localhost` |\n| `port` | Number | TCP port of a MongoDB Instance | `27017` |\n| `hosts` | Array | Contains all hosts and ports for replica set | `[{ host: 'localhost', port: 27017 }]` |\n| `extraOptions` | Object | Extra options passed to the node driver as part of `driverOptions` | `{}` |\n| `connectionType` | String | The desired connection type. Possible values: `NODE_DRIVER`, `STITCH_ON_PREM`, `STITCH_ATLAS` | `NODE_DRIVER` |\n| `authStrategy` | String | The desired authentication strategy. Possible values: `NONE`, `MONGODB`, `X509`, `KERBEROS`, `LDAP`, `SCRAM-SHA-256` | `NONE` |\n\n### Connection string options\n\n```javascript\nconst c = new Connection({ appname: 'My App', replicaSet: 'testing' });\n```\n\n#### General connection string options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `replicaSet` | String | Specifies the name of the replica set, if the mongod is a member of a replica set | `undefined` |\n| `connectTimeoutMS` | Number | The time in milliseconds to attempt a connection before timing out | `undefined` |\n| `socketTimeoutMS` | Number | The time in milliseconds to attempt a send or receive on a socket before the attempt times out | `undefined` |\n| `compression` | Object | Object includes compressors and a compression level. The following compressors can be specified: `snappy`, `zlib` (Available in MongoDB 3.6 or greater) | `undefined` |\n\n#### Connection Pool Option\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `maxPoolSize` | Number | The maximum number of connections in the connection pool | `undefined` |\n| `minPoolSize` | Number | The minimum number of connections in the connection pool | `undefined` |\n| `maxIdleTimeMS` | Number | The maximum number of milliseconds that a connection can remain idle in the pool before being removed and closed | `undefined` |\n| `waitQueueMultiple` | Number | A number that the driver multiples the maxPoolSize value to, to provide the maximum number of threads allowed to wait for a connection to become available from the pool | `undefined` |\n| `waitQueueTimeoutMS` | Number | The maximum time in milliseconds that a thread can wait for a connection to become available | `undefined` |\n\n#### Write Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `w` | Number/String | Corresponds to the write concern [w Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-w) | `undefined` |\n| `wTimeoutMS` | Number | Corresponds to the write concern [wtimeout](https://docs.mongodb.com/manual/reference/write-concern/#wc-wtimeout) | `undefined` |\n| `journal` | Boolean | Corresponds to the write concern [j Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-j) | `undefined` |\n\n#### Read Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readConcernLevel` | String | The level of isolation | `undefined` |\n\n#### Read Preference Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readPreference` | String | Specifies the read preferences for this connection. Possible values: `PRIMARY`, `PRIMARY_PREFERRED`, `SECONDARY`, `SECONDARY_PREFERRED`, `NEAREST` | `PRIMARY` |\n| `maxStalenessSeconds` | Number | Specifies, in seconds, how stale a secondary can be before the client stops using it for read operations | `undefined` |\n| `readPreferenceTags` | Object | Default read preference tags for the client | `undefined` |\n\n#### Authentication Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `authSource` | String | Specify the database name associated with the user’s credentials | `undefined` |\n| `authMechanism` | String | Specifies the authentication mechanism that MongoDB will use to authenticate the connection. Possible values: `DEFAULT`, `GSSAPI`, `MONGODB-X509`, `PLAIN`, `SCRAM-SHA-256` | `undefined` |\n| `authMechanismProperties` | Object | Additional options provided for authentication (e.g. to enable hostname canonicalization for GSSAPI) | `undefined` |\n| `gssapiServiceName` | String | Set the Kerberos service name when connecting to Kerberized MongoDB instances | `undefined` |\n| `gssapiServiceRealm` | String | Set the Realm service name | `undefined` |\n| `gssapiCanonicalizeHostName` | Boolean | Whether canonicalized hostname | `undefined` |\n\n#### Server Selection and Discovery Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `localThresholdMS` | Number | The size (in milliseconds) of the latency window for selecting among multiple suitable MongoDB instances | `undefined` |\n| `serverSelectionTimeoutMS` | Number | Specifies how long (in milliseconds) to block for server selection before throwing an exception | `undefined` |\n| `serverSelectionTryOnce` | Boolean | Instructs the driver to scan the MongoDB deployment exactly once after server selection fails and then either select a server or raise an error | `undefined` |\n| `heartbeatFrequencyMS` | Number | Controls when the driver checks the state of the MongoDB deployment | `undefined` |\n\n#### Miscellaneous Configuration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `appname` | String | An application name passed to server as client metadata | `undefined` |\n| `retryWrites` | Boolean | Enable retryable writes | `undefined` |\n| `uuidRepresentation` | String | The legacy representation of UUID. Possible values: `standard`, `csharpLegacy`, `javaLegacy`, `pythonLegacy` | `undefined` |\n| `loadBalanced` | Boolean | Whether or not the server is running in load balanced mode | `undefined` |\n\n### Stitch attributes\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `stitchServiceName` | String | Stitch service name | `undefined` |\n| `stitchClientAppId` | String | Stitch сlient app ID | `undefined` |\n| `stitchGroupId` | String | Stitch group ID | `undefined` |\n| `stitchBaseUrl` | String | Stitch base Url | `undefined` |\n\n### MONGODB authentication\n\n```javascript\nconst c = new Connection({\n  mongodbUsername: 'arlo',\n  mongodbPassword: 'w@of'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/?slaveOk=true&authSource=admin'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `mongodbUsername` | String | MongoDB username | `undefined` |\n| `mongodbPassword` | String | MongoDB password | `undefined` |\n| `mongodbDatabaseName` | String | The database name associated with the user's credentials | `undefined` |\n| `promoteValues` | Boolean | Whether BSON values should be promoted to their JS type counterparts | `undefined` |\n\n### KERBEROS authentication\n\n```javascript\nconst c = new Connection({\n  kerberosServiceName: 'mongodb',\n  kerberosPrincipal: 'arlo/dog@krb5.mongodb.parts',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo%252Fdog%2540krb5.mongodb.parts@localhost:27017/toys?authMechanism=GSSAPI'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n> @note (imlucas): Kerberos on Windows is broken out as it's own state for UX consideration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `kerberosServiceName` | String | Any program or computer you access over a network | `undefined` |\n| `kerberosPrincipal` | String | The format of a typical Kerberos V5 principal is `primary/instance@REALM` | `undefined` |\n| `kerberosCanonicalizeHostname` | Boolean | Whether canonicalized kerberos hostname | `undefined` |\n\n#### See Also\n\n- [node.js driver Kerberos reference](http://bit.ly/mongodb-node-driver-kerberos)\n- [node.js driver Kerberos functional test][kerberos-functional]\n\n### LDAP authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  ldapUsername: 'arlo',\n  ldapPassword: 'w@of',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/toys?slaveOk=true&authMechanism=PLAIN'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ldapUsername` | String | LDAP username | `undefined` |\n| `ldapPassword` | String | LDAP password | `undefined` |\n\n#### See Also\n\n- [node.js driver LDAP reference](http://bit.ly/mongodb-node-driver-ldap)\n- [node.js driver X509 functional test][ldap-functional]\n\n### X509 authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  x509Username: 'CN=client,OU=arlo,O=MongoDB,L=Philadelphia,ST=Pennsylvania,C=US'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://CN%253Dclient%252COU%253Darlo%252CO%253DMongoDB%252CL%253DPhiladelphia%252CST%253DPennsylvania%252CC%253DUS@localhost:27017?slaveOk=true&authMechanism=MONGODB-X509'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `x509Username` | String | The x.509 certificate derived user name, e.g. `CN=user,OU=OrgUnit,O=myOrg,...` | `undefined` |\n\n#### See Also\n\n- [node.js driver X509 reference](http://bit.ly/mongodb-node-driver-x509)\n- [node.js driver X509 functional test][x509-functional]\n\n### SSL\n\n> **Note**: Not to be confused with `authentication=X509`\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ssl` | Number/String | A boolean to enable or disables TLS/SSL for the connection | `undefined` |\n| `sslMethod` | String | The desired ssl method. Possible values: `NONE`, `SYSTEMCA`, `IFAVAILABLE`, `UNVALIDATED`, `SERVER`, `ALL` | `NONE` |\n| `sslCA` | Buffer/String | Array of valid certificates | `undefined` |\n| `sslCert` | Buffer/String | The certificate | `undefined` |\n| `sslKey` | Buffer/String | The certificate private key | `undefined` |\n| `sslPass` | Buffer/String | The certificate password | `undefined` |\n\nDescription of `sslMethod` values:\n\n- `SYSTEMCA` - SSL required, validate using System CA, with host verification.\n- `IFAVAILABLE` - The driver should try SSL first, fall back to no SSL if unavailable, and use the system's Certificate Authority.\n- `SERVER` - The driver should validate the server certificate and fail to connect if validation fails. See also [node.js driver \"Validate Server Certificate\" docs][driver-ssl-server].\n- `ALL` - The driver must present a valid certificate and validate the server certificate. See also [node.js driver \"Validate Server Certificate and Present Valid Certificate\" docs][driver-ssl-all].\n- `NONE` - No SSL (Not recommended).\n- `UNVALIDATED` - Use SSL but do not perform any validation of the certificate chain. See also [node.js driver \"No Certificate Validation\" docs][driver-ssl-none]. **Very** not recommended and likely to be deprecated in future releases because it exposes potential Man-In-The-Middle attack vectors.\n\n#### See also\n\n- [node.js driver SSL implementation][driver-ssl-impl]\n- [node.js driver SSL tutorial][driver-ssl-tutorial]\n\n### SSH TUNNEL\n\n> New in mongodb-connection-model@5.0.0\n\nBecause [authentication](#authentication) is quite difficult for operators to migrate to, the most common method of securing a MongoDB deployment is to use an [SSH tunnel][sf-ssh-tunnel].  This allows operators to leverage their existing SSH security infrastructure to also provide secure access to MongoDB.  For a standard deployment of MongoDB on AWS, this is almost always to strategy.  Because of this, we now support creating SSH tunnels automatically when connecting to MongoDB.\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options, (connectionError, client) => {\n  if (connectionError) {\n    return console.log(connectionError);\n  }\n\n  client.db('mongodb').collection('fanclub').count((countingError, count) => {\n    console.log('counted:', countingError, count);\n    client.close();\n  });\n});\n```\n\nThe above provides the same functionality as creating the tunnel using the bash\ncommand below and connecting to MongoDB via another terminal. Notice that\nconnection-model uses a random local port each time it creates a tunnel.\nUsing the command line, you'd have to replace `<random port>` with an actual\nport number.\n\n```bash\nssh -i ~/.ssh/my-key-aws-pair.pem -L <random port>:localhost:27017 ubuntu@ec2-11-111-111-111.compute-1.amazonaws.com\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `sshTunnel` | String | The desired SSH tunnel strategy. Possible values: `NONE`, `USER_PASSWORD`, `IDENTITY_FILE` | `undefined` |\n| `sshTunnelHostname` | String | The hostname of the SSH remote host | `undefined` |\n| `sshTunnelPort` | Port | The SSH port of the remote host | `22` |\n| `sshTunnelBindToLocalPort` | Port | Bind the localhost endpoint of the SSH Tunnel to this port | `undefined` |\n| `sshTunnelUsername` | String | The optional SSH username for the remote host | `undefined` |\n| `sshTunnelPassword` | String | The optional SSH password for the remote host | `undefined` |\n| `sshTunnelIdentityFile` | String/Array | The optional path to the SSH identity file for the remote host | `undefined` |\n| `sshTunnelPassphrase` | String | The optional passphrase for `sshTunnelIdentityFile` | `undefined` |\n\nDescription of `sshTunnel` values:\n\n- `NONE` - Do not use SSH tunneling.\n- `USER_PASSWORD` - The tunnel is created with SSH username and password only.\n- `IDENTITY_FILE` - The tunnel is created using an identity file.\n\n## Derived Properties\n\nDerived properties (also known as computed properties) are properties of the state object that depend on other properties to determine their value.\n\n```javascript\nconst c = new Connection();\nconst derivedProps = c.getAttributes({ derived: true });\n```\n\n| Derived Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `instanceId` | String | The mongoscope | `localhost:27017` |\n| `driverAuthMechanism` | String | Converts the value of `authStrategy` for humans into the `authMechanism` value for the driver | `undefined` |\n| `safeUrl` | String | The URL where a password is replaced with stars | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrl` | String | Use this URL in order to connect via DataService | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrlWithSsh` | String | Use this URL in order to connect via connection model itself | `mongodb://localhost:29201/?readPreference=primary&ssl=false` |\n| `driverOptions` | String | The second argument `mongoscope-server` passes to `mongodb.connect` | `{}` |\n\n## Events\n\n> New in mongodb-connection-model@5.0.0\n\n#### Example: SSH Tunnel\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', skipped: true,\n  reason: 'The selected SSL mode does not need to load any files.' }\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', complete: true}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n#### Example: SSL\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  ssl: 'ALL',\n  sslCA: '~/.ssl/my-ca.pem',\n  sslCert: '~/.ssl/my-server.pem',\n  sslKey: '~/.ssl/my-server.pem'\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', complete: true}\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', skipped: true,\n  reason: 'The selected SSH Tunnel mode is NONE.'}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n[workflow_img]: https://github.com/mongodb-js/connection-model/workflows/Check%20and%20Test/badge.svg?event=push\n[workflow_url]: https://github.com/mongodb-js/connection-model/actions?query=workflow%3A%22Check+and+Test%22\n[npm_img]: https://img.shields.io/npm/v/mongodb-connection-model.svg?style=flat-square\n[npm_url]: https://www.npmjs.org/package/mongodb-connection-model\n[gitter_img]: https://badges.gitter.im/Join%20Chat.svg\n[gitter_url]: http://gitter.im/mongodb-js/mongodb-js\n[enterprise_img]: https://img.shields.io/badge/MongoDB-Enterprise-blue.svg?style=flat-square\n[coming_soon_img]: https://img.shields.io/badge/-Coming%20Soon-ff69b4.svg?style=flat-square\n[kerberos-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/kerberos_tests.js\n[ldap-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ldap_tests.js\n[x509-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ssl_x509_tests.js\n[ns]: https://github.com/mongodb-js/ns\n[sf-ssh-tunnel]: http://serverfault.com/questions/597765/how-to-connect-to-mongodb-server-via-ssh-tunnel\n[ec2-key-pairs]: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html\n[driver-ssl-impl]: https://github.com/christkv/mongodb-core/blob/c3d21cb636d74d7a68134ecd3b9f6af536311279/lib/connection/connection.js#L365-L407\n[driver-ssl-tutorial]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/\n[driver-ssl-none]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#no-certificate-validation\n[driver-ssl-server]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate\n[driver-ssl-all]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate-and-present-valid-certificate\n","gitHead":"1f064ba7669c838cc646f440aedd0cf45c4df973","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","test":"mocha","check":"npm run lint && npm run depcheck","pretest":"mongodb-runner install && mongodb-runner start --port=27018","test-ci":"npm run test","depcheck":"depcheck","posttest":"mongodb-runner stop --port=27018","posttest-ci":"node ../../scripts/killall-mongo.js","test-check-ci":"npm run check && npm test"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.17.0+x64 (linux)","description":"MongoDB connection model","directories":{},"_nodeVersion":"16.17.0","compass:main":"index.js","dependencies":{"raf":"^3.4.1","debug":"^4.2.0","lodash":"^4.17.15","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.2.0","storage-mixin":"0.0.0-next-1f064ba7669c838cc646f440aedd0cf45c4df973","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.2","@mongodb-js/ssh-tunnel":"0.0.0-next-1f064ba7669c838cc646f440aedd0cf45c4df973","@mongodb-js/compass-utils":"0.0.0-next-1f064ba7669c838cc646f440aedd0cf45c4df973","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.6.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^10.2.0","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"^5.1.0","depcheck":"^1.4.1","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.10.0","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^5.1.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_0.0.0-next-1f064ba7669c838cc646f440aedd0cf45c4df973_1681937553473_0.6779432320501173","host":"s3://npm-registry-packages"}},"0.0.0-next-259fb95ccf1d41c3210676266488d0705f9b544e":{"name":"mongodb-connection-model","version":"0.0.0-next-259fb95ccf1d41c3210676266488d0705f9b544e","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@0.0.0-next-259fb95ccf1d41c3210676266488d0705f9b544e","maintainers":[{"name":"mongo-j","email":"james.wang@mongodb.com"},{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satya@mongodb.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"iteng@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"9184889fe03c287a42dbd2ad268f8c1d780986ee","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-0.0.0-next-259fb95ccf1d41c3210676266488d0705f9b544e.tgz","fileCount":20,"integrity":"sha512-gyNrf4VrAgBzZ3xB0cA/PDI8TgJ6YOFpyqFcOjr1Zin+rX38mfKV3q6rE4UyMFVqDY5EM3B0rpOURbDuqAx3kg==","signatures":[{"sig":"MEUCIDcyWegeb62k4SLe36ERUo1nR99cyaQ2WmzcdMdr7cEpAiEApE9Kijh0tRXK9KpM+n7nc9U+nVhKV9kjZid50bzSKg0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":108119,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkQJnnACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq3kA/+MvwD2IFpl0vXvaZsnY6n6ppn2SKoPMyzdR6jUizcQuzkrXLV\r\nvKwaKb3efkxXjZc3V6tANNwbWCmJ278Bbv4+qo8t/GJmRKWIli7wsUv4OJoh\r\ng8ySu2+X2H52c5r1Tci9aMPYfRBcWvHm1YEHZsc7SS3FTFeiRiG4fK1wvyTs\r\nix/xkwplb92ycQvInF19+miTmaCu1pAmqTMBXRTv1vFcvzuMNqKUq60+4TRD\r\nuUt5BnVtdvoQamUGLg3q+J8LaEGY8HSuIuEhpFNpjBQAyZg+py5rkHkBKR1i\r\nZSCz/Hn4Ge+ZsdvpnsSI9vx5/afscucHyAZUc8LNKGth4XpiK31QbQ/oIzH+\r\nZx5RcBA7GjjSZAFpwkBIhpTWUCV9ozb3nEdqVqhbC7vhfNoO4n3imUs8z3bD\r\nDA1bhh5hXNZ8Yp0e5yV9qgQu4oWSYrcgk5v1Lm4cw2SmO0d/rqTddEPMI44f\r\npgNGzUOxqAg1g4qvzHzWicUxH38qzsAl7QligIETrqzZqyd6i6uawF4DluMJ\r\ntJEO+lf6yViHePGx99i8ZOPJAXGjwpo92pErb65FBtbhBXZ/j0c0skl7L+nJ\r\nfMpT8ZA8bFPXK4LtsYbaN2OxWozEMeu4S9js2s8IdHnQVYIJ6AgNfv7v2o6H\r\npt9Le0rUqHT8aZuHh3p8HbTUFcURagO8ayU=\r\n=cZiz\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","readme":"# mongodb-connection-model [![][workflow_img]][workflow_url] [![][npm_img]][npm_url]\n\n> MongoDB connection model\n\nThe main purpose of the MongoDB connection model is to be a domain model around a MongoDB connection. It encapsulates generating a [Connection String URI](https://docs.mongodb.com/manual/reference/connection-string/) from a group of attributes and parses URI using the [MongoDB Node.JS Driver URI Parser](https://github.com/mongodb-js/mongodb-core/blob/master/lib/uri_parser.js).\n\n## Installation\n\n```\nnpm install --save mongodb-connection-model\n```\n\n## Usage\n\n### Building URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\nconst c = new Connection({ appname: 'My App Name' });\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://localhost:27017/?readPreference=primary&appname=My%20App&ssl=false'\n```\n\n### Parsing URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\n\nConnection.from(\n  'mongodb://someUsername:testPassword@localhost',\n  (error, result) => {\n    console.log(result);\n    >>> `{\n      hosts: [{ host: 'localhost', port: 27017 }],\n      hostname: 'localhost',\n      port: 27017,\n      auth: {\n        username: 'someUsername',\n        password: 'testPassword',\n        db: 'admin'\n      },\n      isSrvRecord: false,\n      authStrategy: 'MONGODB',\n      mongodbUsername: 'someUsername',\n      mongodbPassword: 'testPassword',\n      mongodbDatabaseName: 'admin',\n      extraOptions: {},\n      connectionType: 'NODE_DRIVER',\n      readPreference: 'primary',\n      kerberosCanonicalizeHostname: false,\n      sslMethod: 'NONE',\n      sshTunnel: 'NONE',\n      sshTunnelPort: 22\n    }`\n  }\n);\n```\n\n## Properties\n\nMongoDB connection model is based on Ampersand.js framework and consist of [props](https://ampersandjs.com/docs/#ampersand-state-props) and [derived props](https://ampersandjs.com/docs/#ampersand-state-derived). The props object describes the observable properties that MongoDB connection model gets from the Node.js Driver API.\n\n```javascript\nconst с = new Connection();\nconst props = с.getAttributes({ props: true });\n```\n\n#### See Also\n\n- [URI Generic Syntax](https://tools.ietf.org/html/rfc3986)\n- [URI Options Specification](https://github.com/mongodb/specifications/blob/master/source/uri-options/uri-options.rst)\n\n### General Properties\n\n```javascript\nconst c = new Connection({ isSrvRecord: true });\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ns` | String | A valid [ns][ns] the user can read from | `undefined` |\n| `isSrvRecord` | Boolean | Indicates SRV record | `false` |\n| `auth` | Object | Authentication from driver (username, user, db, password) | `undefined` |\n| `hostname` | String | Hostname of a MongoDB Instance. In case of the replica set the first host and port will be taken | `localhost` |\n| `port` | Number | TCP port of a MongoDB Instance | `27017` |\n| `hosts` | Array | Contains all hosts and ports for replica set | `[{ host: 'localhost', port: 27017 }]` |\n| `extraOptions` | Object | Extra options passed to the node driver as part of `driverOptions` | `{}` |\n| `connectionType` | String | The desired connection type. Possible values: `NODE_DRIVER`, `STITCH_ON_PREM`, `STITCH_ATLAS` | `NODE_DRIVER` |\n| `authStrategy` | String | The desired authentication strategy. Possible values: `NONE`, `MONGODB`, `X509`, `KERBEROS`, `LDAP`, `SCRAM-SHA-256` | `NONE` |\n\n### Connection string options\n\n```javascript\nconst c = new Connection({ appname: 'My App', replicaSet: 'testing' });\n```\n\n#### General connection string options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `replicaSet` | String | Specifies the name of the replica set, if the mongod is a member of a replica set | `undefined` |\n| `connectTimeoutMS` | Number | The time in milliseconds to attempt a connection before timing out | `undefined` |\n| `socketTimeoutMS` | Number | The time in milliseconds to attempt a send or receive on a socket before the attempt times out | `undefined` |\n| `compression` | Object | Object includes compressors and a compression level. The following compressors can be specified: `snappy`, `zlib` (Available in MongoDB 3.6 or greater) | `undefined` |\n\n#### Connection Pool Option\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `maxPoolSize` | Number | The maximum number of connections in the connection pool | `undefined` |\n| `minPoolSize` | Number | The minimum number of connections in the connection pool | `undefined` |\n| `maxIdleTimeMS` | Number | The maximum number of milliseconds that a connection can remain idle in the pool before being removed and closed | `undefined` |\n| `waitQueueMultiple` | Number | A number that the driver multiples the maxPoolSize value to, to provide the maximum number of threads allowed to wait for a connection to become available from the pool | `undefined` |\n| `waitQueueTimeoutMS` | Number | The maximum time in milliseconds that a thread can wait for a connection to become available | `undefined` |\n\n#### Write Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `w` | Number/String | Corresponds to the write concern [w Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-w) | `undefined` |\n| `wTimeoutMS` | Number | Corresponds to the write concern [wtimeout](https://docs.mongodb.com/manual/reference/write-concern/#wc-wtimeout) | `undefined` |\n| `journal` | Boolean | Corresponds to the write concern [j Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-j) | `undefined` |\n\n#### Read Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readConcernLevel` | String | The level of isolation | `undefined` |\n\n#### Read Preference Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readPreference` | String | Specifies the read preferences for this connection. Possible values: `PRIMARY`, `PRIMARY_PREFERRED`, `SECONDARY`, `SECONDARY_PREFERRED`, `NEAREST` | `PRIMARY` |\n| `maxStalenessSeconds` | Number | Specifies, in seconds, how stale a secondary can be before the client stops using it for read operations | `undefined` |\n| `readPreferenceTags` | Object | Default read preference tags for the client | `undefined` |\n\n#### Authentication Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `authSource` | String | Specify the database name associated with the user’s credentials | `undefined` |\n| `authMechanism` | String | Specifies the authentication mechanism that MongoDB will use to authenticate the connection. Possible values: `DEFAULT`, `GSSAPI`, `MONGODB-X509`, `PLAIN`, `SCRAM-SHA-256` | `undefined` |\n| `authMechanismProperties` | Object | Additional options provided for authentication (e.g. to enable hostname canonicalization for GSSAPI) | `undefined` |\n| `gssapiServiceName` | String | Set the Kerberos service name when connecting to Kerberized MongoDB instances | `undefined` |\n| `gssapiServiceRealm` | String | Set the Realm service name | `undefined` |\n| `gssapiCanonicalizeHostName` | Boolean | Whether canonicalized hostname | `undefined` |\n\n#### Server Selection and Discovery Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `localThresholdMS` | Number | The size (in milliseconds) of the latency window for selecting among multiple suitable MongoDB instances | `undefined` |\n| `serverSelectionTimeoutMS` | Number | Specifies how long (in milliseconds) to block for server selection before throwing an exception | `undefined` |\n| `serverSelectionTryOnce` | Boolean | Instructs the driver to scan the MongoDB deployment exactly once after server selection fails and then either select a server or raise an error | `undefined` |\n| `heartbeatFrequencyMS` | Number | Controls when the driver checks the state of the MongoDB deployment | `undefined` |\n\n#### Miscellaneous Configuration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `appname` | String | An application name passed to server as client metadata | `undefined` |\n| `retryWrites` | Boolean | Enable retryable writes | `undefined` |\n| `uuidRepresentation` | String | The legacy representation of UUID. Possible values: `standard`, `csharpLegacy`, `javaLegacy`, `pythonLegacy` | `undefined` |\n| `loadBalanced` | Boolean | Whether or not the server is running in load balanced mode | `undefined` |\n\n### Stitch attributes\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `stitchServiceName` | String | Stitch service name | `undefined` |\n| `stitchClientAppId` | String | Stitch сlient app ID | `undefined` |\n| `stitchGroupId` | String | Stitch group ID | `undefined` |\n| `stitchBaseUrl` | String | Stitch base Url | `undefined` |\n\n### MONGODB authentication\n\n```javascript\nconst c = new Connection({\n  mongodbUsername: 'arlo',\n  mongodbPassword: 'w@of'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/?slaveOk=true&authSource=admin'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `mongodbUsername` | String | MongoDB username | `undefined` |\n| `mongodbPassword` | String | MongoDB password | `undefined` |\n| `mongodbDatabaseName` | String | The database name associated with the user's credentials | `undefined` |\n| `promoteValues` | Boolean | Whether BSON values should be promoted to their JS type counterparts | `undefined` |\n\n### KERBEROS authentication\n\n```javascript\nconst c = new Connection({\n  kerberosServiceName: 'mongodb',\n  kerberosPrincipal: 'arlo/dog@krb5.mongodb.parts',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo%252Fdog%2540krb5.mongodb.parts@localhost:27017/toys?authMechanism=GSSAPI'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n> @note (imlucas): Kerberos on Windows is broken out as it's own state for UX consideration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `kerberosServiceName` | String | Any program or computer you access over a network | `undefined` |\n| `kerberosPrincipal` | String | The format of a typical Kerberos V5 principal is `primary/instance@REALM` | `undefined` |\n| `kerberosCanonicalizeHostname` | Boolean | Whether canonicalized kerberos hostname | `undefined` |\n\n#### See Also\n\n- [node.js driver Kerberos reference](http://bit.ly/mongodb-node-driver-kerberos)\n- [node.js driver Kerberos functional test][kerberos-functional]\n\n### LDAP authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  ldapUsername: 'arlo',\n  ldapPassword: 'w@of',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/toys?slaveOk=true&authMechanism=PLAIN'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ldapUsername` | String | LDAP username | `undefined` |\n| `ldapPassword` | String | LDAP password | `undefined` |\n\n#### See Also\n\n- [node.js driver LDAP reference](http://bit.ly/mongodb-node-driver-ldap)\n- [node.js driver X509 functional test][ldap-functional]\n\n### X509 authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  x509Username: 'CN=client,OU=arlo,O=MongoDB,L=Philadelphia,ST=Pennsylvania,C=US'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://CN%253Dclient%252COU%253Darlo%252CO%253DMongoDB%252CL%253DPhiladelphia%252CST%253DPennsylvania%252CC%253DUS@localhost:27017?slaveOk=true&authMechanism=MONGODB-X509'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `x509Username` | String | The x.509 certificate derived user name, e.g. `CN=user,OU=OrgUnit,O=myOrg,...` | `undefined` |\n\n#### See Also\n\n- [node.js driver X509 reference](http://bit.ly/mongodb-node-driver-x509)\n- [node.js driver X509 functional test][x509-functional]\n\n### SSL\n\n> **Note**: Not to be confused with `authentication=X509`\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ssl` | Number/String | A boolean to enable or disables TLS/SSL for the connection | `undefined` |\n| `sslMethod` | String | The desired ssl method. Possible values: `NONE`, `SYSTEMCA`, `IFAVAILABLE`, `UNVALIDATED`, `SERVER`, `ALL` | `NONE` |\n| `sslCA` | Buffer/String | Array of valid certificates | `undefined` |\n| `sslCert` | Buffer/String | The certificate | `undefined` |\n| `sslKey` | Buffer/String | The certificate private key | `undefined` |\n| `sslPass` | Buffer/String | The certificate password | `undefined` |\n\nDescription of `sslMethod` values:\n\n- `SYSTEMCA` - SSL required, validate using System CA, with host verification.\n- `IFAVAILABLE` - The driver should try SSL first, fall back to no SSL if unavailable, and use the system's Certificate Authority.\n- `SERVER` - The driver should validate the server certificate and fail to connect if validation fails. See also [node.js driver \"Validate Server Certificate\" docs][driver-ssl-server].\n- `ALL` - The driver must present a valid certificate and validate the server certificate. See also [node.js driver \"Validate Server Certificate and Present Valid Certificate\" docs][driver-ssl-all].\n- `NONE` - No SSL (Not recommended).\n- `UNVALIDATED` - Use SSL but do not perform any validation of the certificate chain. See also [node.js driver \"No Certificate Validation\" docs][driver-ssl-none]. **Very** not recommended and likely to be deprecated in future releases because it exposes potential Man-In-The-Middle attack vectors.\n\n#### See also\n\n- [node.js driver SSL implementation][driver-ssl-impl]\n- [node.js driver SSL tutorial][driver-ssl-tutorial]\n\n### SSH TUNNEL\n\n> New in mongodb-connection-model@5.0.0\n\nBecause [authentication](#authentication) is quite difficult for operators to migrate to, the most common method of securing a MongoDB deployment is to use an [SSH tunnel][sf-ssh-tunnel].  This allows operators to leverage their existing SSH security infrastructure to also provide secure access to MongoDB.  For a standard deployment of MongoDB on AWS, this is almost always to strategy.  Because of this, we now support creating SSH tunnels automatically when connecting to MongoDB.\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options, (connectionError, client) => {\n  if (connectionError) {\n    return console.log(connectionError);\n  }\n\n  client.db('mongodb').collection('fanclub').count((countingError, count) => {\n    console.log('counted:', countingError, count);\n    client.close();\n  });\n});\n```\n\nThe above provides the same functionality as creating the tunnel using the bash\ncommand below and connecting to MongoDB via another terminal. Notice that\nconnection-model uses a random local port each time it creates a tunnel.\nUsing the command line, you'd have to replace `<random port>` with an actual\nport number.\n\n```bash\nssh -i ~/.ssh/my-key-aws-pair.pem -L <random port>:localhost:27017 ubuntu@ec2-11-111-111-111.compute-1.amazonaws.com\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `sshTunnel` | String | The desired SSH tunnel strategy. Possible values: `NONE`, `USER_PASSWORD`, `IDENTITY_FILE` | `undefined` |\n| `sshTunnelHostname` | String | The hostname of the SSH remote host | `undefined` |\n| `sshTunnelPort` | Port | The SSH port of the remote host | `22` |\n| `sshTunnelBindToLocalPort` | Port | Bind the localhost endpoint of the SSH Tunnel to this port | `undefined` |\n| `sshTunnelUsername` | String | The optional SSH username for the remote host | `undefined` |\n| `sshTunnelPassword` | String | The optional SSH password for the remote host | `undefined` |\n| `sshTunnelIdentityFile` | String/Array | The optional path to the SSH identity file for the remote host | `undefined` |\n| `sshTunnelPassphrase` | String | The optional passphrase for `sshTunnelIdentityFile` | `undefined` |\n\nDescription of `sshTunnel` values:\n\n- `NONE` - Do not use SSH tunneling.\n- `USER_PASSWORD` - The tunnel is created with SSH username and password only.\n- `IDENTITY_FILE` - The tunnel is created using an identity file.\n\n## Derived Properties\n\nDerived properties (also known as computed properties) are properties of the state object that depend on other properties to determine their value.\n\n```javascript\nconst c = new Connection();\nconst derivedProps = c.getAttributes({ derived: true });\n```\n\n| Derived Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `instanceId` | String | The mongoscope | `localhost:27017` |\n| `driverAuthMechanism` | String | Converts the value of `authStrategy` for humans into the `authMechanism` value for the driver | `undefined` |\n| `safeUrl` | String | The URL where a password is replaced with stars | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrl` | String | Use this URL in order to connect via DataService | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrlWithSsh` | String | Use this URL in order to connect via connection model itself | `mongodb://localhost:29201/?readPreference=primary&ssl=false` |\n| `driverOptions` | String | The second argument `mongoscope-server` passes to `mongodb.connect` | `{}` |\n\n## Events\n\n> New in mongodb-connection-model@5.0.0\n\n#### Example: SSH Tunnel\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', skipped: true,\n  reason: 'The selected SSL mode does not need to load any files.' }\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', complete: true}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n#### Example: SSL\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  ssl: 'ALL',\n  sslCA: '~/.ssl/my-ca.pem',\n  sslCert: '~/.ssl/my-server.pem',\n  sslKey: '~/.ssl/my-server.pem'\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', complete: true}\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', skipped: true,\n  reason: 'The selected SSH Tunnel mode is NONE.'}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n[workflow_img]: https://github.com/mongodb-js/connection-model/workflows/Check%20and%20Test/badge.svg?event=push\n[workflow_url]: https://github.com/mongodb-js/connection-model/actions?query=workflow%3A%22Check+and+Test%22\n[npm_img]: https://img.shields.io/npm/v/mongodb-connection-model.svg?style=flat-square\n[npm_url]: https://www.npmjs.org/package/mongodb-connection-model\n[gitter_img]: https://badges.gitter.im/Join%20Chat.svg\n[gitter_url]: http://gitter.im/mongodb-js/mongodb-js\n[enterprise_img]: https://img.shields.io/badge/MongoDB-Enterprise-blue.svg?style=flat-square\n[coming_soon_img]: https://img.shields.io/badge/-Coming%20Soon-ff69b4.svg?style=flat-square\n[kerberos-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/kerberos_tests.js\n[ldap-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ldap_tests.js\n[x509-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ssl_x509_tests.js\n[ns]: https://github.com/mongodb-js/ns\n[sf-ssh-tunnel]: http://serverfault.com/questions/597765/how-to-connect-to-mongodb-server-via-ssh-tunnel\n[ec2-key-pairs]: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html\n[driver-ssl-impl]: https://github.com/christkv/mongodb-core/blob/c3d21cb636d74d7a68134ecd3b9f6af536311279/lib/connection/connection.js#L365-L407\n[driver-ssl-tutorial]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/\n[driver-ssl-none]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#no-certificate-validation\n[driver-ssl-server]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate\n[driver-ssl-all]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate-and-present-valid-certificate\n","gitHead":"259fb95ccf1d41c3210676266488d0705f9b544e","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","test":"mocha","check":"npm run lint && npm run depcheck","pretest":"mongodb-runner install && mongodb-runner start --port=27018","test-ci":"npm run test","depcheck":"depcheck","posttest":"mongodb-runner stop --port=27018","posttest-ci":"node ../../scripts/killall-mongo.js","test-check-ci":"npm run check && npm test"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.17.0+x64 (linux)","description":"MongoDB connection model","directories":{},"_nodeVersion":"16.17.0","compass:main":"index.js","dependencies":{"raf":"^3.4.1","debug":"^4.2.0","lodash":"^4.17.15","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.2.0","storage-mixin":"0.0.0-next-259fb95ccf1d41c3210676266488d0705f9b544e","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.2","@mongodb-js/ssh-tunnel":"0.0.0-next-259fb95ccf1d41c3210676266488d0705f9b544e","@mongodb-js/compass-utils":"0.0.0-next-259fb95ccf1d41c3210676266488d0705f9b544e","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.6.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^10.2.0","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"^5.1.0","depcheck":"^1.4.1","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.10.0","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^5.1.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_0.0.0-next-259fb95ccf1d41c3210676266488d0705f9b544e_1681955303326_0.9596166294112609","host":"s3://npm-registry-packages"}},"22.3.0":{"name":"mongodb-connection-model","version":"22.3.0","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@22.3.0","maintainers":[{"name":"mongo-j","email":"james.wang@mongodb.com"},{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satya@mongodb.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"iteng@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"2e88afc2eb282b5f7f540394fa9c29513cf63cab","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-22.3.0.tgz","fileCount":20,"integrity":"sha512-An33sxSgD8AJtXJ3/oL9n2ugM9EQALyH8X0ybp0ATTwwkDcTSmcxvRWmUGkkBCPQFpMqke4p60gkaTE+WtwTKQ==","signatures":[{"sig":"MEQCIB5KnZGGGYCvmdGwRJVcwUlQGrXoFiY+oV7IUZ6hNrHHAiAzWbOtbGdHVpT/riopPXDk2QL/H7Jhr/VdWnOIcalNUQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":107939,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkQmMiACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpvAQ//U1bteXqLuQHjbwjwclT+zHUIS9PAh69PEhJ392TOcb5ZOOrS\r\nFL4/BBxFqP0LQU8JxT2pmqPHQKAqf2gDccVveOAwZKQNN7tbwCCdkmpa0KXd\r\nELgO+ZLS/R+BxtrkIL/RRprT8lV1AZrASX4PRRNo0e1HPd1erOytkY6DzAvN\r\nILvEn+K4prhMbpxrv2vFPSiL+ufl4XhXYcYJFMG35hs2WwtdR/u1qKAY0vk4\r\nnw7MVklZyKOgfGzeyV7k1yWGe9dBBSNs0EBqvLNq8FESoiw+lx4BjvNQ8PwR\r\n9wRJY2w19OuBrAhox2siSDlEspbbMRGXnpHMZxWWf0APYobzDiG8/PlfQq+4\r\n7xtaVGB7GOm/mYD2UsZAbhRNr+u61V/mYtA7jDHphn5TzzZuP5X71am+sLjS\r\n9NaXbYbtD4cUZc0g5mJ2AYoNpIJdKaMZKJ2Y+xBHTbS9M2Lsdw5AeBgthyAt\r\niXO3tbB+tSCQUhKEZP0HUUN6MOOlx+X72AabWkdr9r0Vw2WeUGcoIS7o47IH\r\nvV+KUJA9FkrBx2j2cn30piyMhyty/zqiYD2YCSkR1dvqCTm3wqQ4ysK4XgpI\r\neIc53yXiLXfL9aKNZTli2zktuznOUiSRUEjZDDMsZ5pMHQxrHtytPiBELwOq\r\nNVeaPUOa0avADKB5i+29gpaXD605QI69iIE=\r\n=AbBF\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","gitHead":"e4f2643a437ce2407657a63246e303d13ce8297b","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","test":"mocha","check":"npm run lint && npm run depcheck","pretest":"mongodb-runner install && mongodb-runner start --port=27018","test-ci":"npm run test","depcheck":"depcheck","posttest":"mongodb-runner stop --port=27018","posttest-ci":"node ../../scripts/killall-mongo.js","test-check-ci":"npm run check && npm test"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.20.0+x64 (linux)","description":"MongoDB connection model","directories":{},"_nodeVersion":"16.20.0","compass:main":"index.js","dependencies":{"raf":"^3.4.1","debug":"^4.2.0","lodash":"^4.17.15","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.2.0","storage-mixin":"^5.1.4","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.2","@mongodb-js/ssh-tunnel":"^2.0.5","@mongodb-js/compass-utils":"^0.3.0","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.6.0"},"_hasShrinkwrap":false,"devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^10.2.0","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"^5.1.0","depcheck":"^1.4.1","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.10.0","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^5.1.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_22.3.0_1682072354429_0.7025118382134257","host":"s3://npm-registry-packages"}},"0.0.0-next-604fdbd72ed8b3cb7869997416b51ea07fd77400":{"name":"mongodb-connection-model","version":"0.0.0-next-604fdbd72ed8b3cb7869997416b51ea07fd77400","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@0.0.0-next-604fdbd72ed8b3cb7869997416b51ea07fd77400","maintainers":[{"name":"mongo-j","email":"james.wang@mongodb.com"},{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satya@mongodb.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"iteng@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"867bafb93a488637298590adbc2c93e31077563d","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-0.0.0-next-604fdbd72ed8b3cb7869997416b51ea07fd77400.tgz","fileCount":20,"integrity":"sha512-sLivVxN9B6/0zgnW/iKwlQ9cR6RWWzQ6NHst6p0VL8aXMni+ij+i9R0yyU0T0qphlRXYR7JvfhFm+R6YwgHsAw==","signatures":[{"sig":"MEUCIQD2t/ZuiLG+L2KMNj5g5xkVSifw9T+NI3fYUp+lSsIeIgIgBfZM/I66MuRz4KpxsqeRX4bcJEjUsE0kf257hMmPnsw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":108119,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkSO2HACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoTNQ/+JoFQz5ZZWFgILrrq79GV+9r4YJlAqyPqeACekLQJxBXYB9kz\r\nBf5V8nNbXpGY5hhsiVUo/1MEe4PM07+T+b3qzzWujXuUETvaWJ+p6+SoVs7x\r\ndcgLH865i5bP7YrzKTRCENTIhjR0Wibdp4psP2mm28sHH288HWiPtz4WUfT5\r\nXEjld+gyiwatAHcMtjo9rBP5tx+yoP3yEqwWAzyH7dYEmDgaBabDUACjXYjF\r\n9lc0I99my0AHzAxwkEOVkjT4DyzaZrlUuFP0SHvI0w3dpKAzBEGMHlA0g5q0\r\naP0uwV0UK2Q7GIRDZxrPgRzQJJsY+IY0uv5xk9gdj8RnWVfOGjHZ6yIVM41N\r\n6+ZLIdyMa6R/UuHDNSQzPKzJBHNNAxd6TYi2ly8rFbZxp20sqm+3h+3TvQmR\r\nKdYAQPdbNZhKxgC6Bgh/wRFdufCofCttj0xaIskBuzXPHa9o1suQTIo26Wl9\r\nWS3P9t9Wzj8sNcPh9e3IPR9umGJUe3B4wfEug7MUL/FqAvUh49W+YrzN48YO\r\n2ChAkF/rBr27kLkGigZl9hlLfe8YvZhOzGCA9GDDGBPjZuENTKUBXfLiHKg6\r\nz0oTpRMC02OyfPMnyxp399c3KxdEFPyCvLeYfkW0IBz9bQ7dK3gRM7Gl7cQj\r\ndrbH8SA1M/QyPg7gSaiEXoTXUqZwxKU42Ss=\r\n=/lKQ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","readme":"# mongodb-connection-model [![][workflow_img]][workflow_url] [![][npm_img]][npm_url]\n\n> MongoDB connection model\n\nThe main purpose of the MongoDB connection model is to be a domain model around a MongoDB connection. It encapsulates generating a [Connection String URI](https://docs.mongodb.com/manual/reference/connection-string/) from a group of attributes and parses URI using the [MongoDB Node.JS Driver URI Parser](https://github.com/mongodb-js/mongodb-core/blob/master/lib/uri_parser.js).\n\n## Installation\n\n```\nnpm install --save mongodb-connection-model\n```\n\n## Usage\n\n### Building URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\nconst c = new Connection({ appname: 'My App Name' });\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://localhost:27017/?readPreference=primary&appname=My%20App&ssl=false'\n```\n\n### Parsing URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\n\nConnection.from(\n  'mongodb://someUsername:testPassword@localhost',\n  (error, result) => {\n    console.log(result);\n    >>> `{\n      hosts: [{ host: 'localhost', port: 27017 }],\n      hostname: 'localhost',\n      port: 27017,\n      auth: {\n        username: 'someUsername',\n        password: 'testPassword',\n        db: 'admin'\n      },\n      isSrvRecord: false,\n      authStrategy: 'MONGODB',\n      mongodbUsername: 'someUsername',\n      mongodbPassword: 'testPassword',\n      mongodbDatabaseName: 'admin',\n      extraOptions: {},\n      connectionType: 'NODE_DRIVER',\n      readPreference: 'primary',\n      kerberosCanonicalizeHostname: false,\n      sslMethod: 'NONE',\n      sshTunnel: 'NONE',\n      sshTunnelPort: 22\n    }`\n  }\n);\n```\n\n## Properties\n\nMongoDB connection model is based on Ampersand.js framework and consist of [props](https://ampersandjs.com/docs/#ampersand-state-props) and [derived props](https://ampersandjs.com/docs/#ampersand-state-derived). The props object describes the observable properties that MongoDB connection model gets from the Node.js Driver API.\n\n```javascript\nconst с = new Connection();\nconst props = с.getAttributes({ props: true });\n```\n\n#### See Also\n\n- [URI Generic Syntax](https://tools.ietf.org/html/rfc3986)\n- [URI Options Specification](https://github.com/mongodb/specifications/blob/master/source/uri-options/uri-options.rst)\n\n### General Properties\n\n```javascript\nconst c = new Connection({ isSrvRecord: true });\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ns` | String | A valid [ns][ns] the user can read from | `undefined` |\n| `isSrvRecord` | Boolean | Indicates SRV record | `false` |\n| `auth` | Object | Authentication from driver (username, user, db, password) | `undefined` |\n| `hostname` | String | Hostname of a MongoDB Instance. In case of the replica set the first host and port will be taken | `localhost` |\n| `port` | Number | TCP port of a MongoDB Instance | `27017` |\n| `hosts` | Array | Contains all hosts and ports for replica set | `[{ host: 'localhost', port: 27017 }]` |\n| `extraOptions` | Object | Extra options passed to the node driver as part of `driverOptions` | `{}` |\n| `connectionType` | String | The desired connection type. Possible values: `NODE_DRIVER`, `STITCH_ON_PREM`, `STITCH_ATLAS` | `NODE_DRIVER` |\n| `authStrategy` | String | The desired authentication strategy. Possible values: `NONE`, `MONGODB`, `X509`, `KERBEROS`, `LDAP`, `SCRAM-SHA-256` | `NONE` |\n\n### Connection string options\n\n```javascript\nconst c = new Connection({ appname: 'My App', replicaSet: 'testing' });\n```\n\n#### General connection string options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `replicaSet` | String | Specifies the name of the replica set, if the mongod is a member of a replica set | `undefined` |\n| `connectTimeoutMS` | Number | The time in milliseconds to attempt a connection before timing out | `undefined` |\n| `socketTimeoutMS` | Number | The time in milliseconds to attempt a send or receive on a socket before the attempt times out | `undefined` |\n| `compression` | Object | Object includes compressors and a compression level. The following compressors can be specified: `snappy`, `zlib` (Available in MongoDB 3.6 or greater) | `undefined` |\n\n#### Connection Pool Option\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `maxPoolSize` | Number | The maximum number of connections in the connection pool | `undefined` |\n| `minPoolSize` | Number | The minimum number of connections in the connection pool | `undefined` |\n| `maxIdleTimeMS` | Number | The maximum number of milliseconds that a connection can remain idle in the pool before being removed and closed | `undefined` |\n| `waitQueueMultiple` | Number | A number that the driver multiples the maxPoolSize value to, to provide the maximum number of threads allowed to wait for a connection to become available from the pool | `undefined` |\n| `waitQueueTimeoutMS` | Number | The maximum time in milliseconds that a thread can wait for a connection to become available | `undefined` |\n\n#### Write Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `w` | Number/String | Corresponds to the write concern [w Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-w) | `undefined` |\n| `wTimeoutMS` | Number | Corresponds to the write concern [wtimeout](https://docs.mongodb.com/manual/reference/write-concern/#wc-wtimeout) | `undefined` |\n| `journal` | Boolean | Corresponds to the write concern [j Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-j) | `undefined` |\n\n#### Read Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readConcernLevel` | String | The level of isolation | `undefined` |\n\n#### Read Preference Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readPreference` | String | Specifies the read preferences for this connection. Possible values: `PRIMARY`, `PRIMARY_PREFERRED`, `SECONDARY`, `SECONDARY_PREFERRED`, `NEAREST` | `PRIMARY` |\n| `maxStalenessSeconds` | Number | Specifies, in seconds, how stale a secondary can be before the client stops using it for read operations | `undefined` |\n| `readPreferenceTags` | Object | Default read preference tags for the client | `undefined` |\n\n#### Authentication Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `authSource` | String | Specify the database name associated with the user’s credentials | `undefined` |\n| `authMechanism` | String | Specifies the authentication mechanism that MongoDB will use to authenticate the connection. Possible values: `DEFAULT`, `GSSAPI`, `MONGODB-X509`, `PLAIN`, `SCRAM-SHA-256` | `undefined` |\n| `authMechanismProperties` | Object | Additional options provided for authentication (e.g. to enable hostname canonicalization for GSSAPI) | `undefined` |\n| `gssapiServiceName` | String | Set the Kerberos service name when connecting to Kerberized MongoDB instances | `undefined` |\n| `gssapiServiceRealm` | String | Set the Realm service name | `undefined` |\n| `gssapiCanonicalizeHostName` | Boolean | Whether canonicalized hostname | `undefined` |\n\n#### Server Selection and Discovery Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `localThresholdMS` | Number | The size (in milliseconds) of the latency window for selecting among multiple suitable MongoDB instances | `undefined` |\n| `serverSelectionTimeoutMS` | Number | Specifies how long (in milliseconds) to block for server selection before throwing an exception | `undefined` |\n| `serverSelectionTryOnce` | Boolean | Instructs the driver to scan the MongoDB deployment exactly once after server selection fails and then either select a server or raise an error | `undefined` |\n| `heartbeatFrequencyMS` | Number | Controls when the driver checks the state of the MongoDB deployment | `undefined` |\n\n#### Miscellaneous Configuration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `appname` | String | An application name passed to server as client metadata | `undefined` |\n| `retryWrites` | Boolean | Enable retryable writes | `undefined` |\n| `uuidRepresentation` | String | The legacy representation of UUID. Possible values: `standard`, `csharpLegacy`, `javaLegacy`, `pythonLegacy` | `undefined` |\n| `loadBalanced` | Boolean | Whether or not the server is running in load balanced mode | `undefined` |\n\n### Stitch attributes\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `stitchServiceName` | String | Stitch service name | `undefined` |\n| `stitchClientAppId` | String | Stitch сlient app ID | `undefined` |\n| `stitchGroupId` | String | Stitch group ID | `undefined` |\n| `stitchBaseUrl` | String | Stitch base Url | `undefined` |\n\n### MONGODB authentication\n\n```javascript\nconst c = new Connection({\n  mongodbUsername: 'arlo',\n  mongodbPassword: 'w@of'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/?slaveOk=true&authSource=admin'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `mongodbUsername` | String | MongoDB username | `undefined` |\n| `mongodbPassword` | String | MongoDB password | `undefined` |\n| `mongodbDatabaseName` | String | The database name associated with the user's credentials | `undefined` |\n| `promoteValues` | Boolean | Whether BSON values should be promoted to their JS type counterparts | `undefined` |\n\n### KERBEROS authentication\n\n```javascript\nconst c = new Connection({\n  kerberosServiceName: 'mongodb',\n  kerberosPrincipal: 'arlo/dog@krb5.mongodb.parts',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo%252Fdog%2540krb5.mongodb.parts@localhost:27017/toys?authMechanism=GSSAPI'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n> @note (imlucas): Kerberos on Windows is broken out as it's own state for UX consideration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `kerberosServiceName` | String | Any program or computer you access over a network | `undefined` |\n| `kerberosPrincipal` | String | The format of a typical Kerberos V5 principal is `primary/instance@REALM` | `undefined` |\n| `kerberosCanonicalizeHostname` | Boolean | Whether canonicalized kerberos hostname | `undefined` |\n\n#### See Also\n\n- [node.js driver Kerberos reference](http://bit.ly/mongodb-node-driver-kerberos)\n- [node.js driver Kerberos functional test][kerberos-functional]\n\n### LDAP authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  ldapUsername: 'arlo',\n  ldapPassword: 'w@of',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/toys?slaveOk=true&authMechanism=PLAIN'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ldapUsername` | String | LDAP username | `undefined` |\n| `ldapPassword` | String | LDAP password | `undefined` |\n\n#### See Also\n\n- [node.js driver LDAP reference](http://bit.ly/mongodb-node-driver-ldap)\n- [node.js driver X509 functional test][ldap-functional]\n\n### X509 authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  x509Username: 'CN=client,OU=arlo,O=MongoDB,L=Philadelphia,ST=Pennsylvania,C=US'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://CN%253Dclient%252COU%253Darlo%252CO%253DMongoDB%252CL%253DPhiladelphia%252CST%253DPennsylvania%252CC%253DUS@localhost:27017?slaveOk=true&authMechanism=MONGODB-X509'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `x509Username` | String | The x.509 certificate derived user name, e.g. `CN=user,OU=OrgUnit,O=myOrg,...` | `undefined` |\n\n#### See Also\n\n- [node.js driver X509 reference](http://bit.ly/mongodb-node-driver-x509)\n- [node.js driver X509 functional test][x509-functional]\n\n### SSL\n\n> **Note**: Not to be confused with `authentication=X509`\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ssl` | Number/String | A boolean to enable or disables TLS/SSL for the connection | `undefined` |\n| `sslMethod` | String | The desired ssl method. Possible values: `NONE`, `SYSTEMCA`, `IFAVAILABLE`, `UNVALIDATED`, `SERVER`, `ALL` | `NONE` |\n| `sslCA` | Buffer/String | Array of valid certificates | `undefined` |\n| `sslCert` | Buffer/String | The certificate | `undefined` |\n| `sslKey` | Buffer/String | The certificate private key | `undefined` |\n| `sslPass` | Buffer/String | The certificate password | `undefined` |\n\nDescription of `sslMethod` values:\n\n- `SYSTEMCA` - SSL required, validate using System CA, with host verification.\n- `IFAVAILABLE` - The driver should try SSL first, fall back to no SSL if unavailable, and use the system's Certificate Authority.\n- `SERVER` - The driver should validate the server certificate and fail to connect if validation fails. See also [node.js driver \"Validate Server Certificate\" docs][driver-ssl-server].\n- `ALL` - The driver must present a valid certificate and validate the server certificate. See also [node.js driver \"Validate Server Certificate and Present Valid Certificate\" docs][driver-ssl-all].\n- `NONE` - No SSL (Not recommended).\n- `UNVALIDATED` - Use SSL but do not perform any validation of the certificate chain. See also [node.js driver \"No Certificate Validation\" docs][driver-ssl-none]. **Very** not recommended and likely to be deprecated in future releases because it exposes potential Man-In-The-Middle attack vectors.\n\n#### See also\n\n- [node.js driver SSL implementation][driver-ssl-impl]\n- [node.js driver SSL tutorial][driver-ssl-tutorial]\n\n### SSH TUNNEL\n\n> New in mongodb-connection-model@5.0.0\n\nBecause [authentication](#authentication) is quite difficult for operators to migrate to, the most common method of securing a MongoDB deployment is to use an [SSH tunnel][sf-ssh-tunnel].  This allows operators to leverage their existing SSH security infrastructure to also provide secure access to MongoDB.  For a standard deployment of MongoDB on AWS, this is almost always to strategy.  Because of this, we now support creating SSH tunnels automatically when connecting to MongoDB.\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options, (connectionError, client) => {\n  if (connectionError) {\n    return console.log(connectionError);\n  }\n\n  client.db('mongodb').collection('fanclub').count((countingError, count) => {\n    console.log('counted:', countingError, count);\n    client.close();\n  });\n});\n```\n\nThe above provides the same functionality as creating the tunnel using the bash\ncommand below and connecting to MongoDB via another terminal. Notice that\nconnection-model uses a random local port each time it creates a tunnel.\nUsing the command line, you'd have to replace `<random port>` with an actual\nport number.\n\n```bash\nssh -i ~/.ssh/my-key-aws-pair.pem -L <random port>:localhost:27017 ubuntu@ec2-11-111-111-111.compute-1.amazonaws.com\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `sshTunnel` | String | The desired SSH tunnel strategy. Possible values: `NONE`, `USER_PASSWORD`, `IDENTITY_FILE` | `undefined` |\n| `sshTunnelHostname` | String | The hostname of the SSH remote host | `undefined` |\n| `sshTunnelPort` | Port | The SSH port of the remote host | `22` |\n| `sshTunnelBindToLocalPort` | Port | Bind the localhost endpoint of the SSH Tunnel to this port | `undefined` |\n| `sshTunnelUsername` | String | The optional SSH username for the remote host | `undefined` |\n| `sshTunnelPassword` | String | The optional SSH password for the remote host | `undefined` |\n| `sshTunnelIdentityFile` | String/Array | The optional path to the SSH identity file for the remote host | `undefined` |\n| `sshTunnelPassphrase` | String | The optional passphrase for `sshTunnelIdentityFile` | `undefined` |\n\nDescription of `sshTunnel` values:\n\n- `NONE` - Do not use SSH tunneling.\n- `USER_PASSWORD` - The tunnel is created with SSH username and password only.\n- `IDENTITY_FILE` - The tunnel is created using an identity file.\n\n## Derived Properties\n\nDerived properties (also known as computed properties) are properties of the state object that depend on other properties to determine their value.\n\n```javascript\nconst c = new Connection();\nconst derivedProps = c.getAttributes({ derived: true });\n```\n\n| Derived Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `instanceId` | String | The mongoscope | `localhost:27017` |\n| `driverAuthMechanism` | String | Converts the value of `authStrategy` for humans into the `authMechanism` value for the driver | `undefined` |\n| `safeUrl` | String | The URL where a password is replaced with stars | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrl` | String | Use this URL in order to connect via DataService | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrlWithSsh` | String | Use this URL in order to connect via connection model itself | `mongodb://localhost:29201/?readPreference=primary&ssl=false` |\n| `driverOptions` | String | The second argument `mongoscope-server` passes to `mongodb.connect` | `{}` |\n\n## Events\n\n> New in mongodb-connection-model@5.0.0\n\n#### Example: SSH Tunnel\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', skipped: true,\n  reason: 'The selected SSL mode does not need to load any files.' }\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', complete: true}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n#### Example: SSL\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  ssl: 'ALL',\n  sslCA: '~/.ssl/my-ca.pem',\n  sslCert: '~/.ssl/my-server.pem',\n  sslKey: '~/.ssl/my-server.pem'\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', complete: true}\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', skipped: true,\n  reason: 'The selected SSH Tunnel mode is NONE.'}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n[workflow_img]: https://github.com/mongodb-js/connection-model/workflows/Check%20and%20Test/badge.svg?event=push\n[workflow_url]: https://github.com/mongodb-js/connection-model/actions?query=workflow%3A%22Check+and+Test%22\n[npm_img]: https://img.shields.io/npm/v/mongodb-connection-model.svg?style=flat-square\n[npm_url]: https://www.npmjs.org/package/mongodb-connection-model\n[gitter_img]: https://badges.gitter.im/Join%20Chat.svg\n[gitter_url]: http://gitter.im/mongodb-js/mongodb-js\n[enterprise_img]: https://img.shields.io/badge/MongoDB-Enterprise-blue.svg?style=flat-square\n[coming_soon_img]: https://img.shields.io/badge/-Coming%20Soon-ff69b4.svg?style=flat-square\n[kerberos-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/kerberos_tests.js\n[ldap-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ldap_tests.js\n[x509-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ssl_x509_tests.js\n[ns]: https://github.com/mongodb-js/ns\n[sf-ssh-tunnel]: http://serverfault.com/questions/597765/how-to-connect-to-mongodb-server-via-ssh-tunnel\n[ec2-key-pairs]: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html\n[driver-ssl-impl]: https://github.com/christkv/mongodb-core/blob/c3d21cb636d74d7a68134ecd3b9f6af536311279/lib/connection/connection.js#L365-L407\n[driver-ssl-tutorial]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/\n[driver-ssl-none]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#no-certificate-validation\n[driver-ssl-server]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate\n[driver-ssl-all]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate-and-present-valid-certificate\n","gitHead":"604fdbd72ed8b3cb7869997416b51ea07fd77400","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","test":"mocha","check":"npm run lint && npm run depcheck","pretest":"mongodb-runner install && mongodb-runner start --port=27018","test-ci":"npm run test","depcheck":"depcheck","posttest":"mongodb-runner stop --port=27018","posttest-ci":"node ../../scripts/killall-mongo.js","test-check-ci":"npm run check && npm test"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.17.0+x64 (linux)","description":"MongoDB connection model","directories":{},"_nodeVersion":"16.17.0","compass:main":"index.js","dependencies":{"raf":"^3.4.1","debug":"^4.2.0","lodash":"^4.17.15","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.2.0","storage-mixin":"0.0.0-next-604fdbd72ed8b3cb7869997416b51ea07fd77400","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.2","@mongodb-js/ssh-tunnel":"0.0.0-next-604fdbd72ed8b3cb7869997416b51ea07fd77400","@mongodb-js/compass-utils":"0.0.0-next-604fdbd72ed8b3cb7869997416b51ea07fd77400","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.6.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^10.2.0","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"^5.1.0","depcheck":"^1.4.1","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.10.0","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^5.1.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_0.0.0-next-604fdbd72ed8b3cb7869997416b51ea07fd77400_1682500999305_0.009346094153207751","host":"s3://npm-registry-packages"}},"0.0.0-next-35420eb38f659fbfc4bff9e72644deebafef275e":{"name":"mongodb-connection-model","version":"0.0.0-next-35420eb38f659fbfc4bff9e72644deebafef275e","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@0.0.0-next-35420eb38f659fbfc4bff9e72644deebafef275e","maintainers":[{"name":"mongo-j","email":"james.wang@mongodb.com"},{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satya@mongodb.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"iteng@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"5bb0af865d40f5f1a07de564ff5ea732de5fe313","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-0.0.0-next-35420eb38f659fbfc4bff9e72644deebafef275e.tgz","fileCount":20,"integrity":"sha512-TR9FuZa/WQRd0zU4gPEjJEGRPKJ6ZdOS2XX3HDfGEXb+Eq8OGWXGMsqy/oVdqAfz95VNw33g4P8bZLgRcU0TGA==","signatures":[{"sig":"MEUCIQC64cSYV+83ovElTHyupJXVcb1aR/HoTFatBzAI8YHcqAIgT775l28Yov2UNZl3DEYtvrqE4ZENpV2ESeXIQyHXFG4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":108119,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkSdZmACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpPrg//S5d0jIo9zEhA/Wr38sBq6GAUqVAfvDppitmi0aQHmp/vEc4g\r\numDxd94yJ+O+a8M0UmZB3MYKo02j9BFrVGpXEuEVZPOrQssTXtD44N+o2lPf\r\nSdMs0DzRzBqWks0Cl0+zCacNe9RtqrZ0+o427aOxFYMbEu3WzcAch5ut/bZS\r\nulYmIf/RMnyAJCLmb7lSjkiAc37VuJGAxeII4VYIOLpdhrULWeEiFouwwHnx\r\nf4z6M8rinu6nOrLfBKNL+GOYq8P+SZJ6boZeQHTu3Dw2vK+fp+rr+YP21qkT\r\n34oG1XovLIO0LLU7W4y+I9DmR/6sMLBjqWsBITHnSGy9NlI/dUOf6aY8aSfO\r\n6KxoT5nAJq9agv8WGuMzZO2FMrHjJ2AU5rjFwXdeOnAK7KaINeATes7BeX24\r\nnQ+A5KXCFRHAFqBBOsjSyRyBqbmdhSJC9NjoXSm5n8IDIXo0H5ev7ur/ZCvH\r\nurdrRfYkh3JRHP27EV725vJi76wF3V7FJDnbSWB4WSggDhWRNmX9na2NIord\r\n0KEJ+yaxF/MxhbhheWZ53V93GZhCXAFJjZ4keCh9hxeRYs+9GueQwNv+B0/J\r\n8LtvJ+v6Dsm4iMHTqQ/0Dk/QXNZJEyoiTrRvEo+RX1tUSWISr9sDst8TTkzO\r\nup+FPYUQpEBi94kYhmujLYcE1doDIhkiXoY=\r\n=FBPD\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","readme":"# mongodb-connection-model [![][workflow_img]][workflow_url] [![][npm_img]][npm_url]\n\n> MongoDB connection model\n\nThe main purpose of the MongoDB connection model is to be a domain model around a MongoDB connection. It encapsulates generating a [Connection String URI](https://docs.mongodb.com/manual/reference/connection-string/) from a group of attributes and parses URI using the [MongoDB Node.JS Driver URI Parser](https://github.com/mongodb-js/mongodb-core/blob/master/lib/uri_parser.js).\n\n## Installation\n\n```\nnpm install --save mongodb-connection-model\n```\n\n## Usage\n\n### Building URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\nconst c = new Connection({ appname: 'My App Name' });\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://localhost:27017/?readPreference=primary&appname=My%20App&ssl=false'\n```\n\n### Parsing URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\n\nConnection.from(\n  'mongodb://someUsername:testPassword@localhost',\n  (error, result) => {\n    console.log(result);\n    >>> `{\n      hosts: [{ host: 'localhost', port: 27017 }],\n      hostname: 'localhost',\n      port: 27017,\n      auth: {\n        username: 'someUsername',\n        password: 'testPassword',\n        db: 'admin'\n      },\n      isSrvRecord: false,\n      authStrategy: 'MONGODB',\n      mongodbUsername: 'someUsername',\n      mongodbPassword: 'testPassword',\n      mongodbDatabaseName: 'admin',\n      extraOptions: {},\n      connectionType: 'NODE_DRIVER',\n      readPreference: 'primary',\n      kerberosCanonicalizeHostname: false,\n      sslMethod: 'NONE',\n      sshTunnel: 'NONE',\n      sshTunnelPort: 22\n    }`\n  }\n);\n```\n\n## Properties\n\nMongoDB connection model is based on Ampersand.js framework and consist of [props](https://ampersandjs.com/docs/#ampersand-state-props) and [derived props](https://ampersandjs.com/docs/#ampersand-state-derived). The props object describes the observable properties that MongoDB connection model gets from the Node.js Driver API.\n\n```javascript\nconst с = new Connection();\nconst props = с.getAttributes({ props: true });\n```\n\n#### See Also\n\n- [URI Generic Syntax](https://tools.ietf.org/html/rfc3986)\n- [URI Options Specification](https://github.com/mongodb/specifications/blob/master/source/uri-options/uri-options.rst)\n\n### General Properties\n\n```javascript\nconst c = new Connection({ isSrvRecord: true });\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ns` | String | A valid [ns][ns] the user can read from | `undefined` |\n| `isSrvRecord` | Boolean | Indicates SRV record | `false` |\n| `auth` | Object | Authentication from driver (username, user, db, password) | `undefined` |\n| `hostname` | String | Hostname of a MongoDB Instance. In case of the replica set the first host and port will be taken | `localhost` |\n| `port` | Number | TCP port of a MongoDB Instance | `27017` |\n| `hosts` | Array | Contains all hosts and ports for replica set | `[{ host: 'localhost', port: 27017 }]` |\n| `extraOptions` | Object | Extra options passed to the node driver as part of `driverOptions` | `{}` |\n| `connectionType` | String | The desired connection type. Possible values: `NODE_DRIVER`, `STITCH_ON_PREM`, `STITCH_ATLAS` | `NODE_DRIVER` |\n| `authStrategy` | String | The desired authentication strategy. Possible values: `NONE`, `MONGODB`, `X509`, `KERBEROS`, `LDAP`, `SCRAM-SHA-256` | `NONE` |\n\n### Connection string options\n\n```javascript\nconst c = new Connection({ appname: 'My App', replicaSet: 'testing' });\n```\n\n#### General connection string options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `replicaSet` | String | Specifies the name of the replica set, if the mongod is a member of a replica set | `undefined` |\n| `connectTimeoutMS` | Number | The time in milliseconds to attempt a connection before timing out | `undefined` |\n| `socketTimeoutMS` | Number | The time in milliseconds to attempt a send or receive on a socket before the attempt times out | `undefined` |\n| `compression` | Object | Object includes compressors and a compression level. The following compressors can be specified: `snappy`, `zlib` (Available in MongoDB 3.6 or greater) | `undefined` |\n\n#### Connection Pool Option\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `maxPoolSize` | Number | The maximum number of connections in the connection pool | `undefined` |\n| `minPoolSize` | Number | The minimum number of connections in the connection pool | `undefined` |\n| `maxIdleTimeMS` | Number | The maximum number of milliseconds that a connection can remain idle in the pool before being removed and closed | `undefined` |\n| `waitQueueMultiple` | Number | A number that the driver multiples the maxPoolSize value to, to provide the maximum number of threads allowed to wait for a connection to become available from the pool | `undefined` |\n| `waitQueueTimeoutMS` | Number | The maximum time in milliseconds that a thread can wait for a connection to become available | `undefined` |\n\n#### Write Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `w` | Number/String | Corresponds to the write concern [w Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-w) | `undefined` |\n| `wTimeoutMS` | Number | Corresponds to the write concern [wtimeout](https://docs.mongodb.com/manual/reference/write-concern/#wc-wtimeout) | `undefined` |\n| `journal` | Boolean | Corresponds to the write concern [j Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-j) | `undefined` |\n\n#### Read Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readConcernLevel` | String | The level of isolation | `undefined` |\n\n#### Read Preference Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readPreference` | String | Specifies the read preferences for this connection. Possible values: `PRIMARY`, `PRIMARY_PREFERRED`, `SECONDARY`, `SECONDARY_PREFERRED`, `NEAREST` | `PRIMARY` |\n| `maxStalenessSeconds` | Number | Specifies, in seconds, how stale a secondary can be before the client stops using it for read operations | `undefined` |\n| `readPreferenceTags` | Object | Default read preference tags for the client | `undefined` |\n\n#### Authentication Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `authSource` | String | Specify the database name associated with the user’s credentials | `undefined` |\n| `authMechanism` | String | Specifies the authentication mechanism that MongoDB will use to authenticate the connection. Possible values: `DEFAULT`, `GSSAPI`, `MONGODB-X509`, `PLAIN`, `SCRAM-SHA-256` | `undefined` |\n| `authMechanismProperties` | Object | Additional options provided for authentication (e.g. to enable hostname canonicalization for GSSAPI) | `undefined` |\n| `gssapiServiceName` | String | Set the Kerberos service name when connecting to Kerberized MongoDB instances | `undefined` |\n| `gssapiServiceRealm` | String | Set the Realm service name | `undefined` |\n| `gssapiCanonicalizeHostName` | Boolean | Whether canonicalized hostname | `undefined` |\n\n#### Server Selection and Discovery Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `localThresholdMS` | Number | The size (in milliseconds) of the latency window for selecting among multiple suitable MongoDB instances | `undefined` |\n| `serverSelectionTimeoutMS` | Number | Specifies how long (in milliseconds) to block for server selection before throwing an exception | `undefined` |\n| `serverSelectionTryOnce` | Boolean | Instructs the driver to scan the MongoDB deployment exactly once after server selection fails and then either select a server or raise an error | `undefined` |\n| `heartbeatFrequencyMS` | Number | Controls when the driver checks the state of the MongoDB deployment | `undefined` |\n\n#### Miscellaneous Configuration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `appname` | String | An application name passed to server as client metadata | `undefined` |\n| `retryWrites` | Boolean | Enable retryable writes | `undefined` |\n| `uuidRepresentation` | String | The legacy representation of UUID. Possible values: `standard`, `csharpLegacy`, `javaLegacy`, `pythonLegacy` | `undefined` |\n| `loadBalanced` | Boolean | Whether or not the server is running in load balanced mode | `undefined` |\n\n### Stitch attributes\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `stitchServiceName` | String | Stitch service name | `undefined` |\n| `stitchClientAppId` | String | Stitch сlient app ID | `undefined` |\n| `stitchGroupId` | String | Stitch group ID | `undefined` |\n| `stitchBaseUrl` | String | Stitch base Url | `undefined` |\n\n### MONGODB authentication\n\n```javascript\nconst c = new Connection({\n  mongodbUsername: 'arlo',\n  mongodbPassword: 'w@of'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/?slaveOk=true&authSource=admin'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `mongodbUsername` | String | MongoDB username | `undefined` |\n| `mongodbPassword` | String | MongoDB password | `undefined` |\n| `mongodbDatabaseName` | String | The database name associated with the user's credentials | `undefined` |\n| `promoteValues` | Boolean | Whether BSON values should be promoted to their JS type counterparts | `undefined` |\n\n### KERBEROS authentication\n\n```javascript\nconst c = new Connection({\n  kerberosServiceName: 'mongodb',\n  kerberosPrincipal: 'arlo/dog@krb5.mongodb.parts',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo%252Fdog%2540krb5.mongodb.parts@localhost:27017/toys?authMechanism=GSSAPI'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n> @note (imlucas): Kerberos on Windows is broken out as it's own state for UX consideration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `kerberosServiceName` | String | Any program or computer you access over a network | `undefined` |\n| `kerberosPrincipal` | String | The format of a typical Kerberos V5 principal is `primary/instance@REALM` | `undefined` |\n| `kerberosCanonicalizeHostname` | Boolean | Whether canonicalized kerberos hostname | `undefined` |\n\n#### See Also\n\n- [node.js driver Kerberos reference](http://bit.ly/mongodb-node-driver-kerberos)\n- [node.js driver Kerberos functional test][kerberos-functional]\n\n### LDAP authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  ldapUsername: 'arlo',\n  ldapPassword: 'w@of',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/toys?slaveOk=true&authMechanism=PLAIN'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ldapUsername` | String | LDAP username | `undefined` |\n| `ldapPassword` | String | LDAP password | `undefined` |\n\n#### See Also\n\n- [node.js driver LDAP reference](http://bit.ly/mongodb-node-driver-ldap)\n- [node.js driver X509 functional test][ldap-functional]\n\n### X509 authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  x509Username: 'CN=client,OU=arlo,O=MongoDB,L=Philadelphia,ST=Pennsylvania,C=US'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://CN%253Dclient%252COU%253Darlo%252CO%253DMongoDB%252CL%253DPhiladelphia%252CST%253DPennsylvania%252CC%253DUS@localhost:27017?slaveOk=true&authMechanism=MONGODB-X509'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `x509Username` | String | The x.509 certificate derived user name, e.g. `CN=user,OU=OrgUnit,O=myOrg,...` | `undefined` |\n\n#### See Also\n\n- [node.js driver X509 reference](http://bit.ly/mongodb-node-driver-x509)\n- [node.js driver X509 functional test][x509-functional]\n\n### SSL\n\n> **Note**: Not to be confused with `authentication=X509`\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ssl` | Number/String | A boolean to enable or disables TLS/SSL for the connection | `undefined` |\n| `sslMethod` | String | The desired ssl method. Possible values: `NONE`, `SYSTEMCA`, `IFAVAILABLE`, `UNVALIDATED`, `SERVER`, `ALL` | `NONE` |\n| `sslCA` | Buffer/String | Array of valid certificates | `undefined` |\n| `sslCert` | Buffer/String | The certificate | `undefined` |\n| `sslKey` | Buffer/String | The certificate private key | `undefined` |\n| `sslPass` | Buffer/String | The certificate password | `undefined` |\n\nDescription of `sslMethod` values:\n\n- `SYSTEMCA` - SSL required, validate using System CA, with host verification.\n- `IFAVAILABLE` - The driver should try SSL first, fall back to no SSL if unavailable, and use the system's Certificate Authority.\n- `SERVER` - The driver should validate the server certificate and fail to connect if validation fails. See also [node.js driver \"Validate Server Certificate\" docs][driver-ssl-server].\n- `ALL` - The driver must present a valid certificate and validate the server certificate. See also [node.js driver \"Validate Server Certificate and Present Valid Certificate\" docs][driver-ssl-all].\n- `NONE` - No SSL (Not recommended).\n- `UNVALIDATED` - Use SSL but do not perform any validation of the certificate chain. See also [node.js driver \"No Certificate Validation\" docs][driver-ssl-none]. **Very** not recommended and likely to be deprecated in future releases because it exposes potential Man-In-The-Middle attack vectors.\n\n#### See also\n\n- [node.js driver SSL implementation][driver-ssl-impl]\n- [node.js driver SSL tutorial][driver-ssl-tutorial]\n\n### SSH TUNNEL\n\n> New in mongodb-connection-model@5.0.0\n\nBecause [authentication](#authentication) is quite difficult for operators to migrate to, the most common method of securing a MongoDB deployment is to use an [SSH tunnel][sf-ssh-tunnel].  This allows operators to leverage their existing SSH security infrastructure to also provide secure access to MongoDB.  For a standard deployment of MongoDB on AWS, this is almost always to strategy.  Because of this, we now support creating SSH tunnels automatically when connecting to MongoDB.\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options, (connectionError, client) => {\n  if (connectionError) {\n    return console.log(connectionError);\n  }\n\n  client.db('mongodb').collection('fanclub').count((countingError, count) => {\n    console.log('counted:', countingError, count);\n    client.close();\n  });\n});\n```\n\nThe above provides the same functionality as creating the tunnel using the bash\ncommand below and connecting to MongoDB via another terminal. Notice that\nconnection-model uses a random local port each time it creates a tunnel.\nUsing the command line, you'd have to replace `<random port>` with an actual\nport number.\n\n```bash\nssh -i ~/.ssh/my-key-aws-pair.pem -L <random port>:localhost:27017 ubuntu@ec2-11-111-111-111.compute-1.amazonaws.com\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `sshTunnel` | String | The desired SSH tunnel strategy. Possible values: `NONE`, `USER_PASSWORD`, `IDENTITY_FILE` | `undefined` |\n| `sshTunnelHostname` | String | The hostname of the SSH remote host | `undefined` |\n| `sshTunnelPort` | Port | The SSH port of the remote host | `22` |\n| `sshTunnelBindToLocalPort` | Port | Bind the localhost endpoint of the SSH Tunnel to this port | `undefined` |\n| `sshTunnelUsername` | String | The optional SSH username for the remote host | `undefined` |\n| `sshTunnelPassword` | String | The optional SSH password for the remote host | `undefined` |\n| `sshTunnelIdentityFile` | String/Array | The optional path to the SSH identity file for the remote host | `undefined` |\n| `sshTunnelPassphrase` | String | The optional passphrase for `sshTunnelIdentityFile` | `undefined` |\n\nDescription of `sshTunnel` values:\n\n- `NONE` - Do not use SSH tunneling.\n- `USER_PASSWORD` - The tunnel is created with SSH username and password only.\n- `IDENTITY_FILE` - The tunnel is created using an identity file.\n\n## Derived Properties\n\nDerived properties (also known as computed properties) are properties of the state object that depend on other properties to determine their value.\n\n```javascript\nconst c = new Connection();\nconst derivedProps = c.getAttributes({ derived: true });\n```\n\n| Derived Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `instanceId` | String | The mongoscope | `localhost:27017` |\n| `driverAuthMechanism` | String | Converts the value of `authStrategy` for humans into the `authMechanism` value for the driver | `undefined` |\n| `safeUrl` | String | The URL where a password is replaced with stars | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrl` | String | Use this URL in order to connect via DataService | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrlWithSsh` | String | Use this URL in order to connect via connection model itself | `mongodb://localhost:29201/?readPreference=primary&ssl=false` |\n| `driverOptions` | String | The second argument `mongoscope-server` passes to `mongodb.connect` | `{}` |\n\n## Events\n\n> New in mongodb-connection-model@5.0.0\n\n#### Example: SSH Tunnel\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', skipped: true,\n  reason: 'The selected SSL mode does not need to load any files.' }\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', complete: true}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n#### Example: SSL\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  ssl: 'ALL',\n  sslCA: '~/.ssl/my-ca.pem',\n  sslCert: '~/.ssl/my-server.pem',\n  sslKey: '~/.ssl/my-server.pem'\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', complete: true}\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', skipped: true,\n  reason: 'The selected SSH Tunnel mode is NONE.'}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n[workflow_img]: https://github.com/mongodb-js/connection-model/workflows/Check%20and%20Test/badge.svg?event=push\n[workflow_url]: https://github.com/mongodb-js/connection-model/actions?query=workflow%3A%22Check+and+Test%22\n[npm_img]: https://img.shields.io/npm/v/mongodb-connection-model.svg?style=flat-square\n[npm_url]: https://www.npmjs.org/package/mongodb-connection-model\n[gitter_img]: https://badges.gitter.im/Join%20Chat.svg\n[gitter_url]: http://gitter.im/mongodb-js/mongodb-js\n[enterprise_img]: https://img.shields.io/badge/MongoDB-Enterprise-blue.svg?style=flat-square\n[coming_soon_img]: https://img.shields.io/badge/-Coming%20Soon-ff69b4.svg?style=flat-square\n[kerberos-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/kerberos_tests.js\n[ldap-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ldap_tests.js\n[x509-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ssl_x509_tests.js\n[ns]: https://github.com/mongodb-js/ns\n[sf-ssh-tunnel]: http://serverfault.com/questions/597765/how-to-connect-to-mongodb-server-via-ssh-tunnel\n[ec2-key-pairs]: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html\n[driver-ssl-impl]: https://github.com/christkv/mongodb-core/blob/c3d21cb636d74d7a68134ecd3b9f6af536311279/lib/connection/connection.js#L365-L407\n[driver-ssl-tutorial]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/\n[driver-ssl-none]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#no-certificate-validation\n[driver-ssl-server]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate\n[driver-ssl-all]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate-and-present-valid-certificate\n","gitHead":"35420eb38f659fbfc4bff9e72644deebafef275e","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","test":"mocha","check":"npm run lint && npm run depcheck","pretest":"mongodb-runner install && mongodb-runner start --port=27018","test-ci":"npm run test","depcheck":"depcheck","posttest":"mongodb-runner stop --port=27018","posttest-ci":"node ../../scripts/killall-mongo.js","test-check-ci":"npm run check && npm test"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.17.0+x64 (linux)","description":"MongoDB connection model","directories":{},"_nodeVersion":"16.17.0","compass:main":"index.js","dependencies":{"raf":"^3.4.1","debug":"^4.2.0","lodash":"^4.17.15","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.2.0","storage-mixin":"0.0.0-next-35420eb38f659fbfc4bff9e72644deebafef275e","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.2","@mongodb-js/ssh-tunnel":"0.0.0-next-35420eb38f659fbfc4bff9e72644deebafef275e","@mongodb-js/compass-utils":"0.0.0-next-35420eb38f659fbfc4bff9e72644deebafef275e","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.6.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^10.2.0","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"^5.1.0","depcheck":"^1.4.1","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.10.0","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^5.1.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_0.0.0-next-35420eb38f659fbfc4bff9e72644deebafef275e_1682560614642_0.6758992913612805","host":"s3://npm-registry-packages"}},"0.0.0-next-f8695ae3010acc2686c0a530f153ebb01ddb040a":{"name":"mongodb-connection-model","version":"0.0.0-next-f8695ae3010acc2686c0a530f153ebb01ddb040a","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@0.0.0-next-f8695ae3010acc2686c0a530f153ebb01ddb040a","maintainers":[{"name":"mongo-j","email":"james.wang@mongodb.com"},{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satya@mongodb.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"iteng@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"39b691bb8edd60a9548841ec0e4f64f051d3bfb0","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-0.0.0-next-f8695ae3010acc2686c0a530f153ebb01ddb040a.tgz","fileCount":20,"integrity":"sha512-wjtS0lRut3Un8oOIMOcumNawDLCMaOOHZjXwkhiRwNB6eRvs1JYzufqNkVuGEjQstmAKeMxYdCMB6Snl+TjoWA==","signatures":[{"sig":"MEQCIEycpzQSy4fYFSmxN34DvLISGCYt87QqUuA3SOUZrWkEAiBA/tUAXFPX5W1Yf+lEOrQ1y8e1tPC2ICmaDa9TvWr3Ew==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":108119,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkSj4VACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq/jg//WFTafUBFXv9kJtzQ6JtddP2gG7QeTLOT8n2fM55ECM39f1Ga\r\nRVnpa9KA8t3airgfWHreNT2i7tUH5Y4BD9SEJWAfeW4al4QYxt2Wxrk2k6vY\r\nL7kYgiTHveqducwh4UIVIsbBtIrUonhfgL1TW+18PkYm9lJpotNatAjaKRPM\r\nTQS/JZInZHWZde1KvBCfaVoKYsX4Li6dnJTQMy8OxYQMMHHDcFARWxKwdHKJ\r\n/CDKVBRAZp8isUjFU9RUVTHnjPtC5GOzPJfiFmPAmx97XgvgO1ptunBO2EGz\r\nw0bDCAOh+moXitVthrcFWHrjKBtZU7ukwhhxIXIBbEnEjlIUatPy+1VSERhT\r\nKIz6z8lqvxEy2Q84YeraYbGYEKqn90ulgLmA9LHdSN+yijisW42QjtgO/J9+\r\n45wWA/rAWTHxEnubw0gq+a6QjJkslL3o1CQzcrkIP7cVSSPoPPnLCHBvL5sJ\r\noKeAEYrFkdrzS0Yp4s6IeYGvoq4+xzoAGtsyMJGtcUt/NntIWkGUm7tlQrV0\r\nf8/JDkgpWwg2UbJASwOOepzuEWVcHEZKAEdRXD62AGWYcOzBE3lMvpOcXMpw\r\nhsCbdppfuVybxHBBfs/y5jN5K/OIs2zrbeARVyNuQ+RWFzt45o34NRpFA+tY\r\n1KSkKlKh2Y870WC2aCvqCdf6/Xem1R8L6Wg=\r\n=RZCq\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","readme":"# mongodb-connection-model [![][workflow_img]][workflow_url] [![][npm_img]][npm_url]\n\n> MongoDB connection model\n\nThe main purpose of the MongoDB connection model is to be a domain model around a MongoDB connection. It encapsulates generating a [Connection String URI](https://docs.mongodb.com/manual/reference/connection-string/) from a group of attributes and parses URI using the [MongoDB Node.JS Driver URI Parser](https://github.com/mongodb-js/mongodb-core/blob/master/lib/uri_parser.js).\n\n## Installation\n\n```\nnpm install --save mongodb-connection-model\n```\n\n## Usage\n\n### Building URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\nconst c = new Connection({ appname: 'My App Name' });\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://localhost:27017/?readPreference=primary&appname=My%20App&ssl=false'\n```\n\n### Parsing URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\n\nConnection.from(\n  'mongodb://someUsername:testPassword@localhost',\n  (error, result) => {\n    console.log(result);\n    >>> `{\n      hosts: [{ host: 'localhost', port: 27017 }],\n      hostname: 'localhost',\n      port: 27017,\n      auth: {\n        username: 'someUsername',\n        password: 'testPassword',\n        db: 'admin'\n      },\n      isSrvRecord: false,\n      authStrategy: 'MONGODB',\n      mongodbUsername: 'someUsername',\n      mongodbPassword: 'testPassword',\n      mongodbDatabaseName: 'admin',\n      extraOptions: {},\n      connectionType: 'NODE_DRIVER',\n      readPreference: 'primary',\n      kerberosCanonicalizeHostname: false,\n      sslMethod: 'NONE',\n      sshTunnel: 'NONE',\n      sshTunnelPort: 22\n    }`\n  }\n);\n```\n\n## Properties\n\nMongoDB connection model is based on Ampersand.js framework and consist of [props](https://ampersandjs.com/docs/#ampersand-state-props) and [derived props](https://ampersandjs.com/docs/#ampersand-state-derived). The props object describes the observable properties that MongoDB connection model gets from the Node.js Driver API.\n\n```javascript\nconst с = new Connection();\nconst props = с.getAttributes({ props: true });\n```\n\n#### See Also\n\n- [URI Generic Syntax](https://tools.ietf.org/html/rfc3986)\n- [URI Options Specification](https://github.com/mongodb/specifications/blob/master/source/uri-options/uri-options.rst)\n\n### General Properties\n\n```javascript\nconst c = new Connection({ isSrvRecord: true });\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ns` | String | A valid [ns][ns] the user can read from | `undefined` |\n| `isSrvRecord` | Boolean | Indicates SRV record | `false` |\n| `auth` | Object | Authentication from driver (username, user, db, password) | `undefined` |\n| `hostname` | String | Hostname of a MongoDB Instance. In case of the replica set the first host and port will be taken | `localhost` |\n| `port` | Number | TCP port of a MongoDB Instance | `27017` |\n| `hosts` | Array | Contains all hosts and ports for replica set | `[{ host: 'localhost', port: 27017 }]` |\n| `extraOptions` | Object | Extra options passed to the node driver as part of `driverOptions` | `{}` |\n| `connectionType` | String | The desired connection type. Possible values: `NODE_DRIVER`, `STITCH_ON_PREM`, `STITCH_ATLAS` | `NODE_DRIVER` |\n| `authStrategy` | String | The desired authentication strategy. Possible values: `NONE`, `MONGODB`, `X509`, `KERBEROS`, `LDAP`, `SCRAM-SHA-256` | `NONE` |\n\n### Connection string options\n\n```javascript\nconst c = new Connection({ appname: 'My App', replicaSet: 'testing' });\n```\n\n#### General connection string options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `replicaSet` | String | Specifies the name of the replica set, if the mongod is a member of a replica set | `undefined` |\n| `connectTimeoutMS` | Number | The time in milliseconds to attempt a connection before timing out | `undefined` |\n| `socketTimeoutMS` | Number | The time in milliseconds to attempt a send or receive on a socket before the attempt times out | `undefined` |\n| `compression` | Object | Object includes compressors and a compression level. The following compressors can be specified: `snappy`, `zlib` (Available in MongoDB 3.6 or greater) | `undefined` |\n\n#### Connection Pool Option\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `maxPoolSize` | Number | The maximum number of connections in the connection pool | `undefined` |\n| `minPoolSize` | Number | The minimum number of connections in the connection pool | `undefined` |\n| `maxIdleTimeMS` | Number | The maximum number of milliseconds that a connection can remain idle in the pool before being removed and closed | `undefined` |\n| `waitQueueMultiple` | Number | A number that the driver multiples the maxPoolSize value to, to provide the maximum number of threads allowed to wait for a connection to become available from the pool | `undefined` |\n| `waitQueueTimeoutMS` | Number | The maximum time in milliseconds that a thread can wait for a connection to become available | `undefined` |\n\n#### Write Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `w` | Number/String | Corresponds to the write concern [w Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-w) | `undefined` |\n| `wTimeoutMS` | Number | Corresponds to the write concern [wtimeout](https://docs.mongodb.com/manual/reference/write-concern/#wc-wtimeout) | `undefined` |\n| `journal` | Boolean | Corresponds to the write concern [j Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-j) | `undefined` |\n\n#### Read Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readConcernLevel` | String | The level of isolation | `undefined` |\n\n#### Read Preference Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readPreference` | String | Specifies the read preferences for this connection. Possible values: `PRIMARY`, `PRIMARY_PREFERRED`, `SECONDARY`, `SECONDARY_PREFERRED`, `NEAREST` | `PRIMARY` |\n| `maxStalenessSeconds` | Number | Specifies, in seconds, how stale a secondary can be before the client stops using it for read operations | `undefined` |\n| `readPreferenceTags` | Object | Default read preference tags for the client | `undefined` |\n\n#### Authentication Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `authSource` | String | Specify the database name associated with the user’s credentials | `undefined` |\n| `authMechanism` | String | Specifies the authentication mechanism that MongoDB will use to authenticate the connection. Possible values: `DEFAULT`, `GSSAPI`, `MONGODB-X509`, `PLAIN`, `SCRAM-SHA-256` | `undefined` |\n| `authMechanismProperties` | Object | Additional options provided for authentication (e.g. to enable hostname canonicalization for GSSAPI) | `undefined` |\n| `gssapiServiceName` | String | Set the Kerberos service name when connecting to Kerberized MongoDB instances | `undefined` |\n| `gssapiServiceRealm` | String | Set the Realm service name | `undefined` |\n| `gssapiCanonicalizeHostName` | Boolean | Whether canonicalized hostname | `undefined` |\n\n#### Server Selection and Discovery Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `localThresholdMS` | Number | The size (in milliseconds) of the latency window for selecting among multiple suitable MongoDB instances | `undefined` |\n| `serverSelectionTimeoutMS` | Number | Specifies how long (in milliseconds) to block for server selection before throwing an exception | `undefined` |\n| `serverSelectionTryOnce` | Boolean | Instructs the driver to scan the MongoDB deployment exactly once after server selection fails and then either select a server or raise an error | `undefined` |\n| `heartbeatFrequencyMS` | Number | Controls when the driver checks the state of the MongoDB deployment | `undefined` |\n\n#### Miscellaneous Configuration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `appname` | String | An application name passed to server as client metadata | `undefined` |\n| `retryWrites` | Boolean | Enable retryable writes | `undefined` |\n| `uuidRepresentation` | String | The legacy representation of UUID. Possible values: `standard`, `csharpLegacy`, `javaLegacy`, `pythonLegacy` | `undefined` |\n| `loadBalanced` | Boolean | Whether or not the server is running in load balanced mode | `undefined` |\n\n### Stitch attributes\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `stitchServiceName` | String | Stitch service name | `undefined` |\n| `stitchClientAppId` | String | Stitch сlient app ID | `undefined` |\n| `stitchGroupId` | String | Stitch group ID | `undefined` |\n| `stitchBaseUrl` | String | Stitch base Url | `undefined` |\n\n### MONGODB authentication\n\n```javascript\nconst c = new Connection({\n  mongodbUsername: 'arlo',\n  mongodbPassword: 'w@of'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/?slaveOk=true&authSource=admin'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `mongodbUsername` | String | MongoDB username | `undefined` |\n| `mongodbPassword` | String | MongoDB password | `undefined` |\n| `mongodbDatabaseName` | String | The database name associated with the user's credentials | `undefined` |\n| `promoteValues` | Boolean | Whether BSON values should be promoted to their JS type counterparts | `undefined` |\n\n### KERBEROS authentication\n\n```javascript\nconst c = new Connection({\n  kerberosServiceName: 'mongodb',\n  kerberosPrincipal: 'arlo/dog@krb5.mongodb.parts',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo%252Fdog%2540krb5.mongodb.parts@localhost:27017/toys?authMechanism=GSSAPI'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n> @note (imlucas): Kerberos on Windows is broken out as it's own state for UX consideration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `kerberosServiceName` | String | Any program or computer you access over a network | `undefined` |\n| `kerberosPrincipal` | String | The format of a typical Kerberos V5 principal is `primary/instance@REALM` | `undefined` |\n| `kerberosCanonicalizeHostname` | Boolean | Whether canonicalized kerberos hostname | `undefined` |\n\n#### See Also\n\n- [node.js driver Kerberos reference](http://bit.ly/mongodb-node-driver-kerberos)\n- [node.js driver Kerberos functional test][kerberos-functional]\n\n### LDAP authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  ldapUsername: 'arlo',\n  ldapPassword: 'w@of',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/toys?slaveOk=true&authMechanism=PLAIN'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ldapUsername` | String | LDAP username | `undefined` |\n| `ldapPassword` | String | LDAP password | `undefined` |\n\n#### See Also\n\n- [node.js driver LDAP reference](http://bit.ly/mongodb-node-driver-ldap)\n- [node.js driver X509 functional test][ldap-functional]\n\n### X509 authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  x509Username: 'CN=client,OU=arlo,O=MongoDB,L=Philadelphia,ST=Pennsylvania,C=US'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://CN%253Dclient%252COU%253Darlo%252CO%253DMongoDB%252CL%253DPhiladelphia%252CST%253DPennsylvania%252CC%253DUS@localhost:27017?slaveOk=true&authMechanism=MONGODB-X509'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `x509Username` | String | The x.509 certificate derived user name, e.g. `CN=user,OU=OrgUnit,O=myOrg,...` | `undefined` |\n\n#### See Also\n\n- [node.js driver X509 reference](http://bit.ly/mongodb-node-driver-x509)\n- [node.js driver X509 functional test][x509-functional]\n\n### SSL\n\n> **Note**: Not to be confused with `authentication=X509`\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ssl` | Number/String | A boolean to enable or disables TLS/SSL for the connection | `undefined` |\n| `sslMethod` | String | The desired ssl method. Possible values: `NONE`, `SYSTEMCA`, `IFAVAILABLE`, `UNVALIDATED`, `SERVER`, `ALL` | `NONE` |\n| `sslCA` | Buffer/String | Array of valid certificates | `undefined` |\n| `sslCert` | Buffer/String | The certificate | `undefined` |\n| `sslKey` | Buffer/String | The certificate private key | `undefined` |\n| `sslPass` | Buffer/String | The certificate password | `undefined` |\n\nDescription of `sslMethod` values:\n\n- `SYSTEMCA` - SSL required, validate using System CA, with host verification.\n- `IFAVAILABLE` - The driver should try SSL first, fall back to no SSL if unavailable, and use the system's Certificate Authority.\n- `SERVER` - The driver should validate the server certificate and fail to connect if validation fails. See also [node.js driver \"Validate Server Certificate\" docs][driver-ssl-server].\n- `ALL` - The driver must present a valid certificate and validate the server certificate. See also [node.js driver \"Validate Server Certificate and Present Valid Certificate\" docs][driver-ssl-all].\n- `NONE` - No SSL (Not recommended).\n- `UNVALIDATED` - Use SSL but do not perform any validation of the certificate chain. See also [node.js driver \"No Certificate Validation\" docs][driver-ssl-none]. **Very** not recommended and likely to be deprecated in future releases because it exposes potential Man-In-The-Middle attack vectors.\n\n#### See also\n\n- [node.js driver SSL implementation][driver-ssl-impl]\n- [node.js driver SSL tutorial][driver-ssl-tutorial]\n\n### SSH TUNNEL\n\n> New in mongodb-connection-model@5.0.0\n\nBecause [authentication](#authentication) is quite difficult for operators to migrate to, the most common method of securing a MongoDB deployment is to use an [SSH tunnel][sf-ssh-tunnel].  This allows operators to leverage their existing SSH security infrastructure to also provide secure access to MongoDB.  For a standard deployment of MongoDB on AWS, this is almost always to strategy.  Because of this, we now support creating SSH tunnels automatically when connecting to MongoDB.\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options, (connectionError, client) => {\n  if (connectionError) {\n    return console.log(connectionError);\n  }\n\n  client.db('mongodb').collection('fanclub').count((countingError, count) => {\n    console.log('counted:', countingError, count);\n    client.close();\n  });\n});\n```\n\nThe above provides the same functionality as creating the tunnel using the bash\ncommand below and connecting to MongoDB via another terminal. Notice that\nconnection-model uses a random local port each time it creates a tunnel.\nUsing the command line, you'd have to replace `<random port>` with an actual\nport number.\n\n```bash\nssh -i ~/.ssh/my-key-aws-pair.pem -L <random port>:localhost:27017 ubuntu@ec2-11-111-111-111.compute-1.amazonaws.com\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `sshTunnel` | String | The desired SSH tunnel strategy. Possible values: `NONE`, `USER_PASSWORD`, `IDENTITY_FILE` | `undefined` |\n| `sshTunnelHostname` | String | The hostname of the SSH remote host | `undefined` |\n| `sshTunnelPort` | Port | The SSH port of the remote host | `22` |\n| `sshTunnelBindToLocalPort` | Port | Bind the localhost endpoint of the SSH Tunnel to this port | `undefined` |\n| `sshTunnelUsername` | String | The optional SSH username for the remote host | `undefined` |\n| `sshTunnelPassword` | String | The optional SSH password for the remote host | `undefined` |\n| `sshTunnelIdentityFile` | String/Array | The optional path to the SSH identity file for the remote host | `undefined` |\n| `sshTunnelPassphrase` | String | The optional passphrase for `sshTunnelIdentityFile` | `undefined` |\n\nDescription of `sshTunnel` values:\n\n- `NONE` - Do not use SSH tunneling.\n- `USER_PASSWORD` - The tunnel is created with SSH username and password only.\n- `IDENTITY_FILE` - The tunnel is created using an identity file.\n\n## Derived Properties\n\nDerived properties (also known as computed properties) are properties of the state object that depend on other properties to determine their value.\n\n```javascript\nconst c = new Connection();\nconst derivedProps = c.getAttributes({ derived: true });\n```\n\n| Derived Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `instanceId` | String | The mongoscope | `localhost:27017` |\n| `driverAuthMechanism` | String | Converts the value of `authStrategy` for humans into the `authMechanism` value for the driver | `undefined` |\n| `safeUrl` | String | The URL where a password is replaced with stars | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrl` | String | Use this URL in order to connect via DataService | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrlWithSsh` | String | Use this URL in order to connect via connection model itself | `mongodb://localhost:29201/?readPreference=primary&ssl=false` |\n| `driverOptions` | String | The second argument `mongoscope-server` passes to `mongodb.connect` | `{}` |\n\n## Events\n\n> New in mongodb-connection-model@5.0.0\n\n#### Example: SSH Tunnel\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', skipped: true,\n  reason: 'The selected SSL mode does not need to load any files.' }\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', complete: true}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n#### Example: SSL\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  ssl: 'ALL',\n  sslCA: '~/.ssl/my-ca.pem',\n  sslCert: '~/.ssl/my-server.pem',\n  sslKey: '~/.ssl/my-server.pem'\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', complete: true}\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', skipped: true,\n  reason: 'The selected SSH Tunnel mode is NONE.'}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n[workflow_img]: https://github.com/mongodb-js/connection-model/workflows/Check%20and%20Test/badge.svg?event=push\n[workflow_url]: https://github.com/mongodb-js/connection-model/actions?query=workflow%3A%22Check+and+Test%22\n[npm_img]: https://img.shields.io/npm/v/mongodb-connection-model.svg?style=flat-square\n[npm_url]: https://www.npmjs.org/package/mongodb-connection-model\n[gitter_img]: https://badges.gitter.im/Join%20Chat.svg\n[gitter_url]: http://gitter.im/mongodb-js/mongodb-js\n[enterprise_img]: https://img.shields.io/badge/MongoDB-Enterprise-blue.svg?style=flat-square\n[coming_soon_img]: https://img.shields.io/badge/-Coming%20Soon-ff69b4.svg?style=flat-square\n[kerberos-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/kerberos_tests.js\n[ldap-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ldap_tests.js\n[x509-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ssl_x509_tests.js\n[ns]: https://github.com/mongodb-js/ns\n[sf-ssh-tunnel]: http://serverfault.com/questions/597765/how-to-connect-to-mongodb-server-via-ssh-tunnel\n[ec2-key-pairs]: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html\n[driver-ssl-impl]: https://github.com/christkv/mongodb-core/blob/c3d21cb636d74d7a68134ecd3b9f6af536311279/lib/connection/connection.js#L365-L407\n[driver-ssl-tutorial]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/\n[driver-ssl-none]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#no-certificate-validation\n[driver-ssl-server]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate\n[driver-ssl-all]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate-and-present-valid-certificate\n","gitHead":"f8695ae3010acc2686c0a530f153ebb01ddb040a","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","test":"mocha","check":"npm run lint && npm run depcheck","pretest":"mongodb-runner install && mongodb-runner start --port=27018","test-ci":"npm run test","depcheck":"depcheck","posttest":"mongodb-runner stop --port=27018","posttest-ci":"node ../../scripts/killall-mongo.js","test-check-ci":"npm run check && npm test"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.17.0+x64 (linux)","description":"MongoDB connection model","directories":{},"_nodeVersion":"16.17.0","compass:main":"index.js","dependencies":{"raf":"^3.4.1","debug":"^4.2.0","lodash":"^4.17.15","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.2.0","storage-mixin":"0.0.0-next-f8695ae3010acc2686c0a530f153ebb01ddb040a","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.2","@mongodb-js/ssh-tunnel":"0.0.0-next-f8695ae3010acc2686c0a530f153ebb01ddb040a","@mongodb-js/compass-utils":"0.0.0-next-f8695ae3010acc2686c0a530f153ebb01ddb040a","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.6.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^10.2.0","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"^5.1.0","depcheck":"^1.4.1","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.10.0","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^5.1.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_0.0.0-next-f8695ae3010acc2686c0a530f153ebb01ddb040a_1682587157657_0.8392897220514464","host":"s3://npm-registry-packages"}},"0.0.0-next-5965a9bfaeadf7fcf283dfd3fe19aa58f68c5c1c":{"name":"mongodb-connection-model","version":"0.0.0-next-5965a9bfaeadf7fcf283dfd3fe19aa58f68c5c1c","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@0.0.0-next-5965a9bfaeadf7fcf283dfd3fe19aa58f68c5c1c","maintainers":[{"name":"mongo-j","email":"james.wang@mongodb.com"},{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satya@mongodb.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"iteng@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"50915afa5ad786f44c0004de8d7d8ce9c12849c9","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-0.0.0-next-5965a9bfaeadf7fcf283dfd3fe19aa58f68c5c1c.tgz","fileCount":20,"integrity":"sha512-enHiTtdiLzePbeyZsOCnXe0j0IxPCKttVukgEkOSp8eJL+8LIHqmDHOfc6OLkTmxWYL+lY/0W8RdkxKCC39t4Q==","signatures":[{"sig":"MEUCIDQWPzogmCS7pkixSDTGWZnxBOHTXT1bCJPegxIbGdQgAiEAk+z530mbikKAkXDxYJyk3eZz5dL2yxyLgCq0os3UzPs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":108119,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkSuzxACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpu3hAAh2+hoTm4mYhPsPKVPUdYCpH/t9B2wl2nFlKb+jlQ1gsTTmXO\r\nPzFkJScqY6nC2/cSEB9Hn1liTotK56QgM78K1XiQ+MztlnIHI3fqcR3sJhcu\r\nNc6/tz+bvbcPvwYhbVelWGO9K2qnvUpnqiqaIh/8hO2Q1p2sF3pzkZWnn2xC\r\nOM9sgNK/jCCqN27WZDN75Jmi9juZDTusuMkASqmTbsxNSjKmKM0u1h41zsim\r\n5mFvPUHBWALy2JEsyWt2NAaTWkOX3nSk94U74o0kW79IkbTjoOWy7BhmDe09\r\nFxnpmAQO9XBfmscARmv2PtIwrPo7V+9YMf6pRZnNv0v8c8c0lDyIi4iLihGQ\r\nE9OTzZW1PwSDRsPLulz3A+rxZ3myEl+3sCI8jnYJLjgzs50RS4dheilJJaep\r\nUpXA5sM4NOzDCNmUjmk8+9c8b+V63fbZ51WAnnbHdJPNYMsiVQwOA9HM3HRy\r\nRjCGWWq7fYbR0UM9QgXaLsggzMzOt5Cly4YzE2dX/LeZl9OiIqKi5ALptX7B\r\nFEbdBjY1vQJMUkO5SOxCRLZYL05QpZBsjKoqypHFDKsu3Fgnki2xVUxF7sgu\r\n0dgJbCC7YAtHxNDNTmOSLH2mkHqwggUICyQjK2PVQ+ppxO7ePK+C9s5PQfto\r\nrNalTHxzbKtLnfSabXbxV78sz2gJ8pkAXyY=\r\n=2CED\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","readme":"# mongodb-connection-model [![][workflow_img]][workflow_url] [![][npm_img]][npm_url]\n\n> MongoDB connection model\n\nThe main purpose of the MongoDB connection model is to be a domain model around a MongoDB connection. It encapsulates generating a [Connection String URI](https://docs.mongodb.com/manual/reference/connection-string/) from a group of attributes and parses URI using the [MongoDB Node.JS Driver URI Parser](https://github.com/mongodb-js/mongodb-core/blob/master/lib/uri_parser.js).\n\n## Installation\n\n```\nnpm install --save mongodb-connection-model\n```\n\n## Usage\n\n### Building URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\nconst c = new Connection({ appname: 'My App Name' });\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://localhost:27017/?readPreference=primary&appname=My%20App&ssl=false'\n```\n\n### Parsing URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\n\nConnection.from(\n  'mongodb://someUsername:testPassword@localhost',\n  (error, result) => {\n    console.log(result);\n    >>> `{\n      hosts: [{ host: 'localhost', port: 27017 }],\n      hostname: 'localhost',\n      port: 27017,\n      auth: {\n        username: 'someUsername',\n        password: 'testPassword',\n        db: 'admin'\n      },\n      isSrvRecord: false,\n      authStrategy: 'MONGODB',\n      mongodbUsername: 'someUsername',\n      mongodbPassword: 'testPassword',\n      mongodbDatabaseName: 'admin',\n      extraOptions: {},\n      connectionType: 'NODE_DRIVER',\n      readPreference: 'primary',\n      kerberosCanonicalizeHostname: false,\n      sslMethod: 'NONE',\n      sshTunnel: 'NONE',\n      sshTunnelPort: 22\n    }`\n  }\n);\n```\n\n## Properties\n\nMongoDB connection model is based on Ampersand.js framework and consist of [props](https://ampersandjs.com/docs/#ampersand-state-props) and [derived props](https://ampersandjs.com/docs/#ampersand-state-derived). The props object describes the observable properties that MongoDB connection model gets from the Node.js Driver API.\n\n```javascript\nconst с = new Connection();\nconst props = с.getAttributes({ props: true });\n```\n\n#### See Also\n\n- [URI Generic Syntax](https://tools.ietf.org/html/rfc3986)\n- [URI Options Specification](https://github.com/mongodb/specifications/blob/master/source/uri-options/uri-options.rst)\n\n### General Properties\n\n```javascript\nconst c = new Connection({ isSrvRecord: true });\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ns` | String | A valid [ns][ns] the user can read from | `undefined` |\n| `isSrvRecord` | Boolean | Indicates SRV record | `false` |\n| `auth` | Object | Authentication from driver (username, user, db, password) | `undefined` |\n| `hostname` | String | Hostname of a MongoDB Instance. In case of the replica set the first host and port will be taken | `localhost` |\n| `port` | Number | TCP port of a MongoDB Instance | `27017` |\n| `hosts` | Array | Contains all hosts and ports for replica set | `[{ host: 'localhost', port: 27017 }]` |\n| `extraOptions` | Object | Extra options passed to the node driver as part of `driverOptions` | `{}` |\n| `connectionType` | String | The desired connection type. Possible values: `NODE_DRIVER`, `STITCH_ON_PREM`, `STITCH_ATLAS` | `NODE_DRIVER` |\n| `authStrategy` | String | The desired authentication strategy. Possible values: `NONE`, `MONGODB`, `X509`, `KERBEROS`, `LDAP`, `SCRAM-SHA-256` | `NONE` |\n\n### Connection string options\n\n```javascript\nconst c = new Connection({ appname: 'My App', replicaSet: 'testing' });\n```\n\n#### General connection string options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `replicaSet` | String | Specifies the name of the replica set, if the mongod is a member of a replica set | `undefined` |\n| `connectTimeoutMS` | Number | The time in milliseconds to attempt a connection before timing out | `undefined` |\n| `socketTimeoutMS` | Number | The time in milliseconds to attempt a send or receive on a socket before the attempt times out | `undefined` |\n| `compression` | Object | Object includes compressors and a compression level. The following compressors can be specified: `snappy`, `zlib` (Available in MongoDB 3.6 or greater) | `undefined` |\n\n#### Connection Pool Option\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `maxPoolSize` | Number | The maximum number of connections in the connection pool | `undefined` |\n| `minPoolSize` | Number | The minimum number of connections in the connection pool | `undefined` |\n| `maxIdleTimeMS` | Number | The maximum number of milliseconds that a connection can remain idle in the pool before being removed and closed | `undefined` |\n| `waitQueueMultiple` | Number | A number that the driver multiples the maxPoolSize value to, to provide the maximum number of threads allowed to wait for a connection to become available from the pool | `undefined` |\n| `waitQueueTimeoutMS` | Number | The maximum time in milliseconds that a thread can wait for a connection to become available | `undefined` |\n\n#### Write Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `w` | Number/String | Corresponds to the write concern [w Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-w) | `undefined` |\n| `wTimeoutMS` | Number | Corresponds to the write concern [wtimeout](https://docs.mongodb.com/manual/reference/write-concern/#wc-wtimeout) | `undefined` |\n| `journal` | Boolean | Corresponds to the write concern [j Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-j) | `undefined` |\n\n#### Read Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readConcernLevel` | String | The level of isolation | `undefined` |\n\n#### Read Preference Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readPreference` | String | Specifies the read preferences for this connection. Possible values: `PRIMARY`, `PRIMARY_PREFERRED`, `SECONDARY`, `SECONDARY_PREFERRED`, `NEAREST` | `PRIMARY` |\n| `maxStalenessSeconds` | Number | Specifies, in seconds, how stale a secondary can be before the client stops using it for read operations | `undefined` |\n| `readPreferenceTags` | Object | Default read preference tags for the client | `undefined` |\n\n#### Authentication Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `authSource` | String | Specify the database name associated with the user’s credentials | `undefined` |\n| `authMechanism` | String | Specifies the authentication mechanism that MongoDB will use to authenticate the connection. Possible values: `DEFAULT`, `GSSAPI`, `MONGODB-X509`, `PLAIN`, `SCRAM-SHA-256` | `undefined` |\n| `authMechanismProperties` | Object | Additional options provided for authentication (e.g. to enable hostname canonicalization for GSSAPI) | `undefined` |\n| `gssapiServiceName` | String | Set the Kerberos service name when connecting to Kerberized MongoDB instances | `undefined` |\n| `gssapiServiceRealm` | String | Set the Realm service name | `undefined` |\n| `gssapiCanonicalizeHostName` | Boolean | Whether canonicalized hostname | `undefined` |\n\n#### Server Selection and Discovery Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `localThresholdMS` | Number | The size (in milliseconds) of the latency window for selecting among multiple suitable MongoDB instances | `undefined` |\n| `serverSelectionTimeoutMS` | Number | Specifies how long (in milliseconds) to block for server selection before throwing an exception | `undefined` |\n| `serverSelectionTryOnce` | Boolean | Instructs the driver to scan the MongoDB deployment exactly once after server selection fails and then either select a server or raise an error | `undefined` |\n| `heartbeatFrequencyMS` | Number | Controls when the driver checks the state of the MongoDB deployment | `undefined` |\n\n#### Miscellaneous Configuration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `appname` | String | An application name passed to server as client metadata | `undefined` |\n| `retryWrites` | Boolean | Enable retryable writes | `undefined` |\n| `uuidRepresentation` | String | The legacy representation of UUID. Possible values: `standard`, `csharpLegacy`, `javaLegacy`, `pythonLegacy` | `undefined` |\n| `loadBalanced` | Boolean | Whether or not the server is running in load balanced mode | `undefined` |\n\n### Stitch attributes\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `stitchServiceName` | String | Stitch service name | `undefined` |\n| `stitchClientAppId` | String | Stitch сlient app ID | `undefined` |\n| `stitchGroupId` | String | Stitch group ID | `undefined` |\n| `stitchBaseUrl` | String | Stitch base Url | `undefined` |\n\n### MONGODB authentication\n\n```javascript\nconst c = new Connection({\n  mongodbUsername: 'arlo',\n  mongodbPassword: 'w@of'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/?slaveOk=true&authSource=admin'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `mongodbUsername` | String | MongoDB username | `undefined` |\n| `mongodbPassword` | String | MongoDB password | `undefined` |\n| `mongodbDatabaseName` | String | The database name associated with the user's credentials | `undefined` |\n| `promoteValues` | Boolean | Whether BSON values should be promoted to their JS type counterparts | `undefined` |\n\n### KERBEROS authentication\n\n```javascript\nconst c = new Connection({\n  kerberosServiceName: 'mongodb',\n  kerberosPrincipal: 'arlo/dog@krb5.mongodb.parts',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo%252Fdog%2540krb5.mongodb.parts@localhost:27017/toys?authMechanism=GSSAPI'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n> @note (imlucas): Kerberos on Windows is broken out as it's own state for UX consideration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `kerberosServiceName` | String | Any program or computer you access over a network | `undefined` |\n| `kerberosPrincipal` | String | The format of a typical Kerberos V5 principal is `primary/instance@REALM` | `undefined` |\n| `kerberosCanonicalizeHostname` | Boolean | Whether canonicalized kerberos hostname | `undefined` |\n\n#### See Also\n\n- [node.js driver Kerberos reference](http://bit.ly/mongodb-node-driver-kerberos)\n- [node.js driver Kerberos functional test][kerberos-functional]\n\n### LDAP authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  ldapUsername: 'arlo',\n  ldapPassword: 'w@of',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/toys?slaveOk=true&authMechanism=PLAIN'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ldapUsername` | String | LDAP username | `undefined` |\n| `ldapPassword` | String | LDAP password | `undefined` |\n\n#### See Also\n\n- [node.js driver LDAP reference](http://bit.ly/mongodb-node-driver-ldap)\n- [node.js driver X509 functional test][ldap-functional]\n\n### X509 authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  x509Username: 'CN=client,OU=arlo,O=MongoDB,L=Philadelphia,ST=Pennsylvania,C=US'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://CN%253Dclient%252COU%253Darlo%252CO%253DMongoDB%252CL%253DPhiladelphia%252CST%253DPennsylvania%252CC%253DUS@localhost:27017?slaveOk=true&authMechanism=MONGODB-X509'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `x509Username` | String | The x.509 certificate derived user name, e.g. `CN=user,OU=OrgUnit,O=myOrg,...` | `undefined` |\n\n#### See Also\n\n- [node.js driver X509 reference](http://bit.ly/mongodb-node-driver-x509)\n- [node.js driver X509 functional test][x509-functional]\n\n### SSL\n\n> **Note**: Not to be confused with `authentication=X509`\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ssl` | Number/String | A boolean to enable or disables TLS/SSL for the connection | `undefined` |\n| `sslMethod` | String | The desired ssl method. Possible values: `NONE`, `SYSTEMCA`, `IFAVAILABLE`, `UNVALIDATED`, `SERVER`, `ALL` | `NONE` |\n| `sslCA` | Buffer/String | Array of valid certificates | `undefined` |\n| `sslCert` | Buffer/String | The certificate | `undefined` |\n| `sslKey` | Buffer/String | The certificate private key | `undefined` |\n| `sslPass` | Buffer/String | The certificate password | `undefined` |\n\nDescription of `sslMethod` values:\n\n- `SYSTEMCA` - SSL required, validate using System CA, with host verification.\n- `IFAVAILABLE` - The driver should try SSL first, fall back to no SSL if unavailable, and use the system's Certificate Authority.\n- `SERVER` - The driver should validate the server certificate and fail to connect if validation fails. See also [node.js driver \"Validate Server Certificate\" docs][driver-ssl-server].\n- `ALL` - The driver must present a valid certificate and validate the server certificate. See also [node.js driver \"Validate Server Certificate and Present Valid Certificate\" docs][driver-ssl-all].\n- `NONE` - No SSL (Not recommended).\n- `UNVALIDATED` - Use SSL but do not perform any validation of the certificate chain. See also [node.js driver \"No Certificate Validation\" docs][driver-ssl-none]. **Very** not recommended and likely to be deprecated in future releases because it exposes potential Man-In-The-Middle attack vectors.\n\n#### See also\n\n- [node.js driver SSL implementation][driver-ssl-impl]\n- [node.js driver SSL tutorial][driver-ssl-tutorial]\n\n### SSH TUNNEL\n\n> New in mongodb-connection-model@5.0.0\n\nBecause [authentication](#authentication) is quite difficult for operators to migrate to, the most common method of securing a MongoDB deployment is to use an [SSH tunnel][sf-ssh-tunnel].  This allows operators to leverage their existing SSH security infrastructure to also provide secure access to MongoDB.  For a standard deployment of MongoDB on AWS, this is almost always to strategy.  Because of this, we now support creating SSH tunnels automatically when connecting to MongoDB.\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options, (connectionError, client) => {\n  if (connectionError) {\n    return console.log(connectionError);\n  }\n\n  client.db('mongodb').collection('fanclub').count((countingError, count) => {\n    console.log('counted:', countingError, count);\n    client.close();\n  });\n});\n```\n\nThe above provides the same functionality as creating the tunnel using the bash\ncommand below and connecting to MongoDB via another terminal. Notice that\nconnection-model uses a random local port each time it creates a tunnel.\nUsing the command line, you'd have to replace `<random port>` with an actual\nport number.\n\n```bash\nssh -i ~/.ssh/my-key-aws-pair.pem -L <random port>:localhost:27017 ubuntu@ec2-11-111-111-111.compute-1.amazonaws.com\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `sshTunnel` | String | The desired SSH tunnel strategy. Possible values: `NONE`, `USER_PASSWORD`, `IDENTITY_FILE` | `undefined` |\n| `sshTunnelHostname` | String | The hostname of the SSH remote host | `undefined` |\n| `sshTunnelPort` | Port | The SSH port of the remote host | `22` |\n| `sshTunnelBindToLocalPort` | Port | Bind the localhost endpoint of the SSH Tunnel to this port | `undefined` |\n| `sshTunnelUsername` | String | The optional SSH username for the remote host | `undefined` |\n| `sshTunnelPassword` | String | The optional SSH password for the remote host | `undefined` |\n| `sshTunnelIdentityFile` | String/Array | The optional path to the SSH identity file for the remote host | `undefined` |\n| `sshTunnelPassphrase` | String | The optional passphrase for `sshTunnelIdentityFile` | `undefined` |\n\nDescription of `sshTunnel` values:\n\n- `NONE` - Do not use SSH tunneling.\n- `USER_PASSWORD` - The tunnel is created with SSH username and password only.\n- `IDENTITY_FILE` - The tunnel is created using an identity file.\n\n## Derived Properties\n\nDerived properties (also known as computed properties) are properties of the state object that depend on other properties to determine their value.\n\n```javascript\nconst c = new Connection();\nconst derivedProps = c.getAttributes({ derived: true });\n```\n\n| Derived Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `instanceId` | String | The mongoscope | `localhost:27017` |\n| `driverAuthMechanism` | String | Converts the value of `authStrategy` for humans into the `authMechanism` value for the driver | `undefined` |\n| `safeUrl` | String | The URL where a password is replaced with stars | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrl` | String | Use this URL in order to connect via DataService | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrlWithSsh` | String | Use this URL in order to connect via connection model itself | `mongodb://localhost:29201/?readPreference=primary&ssl=false` |\n| `driverOptions` | String | The second argument `mongoscope-server` passes to `mongodb.connect` | `{}` |\n\n## Events\n\n> New in mongodb-connection-model@5.0.0\n\n#### Example: SSH Tunnel\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', skipped: true,\n  reason: 'The selected SSL mode does not need to load any files.' }\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', complete: true}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n#### Example: SSL\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  ssl: 'ALL',\n  sslCA: '~/.ssl/my-ca.pem',\n  sslCert: '~/.ssl/my-server.pem',\n  sslKey: '~/.ssl/my-server.pem'\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', complete: true}\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', skipped: true,\n  reason: 'The selected SSH Tunnel mode is NONE.'}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n[workflow_img]: https://github.com/mongodb-js/connection-model/workflows/Check%20and%20Test/badge.svg?event=push\n[workflow_url]: https://github.com/mongodb-js/connection-model/actions?query=workflow%3A%22Check+and+Test%22\n[npm_img]: https://img.shields.io/npm/v/mongodb-connection-model.svg?style=flat-square\n[npm_url]: https://www.npmjs.org/package/mongodb-connection-model\n[gitter_img]: https://badges.gitter.im/Join%20Chat.svg\n[gitter_url]: http://gitter.im/mongodb-js/mongodb-js\n[enterprise_img]: https://img.shields.io/badge/MongoDB-Enterprise-blue.svg?style=flat-square\n[coming_soon_img]: https://img.shields.io/badge/-Coming%20Soon-ff69b4.svg?style=flat-square\n[kerberos-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/kerberos_tests.js\n[ldap-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ldap_tests.js\n[x509-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ssl_x509_tests.js\n[ns]: https://github.com/mongodb-js/ns\n[sf-ssh-tunnel]: http://serverfault.com/questions/597765/how-to-connect-to-mongodb-server-via-ssh-tunnel\n[ec2-key-pairs]: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html\n[driver-ssl-impl]: https://github.com/christkv/mongodb-core/blob/c3d21cb636d74d7a68134ecd3b9f6af536311279/lib/connection/connection.js#L365-L407\n[driver-ssl-tutorial]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/\n[driver-ssl-none]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#no-certificate-validation\n[driver-ssl-server]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate\n[driver-ssl-all]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate-and-present-valid-certificate\n","gitHead":"5965a9bfaeadf7fcf283dfd3fe19aa58f68c5c1c","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","test":"mocha","check":"npm run lint && npm run depcheck","pretest":"mongodb-runner install && mongodb-runner start --port=27018","test-ci":"npm run test","depcheck":"depcheck","posttest":"mongodb-runner stop --port=27018","posttest-ci":"node ../../scripts/killall-mongo.js","test-check-ci":"npm run check && npm test"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.17.0+x64 (linux)","description":"MongoDB connection model","directories":{},"_nodeVersion":"16.17.0","compass:main":"index.js","dependencies":{"raf":"^3.4.1","debug":"^4.2.0","lodash":"^4.17.15","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.2.0","storage-mixin":"0.0.0-next-5965a9bfaeadf7fcf283dfd3fe19aa58f68c5c1c","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.2","@mongodb-js/ssh-tunnel":"0.0.0-next-5965a9bfaeadf7fcf283dfd3fe19aa58f68c5c1c","@mongodb-js/compass-utils":"0.0.0-next-5965a9bfaeadf7fcf283dfd3fe19aa58f68c5c1c","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.6.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^10.2.0","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"^5.1.0","depcheck":"^1.4.1","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.10.0","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^5.1.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_0.0.0-next-5965a9bfaeadf7fcf283dfd3fe19aa58f68c5c1c_1682631921376_0.24471624954543647","host":"s3://npm-registry-packages"}},"0.0.0-next-07a892207f0c33a49a10f047b8e98d59fb1df676":{"name":"mongodb-connection-model","version":"0.0.0-next-07a892207f0c33a49a10f047b8e98d59fb1df676","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@0.0.0-next-07a892207f0c33a49a10f047b8e98d59fb1df676","maintainers":[{"name":"mongo-j","email":"james.wang@mongodb.com"},{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satya@mongodb.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"iteng@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"9bae66317a148bf89eb83a003f978c1f21526372","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-0.0.0-next-07a892207f0c33a49a10f047b8e98d59fb1df676.tgz","fileCount":20,"integrity":"sha512-tW2PmbjK/Makucu4ZMpCOP/oXHUKEAUSR9J0MKgKpVcTHm6Doo+2f2l+U6oWGEREli272xTU0ki4ZrAk4o2aHw==","signatures":[{"sig":"MEUCIQCDRsj/TjrW/pZrI4Br3OcyIRv1RuwSNqsGAExof0m3twIgPNaQ9j6C81IWz5XrF7gXSgVUKDMg3tBl8P/o3nt7Rtc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":108119,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkUflYACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqRxQ/9HqU2n0Jfj6/RytNgdBzKnb6ATRybRP94uhQZ2A1shbNkmfMG\r\nfeIzCYyjB5JSyBJzHRkbTzzpN3M6Q5BKSttAzDI9CsMthAiSMx75p0D8HREd\r\nzhm6yMu3TI+igklr2PusPCIUTmmVwsonXiNnToGpQk5HJllnAPjDomnMzcLR\r\nj6igjVIzFbk0zw8p98u0ie+Oxs7bmFEBsnvpFpOxLqOFipru45A9K+/wVvcy\r\nSBniXnDeRhUIuMjj62vn+UuxgVFbGTa+36sbf+6O0PupYDGoqXWq0hvWrAOj\r\nL379xObO/NSq/VpD6TEJHc0qJF7U6dVQyvakQJEoxB5m1WrCMbCDvhtxbr3Y\r\nE8eT6ljNAqVSL5AeC2H029bRDpQwuWN0PtJpHAPNuOoQRdBBpVOFZRc4QGZl\r\nyKLZLyfvSxAMw/VV6Eyz+F8lKoospROSy4soLoY/URc3KQjV7XgrinKodSOL\r\nL6OyghDtLiqCSeYU8oKxH7lr8aTwgXpO3ywPSgrM8ElaxAZjZ06gvf+Dih6c\r\ndnbNqGRyeAWBmmvcQrxg2I7yHcuQeI5diLa2Xu2Zl3dFeedjha8bK+P5PKkz\r\n/vHmWZNNlyV7fVKtdad6i6Dvev5Ugx3x1XdhTVsogbk9ARwFjm9ebqaH0foV\r\nPGKQCLpAKl0RBgweFVDTW27tikPim74S6wk=\r\n=1e/a\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","readme":"# mongodb-connection-model [![][workflow_img]][workflow_url] [![][npm_img]][npm_url]\n\n> MongoDB connection model\n\nThe main purpose of the MongoDB connection model is to be a domain model around a MongoDB connection. It encapsulates generating a [Connection String URI](https://docs.mongodb.com/manual/reference/connection-string/) from a group of attributes and parses URI using the [MongoDB Node.JS Driver URI Parser](https://github.com/mongodb-js/mongodb-core/blob/master/lib/uri_parser.js).\n\n## Installation\n\n```\nnpm install --save mongodb-connection-model\n```\n\n## Usage\n\n### Building URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\nconst c = new Connection({ appname: 'My App Name' });\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://localhost:27017/?readPreference=primary&appname=My%20App&ssl=false'\n```\n\n### Parsing URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\n\nConnection.from(\n  'mongodb://someUsername:testPassword@localhost',\n  (error, result) => {\n    console.log(result);\n    >>> `{\n      hosts: [{ host: 'localhost', port: 27017 }],\n      hostname: 'localhost',\n      port: 27017,\n      auth: {\n        username: 'someUsername',\n        password: 'testPassword',\n        db: 'admin'\n      },\n      isSrvRecord: false,\n      authStrategy: 'MONGODB',\n      mongodbUsername: 'someUsername',\n      mongodbPassword: 'testPassword',\n      mongodbDatabaseName: 'admin',\n      extraOptions: {},\n      connectionType: 'NODE_DRIVER',\n      readPreference: 'primary',\n      kerberosCanonicalizeHostname: false,\n      sslMethod: 'NONE',\n      sshTunnel: 'NONE',\n      sshTunnelPort: 22\n    }`\n  }\n);\n```\n\n## Properties\n\nMongoDB connection model is based on Ampersand.js framework and consist of [props](https://ampersandjs.com/docs/#ampersand-state-props) and [derived props](https://ampersandjs.com/docs/#ampersand-state-derived). The props object describes the observable properties that MongoDB connection model gets from the Node.js Driver API.\n\n```javascript\nconst с = new Connection();\nconst props = с.getAttributes({ props: true });\n```\n\n#### See Also\n\n- [URI Generic Syntax](https://tools.ietf.org/html/rfc3986)\n- [URI Options Specification](https://github.com/mongodb/specifications/blob/master/source/uri-options/uri-options.rst)\n\n### General Properties\n\n```javascript\nconst c = new Connection({ isSrvRecord: true });\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ns` | String | A valid [ns][ns] the user can read from | `undefined` |\n| `isSrvRecord` | Boolean | Indicates SRV record | `false` |\n| `auth` | Object | Authentication from driver (username, user, db, password) | `undefined` |\n| `hostname` | String | Hostname of a MongoDB Instance. In case of the replica set the first host and port will be taken | `localhost` |\n| `port` | Number | TCP port of a MongoDB Instance | `27017` |\n| `hosts` | Array | Contains all hosts and ports for replica set | `[{ host: 'localhost', port: 27017 }]` |\n| `extraOptions` | Object | Extra options passed to the node driver as part of `driverOptions` | `{}` |\n| `connectionType` | String | The desired connection type. Possible values: `NODE_DRIVER`, `STITCH_ON_PREM`, `STITCH_ATLAS` | `NODE_DRIVER` |\n| `authStrategy` | String | The desired authentication strategy. Possible values: `NONE`, `MONGODB`, `X509`, `KERBEROS`, `LDAP`, `SCRAM-SHA-256` | `NONE` |\n\n### Connection string options\n\n```javascript\nconst c = new Connection({ appname: 'My App', replicaSet: 'testing' });\n```\n\n#### General connection string options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `replicaSet` | String | Specifies the name of the replica set, if the mongod is a member of a replica set | `undefined` |\n| `connectTimeoutMS` | Number | The time in milliseconds to attempt a connection before timing out | `undefined` |\n| `socketTimeoutMS` | Number | The time in milliseconds to attempt a send or receive on a socket before the attempt times out | `undefined` |\n| `compression` | Object | Object includes compressors and a compression level. The following compressors can be specified: `snappy`, `zlib` (Available in MongoDB 3.6 or greater) | `undefined` |\n\n#### Connection Pool Option\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `maxPoolSize` | Number | The maximum number of connections in the connection pool | `undefined` |\n| `minPoolSize` | Number | The minimum number of connections in the connection pool | `undefined` |\n| `maxIdleTimeMS` | Number | The maximum number of milliseconds that a connection can remain idle in the pool before being removed and closed | `undefined` |\n| `waitQueueMultiple` | Number | A number that the driver multiples the maxPoolSize value to, to provide the maximum number of threads allowed to wait for a connection to become available from the pool | `undefined` |\n| `waitQueueTimeoutMS` | Number | The maximum time in milliseconds that a thread can wait for a connection to become available | `undefined` |\n\n#### Write Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `w` | Number/String | Corresponds to the write concern [w Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-w) | `undefined` |\n| `wTimeoutMS` | Number | Corresponds to the write concern [wtimeout](https://docs.mongodb.com/manual/reference/write-concern/#wc-wtimeout) | `undefined` |\n| `journal` | Boolean | Corresponds to the write concern [j Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-j) | `undefined` |\n\n#### Read Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readConcernLevel` | String | The level of isolation | `undefined` |\n\n#### Read Preference Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readPreference` | String | Specifies the read preferences for this connection. Possible values: `PRIMARY`, `PRIMARY_PREFERRED`, `SECONDARY`, `SECONDARY_PREFERRED`, `NEAREST` | `PRIMARY` |\n| `maxStalenessSeconds` | Number | Specifies, in seconds, how stale a secondary can be before the client stops using it for read operations | `undefined` |\n| `readPreferenceTags` | Object | Default read preference tags for the client | `undefined` |\n\n#### Authentication Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `authSource` | String | Specify the database name associated with the user’s credentials | `undefined` |\n| `authMechanism` | String | Specifies the authentication mechanism that MongoDB will use to authenticate the connection. Possible values: `DEFAULT`, `GSSAPI`, `MONGODB-X509`, `PLAIN`, `SCRAM-SHA-256` | `undefined` |\n| `authMechanismProperties` | Object | Additional options provided for authentication (e.g. to enable hostname canonicalization for GSSAPI) | `undefined` |\n| `gssapiServiceName` | String | Set the Kerberos service name when connecting to Kerberized MongoDB instances | `undefined` |\n| `gssapiServiceRealm` | String | Set the Realm service name | `undefined` |\n| `gssapiCanonicalizeHostName` | Boolean | Whether canonicalized hostname | `undefined` |\n\n#### Server Selection and Discovery Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `localThresholdMS` | Number | The size (in milliseconds) of the latency window for selecting among multiple suitable MongoDB instances | `undefined` |\n| `serverSelectionTimeoutMS` | Number | Specifies how long (in milliseconds) to block for server selection before throwing an exception | `undefined` |\n| `serverSelectionTryOnce` | Boolean | Instructs the driver to scan the MongoDB deployment exactly once after server selection fails and then either select a server or raise an error | `undefined` |\n| `heartbeatFrequencyMS` | Number | Controls when the driver checks the state of the MongoDB deployment | `undefined` |\n\n#### Miscellaneous Configuration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `appname` | String | An application name passed to server as client metadata | `undefined` |\n| `retryWrites` | Boolean | Enable retryable writes | `undefined` |\n| `uuidRepresentation` | String | The legacy representation of UUID. Possible values: `standard`, `csharpLegacy`, `javaLegacy`, `pythonLegacy` | `undefined` |\n| `loadBalanced` | Boolean | Whether or not the server is running in load balanced mode | `undefined` |\n\n### Stitch attributes\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `stitchServiceName` | String | Stitch service name | `undefined` |\n| `stitchClientAppId` | String | Stitch сlient app ID | `undefined` |\n| `stitchGroupId` | String | Stitch group ID | `undefined` |\n| `stitchBaseUrl` | String | Stitch base Url | `undefined` |\n\n### MONGODB authentication\n\n```javascript\nconst c = new Connection({\n  mongodbUsername: 'arlo',\n  mongodbPassword: 'w@of'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/?slaveOk=true&authSource=admin'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `mongodbUsername` | String | MongoDB username | `undefined` |\n| `mongodbPassword` | String | MongoDB password | `undefined` |\n| `mongodbDatabaseName` | String | The database name associated with the user's credentials | `undefined` |\n| `promoteValues` | Boolean | Whether BSON values should be promoted to their JS type counterparts | `undefined` |\n\n### KERBEROS authentication\n\n```javascript\nconst c = new Connection({\n  kerberosServiceName: 'mongodb',\n  kerberosPrincipal: 'arlo/dog@krb5.mongodb.parts',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo%252Fdog%2540krb5.mongodb.parts@localhost:27017/toys?authMechanism=GSSAPI'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n> @note (imlucas): Kerberos on Windows is broken out as it's own state for UX consideration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `kerberosServiceName` | String | Any program or computer you access over a network | `undefined` |\n| `kerberosPrincipal` | String | The format of a typical Kerberos V5 principal is `primary/instance@REALM` | `undefined` |\n| `kerberosCanonicalizeHostname` | Boolean | Whether canonicalized kerberos hostname | `undefined` |\n\n#### See Also\n\n- [node.js driver Kerberos reference](http://bit.ly/mongodb-node-driver-kerberos)\n- [node.js driver Kerberos functional test][kerberos-functional]\n\n### LDAP authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  ldapUsername: 'arlo',\n  ldapPassword: 'w@of',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/toys?slaveOk=true&authMechanism=PLAIN'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ldapUsername` | String | LDAP username | `undefined` |\n| `ldapPassword` | String | LDAP password | `undefined` |\n\n#### See Also\n\n- [node.js driver LDAP reference](http://bit.ly/mongodb-node-driver-ldap)\n- [node.js driver X509 functional test][ldap-functional]\n\n### X509 authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  x509Username: 'CN=client,OU=arlo,O=MongoDB,L=Philadelphia,ST=Pennsylvania,C=US'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://CN%253Dclient%252COU%253Darlo%252CO%253DMongoDB%252CL%253DPhiladelphia%252CST%253DPennsylvania%252CC%253DUS@localhost:27017?slaveOk=true&authMechanism=MONGODB-X509'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `x509Username` | String | The x.509 certificate derived user name, e.g. `CN=user,OU=OrgUnit,O=myOrg,...` | `undefined` |\n\n#### See Also\n\n- [node.js driver X509 reference](http://bit.ly/mongodb-node-driver-x509)\n- [node.js driver X509 functional test][x509-functional]\n\n### SSL\n\n> **Note**: Not to be confused with `authentication=X509`\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ssl` | Number/String | A boolean to enable or disables TLS/SSL for the connection | `undefined` |\n| `sslMethod` | String | The desired ssl method. Possible values: `NONE`, `SYSTEMCA`, `IFAVAILABLE`, `UNVALIDATED`, `SERVER`, `ALL` | `NONE` |\n| `sslCA` | Buffer/String | Array of valid certificates | `undefined` |\n| `sslCert` | Buffer/String | The certificate | `undefined` |\n| `sslKey` | Buffer/String | The certificate private key | `undefined` |\n| `sslPass` | Buffer/String | The certificate password | `undefined` |\n\nDescription of `sslMethod` values:\n\n- `SYSTEMCA` - SSL required, validate using System CA, with host verification.\n- `IFAVAILABLE` - The driver should try SSL first, fall back to no SSL if unavailable, and use the system's Certificate Authority.\n- `SERVER` - The driver should validate the server certificate and fail to connect if validation fails. See also [node.js driver \"Validate Server Certificate\" docs][driver-ssl-server].\n- `ALL` - The driver must present a valid certificate and validate the server certificate. See also [node.js driver \"Validate Server Certificate and Present Valid Certificate\" docs][driver-ssl-all].\n- `NONE` - No SSL (Not recommended).\n- `UNVALIDATED` - Use SSL but do not perform any validation of the certificate chain. See also [node.js driver \"No Certificate Validation\" docs][driver-ssl-none]. **Very** not recommended and likely to be deprecated in future releases because it exposes potential Man-In-The-Middle attack vectors.\n\n#### See also\n\n- [node.js driver SSL implementation][driver-ssl-impl]\n- [node.js driver SSL tutorial][driver-ssl-tutorial]\n\n### SSH TUNNEL\n\n> New in mongodb-connection-model@5.0.0\n\nBecause [authentication](#authentication) is quite difficult for operators to migrate to, the most common method of securing a MongoDB deployment is to use an [SSH tunnel][sf-ssh-tunnel].  This allows operators to leverage their existing SSH security infrastructure to also provide secure access to MongoDB.  For a standard deployment of MongoDB on AWS, this is almost always to strategy.  Because of this, we now support creating SSH tunnels automatically when connecting to MongoDB.\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options, (connectionError, client) => {\n  if (connectionError) {\n    return console.log(connectionError);\n  }\n\n  client.db('mongodb').collection('fanclub').count((countingError, count) => {\n    console.log('counted:', countingError, count);\n    client.close();\n  });\n});\n```\n\nThe above provides the same functionality as creating the tunnel using the bash\ncommand below and connecting to MongoDB via another terminal. Notice that\nconnection-model uses a random local port each time it creates a tunnel.\nUsing the command line, you'd have to replace `<random port>` with an actual\nport number.\n\n```bash\nssh -i ~/.ssh/my-key-aws-pair.pem -L <random port>:localhost:27017 ubuntu@ec2-11-111-111-111.compute-1.amazonaws.com\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `sshTunnel` | String | The desired SSH tunnel strategy. Possible values: `NONE`, `USER_PASSWORD`, `IDENTITY_FILE` | `undefined` |\n| `sshTunnelHostname` | String | The hostname of the SSH remote host | `undefined` |\n| `sshTunnelPort` | Port | The SSH port of the remote host | `22` |\n| `sshTunnelBindToLocalPort` | Port | Bind the localhost endpoint of the SSH Tunnel to this port | `undefined` |\n| `sshTunnelUsername` | String | The optional SSH username for the remote host | `undefined` |\n| `sshTunnelPassword` | String | The optional SSH password for the remote host | `undefined` |\n| `sshTunnelIdentityFile` | String/Array | The optional path to the SSH identity file for the remote host | `undefined` |\n| `sshTunnelPassphrase` | String | The optional passphrase for `sshTunnelIdentityFile` | `undefined` |\n\nDescription of `sshTunnel` values:\n\n- `NONE` - Do not use SSH tunneling.\n- `USER_PASSWORD` - The tunnel is created with SSH username and password only.\n- `IDENTITY_FILE` - The tunnel is created using an identity file.\n\n## Derived Properties\n\nDerived properties (also known as computed properties) are properties of the state object that depend on other properties to determine their value.\n\n```javascript\nconst c = new Connection();\nconst derivedProps = c.getAttributes({ derived: true });\n```\n\n| Derived Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `instanceId` | String | The mongoscope | `localhost:27017` |\n| `driverAuthMechanism` | String | Converts the value of `authStrategy` for humans into the `authMechanism` value for the driver | `undefined` |\n| `safeUrl` | String | The URL where a password is replaced with stars | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrl` | String | Use this URL in order to connect via DataService | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrlWithSsh` | String | Use this URL in order to connect via connection model itself | `mongodb://localhost:29201/?readPreference=primary&ssl=false` |\n| `driverOptions` | String | The second argument `mongoscope-server` passes to `mongodb.connect` | `{}` |\n\n## Events\n\n> New in mongodb-connection-model@5.0.0\n\n#### Example: SSH Tunnel\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', skipped: true,\n  reason: 'The selected SSL mode does not need to load any files.' }\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', complete: true}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n#### Example: SSL\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  ssl: 'ALL',\n  sslCA: '~/.ssl/my-ca.pem',\n  sslCert: '~/.ssl/my-server.pem',\n  sslKey: '~/.ssl/my-server.pem'\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', complete: true}\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', skipped: true,\n  reason: 'The selected SSH Tunnel mode is NONE.'}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n[workflow_img]: https://github.com/mongodb-js/connection-model/workflows/Check%20and%20Test/badge.svg?event=push\n[workflow_url]: https://github.com/mongodb-js/connection-model/actions?query=workflow%3A%22Check+and+Test%22\n[npm_img]: https://img.shields.io/npm/v/mongodb-connection-model.svg?style=flat-square\n[npm_url]: https://www.npmjs.org/package/mongodb-connection-model\n[gitter_img]: https://badges.gitter.im/Join%20Chat.svg\n[gitter_url]: http://gitter.im/mongodb-js/mongodb-js\n[enterprise_img]: https://img.shields.io/badge/MongoDB-Enterprise-blue.svg?style=flat-square\n[coming_soon_img]: https://img.shields.io/badge/-Coming%20Soon-ff69b4.svg?style=flat-square\n[kerberos-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/kerberos_tests.js\n[ldap-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ldap_tests.js\n[x509-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ssl_x509_tests.js\n[ns]: https://github.com/mongodb-js/ns\n[sf-ssh-tunnel]: http://serverfault.com/questions/597765/how-to-connect-to-mongodb-server-via-ssh-tunnel\n[ec2-key-pairs]: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html\n[driver-ssl-impl]: https://github.com/christkv/mongodb-core/blob/c3d21cb636d74d7a68134ecd3b9f6af536311279/lib/connection/connection.js#L365-L407\n[driver-ssl-tutorial]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/\n[driver-ssl-none]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#no-certificate-validation\n[driver-ssl-server]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate\n[driver-ssl-all]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate-and-present-valid-certificate\n","gitHead":"07a892207f0c33a49a10f047b8e98d59fb1df676","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","test":"mocha","check":"npm run lint && npm run depcheck","pretest":"mongodb-runner install && mongodb-runner start --port=27018","test-ci":"npm run test","depcheck":"depcheck","posttest":"mongodb-runner stop --port=27018","posttest-ci":"node ../../scripts/killall-mongo.js","test-check-ci":"npm run check && npm test"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.17.0+x64 (linux)","description":"MongoDB connection model","directories":{},"_nodeVersion":"16.17.0","compass:main":"index.js","dependencies":{"raf":"^3.4.1","debug":"^4.2.0","lodash":"^4.17.15","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.2.0","storage-mixin":"0.0.0-next-07a892207f0c33a49a10f047b8e98d59fb1df676","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.2","@mongodb-js/ssh-tunnel":"0.0.0-next-07a892207f0c33a49a10f047b8e98d59fb1df676","@mongodb-js/compass-utils":"0.0.0-next-07a892207f0c33a49a10f047b8e98d59fb1df676","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.6.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^10.2.0","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"^5.1.0","depcheck":"^1.4.1","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.10.0","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^5.1.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_0.0.0-next-07a892207f0c33a49a10f047b8e98d59fb1df676_1683093848218_0.3225382362607925","host":"s3://npm-registry-packages"}},"0.0.0-next-3871489afff599d3c0e5827b05c6cd97787625bb":{"name":"mongodb-connection-model","version":"0.0.0-next-3871489afff599d3c0e5827b05c6cd97787625bb","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@0.0.0-next-3871489afff599d3c0e5827b05c6cd97787625bb","maintainers":[{"name":"mongo-j","email":"james.wang@mongodb.com"},{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satya@mongodb.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"iteng@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"2c070a2181060fd6c0cbeb7a5cba63690297e251","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-0.0.0-next-3871489afff599d3c0e5827b05c6cd97787625bb.tgz","fileCount":20,"integrity":"sha512-UuePJso9NfzIbUePCiT0oKykslqD1ttmlzjwVl/29xw59tmW0dvFwRLUe1xSU6DphZ/kYRD+sEZ81Hmwb9ZexQ==","signatures":[{"sig":"MEQCIAwT9ILaRiim06JMZeyDD+8hEqDTc/FUnIV1GM1vCdF4AiBLqikNxw7d/WI8TDH4JMhXWVeJUPyOhnqxYJJFGMN7UA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":108119,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkUp74ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrZOw//aUcvfXscwXYOUCZ0MBe/rNFOPVke/NOnh3MTBx+riNAxVfJz\r\nWvETQmf+NzyKgrCJeinPbfGAdqFiqE5uxyLJzUu9Oat7KH7dENs7X/fxG0j3\r\np4A2ckD/CTz3EdPgiOpHx6ORkUNY0auAGSn1H+4xy8UFxZH/qrrUVgnn/gCd\r\nSmWgiMAMN6Cmvajn/oVNK4Ym41n28EmW4xl8dPjUWref+4m33IdN06wOD6i2\r\nHpj/BrRHFRCHFxqN1zVtC7eiOcdOCCqLA3x3yMzlKFigGqzUxieHBPuvZTeP\r\nGaYageiGPe4Jp7FblXp6DMSlROK+6xj/AhtbM1RmTijCsT5W910IIUFwoNTm\r\nii2qDC/tqTiX8bdrwJvN2PamnhF91RT+/O7aQ+AoDUDaRMVrrKmzQduNGy4U\r\nZpOBguh3UhW54ztXlrqyCZPrPH+iwTQjlvC7mmCUtZ5pxl1vVJNMBkJU332O\r\niDme76P68K8fPCtpOgYbpOfJp1KyCE88Ph6IQ8OK7hsX23WZaIUdEEdabevo\r\nmsNg0kKdJVs7bHqbljwHJLg0KZh92umckOlje5sBRDHuUHxw7wFZHMzTZyEq\r\ndlnEBTaa98widVC4iDaXYg4COV9XaBhBnUdzsu2mKr3MH/+jeKkRJ/8RYxPb\r\nWjYwe2ig07B4KAdUMjtJi+MzkGp4Ir6F6v4=\r\n=zHNf\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","readme":"# mongodb-connection-model [![][workflow_img]][workflow_url] [![][npm_img]][npm_url]\n\n> MongoDB connection model\n\nThe main purpose of the MongoDB connection model is to be a domain model around a MongoDB connection. It encapsulates generating a [Connection String URI](https://docs.mongodb.com/manual/reference/connection-string/) from a group of attributes and parses URI using the [MongoDB Node.JS Driver URI Parser](https://github.com/mongodb-js/mongodb-core/blob/master/lib/uri_parser.js).\n\n## Installation\n\n```\nnpm install --save mongodb-connection-model\n```\n\n## Usage\n\n### Building URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\nconst c = new Connection({ appname: 'My App Name' });\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://localhost:27017/?readPreference=primary&appname=My%20App&ssl=false'\n```\n\n### Parsing URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\n\nConnection.from(\n  'mongodb://someUsername:testPassword@localhost',\n  (error, result) => {\n    console.log(result);\n    >>> `{\n      hosts: [{ host: 'localhost', port: 27017 }],\n      hostname: 'localhost',\n      port: 27017,\n      auth: {\n        username: 'someUsername',\n        password: 'testPassword',\n        db: 'admin'\n      },\n      isSrvRecord: false,\n      authStrategy: 'MONGODB',\n      mongodbUsername: 'someUsername',\n      mongodbPassword: 'testPassword',\n      mongodbDatabaseName: 'admin',\n      extraOptions: {},\n      connectionType: 'NODE_DRIVER',\n      readPreference: 'primary',\n      kerberosCanonicalizeHostname: false,\n      sslMethod: 'NONE',\n      sshTunnel: 'NONE',\n      sshTunnelPort: 22\n    }`\n  }\n);\n```\n\n## Properties\n\nMongoDB connection model is based on Ampersand.js framework and consist of [props](https://ampersandjs.com/docs/#ampersand-state-props) and [derived props](https://ampersandjs.com/docs/#ampersand-state-derived). The props object describes the observable properties that MongoDB connection model gets from the Node.js Driver API.\n\n```javascript\nconst с = new Connection();\nconst props = с.getAttributes({ props: true });\n```\n\n#### See Also\n\n- [URI Generic Syntax](https://tools.ietf.org/html/rfc3986)\n- [URI Options Specification](https://github.com/mongodb/specifications/blob/master/source/uri-options/uri-options.rst)\n\n### General Properties\n\n```javascript\nconst c = new Connection({ isSrvRecord: true });\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ns` | String | A valid [ns][ns] the user can read from | `undefined` |\n| `isSrvRecord` | Boolean | Indicates SRV record | `false` |\n| `auth` | Object | Authentication from driver (username, user, db, password) | `undefined` |\n| `hostname` | String | Hostname of a MongoDB Instance. In case of the replica set the first host and port will be taken | `localhost` |\n| `port` | Number | TCP port of a MongoDB Instance | `27017` |\n| `hosts` | Array | Contains all hosts and ports for replica set | `[{ host: 'localhost', port: 27017 }]` |\n| `extraOptions` | Object | Extra options passed to the node driver as part of `driverOptions` | `{}` |\n| `connectionType` | String | The desired connection type. Possible values: `NODE_DRIVER`, `STITCH_ON_PREM`, `STITCH_ATLAS` | `NODE_DRIVER` |\n| `authStrategy` | String | The desired authentication strategy. Possible values: `NONE`, `MONGODB`, `X509`, `KERBEROS`, `LDAP`, `SCRAM-SHA-256` | `NONE` |\n\n### Connection string options\n\n```javascript\nconst c = new Connection({ appname: 'My App', replicaSet: 'testing' });\n```\n\n#### General connection string options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `replicaSet` | String | Specifies the name of the replica set, if the mongod is a member of a replica set | `undefined` |\n| `connectTimeoutMS` | Number | The time in milliseconds to attempt a connection before timing out | `undefined` |\n| `socketTimeoutMS` | Number | The time in milliseconds to attempt a send or receive on a socket before the attempt times out | `undefined` |\n| `compression` | Object | Object includes compressors and a compression level. The following compressors can be specified: `snappy`, `zlib` (Available in MongoDB 3.6 or greater) | `undefined` |\n\n#### Connection Pool Option\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `maxPoolSize` | Number | The maximum number of connections in the connection pool | `undefined` |\n| `minPoolSize` | Number | The minimum number of connections in the connection pool | `undefined` |\n| `maxIdleTimeMS` | Number | The maximum number of milliseconds that a connection can remain idle in the pool before being removed and closed | `undefined` |\n| `waitQueueMultiple` | Number | A number that the driver multiples the maxPoolSize value to, to provide the maximum number of threads allowed to wait for a connection to become available from the pool | `undefined` |\n| `waitQueueTimeoutMS` | Number | The maximum time in milliseconds that a thread can wait for a connection to become available | `undefined` |\n\n#### Write Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `w` | Number/String | Corresponds to the write concern [w Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-w) | `undefined` |\n| `wTimeoutMS` | Number | Corresponds to the write concern [wtimeout](https://docs.mongodb.com/manual/reference/write-concern/#wc-wtimeout) | `undefined` |\n| `journal` | Boolean | Corresponds to the write concern [j Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-j) | `undefined` |\n\n#### Read Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readConcernLevel` | String | The level of isolation | `undefined` |\n\n#### Read Preference Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readPreference` | String | Specifies the read preferences for this connection. Possible values: `PRIMARY`, `PRIMARY_PREFERRED`, `SECONDARY`, `SECONDARY_PREFERRED`, `NEAREST` | `PRIMARY` |\n| `maxStalenessSeconds` | Number | Specifies, in seconds, how stale a secondary can be before the client stops using it for read operations | `undefined` |\n| `readPreferenceTags` | Object | Default read preference tags for the client | `undefined` |\n\n#### Authentication Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `authSource` | String | Specify the database name associated with the user’s credentials | `undefined` |\n| `authMechanism` | String | Specifies the authentication mechanism that MongoDB will use to authenticate the connection. Possible values: `DEFAULT`, `GSSAPI`, `MONGODB-X509`, `PLAIN`, `SCRAM-SHA-256` | `undefined` |\n| `authMechanismProperties` | Object | Additional options provided for authentication (e.g. to enable hostname canonicalization for GSSAPI) | `undefined` |\n| `gssapiServiceName` | String | Set the Kerberos service name when connecting to Kerberized MongoDB instances | `undefined` |\n| `gssapiServiceRealm` | String | Set the Realm service name | `undefined` |\n| `gssapiCanonicalizeHostName` | Boolean | Whether canonicalized hostname | `undefined` |\n\n#### Server Selection and Discovery Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `localThresholdMS` | Number | The size (in milliseconds) of the latency window for selecting among multiple suitable MongoDB instances | `undefined` |\n| `serverSelectionTimeoutMS` | Number | Specifies how long (in milliseconds) to block for server selection before throwing an exception | `undefined` |\n| `serverSelectionTryOnce` | Boolean | Instructs the driver to scan the MongoDB deployment exactly once after server selection fails and then either select a server or raise an error | `undefined` |\n| `heartbeatFrequencyMS` | Number | Controls when the driver checks the state of the MongoDB deployment | `undefined` |\n\n#### Miscellaneous Configuration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `appname` | String | An application name passed to server as client metadata | `undefined` |\n| `retryWrites` | Boolean | Enable retryable writes | `undefined` |\n| `uuidRepresentation` | String | The legacy representation of UUID. Possible values: `standard`, `csharpLegacy`, `javaLegacy`, `pythonLegacy` | `undefined` |\n| `loadBalanced` | Boolean | Whether or not the server is running in load balanced mode | `undefined` |\n\n### Stitch attributes\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `stitchServiceName` | String | Stitch service name | `undefined` |\n| `stitchClientAppId` | String | Stitch сlient app ID | `undefined` |\n| `stitchGroupId` | String | Stitch group ID | `undefined` |\n| `stitchBaseUrl` | String | Stitch base Url | `undefined` |\n\n### MONGODB authentication\n\n```javascript\nconst c = new Connection({\n  mongodbUsername: 'arlo',\n  mongodbPassword: 'w@of'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/?slaveOk=true&authSource=admin'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `mongodbUsername` | String | MongoDB username | `undefined` |\n| `mongodbPassword` | String | MongoDB password | `undefined` |\n| `mongodbDatabaseName` | String | The database name associated with the user's credentials | `undefined` |\n| `promoteValues` | Boolean | Whether BSON values should be promoted to their JS type counterparts | `undefined` |\n\n### KERBEROS authentication\n\n```javascript\nconst c = new Connection({\n  kerberosServiceName: 'mongodb',\n  kerberosPrincipal: 'arlo/dog@krb5.mongodb.parts',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo%252Fdog%2540krb5.mongodb.parts@localhost:27017/toys?authMechanism=GSSAPI'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n> @note (imlucas): Kerberos on Windows is broken out as it's own state for UX consideration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `kerberosServiceName` | String | Any program or computer you access over a network | `undefined` |\n| `kerberosPrincipal` | String | The format of a typical Kerberos V5 principal is `primary/instance@REALM` | `undefined` |\n| `kerberosCanonicalizeHostname` | Boolean | Whether canonicalized kerberos hostname | `undefined` |\n\n#### See Also\n\n- [node.js driver Kerberos reference](http://bit.ly/mongodb-node-driver-kerberos)\n- [node.js driver Kerberos functional test][kerberos-functional]\n\n### LDAP authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  ldapUsername: 'arlo',\n  ldapPassword: 'w@of',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/toys?slaveOk=true&authMechanism=PLAIN'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ldapUsername` | String | LDAP username | `undefined` |\n| `ldapPassword` | String | LDAP password | `undefined` |\n\n#### See Also\n\n- [node.js driver LDAP reference](http://bit.ly/mongodb-node-driver-ldap)\n- [node.js driver X509 functional test][ldap-functional]\n\n### X509 authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  x509Username: 'CN=client,OU=arlo,O=MongoDB,L=Philadelphia,ST=Pennsylvania,C=US'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://CN%253Dclient%252COU%253Darlo%252CO%253DMongoDB%252CL%253DPhiladelphia%252CST%253DPennsylvania%252CC%253DUS@localhost:27017?slaveOk=true&authMechanism=MONGODB-X509'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `x509Username` | String | The x.509 certificate derived user name, e.g. `CN=user,OU=OrgUnit,O=myOrg,...` | `undefined` |\n\n#### See Also\n\n- [node.js driver X509 reference](http://bit.ly/mongodb-node-driver-x509)\n- [node.js driver X509 functional test][x509-functional]\n\n### SSL\n\n> **Note**: Not to be confused with `authentication=X509`\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ssl` | Number/String | A boolean to enable or disables TLS/SSL for the connection | `undefined` |\n| `sslMethod` | String | The desired ssl method. Possible values: `NONE`, `SYSTEMCA`, `IFAVAILABLE`, `UNVALIDATED`, `SERVER`, `ALL` | `NONE` |\n| `sslCA` | Buffer/String | Array of valid certificates | `undefined` |\n| `sslCert` | Buffer/String | The certificate | `undefined` |\n| `sslKey` | Buffer/String | The certificate private key | `undefined` |\n| `sslPass` | Buffer/String | The certificate password | `undefined` |\n\nDescription of `sslMethod` values:\n\n- `SYSTEMCA` - SSL required, validate using System CA, with host verification.\n- `IFAVAILABLE` - The driver should try SSL first, fall back to no SSL if unavailable, and use the system's Certificate Authority.\n- `SERVER` - The driver should validate the server certificate and fail to connect if validation fails. See also [node.js driver \"Validate Server Certificate\" docs][driver-ssl-server].\n- `ALL` - The driver must present a valid certificate and validate the server certificate. See also [node.js driver \"Validate Server Certificate and Present Valid Certificate\" docs][driver-ssl-all].\n- `NONE` - No SSL (Not recommended).\n- `UNVALIDATED` - Use SSL but do not perform any validation of the certificate chain. See also [node.js driver \"No Certificate Validation\" docs][driver-ssl-none]. **Very** not recommended and likely to be deprecated in future releases because it exposes potential Man-In-The-Middle attack vectors.\n\n#### See also\n\n- [node.js driver SSL implementation][driver-ssl-impl]\n- [node.js driver SSL tutorial][driver-ssl-tutorial]\n\n### SSH TUNNEL\n\n> New in mongodb-connection-model@5.0.0\n\nBecause [authentication](#authentication) is quite difficult for operators to migrate to, the most common method of securing a MongoDB deployment is to use an [SSH tunnel][sf-ssh-tunnel].  This allows operators to leverage their existing SSH security infrastructure to also provide secure access to MongoDB.  For a standard deployment of MongoDB on AWS, this is almost always to strategy.  Because of this, we now support creating SSH tunnels automatically when connecting to MongoDB.\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options, (connectionError, client) => {\n  if (connectionError) {\n    return console.log(connectionError);\n  }\n\n  client.db('mongodb').collection('fanclub').count((countingError, count) => {\n    console.log('counted:', countingError, count);\n    client.close();\n  });\n});\n```\n\nThe above provides the same functionality as creating the tunnel using the bash\ncommand below and connecting to MongoDB via another terminal. Notice that\nconnection-model uses a random local port each time it creates a tunnel.\nUsing the command line, you'd have to replace `<random port>` with an actual\nport number.\n\n```bash\nssh -i ~/.ssh/my-key-aws-pair.pem -L <random port>:localhost:27017 ubuntu@ec2-11-111-111-111.compute-1.amazonaws.com\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `sshTunnel` | String | The desired SSH tunnel strategy. Possible values: `NONE`, `USER_PASSWORD`, `IDENTITY_FILE` | `undefined` |\n| `sshTunnelHostname` | String | The hostname of the SSH remote host | `undefined` |\n| `sshTunnelPort` | Port | The SSH port of the remote host | `22` |\n| `sshTunnelBindToLocalPort` | Port | Bind the localhost endpoint of the SSH Tunnel to this port | `undefined` |\n| `sshTunnelUsername` | String | The optional SSH username for the remote host | `undefined` |\n| `sshTunnelPassword` | String | The optional SSH password for the remote host | `undefined` |\n| `sshTunnelIdentityFile` | String/Array | The optional path to the SSH identity file for the remote host | `undefined` |\n| `sshTunnelPassphrase` | String | The optional passphrase for `sshTunnelIdentityFile` | `undefined` |\n\nDescription of `sshTunnel` values:\n\n- `NONE` - Do not use SSH tunneling.\n- `USER_PASSWORD` - The tunnel is created with SSH username and password only.\n- `IDENTITY_FILE` - The tunnel is created using an identity file.\n\n## Derived Properties\n\nDerived properties (also known as computed properties) are properties of the state object that depend on other properties to determine their value.\n\n```javascript\nconst c = new Connection();\nconst derivedProps = c.getAttributes({ derived: true });\n```\n\n| Derived Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `instanceId` | String | The mongoscope | `localhost:27017` |\n| `driverAuthMechanism` | String | Converts the value of `authStrategy` for humans into the `authMechanism` value for the driver | `undefined` |\n| `safeUrl` | String | The URL where a password is replaced with stars | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrl` | String | Use this URL in order to connect via DataService | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrlWithSsh` | String | Use this URL in order to connect via connection model itself | `mongodb://localhost:29201/?readPreference=primary&ssl=false` |\n| `driverOptions` | String | The second argument `mongoscope-server` passes to `mongodb.connect` | `{}` |\n\n## Events\n\n> New in mongodb-connection-model@5.0.0\n\n#### Example: SSH Tunnel\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', skipped: true,\n  reason: 'The selected SSL mode does not need to load any files.' }\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', complete: true}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n#### Example: SSL\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  ssl: 'ALL',\n  sslCA: '~/.ssl/my-ca.pem',\n  sslCert: '~/.ssl/my-server.pem',\n  sslKey: '~/.ssl/my-server.pem'\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', complete: true}\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', skipped: true,\n  reason: 'The selected SSH Tunnel mode is NONE.'}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n[workflow_img]: https://github.com/mongodb-js/connection-model/workflows/Check%20and%20Test/badge.svg?event=push\n[workflow_url]: https://github.com/mongodb-js/connection-model/actions?query=workflow%3A%22Check+and+Test%22\n[npm_img]: https://img.shields.io/npm/v/mongodb-connection-model.svg?style=flat-square\n[npm_url]: https://www.npmjs.org/package/mongodb-connection-model\n[gitter_img]: https://badges.gitter.im/Join%20Chat.svg\n[gitter_url]: http://gitter.im/mongodb-js/mongodb-js\n[enterprise_img]: https://img.shields.io/badge/MongoDB-Enterprise-blue.svg?style=flat-square\n[coming_soon_img]: https://img.shields.io/badge/-Coming%20Soon-ff69b4.svg?style=flat-square\n[kerberos-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/kerberos_tests.js\n[ldap-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ldap_tests.js\n[x509-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ssl_x509_tests.js\n[ns]: https://github.com/mongodb-js/ns\n[sf-ssh-tunnel]: http://serverfault.com/questions/597765/how-to-connect-to-mongodb-server-via-ssh-tunnel\n[ec2-key-pairs]: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html\n[driver-ssl-impl]: https://github.com/christkv/mongodb-core/blob/c3d21cb636d74d7a68134ecd3b9f6af536311279/lib/connection/connection.js#L365-L407\n[driver-ssl-tutorial]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/\n[driver-ssl-none]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#no-certificate-validation\n[driver-ssl-server]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate\n[driver-ssl-all]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate-and-present-valid-certificate\n","gitHead":"3871489afff599d3c0e5827b05c6cd97787625bb","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","test":"mocha","check":"npm run lint && npm run depcheck","pretest":"mongodb-runner install && mongodb-runner start --port=27018","test-ci":"npm run test","depcheck":"depcheck","posttest":"mongodb-runner stop --port=27018","posttest-ci":"node ../../scripts/killall-mongo.js","test-check-ci":"npm run check && npm test"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.17.0+x64 (linux)","description":"MongoDB connection model","directories":{},"_nodeVersion":"16.17.0","compass:main":"index.js","dependencies":{"raf":"^3.4.1","debug":"^4.2.0","lodash":"^4.17.15","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.2.0","storage-mixin":"0.0.0-next-3871489afff599d3c0e5827b05c6cd97787625bb","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.2","@mongodb-js/ssh-tunnel":"0.0.0-next-3871489afff599d3c0e5827b05c6cd97787625bb","@mongodb-js/compass-utils":"0.0.0-next-3871489afff599d3c0e5827b05c6cd97787625bb","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.6.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^10.2.0","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"^5.3.0","depcheck":"^1.4.1","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.10.0","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^5.3.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_0.0.0-next-3871489afff599d3c0e5827b05c6cd97787625bb_1683136248610_0.6520868367462138","host":"s3://npm-registry-packages"}},"0.0.0-next-28d3c6ea9e684b19e4fcfd38c8b4e94fba06844f":{"name":"mongodb-connection-model","version":"0.0.0-next-28d3c6ea9e684b19e4fcfd38c8b4e94fba06844f","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@0.0.0-next-28d3c6ea9e684b19e4fcfd38c8b4e94fba06844f","maintainers":[{"name":"mongo-j","email":"james.wang@mongodb.com"},{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satya@mongodb.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"iteng@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"73416bb30db417eea1998b4bbdcf171b2cabdb88","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-0.0.0-next-28d3c6ea9e684b19e4fcfd38c8b4e94fba06844f.tgz","fileCount":20,"integrity":"sha512-4XJd1ye0jqE2juudERXF7hXeDCYTQg+8RLojo+BgkvAC9mzdm3mNRDuW3H0piet/EiYBnq4uLG6BltnCwb3AXA==","signatures":[{"sig":"MEYCIQC8tDaoXmD+nVBofHt/6tWf32svG4YUMFvRhwSDAQYFDwIhANpnjtzD+zEpxRsnH0qprLJ75vYPX8xSMQKzyFOIIRJB","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":108119,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkU16VACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqpnw/+NuSnGJGXPzbKi04p4jVB4P5XJg41cUa6UaT7oz+N/9HJyVim\r\nrRrIWzlwCbVwx2k+g9f8aTfWhNl541qtb0vzwjH+PyoETfKY+4RxK/IhRjIN\r\naMSyp0tQo517GaxoYplHNxmM69BNdQXOWlWu2J6zbOVpA0uesTJwMiGzu3f/\r\n8Eis8XMEbbAwHZSw74fllN7vQ/8tzLfySZq0ANEpZLbhLqwnIzJGeOH7InC2\r\np95cL/4P3ufGTU/ZBunLy+wt/soVjVTdbXQ11tHk0Yr6M/Q0P8LO9qdfkt+K\r\ns6NffqSEHlWSUPw0g3R/YeQta+sk7lMjfRCj/zULsAaXrRAtpdIebF0vq8Rl\r\nyz3/3Se47Vm0K8kcQ8H/D+z6X8sTTBPKOndxHU6SwCno3qEavRxtmabWQ7GW\r\nBl5Cd4Dk7fbksa4SOtYy6hb5nJaT4EywA7KgCnn7IKH0w0JLXEJzbxz21QnN\r\nypdQwlyknZ0g2V+nmNVIYHTb9cwpMVFL6XL2eGOMSVJDU1ZAtfTvQGojo2Aw\r\nN8cCim4/ROqfgD71751vrHV56KBSTnq00TgqHklURYSe6LFmmAHLtesNmRU3\r\nT75kORGnaXiM6eNSN1NL/8+SOKxJLCEXs4yquSjqNmPQ54Czk7JoHEAadVmH\r\n7PRDgDXOgJCeoNqoFWVNspZvYHZtMlPClYk=\r\n=preX\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","readme":"# mongodb-connection-model [![][workflow_img]][workflow_url] [![][npm_img]][npm_url]\n\n> MongoDB connection model\n\nThe main purpose of the MongoDB connection model is to be a domain model around a MongoDB connection. It encapsulates generating a [Connection String URI](https://docs.mongodb.com/manual/reference/connection-string/) from a group of attributes and parses URI using the [MongoDB Node.JS Driver URI Parser](https://github.com/mongodb-js/mongodb-core/blob/master/lib/uri_parser.js).\n\n## Installation\n\n```\nnpm install --save mongodb-connection-model\n```\n\n## Usage\n\n### Building URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\nconst c = new Connection({ appname: 'My App Name' });\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://localhost:27017/?readPreference=primary&appname=My%20App&ssl=false'\n```\n\n### Parsing URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\n\nConnection.from(\n  'mongodb://someUsername:testPassword@localhost',\n  (error, result) => {\n    console.log(result);\n    >>> `{\n      hosts: [{ host: 'localhost', port: 27017 }],\n      hostname: 'localhost',\n      port: 27017,\n      auth: {\n        username: 'someUsername',\n        password: 'testPassword',\n        db: 'admin'\n      },\n      isSrvRecord: false,\n      authStrategy: 'MONGODB',\n      mongodbUsername: 'someUsername',\n      mongodbPassword: 'testPassword',\n      mongodbDatabaseName: 'admin',\n      extraOptions: {},\n      connectionType: 'NODE_DRIVER',\n      readPreference: 'primary',\n      kerberosCanonicalizeHostname: false,\n      sslMethod: 'NONE',\n      sshTunnel: 'NONE',\n      sshTunnelPort: 22\n    }`\n  }\n);\n```\n\n## Properties\n\nMongoDB connection model is based on Ampersand.js framework and consist of [props](https://ampersandjs.com/docs/#ampersand-state-props) and [derived props](https://ampersandjs.com/docs/#ampersand-state-derived). The props object describes the observable properties that MongoDB connection model gets from the Node.js Driver API.\n\n```javascript\nconst с = new Connection();\nconst props = с.getAttributes({ props: true });\n```\n\n#### See Also\n\n- [URI Generic Syntax](https://tools.ietf.org/html/rfc3986)\n- [URI Options Specification](https://github.com/mongodb/specifications/blob/master/source/uri-options/uri-options.rst)\n\n### General Properties\n\n```javascript\nconst c = new Connection({ isSrvRecord: true });\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ns` | String | A valid [ns][ns] the user can read from | `undefined` |\n| `isSrvRecord` | Boolean | Indicates SRV record | `false` |\n| `auth` | Object | Authentication from driver (username, user, db, password) | `undefined` |\n| `hostname` | String | Hostname of a MongoDB Instance. In case of the replica set the first host and port will be taken | `localhost` |\n| `port` | Number | TCP port of a MongoDB Instance | `27017` |\n| `hosts` | Array | Contains all hosts and ports for replica set | `[{ host: 'localhost', port: 27017 }]` |\n| `extraOptions` | Object | Extra options passed to the node driver as part of `driverOptions` | `{}` |\n| `connectionType` | String | The desired connection type. Possible values: `NODE_DRIVER`, `STITCH_ON_PREM`, `STITCH_ATLAS` | `NODE_DRIVER` |\n| `authStrategy` | String | The desired authentication strategy. Possible values: `NONE`, `MONGODB`, `X509`, `KERBEROS`, `LDAP`, `SCRAM-SHA-256` | `NONE` |\n\n### Connection string options\n\n```javascript\nconst c = new Connection({ appname: 'My App', replicaSet: 'testing' });\n```\n\n#### General connection string options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `replicaSet` | String | Specifies the name of the replica set, if the mongod is a member of a replica set | `undefined` |\n| `connectTimeoutMS` | Number | The time in milliseconds to attempt a connection before timing out | `undefined` |\n| `socketTimeoutMS` | Number | The time in milliseconds to attempt a send or receive on a socket before the attempt times out | `undefined` |\n| `compression` | Object | Object includes compressors and a compression level. The following compressors can be specified: `snappy`, `zlib` (Available in MongoDB 3.6 or greater) | `undefined` |\n\n#### Connection Pool Option\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `maxPoolSize` | Number | The maximum number of connections in the connection pool | `undefined` |\n| `minPoolSize` | Number | The minimum number of connections in the connection pool | `undefined` |\n| `maxIdleTimeMS` | Number | The maximum number of milliseconds that a connection can remain idle in the pool before being removed and closed | `undefined` |\n| `waitQueueMultiple` | Number | A number that the driver multiples the maxPoolSize value to, to provide the maximum number of threads allowed to wait for a connection to become available from the pool | `undefined` |\n| `waitQueueTimeoutMS` | Number | The maximum time in milliseconds that a thread can wait for a connection to become available | `undefined` |\n\n#### Write Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `w` | Number/String | Corresponds to the write concern [w Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-w) | `undefined` |\n| `wTimeoutMS` | Number | Corresponds to the write concern [wtimeout](https://docs.mongodb.com/manual/reference/write-concern/#wc-wtimeout) | `undefined` |\n| `journal` | Boolean | Corresponds to the write concern [j Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-j) | `undefined` |\n\n#### Read Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readConcernLevel` | String | The level of isolation | `undefined` |\n\n#### Read Preference Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readPreference` | String | Specifies the read preferences for this connection. Possible values: `PRIMARY`, `PRIMARY_PREFERRED`, `SECONDARY`, `SECONDARY_PREFERRED`, `NEAREST` | `PRIMARY` |\n| `maxStalenessSeconds` | Number | Specifies, in seconds, how stale a secondary can be before the client stops using it for read operations | `undefined` |\n| `readPreferenceTags` | Object | Default read preference tags for the client | `undefined` |\n\n#### Authentication Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `authSource` | String | Specify the database name associated with the user’s credentials | `undefined` |\n| `authMechanism` | String | Specifies the authentication mechanism that MongoDB will use to authenticate the connection. Possible values: `DEFAULT`, `GSSAPI`, `MONGODB-X509`, `PLAIN`, `SCRAM-SHA-256` | `undefined` |\n| `authMechanismProperties` | Object | Additional options provided for authentication (e.g. to enable hostname canonicalization for GSSAPI) | `undefined` |\n| `gssapiServiceName` | String | Set the Kerberos service name when connecting to Kerberized MongoDB instances | `undefined` |\n| `gssapiServiceRealm` | String | Set the Realm service name | `undefined` |\n| `gssapiCanonicalizeHostName` | Boolean | Whether canonicalized hostname | `undefined` |\n\n#### Server Selection and Discovery Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `localThresholdMS` | Number | The size (in milliseconds) of the latency window for selecting among multiple suitable MongoDB instances | `undefined` |\n| `serverSelectionTimeoutMS` | Number | Specifies how long (in milliseconds) to block for server selection before throwing an exception | `undefined` |\n| `serverSelectionTryOnce` | Boolean | Instructs the driver to scan the MongoDB deployment exactly once after server selection fails and then either select a server or raise an error | `undefined` |\n| `heartbeatFrequencyMS` | Number | Controls when the driver checks the state of the MongoDB deployment | `undefined` |\n\n#### Miscellaneous Configuration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `appname` | String | An application name passed to server as client metadata | `undefined` |\n| `retryWrites` | Boolean | Enable retryable writes | `undefined` |\n| `uuidRepresentation` | String | The legacy representation of UUID. Possible values: `standard`, `csharpLegacy`, `javaLegacy`, `pythonLegacy` | `undefined` |\n| `loadBalanced` | Boolean | Whether or not the server is running in load balanced mode | `undefined` |\n\n### Stitch attributes\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `stitchServiceName` | String | Stitch service name | `undefined` |\n| `stitchClientAppId` | String | Stitch сlient app ID | `undefined` |\n| `stitchGroupId` | String | Stitch group ID | `undefined` |\n| `stitchBaseUrl` | String | Stitch base Url | `undefined` |\n\n### MONGODB authentication\n\n```javascript\nconst c = new Connection({\n  mongodbUsername: 'arlo',\n  mongodbPassword: 'w@of'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/?slaveOk=true&authSource=admin'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `mongodbUsername` | String | MongoDB username | `undefined` |\n| `mongodbPassword` | String | MongoDB password | `undefined` |\n| `mongodbDatabaseName` | String | The database name associated with the user's credentials | `undefined` |\n| `promoteValues` | Boolean | Whether BSON values should be promoted to their JS type counterparts | `undefined` |\n\n### KERBEROS authentication\n\n```javascript\nconst c = new Connection({\n  kerberosServiceName: 'mongodb',\n  kerberosPrincipal: 'arlo/dog@krb5.mongodb.parts',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo%252Fdog%2540krb5.mongodb.parts@localhost:27017/toys?authMechanism=GSSAPI'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n> @note (imlucas): Kerberos on Windows is broken out as it's own state for UX consideration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `kerberosServiceName` | String | Any program or computer you access over a network | `undefined` |\n| `kerberosPrincipal` | String | The format of a typical Kerberos V5 principal is `primary/instance@REALM` | `undefined` |\n| `kerberosCanonicalizeHostname` | Boolean | Whether canonicalized kerberos hostname | `undefined` |\n\n#### See Also\n\n- [node.js driver Kerberos reference](http://bit.ly/mongodb-node-driver-kerberos)\n- [node.js driver Kerberos functional test][kerberos-functional]\n\n### LDAP authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  ldapUsername: 'arlo',\n  ldapPassword: 'w@of',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/toys?slaveOk=true&authMechanism=PLAIN'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ldapUsername` | String | LDAP username | `undefined` |\n| `ldapPassword` | String | LDAP password | `undefined` |\n\n#### See Also\n\n- [node.js driver LDAP reference](http://bit.ly/mongodb-node-driver-ldap)\n- [node.js driver X509 functional test][ldap-functional]\n\n### X509 authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  x509Username: 'CN=client,OU=arlo,O=MongoDB,L=Philadelphia,ST=Pennsylvania,C=US'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://CN%253Dclient%252COU%253Darlo%252CO%253DMongoDB%252CL%253DPhiladelphia%252CST%253DPennsylvania%252CC%253DUS@localhost:27017?slaveOk=true&authMechanism=MONGODB-X509'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `x509Username` | String | The x.509 certificate derived user name, e.g. `CN=user,OU=OrgUnit,O=myOrg,...` | `undefined` |\n\n#### See Also\n\n- [node.js driver X509 reference](http://bit.ly/mongodb-node-driver-x509)\n- [node.js driver X509 functional test][x509-functional]\n\n### SSL\n\n> **Note**: Not to be confused with `authentication=X509`\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ssl` | Number/String | A boolean to enable or disables TLS/SSL for the connection | `undefined` |\n| `sslMethod` | String | The desired ssl method. Possible values: `NONE`, `SYSTEMCA`, `IFAVAILABLE`, `UNVALIDATED`, `SERVER`, `ALL` | `NONE` |\n| `sslCA` | Buffer/String | Array of valid certificates | `undefined` |\n| `sslCert` | Buffer/String | The certificate | `undefined` |\n| `sslKey` | Buffer/String | The certificate private key | `undefined` |\n| `sslPass` | Buffer/String | The certificate password | `undefined` |\n\nDescription of `sslMethod` values:\n\n- `SYSTEMCA` - SSL required, validate using System CA, with host verification.\n- `IFAVAILABLE` - The driver should try SSL first, fall back to no SSL if unavailable, and use the system's Certificate Authority.\n- `SERVER` - The driver should validate the server certificate and fail to connect if validation fails. See also [node.js driver \"Validate Server Certificate\" docs][driver-ssl-server].\n- `ALL` - The driver must present a valid certificate and validate the server certificate. See also [node.js driver \"Validate Server Certificate and Present Valid Certificate\" docs][driver-ssl-all].\n- `NONE` - No SSL (Not recommended).\n- `UNVALIDATED` - Use SSL but do not perform any validation of the certificate chain. See also [node.js driver \"No Certificate Validation\" docs][driver-ssl-none]. **Very** not recommended and likely to be deprecated in future releases because it exposes potential Man-In-The-Middle attack vectors.\n\n#### See also\n\n- [node.js driver SSL implementation][driver-ssl-impl]\n- [node.js driver SSL tutorial][driver-ssl-tutorial]\n\n### SSH TUNNEL\n\n> New in mongodb-connection-model@5.0.0\n\nBecause [authentication](#authentication) is quite difficult for operators to migrate to, the most common method of securing a MongoDB deployment is to use an [SSH tunnel][sf-ssh-tunnel].  This allows operators to leverage their existing SSH security infrastructure to also provide secure access to MongoDB.  For a standard deployment of MongoDB on AWS, this is almost always to strategy.  Because of this, we now support creating SSH tunnels automatically when connecting to MongoDB.\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options, (connectionError, client) => {\n  if (connectionError) {\n    return console.log(connectionError);\n  }\n\n  client.db('mongodb').collection('fanclub').count((countingError, count) => {\n    console.log('counted:', countingError, count);\n    client.close();\n  });\n});\n```\n\nThe above provides the same functionality as creating the tunnel using the bash\ncommand below and connecting to MongoDB via another terminal. Notice that\nconnection-model uses a random local port each time it creates a tunnel.\nUsing the command line, you'd have to replace `<random port>` with an actual\nport number.\n\n```bash\nssh -i ~/.ssh/my-key-aws-pair.pem -L <random port>:localhost:27017 ubuntu@ec2-11-111-111-111.compute-1.amazonaws.com\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `sshTunnel` | String | The desired SSH tunnel strategy. Possible values: `NONE`, `USER_PASSWORD`, `IDENTITY_FILE` | `undefined` |\n| `sshTunnelHostname` | String | The hostname of the SSH remote host | `undefined` |\n| `sshTunnelPort` | Port | The SSH port of the remote host | `22` |\n| `sshTunnelBindToLocalPort` | Port | Bind the localhost endpoint of the SSH Tunnel to this port | `undefined` |\n| `sshTunnelUsername` | String | The optional SSH username for the remote host | `undefined` |\n| `sshTunnelPassword` | String | The optional SSH password for the remote host | `undefined` |\n| `sshTunnelIdentityFile` | String/Array | The optional path to the SSH identity file for the remote host | `undefined` |\n| `sshTunnelPassphrase` | String | The optional passphrase for `sshTunnelIdentityFile` | `undefined` |\n\nDescription of `sshTunnel` values:\n\n- `NONE` - Do not use SSH tunneling.\n- `USER_PASSWORD` - The tunnel is created with SSH username and password only.\n- `IDENTITY_FILE` - The tunnel is created using an identity file.\n\n## Derived Properties\n\nDerived properties (also known as computed properties) are properties of the state object that depend on other properties to determine their value.\n\n```javascript\nconst c = new Connection();\nconst derivedProps = c.getAttributes({ derived: true });\n```\n\n| Derived Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `instanceId` | String | The mongoscope | `localhost:27017` |\n| `driverAuthMechanism` | String | Converts the value of `authStrategy` for humans into the `authMechanism` value for the driver | `undefined` |\n| `safeUrl` | String | The URL where a password is replaced with stars | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrl` | String | Use this URL in order to connect via DataService | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrlWithSsh` | String | Use this URL in order to connect via connection model itself | `mongodb://localhost:29201/?readPreference=primary&ssl=false` |\n| `driverOptions` | String | The second argument `mongoscope-server` passes to `mongodb.connect` | `{}` |\n\n## Events\n\n> New in mongodb-connection-model@5.0.0\n\n#### Example: SSH Tunnel\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', skipped: true,\n  reason: 'The selected SSL mode does not need to load any files.' }\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', complete: true}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n#### Example: SSL\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  ssl: 'ALL',\n  sslCA: '~/.ssl/my-ca.pem',\n  sslCert: '~/.ssl/my-server.pem',\n  sslKey: '~/.ssl/my-server.pem'\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', complete: true}\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', skipped: true,\n  reason: 'The selected SSH Tunnel mode is NONE.'}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n[workflow_img]: https://github.com/mongodb-js/connection-model/workflows/Check%20and%20Test/badge.svg?event=push\n[workflow_url]: https://github.com/mongodb-js/connection-model/actions?query=workflow%3A%22Check+and+Test%22\n[npm_img]: https://img.shields.io/npm/v/mongodb-connection-model.svg?style=flat-square\n[npm_url]: https://www.npmjs.org/package/mongodb-connection-model\n[gitter_img]: https://badges.gitter.im/Join%20Chat.svg\n[gitter_url]: http://gitter.im/mongodb-js/mongodb-js\n[enterprise_img]: https://img.shields.io/badge/MongoDB-Enterprise-blue.svg?style=flat-square\n[coming_soon_img]: https://img.shields.io/badge/-Coming%20Soon-ff69b4.svg?style=flat-square\n[kerberos-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/kerberos_tests.js\n[ldap-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ldap_tests.js\n[x509-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ssl_x509_tests.js\n[ns]: https://github.com/mongodb-js/ns\n[sf-ssh-tunnel]: http://serverfault.com/questions/597765/how-to-connect-to-mongodb-server-via-ssh-tunnel\n[ec2-key-pairs]: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html\n[driver-ssl-impl]: https://github.com/christkv/mongodb-core/blob/c3d21cb636d74d7a68134ecd3b9f6af536311279/lib/connection/connection.js#L365-L407\n[driver-ssl-tutorial]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/\n[driver-ssl-none]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#no-certificate-validation\n[driver-ssl-server]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate\n[driver-ssl-all]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate-and-present-valid-certificate\n","gitHead":"28d3c6ea9e684b19e4fcfd38c8b4e94fba06844f","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","test":"mocha","check":"npm run lint && npm run depcheck","pretest":"mongodb-runner install && mongodb-runner start --port=27018","test-ci":"npm run test","depcheck":"depcheck","posttest":"mongodb-runner stop --port=27018","posttest-ci":"node ../../scripts/killall-mongo.js","test-check-ci":"npm run check && npm test"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.17.0+x64 (linux)","description":"MongoDB connection model","directories":{},"_nodeVersion":"16.17.0","compass:main":"index.js","dependencies":{"raf":"^3.4.1","debug":"^4.2.0","lodash":"^4.17.15","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.2.0","storage-mixin":"0.0.0-next-28d3c6ea9e684b19e4fcfd38c8b4e94fba06844f","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.2","@mongodb-js/ssh-tunnel":"0.0.0-next-28d3c6ea9e684b19e4fcfd38c8b4e94fba06844f","@mongodb-js/compass-utils":"0.0.0-next-28d3c6ea9e684b19e4fcfd38c8b4e94fba06844f","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.6.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","mocha":"^10.2.0","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"^5.3.0","depcheck":"^1.4.1","proxyquire":"^2.1.0","chai-subset":"^1.6.0","mock-require":"^3.0.3","mongodb-runner":"^4.10.0","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^5.3.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_0.0.0-next-28d3c6ea9e684b19e4fcfd38c8b4e94fba06844f_1683185301009_0.7998175514634407","host":"s3://npm-registry-packages"}},"0.0.0-next-0189b6f6005b078db9424856c7565117e3b45ef3":{"name":"mongodb-connection-model","version":"0.0.0-next-0189b6f6005b078db9424856c7565117e3b45ef3","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@0.0.0-next-0189b6f6005b078db9424856c7565117e3b45ef3","maintainers":[{"name":"mongo-j","email":"james.wang@mongodb.com"},{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satya@mongodb.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"iteng@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"dac3e22399fd147257bd897ee5860f21c1ad607b","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-0.0.0-next-0189b6f6005b078db9424856c7565117e3b45ef3.tgz","fileCount":20,"integrity":"sha512-rei0l+oWOOk6wgE7M3evSDA1Vq8k/O9Gg7A8z6kiZqm8bEQxFNBbJUw8mKPhLJ23rwrTsgfF5zJLZQRzI/5zmQ==","signatures":[{"sig":"MEQCID46PZ8pGdE54kYuOJYoAHgz8+V3CJl2Dq0XlV9io/ypAiBvSpf54XoaKP38dcn6JMPIPGF0woL6oMbhDAV14Knk2g==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":107810},"main":"index.js","readme":"# mongodb-connection-model [![][workflow_img]][workflow_url] [![][npm_img]][npm_url]\n\n> MongoDB connection model\n\nThe main purpose of the MongoDB connection model is to be a domain model around a MongoDB connection. It encapsulates generating a [Connection String URI](https://docs.mongodb.com/manual/reference/connection-string/) from a group of attributes and parses URI using the [MongoDB Node.JS Driver URI Parser](https://github.com/mongodb-js/mongodb-core/blob/master/lib/uri_parser.js).\n\n## Installation\n\n```\nnpm install --save mongodb-connection-model\n```\n\n## Usage\n\n### Building URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\nconst c = new Connection({ appname: 'My App Name' });\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://localhost:27017/?readPreference=primary&appname=My%20App&ssl=false'\n```\n\n### Parsing URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\n\nConnection.from(\n  'mongodb://someUsername:testPassword@localhost',\n  (error, result) => {\n    console.log(result);\n    >>> `{\n      hosts: [{ host: 'localhost', port: 27017 }],\n      hostname: 'localhost',\n      port: 27017,\n      auth: {\n        username: 'someUsername',\n        password: 'testPassword',\n        db: 'admin'\n      },\n      isSrvRecord: false,\n      authStrategy: 'MONGODB',\n      mongodbUsername: 'someUsername',\n      mongodbPassword: 'testPassword',\n      mongodbDatabaseName: 'admin',\n      extraOptions: {},\n      connectionType: 'NODE_DRIVER',\n      readPreference: 'primary',\n      kerberosCanonicalizeHostname: false,\n      sslMethod: 'NONE',\n      sshTunnel: 'NONE',\n      sshTunnelPort: 22\n    }`\n  }\n);\n```\n\n## Properties\n\nMongoDB connection model is based on Ampersand.js framework and consist of [props](https://ampersandjs.com/docs/#ampersand-state-props) and [derived props](https://ampersandjs.com/docs/#ampersand-state-derived). The props object describes the observable properties that MongoDB connection model gets from the Node.js Driver API.\n\n```javascript\nconst с = new Connection();\nconst props = с.getAttributes({ props: true });\n```\n\n#### See Also\n\n- [URI Generic Syntax](https://tools.ietf.org/html/rfc3986)\n- [URI Options Specification](https://github.com/mongodb/specifications/blob/master/source/uri-options/uri-options.rst)\n\n### General Properties\n\n```javascript\nconst c = new Connection({ isSrvRecord: true });\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ns` | String | A valid [ns][ns] the user can read from | `undefined` |\n| `isSrvRecord` | Boolean | Indicates SRV record | `false` |\n| `auth` | Object | Authentication from driver (username, user, db, password) | `undefined` |\n| `hostname` | String | Hostname of a MongoDB Instance. In case of the replica set the first host and port will be taken | `localhost` |\n| `port` | Number | TCP port of a MongoDB Instance | `27017` |\n| `hosts` | Array | Contains all hosts and ports for replica set | `[{ host: 'localhost', port: 27017 }]` |\n| `extraOptions` | Object | Extra options passed to the node driver as part of `driverOptions` | `{}` |\n| `connectionType` | String | The desired connection type. Possible values: `NODE_DRIVER`, `STITCH_ON_PREM`, `STITCH_ATLAS` | `NODE_DRIVER` |\n| `authStrategy` | String | The desired authentication strategy. Possible values: `NONE`, `MONGODB`, `X509`, `KERBEROS`, `LDAP`, `SCRAM-SHA-256` | `NONE` |\n\n### Connection string options\n\n```javascript\nconst c = new Connection({ appname: 'My App', replicaSet: 'testing' });\n```\n\n#### General connection string options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `replicaSet` | String | Specifies the name of the replica set, if the mongod is a member of a replica set | `undefined` |\n| `connectTimeoutMS` | Number | The time in milliseconds to attempt a connection before timing out | `undefined` |\n| `socketTimeoutMS` | Number | The time in milliseconds to attempt a send or receive on a socket before the attempt times out | `undefined` |\n| `compression` | Object | Object includes compressors and a compression level. The following compressors can be specified: `snappy`, `zlib` (Available in MongoDB 3.6 or greater) | `undefined` |\n\n#### Connection Pool Option\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `maxPoolSize` | Number | The maximum number of connections in the connection pool | `undefined` |\n| `minPoolSize` | Number | The minimum number of connections in the connection pool | `undefined` |\n| `maxIdleTimeMS` | Number | The maximum number of milliseconds that a connection can remain idle in the pool before being removed and closed | `undefined` |\n| `waitQueueMultiple` | Number | A number that the driver multiples the maxPoolSize value to, to provide the maximum number of threads allowed to wait for a connection to become available from the pool | `undefined` |\n| `waitQueueTimeoutMS` | Number | The maximum time in milliseconds that a thread can wait for a connection to become available | `undefined` |\n\n#### Write Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `w` | Number/String | Corresponds to the write concern [w Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-w) | `undefined` |\n| `wTimeoutMS` | Number | Corresponds to the write concern [wtimeout](https://docs.mongodb.com/manual/reference/write-concern/#wc-wtimeout) | `undefined` |\n| `journal` | Boolean | Corresponds to the write concern [j Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-j) | `undefined` |\n\n#### Read Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readConcernLevel` | String | The level of isolation | `undefined` |\n\n#### Read Preference Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readPreference` | String | Specifies the read preferences for this connection. Possible values: `PRIMARY`, `PRIMARY_PREFERRED`, `SECONDARY`, `SECONDARY_PREFERRED`, `NEAREST` | `PRIMARY` |\n| `maxStalenessSeconds` | Number | Specifies, in seconds, how stale a secondary can be before the client stops using it for read operations | `undefined` |\n| `readPreferenceTags` | Object | Default read preference tags for the client | `undefined` |\n\n#### Authentication Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `authSource` | String | Specify the database name associated with the user’s credentials | `undefined` |\n| `authMechanism` | String | Specifies the authentication mechanism that MongoDB will use to authenticate the connection. Possible values: `DEFAULT`, `GSSAPI`, `MONGODB-X509`, `PLAIN`, `SCRAM-SHA-256` | `undefined` |\n| `authMechanismProperties` | Object | Additional options provided for authentication (e.g. to enable hostname canonicalization for GSSAPI) | `undefined` |\n| `gssapiServiceName` | String | Set the Kerberos service name when connecting to Kerberized MongoDB instances | `undefined` |\n| `gssapiServiceRealm` | String | Set the Realm service name | `undefined` |\n| `gssapiCanonicalizeHostName` | Boolean | Whether canonicalized hostname | `undefined` |\n\n#### Server Selection and Discovery Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `localThresholdMS` | Number | The size (in milliseconds) of the latency window for selecting among multiple suitable MongoDB instances | `undefined` |\n| `serverSelectionTimeoutMS` | Number | Specifies how long (in milliseconds) to block for server selection before throwing an exception | `undefined` |\n| `serverSelectionTryOnce` | Boolean | Instructs the driver to scan the MongoDB deployment exactly once after server selection fails and then either select a server or raise an error | `undefined` |\n| `heartbeatFrequencyMS` | Number | Controls when the driver checks the state of the MongoDB deployment | `undefined` |\n\n#### Miscellaneous Configuration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `appname` | String | An application name passed to server as client metadata | `undefined` |\n| `retryWrites` | Boolean | Enable retryable writes | `undefined` |\n| `uuidRepresentation` | String | The legacy representation of UUID. Possible values: `standard`, `csharpLegacy`, `javaLegacy`, `pythonLegacy` | `undefined` |\n| `loadBalanced` | Boolean | Whether or not the server is running in load balanced mode | `undefined` |\n\n### Stitch attributes\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `stitchServiceName` | String | Stitch service name | `undefined` |\n| `stitchClientAppId` | String | Stitch сlient app ID | `undefined` |\n| `stitchGroupId` | String | Stitch group ID | `undefined` |\n| `stitchBaseUrl` | String | Stitch base Url | `undefined` |\n\n### MONGODB authentication\n\n```javascript\nconst c = new Connection({\n  mongodbUsername: 'arlo',\n  mongodbPassword: 'w@of'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/?slaveOk=true&authSource=admin'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `mongodbUsername` | String | MongoDB username | `undefined` |\n| `mongodbPassword` | String | MongoDB password | `undefined` |\n| `mongodbDatabaseName` | String | The database name associated with the user's credentials | `undefined` |\n| `promoteValues` | Boolean | Whether BSON values should be promoted to their JS type counterparts | `undefined` |\n\n### KERBEROS authentication\n\n```javascript\nconst c = new Connection({\n  kerberosServiceName: 'mongodb',\n  kerberosPrincipal: 'arlo/dog@krb5.mongodb.parts',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo%252Fdog%2540krb5.mongodb.parts@localhost:27017/toys?authMechanism=GSSAPI'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n> @note (imlucas): Kerberos on Windows is broken out as it's own state for UX consideration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `kerberosServiceName` | String | Any program or computer you access over a network | `undefined` |\n| `kerberosPrincipal` | String | The format of a typical Kerberos V5 principal is `primary/instance@REALM` | `undefined` |\n| `kerberosCanonicalizeHostname` | Boolean | Whether canonicalized kerberos hostname | `undefined` |\n\n#### See Also\n\n- [node.js driver Kerberos reference](http://bit.ly/mongodb-node-driver-kerberos)\n- [node.js driver Kerberos functional test][kerberos-functional]\n\n### LDAP authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  ldapUsername: 'arlo',\n  ldapPassword: 'w@of',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/toys?slaveOk=true&authMechanism=PLAIN'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ldapUsername` | String | LDAP username | `undefined` |\n| `ldapPassword` | String | LDAP password | `undefined` |\n\n#### See Also\n\n- [node.js driver LDAP reference](http://bit.ly/mongodb-node-driver-ldap)\n- [node.js driver X509 functional test][ldap-functional]\n\n### X509 authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  x509Username: 'CN=client,OU=arlo,O=MongoDB,L=Philadelphia,ST=Pennsylvania,C=US'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://CN%253Dclient%252COU%253Darlo%252CO%253DMongoDB%252CL%253DPhiladelphia%252CST%253DPennsylvania%252CC%253DUS@localhost:27017?slaveOk=true&authMechanism=MONGODB-X509'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `x509Username` | String | The x.509 certificate derived user name, e.g. `CN=user,OU=OrgUnit,O=myOrg,...` | `undefined` |\n\n#### See Also\n\n- [node.js driver X509 reference](http://bit.ly/mongodb-node-driver-x509)\n- [node.js driver X509 functional test][x509-functional]\n\n### SSL\n\n> **Note**: Not to be confused with `authentication=X509`\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ssl` | Number/String | A boolean to enable or disables TLS/SSL for the connection | `undefined` |\n| `sslMethod` | String | The desired ssl method. Possible values: `NONE`, `SYSTEMCA`, `IFAVAILABLE`, `UNVALIDATED`, `SERVER`, `ALL` | `NONE` |\n| `sslCA` | Buffer/String | Array of valid certificates | `undefined` |\n| `sslCert` | Buffer/String | The certificate | `undefined` |\n| `sslKey` | Buffer/String | The certificate private key | `undefined` |\n| `sslPass` | Buffer/String | The certificate password | `undefined` |\n\nDescription of `sslMethod` values:\n\n- `SYSTEMCA` - SSL required, validate using System CA, with host verification.\n- `IFAVAILABLE` - The driver should try SSL first, fall back to no SSL if unavailable, and use the system's Certificate Authority.\n- `SERVER` - The driver should validate the server certificate and fail to connect if validation fails. See also [node.js driver \"Validate Server Certificate\" docs][driver-ssl-server].\n- `ALL` - The driver must present a valid certificate and validate the server certificate. See also [node.js driver \"Validate Server Certificate and Present Valid Certificate\" docs][driver-ssl-all].\n- `NONE` - No SSL (Not recommended).\n- `UNVALIDATED` - Use SSL but do not perform any validation of the certificate chain. See also [node.js driver \"No Certificate Validation\" docs][driver-ssl-none]. **Very** not recommended and likely to be deprecated in future releases because it exposes potential Man-In-The-Middle attack vectors.\n\n#### See also\n\n- [node.js driver SSL implementation][driver-ssl-impl]\n- [node.js driver SSL tutorial][driver-ssl-tutorial]\n\n### SSH TUNNEL\n\n> New in mongodb-connection-model@5.0.0\n\nBecause [authentication](#authentication) is quite difficult for operators to migrate to, the most common method of securing a MongoDB deployment is to use an [SSH tunnel][sf-ssh-tunnel].  This allows operators to leverage their existing SSH security infrastructure to also provide secure access to MongoDB.  For a standard deployment of MongoDB on AWS, this is almost always to strategy.  Because of this, we now support creating SSH tunnels automatically when connecting to MongoDB.\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options, (connectionError, client) => {\n  if (connectionError) {\n    return console.log(connectionError);\n  }\n\n  client.db('mongodb').collection('fanclub').count((countingError, count) => {\n    console.log('counted:', countingError, count);\n    client.close();\n  });\n});\n```\n\nThe above provides the same functionality as creating the tunnel using the bash\ncommand below and connecting to MongoDB via another terminal. Notice that\nconnection-model uses a random local port each time it creates a tunnel.\nUsing the command line, you'd have to replace `<random port>` with an actual\nport number.\n\n```bash\nssh -i ~/.ssh/my-key-aws-pair.pem -L <random port>:localhost:27017 ubuntu@ec2-11-111-111-111.compute-1.amazonaws.com\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `sshTunnel` | String | The desired SSH tunnel strategy. Possible values: `NONE`, `USER_PASSWORD`, `IDENTITY_FILE` | `undefined` |\n| `sshTunnelHostname` | String | The hostname of the SSH remote host | `undefined` |\n| `sshTunnelPort` | Port | The SSH port of the remote host | `22` |\n| `sshTunnelBindToLocalPort` | Port | Bind the localhost endpoint of the SSH Tunnel to this port | `undefined` |\n| `sshTunnelUsername` | String | The optional SSH username for the remote host | `undefined` |\n| `sshTunnelPassword` | String | The optional SSH password for the remote host | `undefined` |\n| `sshTunnelIdentityFile` | String/Array | The optional path to the SSH identity file for the remote host | `undefined` |\n| `sshTunnelPassphrase` | String | The optional passphrase for `sshTunnelIdentityFile` | `undefined` |\n\nDescription of `sshTunnel` values:\n\n- `NONE` - Do not use SSH tunneling.\n- `USER_PASSWORD` - The tunnel is created with SSH username and password only.\n- `IDENTITY_FILE` - The tunnel is created using an identity file.\n\n## Derived Properties\n\nDerived properties (also known as computed properties) are properties of the state object that depend on other properties to determine their value.\n\n```javascript\nconst c = new Connection();\nconst derivedProps = c.getAttributes({ derived: true });\n```\n\n| Derived Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `instanceId` | String | The mongoscope | `localhost:27017` |\n| `driverAuthMechanism` | String | Converts the value of `authStrategy` for humans into the `authMechanism` value for the driver | `undefined` |\n| `safeUrl` | String | The URL where a password is replaced with stars | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrl` | String | Use this URL in order to connect via DataService | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrlWithSsh` | String | Use this URL in order to connect via connection model itself | `mongodb://localhost:29201/?readPreference=primary&ssl=false` |\n| `driverOptions` | String | The second argument `mongoscope-server` passes to `mongodb.connect` | `{}` |\n\n## Events\n\n> New in mongodb-connection-model@5.0.0\n\n#### Example: SSH Tunnel\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', skipped: true,\n  reason: 'The selected SSL mode does not need to load any files.' }\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', complete: true}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n#### Example: SSL\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  ssl: 'ALL',\n  sslCA: '~/.ssl/my-ca.pem',\n  sslCert: '~/.ssl/my-server.pem',\n  sslKey: '~/.ssl/my-server.pem'\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', complete: true}\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', skipped: true,\n  reason: 'The selected SSH Tunnel mode is NONE.'}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n[workflow_img]: https://github.com/mongodb-js/connection-model/workflows/Check%20and%20Test/badge.svg?event=push\n[workflow_url]: https://github.com/mongodb-js/connection-model/actions?query=workflow%3A%22Check+and+Test%22\n[npm_img]: https://img.shields.io/npm/v/mongodb-connection-model.svg?style=flat-square\n[npm_url]: https://www.npmjs.org/package/mongodb-connection-model\n[gitter_img]: https://badges.gitter.im/Join%20Chat.svg\n[gitter_url]: http://gitter.im/mongodb-js/mongodb-js\n[enterprise_img]: https://img.shields.io/badge/MongoDB-Enterprise-blue.svg?style=flat-square\n[coming_soon_img]: https://img.shields.io/badge/-Coming%20Soon-ff69b4.svg?style=flat-square\n[kerberos-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/kerberos_tests.js\n[ldap-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ldap_tests.js\n[x509-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ssl_x509_tests.js\n[ns]: https://github.com/mongodb-js/ns\n[sf-ssh-tunnel]: http://serverfault.com/questions/597765/how-to-connect-to-mongodb-server-via-ssh-tunnel\n[ec2-key-pairs]: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html\n[driver-ssl-impl]: https://github.com/christkv/mongodb-core/blob/c3d21cb636d74d7a68134ecd3b9f6af536311279/lib/connection/connection.js#L365-L407\n[driver-ssl-tutorial]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/\n[driver-ssl-none]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#no-certificate-validation\n[driver-ssl-server]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate\n[driver-ssl-all]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate-and-present-valid-certificate\n","gitHead":"0189b6f6005b078db9424856c7565117e3b45ef3","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","check":"npm run lint && npm run depcheck","depcheck":"depcheck","test-check-ci":"npm run check"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.17.0+x64 (linux)","description":"MongoDB connection model","directories":{},"_nodeVersion":"16.17.0","compass:main":"index.js","dependencies":{"raf":"^3.4.1","debug":"^4.2.0","lodash":"^4.17.21","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.2.0","storage-mixin":"0.0.0-next-0189b6f6005b078db9424856c7565117e3b45ef3","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.2","@mongodb-js/ssh-tunnel":"0.0.0-next-0189b6f6005b078db9424856c7565117e3b45ef3","@mongodb-js/compass-utils":"0.0.0-next-0189b6f6005b078db9424856c7565117e3b45ef3","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.6.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"^5.5.0","depcheck":"^1.4.1","proxyquire":"^2.1.3","chai-subset":"^1.6.0","mock-require":"^3.0.3","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^5.5.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_0.0.0-next-0189b6f6005b078db9424856c7565117e3b45ef3_1685749290134_0.25195422291780445","host":"s3://npm-registry-packages"}},"0.0.0-next-2bd69249c64bee9c103212c46e5c582418f87054":{"name":"mongodb-connection-model","version":"0.0.0-next-2bd69249c64bee9c103212c46e5c582418f87054","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@0.0.0-next-2bd69249c64bee9c103212c46e5c582418f87054","maintainers":[{"name":"mongo-j","email":"james.wang@mongodb.com"},{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satya@mongodb.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"iteng@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"b986387a5b4fdf7b4c5561abdf645a6440f53222","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-0.0.0-next-2bd69249c64bee9c103212c46e5c582418f87054.tgz","fileCount":20,"integrity":"sha512-ozv8QtM2FovlDrkwacyFu9Ot2cZM+EVtIjokOYibsFplK9PnBOMaOBtRJBpBO9r3Tiicz5T7C7qp1rqzzcMzvg==","signatures":[{"sig":"MEUCIQC+IGz8PGNp7IHyRh/y3zEOcE3zhvlK3pjrko/dUUL1VQIgcn71LR2A3OFCCTQueC5pyG/enD+PY8O5+02hSuEq1dw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":107810},"main":"index.js","readme":"# mongodb-connection-model [![][workflow_img]][workflow_url] [![][npm_img]][npm_url]\n\n> MongoDB connection model\n\nThe main purpose of the MongoDB connection model is to be a domain model around a MongoDB connection. It encapsulates generating a [Connection String URI](https://docs.mongodb.com/manual/reference/connection-string/) from a group of attributes and parses URI using the [MongoDB Node.JS Driver URI Parser](https://github.com/mongodb-js/mongodb-core/blob/master/lib/uri_parser.js).\n\n## Installation\n\n```\nnpm install --save mongodb-connection-model\n```\n\n## Usage\n\n### Building URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\nconst c = new Connection({ appname: 'My App Name' });\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://localhost:27017/?readPreference=primary&appname=My%20App&ssl=false'\n```\n\n### Parsing URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\n\nConnection.from(\n  'mongodb://someUsername:testPassword@localhost',\n  (error, result) => {\n    console.log(result);\n    >>> `{\n      hosts: [{ host: 'localhost', port: 27017 }],\n      hostname: 'localhost',\n      port: 27017,\n      auth: {\n        username: 'someUsername',\n        password: 'testPassword',\n        db: 'admin'\n      },\n      isSrvRecord: false,\n      authStrategy: 'MONGODB',\n      mongodbUsername: 'someUsername',\n      mongodbPassword: 'testPassword',\n      mongodbDatabaseName: 'admin',\n      extraOptions: {},\n      connectionType: 'NODE_DRIVER',\n      readPreference: 'primary',\n      kerberosCanonicalizeHostname: false,\n      sslMethod: 'NONE',\n      sshTunnel: 'NONE',\n      sshTunnelPort: 22\n    }`\n  }\n);\n```\n\n## Properties\n\nMongoDB connection model is based on Ampersand.js framework and consist of [props](https://ampersandjs.com/docs/#ampersand-state-props) and [derived props](https://ampersandjs.com/docs/#ampersand-state-derived). The props object describes the observable properties that MongoDB connection model gets from the Node.js Driver API.\n\n```javascript\nconst с = new Connection();\nconst props = с.getAttributes({ props: true });\n```\n\n#### See Also\n\n- [URI Generic Syntax](https://tools.ietf.org/html/rfc3986)\n- [URI Options Specification](https://github.com/mongodb/specifications/blob/master/source/uri-options/uri-options.rst)\n\n### General Properties\n\n```javascript\nconst c = new Connection({ isSrvRecord: true });\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ns` | String | A valid [ns][ns] the user can read from | `undefined` |\n| `isSrvRecord` | Boolean | Indicates SRV record | `false` |\n| `auth` | Object | Authentication from driver (username, user, db, password) | `undefined` |\n| `hostname` | String | Hostname of a MongoDB Instance. In case of the replica set the first host and port will be taken | `localhost` |\n| `port` | Number | TCP port of a MongoDB Instance | `27017` |\n| `hosts` | Array | Contains all hosts and ports for replica set | `[{ host: 'localhost', port: 27017 }]` |\n| `extraOptions` | Object | Extra options passed to the node driver as part of `driverOptions` | `{}` |\n| `connectionType` | String | The desired connection type. Possible values: `NODE_DRIVER`, `STITCH_ON_PREM`, `STITCH_ATLAS` | `NODE_DRIVER` |\n| `authStrategy` | String | The desired authentication strategy. Possible values: `NONE`, `MONGODB`, `X509`, `KERBEROS`, `LDAP`, `SCRAM-SHA-256` | `NONE` |\n\n### Connection string options\n\n```javascript\nconst c = new Connection({ appname: 'My App', replicaSet: 'testing' });\n```\n\n#### General connection string options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `replicaSet` | String | Specifies the name of the replica set, if the mongod is a member of a replica set | `undefined` |\n| `connectTimeoutMS` | Number | The time in milliseconds to attempt a connection before timing out | `undefined` |\n| `socketTimeoutMS` | Number | The time in milliseconds to attempt a send or receive on a socket before the attempt times out | `undefined` |\n| `compression` | Object | Object includes compressors and a compression level. The following compressors can be specified: `snappy`, `zlib` (Available in MongoDB 3.6 or greater) | `undefined` |\n\n#### Connection Pool Option\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `maxPoolSize` | Number | The maximum number of connections in the connection pool | `undefined` |\n| `minPoolSize` | Number | The minimum number of connections in the connection pool | `undefined` |\n| `maxIdleTimeMS` | Number | The maximum number of milliseconds that a connection can remain idle in the pool before being removed and closed | `undefined` |\n| `waitQueueMultiple` | Number | A number that the driver multiples the maxPoolSize value to, to provide the maximum number of threads allowed to wait for a connection to become available from the pool | `undefined` |\n| `waitQueueTimeoutMS` | Number | The maximum time in milliseconds that a thread can wait for a connection to become available | `undefined` |\n\n#### Write Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `w` | Number/String | Corresponds to the write concern [w Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-w) | `undefined` |\n| `wTimeoutMS` | Number | Corresponds to the write concern [wtimeout](https://docs.mongodb.com/manual/reference/write-concern/#wc-wtimeout) | `undefined` |\n| `journal` | Boolean | Corresponds to the write concern [j Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-j) | `undefined` |\n\n#### Read Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readConcernLevel` | String | The level of isolation | `undefined` |\n\n#### Read Preference Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readPreference` | String | Specifies the read preferences for this connection. Possible values: `PRIMARY`, `PRIMARY_PREFERRED`, `SECONDARY`, `SECONDARY_PREFERRED`, `NEAREST` | `PRIMARY` |\n| `maxStalenessSeconds` | Number | Specifies, in seconds, how stale a secondary can be before the client stops using it for read operations | `undefined` |\n| `readPreferenceTags` | Object | Default read preference tags for the client | `undefined` |\n\n#### Authentication Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `authSource` | String | Specify the database name associated with the user’s credentials | `undefined` |\n| `authMechanism` | String | Specifies the authentication mechanism that MongoDB will use to authenticate the connection. Possible values: `DEFAULT`, `GSSAPI`, `MONGODB-X509`, `PLAIN`, `SCRAM-SHA-256` | `undefined` |\n| `authMechanismProperties` | Object | Additional options provided for authentication (e.g. to enable hostname canonicalization for GSSAPI) | `undefined` |\n| `gssapiServiceName` | String | Set the Kerberos service name when connecting to Kerberized MongoDB instances | `undefined` |\n| `gssapiServiceRealm` | String | Set the Realm service name | `undefined` |\n| `gssapiCanonicalizeHostName` | Boolean | Whether canonicalized hostname | `undefined` |\n\n#### Server Selection and Discovery Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `localThresholdMS` | Number | The size (in milliseconds) of the latency window for selecting among multiple suitable MongoDB instances | `undefined` |\n| `serverSelectionTimeoutMS` | Number | Specifies how long (in milliseconds) to block for server selection before throwing an exception | `undefined` |\n| `serverSelectionTryOnce` | Boolean | Instructs the driver to scan the MongoDB deployment exactly once after server selection fails and then either select a server or raise an error | `undefined` |\n| `heartbeatFrequencyMS` | Number | Controls when the driver checks the state of the MongoDB deployment | `undefined` |\n\n#### Miscellaneous Configuration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `appname` | String | An application name passed to server as client metadata | `undefined` |\n| `retryWrites` | Boolean | Enable retryable writes | `undefined` |\n| `uuidRepresentation` | String | The legacy representation of UUID. Possible values: `standard`, `csharpLegacy`, `javaLegacy`, `pythonLegacy` | `undefined` |\n| `loadBalanced` | Boolean | Whether or not the server is running in load balanced mode | `undefined` |\n\n### Stitch attributes\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `stitchServiceName` | String | Stitch service name | `undefined` |\n| `stitchClientAppId` | String | Stitch сlient app ID | `undefined` |\n| `stitchGroupId` | String | Stitch group ID | `undefined` |\n| `stitchBaseUrl` | String | Stitch base Url | `undefined` |\n\n### MONGODB authentication\n\n```javascript\nconst c = new Connection({\n  mongodbUsername: 'arlo',\n  mongodbPassword: 'w@of'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/?slaveOk=true&authSource=admin'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `mongodbUsername` | String | MongoDB username | `undefined` |\n| `mongodbPassword` | String | MongoDB password | `undefined` |\n| `mongodbDatabaseName` | String | The database name associated with the user's credentials | `undefined` |\n| `promoteValues` | Boolean | Whether BSON values should be promoted to their JS type counterparts | `undefined` |\n\n### KERBEROS authentication\n\n```javascript\nconst c = new Connection({\n  kerberosServiceName: 'mongodb',\n  kerberosPrincipal: 'arlo/dog@krb5.mongodb.parts',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo%252Fdog%2540krb5.mongodb.parts@localhost:27017/toys?authMechanism=GSSAPI'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n> @note (imlucas): Kerberos on Windows is broken out as it's own state for UX consideration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `kerberosServiceName` | String | Any program or computer you access over a network | `undefined` |\n| `kerberosPrincipal` | String | The format of a typical Kerberos V5 principal is `primary/instance@REALM` | `undefined` |\n| `kerberosCanonicalizeHostname` | Boolean | Whether canonicalized kerberos hostname | `undefined` |\n\n#### See Also\n\n- [node.js driver Kerberos reference](http://bit.ly/mongodb-node-driver-kerberos)\n- [node.js driver Kerberos functional test][kerberos-functional]\n\n### LDAP authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  ldapUsername: 'arlo',\n  ldapPassword: 'w@of',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/toys?slaveOk=true&authMechanism=PLAIN'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ldapUsername` | String | LDAP username | `undefined` |\n| `ldapPassword` | String | LDAP password | `undefined` |\n\n#### See Also\n\n- [node.js driver LDAP reference](http://bit.ly/mongodb-node-driver-ldap)\n- [node.js driver X509 functional test][ldap-functional]\n\n### X509 authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  x509Username: 'CN=client,OU=arlo,O=MongoDB,L=Philadelphia,ST=Pennsylvania,C=US'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://CN%253Dclient%252COU%253Darlo%252CO%253DMongoDB%252CL%253DPhiladelphia%252CST%253DPennsylvania%252CC%253DUS@localhost:27017?slaveOk=true&authMechanism=MONGODB-X509'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `x509Username` | String | The x.509 certificate derived user name, e.g. `CN=user,OU=OrgUnit,O=myOrg,...` | `undefined` |\n\n#### See Also\n\n- [node.js driver X509 reference](http://bit.ly/mongodb-node-driver-x509)\n- [node.js driver X509 functional test][x509-functional]\n\n### SSL\n\n> **Note**: Not to be confused with `authentication=X509`\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ssl` | Number/String | A boolean to enable or disables TLS/SSL for the connection | `undefined` |\n| `sslMethod` | String | The desired ssl method. Possible values: `NONE`, `SYSTEMCA`, `IFAVAILABLE`, `UNVALIDATED`, `SERVER`, `ALL` | `NONE` |\n| `sslCA` | Buffer/String | Array of valid certificates | `undefined` |\n| `sslCert` | Buffer/String | The certificate | `undefined` |\n| `sslKey` | Buffer/String | The certificate private key | `undefined` |\n| `sslPass` | Buffer/String | The certificate password | `undefined` |\n\nDescription of `sslMethod` values:\n\n- `SYSTEMCA` - SSL required, validate using System CA, with host verification.\n- `IFAVAILABLE` - The driver should try SSL first, fall back to no SSL if unavailable, and use the system's Certificate Authority.\n- `SERVER` - The driver should validate the server certificate and fail to connect if validation fails. See also [node.js driver \"Validate Server Certificate\" docs][driver-ssl-server].\n- `ALL` - The driver must present a valid certificate and validate the server certificate. See also [node.js driver \"Validate Server Certificate and Present Valid Certificate\" docs][driver-ssl-all].\n- `NONE` - No SSL (Not recommended).\n- `UNVALIDATED` - Use SSL but do not perform any validation of the certificate chain. See also [node.js driver \"No Certificate Validation\" docs][driver-ssl-none]. **Very** not recommended and likely to be deprecated in future releases because it exposes potential Man-In-The-Middle attack vectors.\n\n#### See also\n\n- [node.js driver SSL implementation][driver-ssl-impl]\n- [node.js driver SSL tutorial][driver-ssl-tutorial]\n\n### SSH TUNNEL\n\n> New in mongodb-connection-model@5.0.0\n\nBecause [authentication](#authentication) is quite difficult for operators to migrate to, the most common method of securing a MongoDB deployment is to use an [SSH tunnel][sf-ssh-tunnel].  This allows operators to leverage their existing SSH security infrastructure to also provide secure access to MongoDB.  For a standard deployment of MongoDB on AWS, this is almost always to strategy.  Because of this, we now support creating SSH tunnels automatically when connecting to MongoDB.\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options, (connectionError, client) => {\n  if (connectionError) {\n    return console.log(connectionError);\n  }\n\n  client.db('mongodb').collection('fanclub').count((countingError, count) => {\n    console.log('counted:', countingError, count);\n    client.close();\n  });\n});\n```\n\nThe above provides the same functionality as creating the tunnel using the bash\ncommand below and connecting to MongoDB via another terminal. Notice that\nconnection-model uses a random local port each time it creates a tunnel.\nUsing the command line, you'd have to replace `<random port>` with an actual\nport number.\n\n```bash\nssh -i ~/.ssh/my-key-aws-pair.pem -L <random port>:localhost:27017 ubuntu@ec2-11-111-111-111.compute-1.amazonaws.com\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `sshTunnel` | String | The desired SSH tunnel strategy. Possible values: `NONE`, `USER_PASSWORD`, `IDENTITY_FILE` | `undefined` |\n| `sshTunnelHostname` | String | The hostname of the SSH remote host | `undefined` |\n| `sshTunnelPort` | Port | The SSH port of the remote host | `22` |\n| `sshTunnelBindToLocalPort` | Port | Bind the localhost endpoint of the SSH Tunnel to this port | `undefined` |\n| `sshTunnelUsername` | String | The optional SSH username for the remote host | `undefined` |\n| `sshTunnelPassword` | String | The optional SSH password for the remote host | `undefined` |\n| `sshTunnelIdentityFile` | String/Array | The optional path to the SSH identity file for the remote host | `undefined` |\n| `sshTunnelPassphrase` | String | The optional passphrase for `sshTunnelIdentityFile` | `undefined` |\n\nDescription of `sshTunnel` values:\n\n- `NONE` - Do not use SSH tunneling.\n- `USER_PASSWORD` - The tunnel is created with SSH username and password only.\n- `IDENTITY_FILE` - The tunnel is created using an identity file.\n\n## Derived Properties\n\nDerived properties (also known as computed properties) are properties of the state object that depend on other properties to determine their value.\n\n```javascript\nconst c = new Connection();\nconst derivedProps = c.getAttributes({ derived: true });\n```\n\n| Derived Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `instanceId` | String | The mongoscope | `localhost:27017` |\n| `driverAuthMechanism` | String | Converts the value of `authStrategy` for humans into the `authMechanism` value for the driver | `undefined` |\n| `safeUrl` | String | The URL where a password is replaced with stars | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrl` | String | Use this URL in order to connect via DataService | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrlWithSsh` | String | Use this URL in order to connect via connection model itself | `mongodb://localhost:29201/?readPreference=primary&ssl=false` |\n| `driverOptions` | String | The second argument `mongoscope-server` passes to `mongodb.connect` | `{}` |\n\n## Events\n\n> New in mongodb-connection-model@5.0.0\n\n#### Example: SSH Tunnel\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', skipped: true,\n  reason: 'The selected SSL mode does not need to load any files.' }\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', complete: true}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n#### Example: SSL\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  ssl: 'ALL',\n  sslCA: '~/.ssl/my-ca.pem',\n  sslCert: '~/.ssl/my-server.pem',\n  sslKey: '~/.ssl/my-server.pem'\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', complete: true}\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', skipped: true,\n  reason: 'The selected SSH Tunnel mode is NONE.'}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n[workflow_img]: https://github.com/mongodb-js/connection-model/workflows/Check%20and%20Test/badge.svg?event=push\n[workflow_url]: https://github.com/mongodb-js/connection-model/actions?query=workflow%3A%22Check+and+Test%22\n[npm_img]: https://img.shields.io/npm/v/mongodb-connection-model.svg?style=flat-square\n[npm_url]: https://www.npmjs.org/package/mongodb-connection-model\n[gitter_img]: https://badges.gitter.im/Join%20Chat.svg\n[gitter_url]: http://gitter.im/mongodb-js/mongodb-js\n[enterprise_img]: https://img.shields.io/badge/MongoDB-Enterprise-blue.svg?style=flat-square\n[coming_soon_img]: https://img.shields.io/badge/-Coming%20Soon-ff69b4.svg?style=flat-square\n[kerberos-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/kerberos_tests.js\n[ldap-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ldap_tests.js\n[x509-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ssl_x509_tests.js\n[ns]: https://github.com/mongodb-js/ns\n[sf-ssh-tunnel]: http://serverfault.com/questions/597765/how-to-connect-to-mongodb-server-via-ssh-tunnel\n[ec2-key-pairs]: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html\n[driver-ssl-impl]: https://github.com/christkv/mongodb-core/blob/c3d21cb636d74d7a68134ecd3b9f6af536311279/lib/connection/connection.js#L365-L407\n[driver-ssl-tutorial]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/\n[driver-ssl-none]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#no-certificate-validation\n[driver-ssl-server]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate\n[driver-ssl-all]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate-and-present-valid-certificate\n","gitHead":"2bd69249c64bee9c103212c46e5c582418f87054","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","check":"npm run lint && npm run depcheck","depcheck":"depcheck","test-check-ci":"npm run check"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.17.0+x64 (linux)","description":"MongoDB connection model","directories":{},"_nodeVersion":"16.17.0","compass:main":"index.js","dependencies":{"raf":"^3.4.1","debug":"^4.2.0","lodash":"^4.17.21","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.2.0","storage-mixin":"0.0.0-next-2bd69249c64bee9c103212c46e5c582418f87054","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.2","@mongodb-js/ssh-tunnel":"0.0.0-next-2bd69249c64bee9c103212c46e5c582418f87054","@mongodb-js/compass-utils":"0.0.0-next-2bd69249c64bee9c103212c46e5c582418f87054","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.6.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"^5.5.0","depcheck":"^1.4.1","proxyquire":"^2.1.3","chai-subset":"^1.6.0","mock-require":"^3.0.3","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^5.5.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_0.0.0-next-2bd69249c64bee9c103212c46e5c582418f87054_1685749387883_0.439123549275344","host":"s3://npm-registry-packages"}},"0.0.0-next-e182f845553cf87006baf04d22367061288c5226":{"name":"mongodb-connection-model","version":"0.0.0-next-e182f845553cf87006baf04d22367061288c5226","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@0.0.0-next-e182f845553cf87006baf04d22367061288c5226","maintainers":[{"name":"mongo-j","email":"james.wang@mongodb.com"},{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satya@mongodb.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"iteng@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"4da2afa8fcea606c5ca683fa5bfa57141fc9f781","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-0.0.0-next-e182f845553cf87006baf04d22367061288c5226.tgz","fileCount":20,"integrity":"sha512-c1spVculBfokApdP/8P5KfwijAvnHu7myAErRRH9KnsWKXarKqh3hiJ1M5qxt74ErhpHar4DXjzNXrt8O+ToAA==","signatures":[{"sig":"MEYCIQChws9brFTT4iNpk4aRn2Nxq/eFKJCZCbqVgM+Q4TaREgIhANn9JVdOu4hJQdBOvTlDtn+p/ts13iq90NXr/eJZL5UU","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":107810},"main":"index.js","readme":"# mongodb-connection-model [![][workflow_img]][workflow_url] [![][npm_img]][npm_url]\n\n> MongoDB connection model\n\nThe main purpose of the MongoDB connection model is to be a domain model around a MongoDB connection. It encapsulates generating a [Connection String URI](https://docs.mongodb.com/manual/reference/connection-string/) from a group of attributes and parses URI using the [MongoDB Node.JS Driver URI Parser](https://github.com/mongodb-js/mongodb-core/blob/master/lib/uri_parser.js).\n\n## Installation\n\n```\nnpm install --save mongodb-connection-model\n```\n\n## Usage\n\n### Building URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\nconst c = new Connection({ appname: 'My App Name' });\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://localhost:27017/?readPreference=primary&appname=My%20App&ssl=false'\n```\n\n### Parsing URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\n\nConnection.from(\n  'mongodb://someUsername:testPassword@localhost',\n  (error, result) => {\n    console.log(result);\n    >>> `{\n      hosts: [{ host: 'localhost', port: 27017 }],\n      hostname: 'localhost',\n      port: 27017,\n      auth: {\n        username: 'someUsername',\n        password: 'testPassword',\n        db: 'admin'\n      },\n      isSrvRecord: false,\n      authStrategy: 'MONGODB',\n      mongodbUsername: 'someUsername',\n      mongodbPassword: 'testPassword',\n      mongodbDatabaseName: 'admin',\n      extraOptions: {},\n      connectionType: 'NODE_DRIVER',\n      readPreference: 'primary',\n      kerberosCanonicalizeHostname: false,\n      sslMethod: 'NONE',\n      sshTunnel: 'NONE',\n      sshTunnelPort: 22\n    }`\n  }\n);\n```\n\n## Properties\n\nMongoDB connection model is based on Ampersand.js framework and consist of [props](https://ampersandjs.com/docs/#ampersand-state-props) and [derived props](https://ampersandjs.com/docs/#ampersand-state-derived). The props object describes the observable properties that MongoDB connection model gets from the Node.js Driver API.\n\n```javascript\nconst с = new Connection();\nconst props = с.getAttributes({ props: true });\n```\n\n#### See Also\n\n- [URI Generic Syntax](https://tools.ietf.org/html/rfc3986)\n- [URI Options Specification](https://github.com/mongodb/specifications/blob/master/source/uri-options/uri-options.rst)\n\n### General Properties\n\n```javascript\nconst c = new Connection({ isSrvRecord: true });\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ns` | String | A valid [ns][ns] the user can read from | `undefined` |\n| `isSrvRecord` | Boolean | Indicates SRV record | `false` |\n| `auth` | Object | Authentication from driver (username, user, db, password) | `undefined` |\n| `hostname` | String | Hostname of a MongoDB Instance. In case of the replica set the first host and port will be taken | `localhost` |\n| `port` | Number | TCP port of a MongoDB Instance | `27017` |\n| `hosts` | Array | Contains all hosts and ports for replica set | `[{ host: 'localhost', port: 27017 }]` |\n| `extraOptions` | Object | Extra options passed to the node driver as part of `driverOptions` | `{}` |\n| `connectionType` | String | The desired connection type. Possible values: `NODE_DRIVER`, `STITCH_ON_PREM`, `STITCH_ATLAS` | `NODE_DRIVER` |\n| `authStrategy` | String | The desired authentication strategy. Possible values: `NONE`, `MONGODB`, `X509`, `KERBEROS`, `LDAP`, `SCRAM-SHA-256` | `NONE` |\n\n### Connection string options\n\n```javascript\nconst c = new Connection({ appname: 'My App', replicaSet: 'testing' });\n```\n\n#### General connection string options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `replicaSet` | String | Specifies the name of the replica set, if the mongod is a member of a replica set | `undefined` |\n| `connectTimeoutMS` | Number | The time in milliseconds to attempt a connection before timing out | `undefined` |\n| `socketTimeoutMS` | Number | The time in milliseconds to attempt a send or receive on a socket before the attempt times out | `undefined` |\n| `compression` | Object | Object includes compressors and a compression level. The following compressors can be specified: `snappy`, `zlib` (Available in MongoDB 3.6 or greater) | `undefined` |\n\n#### Connection Pool Option\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `maxPoolSize` | Number | The maximum number of connections in the connection pool | `undefined` |\n| `minPoolSize` | Number | The minimum number of connections in the connection pool | `undefined` |\n| `maxIdleTimeMS` | Number | The maximum number of milliseconds that a connection can remain idle in the pool before being removed and closed | `undefined` |\n| `waitQueueMultiple` | Number | A number that the driver multiples the maxPoolSize value to, to provide the maximum number of threads allowed to wait for a connection to become available from the pool | `undefined` |\n| `waitQueueTimeoutMS` | Number | The maximum time in milliseconds that a thread can wait for a connection to become available | `undefined` |\n\n#### Write Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `w` | Number/String | Corresponds to the write concern [w Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-w) | `undefined` |\n| `wTimeoutMS` | Number | Corresponds to the write concern [wtimeout](https://docs.mongodb.com/manual/reference/write-concern/#wc-wtimeout) | `undefined` |\n| `journal` | Boolean | Corresponds to the write concern [j Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-j) | `undefined` |\n\n#### Read Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readConcernLevel` | String | The level of isolation | `undefined` |\n\n#### Read Preference Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readPreference` | String | Specifies the read preferences for this connection. Possible values: `PRIMARY`, `PRIMARY_PREFERRED`, `SECONDARY`, `SECONDARY_PREFERRED`, `NEAREST` | `PRIMARY` |\n| `maxStalenessSeconds` | Number | Specifies, in seconds, how stale a secondary can be before the client stops using it for read operations | `undefined` |\n| `readPreferenceTags` | Object | Default read preference tags for the client | `undefined` |\n\n#### Authentication Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `authSource` | String | Specify the database name associated with the user’s credentials | `undefined` |\n| `authMechanism` | String | Specifies the authentication mechanism that MongoDB will use to authenticate the connection. Possible values: `DEFAULT`, `GSSAPI`, `MONGODB-X509`, `PLAIN`, `SCRAM-SHA-256` | `undefined` |\n| `authMechanismProperties` | Object | Additional options provided for authentication (e.g. to enable hostname canonicalization for GSSAPI) | `undefined` |\n| `gssapiServiceName` | String | Set the Kerberos service name when connecting to Kerberized MongoDB instances | `undefined` |\n| `gssapiServiceRealm` | String | Set the Realm service name | `undefined` |\n| `gssapiCanonicalizeHostName` | Boolean | Whether canonicalized hostname | `undefined` |\n\n#### Server Selection and Discovery Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `localThresholdMS` | Number | The size (in milliseconds) of the latency window for selecting among multiple suitable MongoDB instances | `undefined` |\n| `serverSelectionTimeoutMS` | Number | Specifies how long (in milliseconds) to block for server selection before throwing an exception | `undefined` |\n| `serverSelectionTryOnce` | Boolean | Instructs the driver to scan the MongoDB deployment exactly once after server selection fails and then either select a server or raise an error | `undefined` |\n| `heartbeatFrequencyMS` | Number | Controls when the driver checks the state of the MongoDB deployment | `undefined` |\n\n#### Miscellaneous Configuration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `appname` | String | An application name passed to server as client metadata | `undefined` |\n| `retryWrites` | Boolean | Enable retryable writes | `undefined` |\n| `uuidRepresentation` | String | The legacy representation of UUID. Possible values: `standard`, `csharpLegacy`, `javaLegacy`, `pythonLegacy` | `undefined` |\n| `loadBalanced` | Boolean | Whether or not the server is running in load balanced mode | `undefined` |\n\n### Stitch attributes\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `stitchServiceName` | String | Stitch service name | `undefined` |\n| `stitchClientAppId` | String | Stitch сlient app ID | `undefined` |\n| `stitchGroupId` | String | Stitch group ID | `undefined` |\n| `stitchBaseUrl` | String | Stitch base Url | `undefined` |\n\n### MONGODB authentication\n\n```javascript\nconst c = new Connection({\n  mongodbUsername: 'arlo',\n  mongodbPassword: 'w@of'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/?slaveOk=true&authSource=admin'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `mongodbUsername` | String | MongoDB username | `undefined` |\n| `mongodbPassword` | String | MongoDB password | `undefined` |\n| `mongodbDatabaseName` | String | The database name associated with the user's credentials | `undefined` |\n| `promoteValues` | Boolean | Whether BSON values should be promoted to their JS type counterparts | `undefined` |\n\n### KERBEROS authentication\n\n```javascript\nconst c = new Connection({\n  kerberosServiceName: 'mongodb',\n  kerberosPrincipal: 'arlo/dog@krb5.mongodb.parts',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo%252Fdog%2540krb5.mongodb.parts@localhost:27017/toys?authMechanism=GSSAPI'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n> @note (imlucas): Kerberos on Windows is broken out as it's own state for UX consideration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `kerberosServiceName` | String | Any program or computer you access over a network | `undefined` |\n| `kerberosPrincipal` | String | The format of a typical Kerberos V5 principal is `primary/instance@REALM` | `undefined` |\n| `kerberosCanonicalizeHostname` | Boolean | Whether canonicalized kerberos hostname | `undefined` |\n\n#### See Also\n\n- [node.js driver Kerberos reference](http://bit.ly/mongodb-node-driver-kerberos)\n- [node.js driver Kerberos functional test][kerberos-functional]\n\n### LDAP authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  ldapUsername: 'arlo',\n  ldapPassword: 'w@of',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/toys?slaveOk=true&authMechanism=PLAIN'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ldapUsername` | String | LDAP username | `undefined` |\n| `ldapPassword` | String | LDAP password | `undefined` |\n\n#### See Also\n\n- [node.js driver LDAP reference](http://bit.ly/mongodb-node-driver-ldap)\n- [node.js driver X509 functional test][ldap-functional]\n\n### X509 authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  x509Username: 'CN=client,OU=arlo,O=MongoDB,L=Philadelphia,ST=Pennsylvania,C=US'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://CN%253Dclient%252COU%253Darlo%252CO%253DMongoDB%252CL%253DPhiladelphia%252CST%253DPennsylvania%252CC%253DUS@localhost:27017?slaveOk=true&authMechanism=MONGODB-X509'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `x509Username` | String | The x.509 certificate derived user name, e.g. `CN=user,OU=OrgUnit,O=myOrg,...` | `undefined` |\n\n#### See Also\n\n- [node.js driver X509 reference](http://bit.ly/mongodb-node-driver-x509)\n- [node.js driver X509 functional test][x509-functional]\n\n### SSL\n\n> **Note**: Not to be confused with `authentication=X509`\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ssl` | Number/String | A boolean to enable or disables TLS/SSL for the connection | `undefined` |\n| `sslMethod` | String | The desired ssl method. Possible values: `NONE`, `SYSTEMCA`, `IFAVAILABLE`, `UNVALIDATED`, `SERVER`, `ALL` | `NONE` |\n| `sslCA` | Buffer/String | Array of valid certificates | `undefined` |\n| `sslCert` | Buffer/String | The certificate | `undefined` |\n| `sslKey` | Buffer/String | The certificate private key | `undefined` |\n| `sslPass` | Buffer/String | The certificate password | `undefined` |\n\nDescription of `sslMethod` values:\n\n- `SYSTEMCA` - SSL required, validate using System CA, with host verification.\n- `IFAVAILABLE` - The driver should try SSL first, fall back to no SSL if unavailable, and use the system's Certificate Authority.\n- `SERVER` - The driver should validate the server certificate and fail to connect if validation fails. See also [node.js driver \"Validate Server Certificate\" docs][driver-ssl-server].\n- `ALL` - The driver must present a valid certificate and validate the server certificate. See also [node.js driver \"Validate Server Certificate and Present Valid Certificate\" docs][driver-ssl-all].\n- `NONE` - No SSL (Not recommended).\n- `UNVALIDATED` - Use SSL but do not perform any validation of the certificate chain. See also [node.js driver \"No Certificate Validation\" docs][driver-ssl-none]. **Very** not recommended and likely to be deprecated in future releases because it exposes potential Man-In-The-Middle attack vectors.\n\n#### See also\n\n- [node.js driver SSL implementation][driver-ssl-impl]\n- [node.js driver SSL tutorial][driver-ssl-tutorial]\n\n### SSH TUNNEL\n\n> New in mongodb-connection-model@5.0.0\n\nBecause [authentication](#authentication) is quite difficult for operators to migrate to, the most common method of securing a MongoDB deployment is to use an [SSH tunnel][sf-ssh-tunnel].  This allows operators to leverage their existing SSH security infrastructure to also provide secure access to MongoDB.  For a standard deployment of MongoDB on AWS, this is almost always to strategy.  Because of this, we now support creating SSH tunnels automatically when connecting to MongoDB.\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options, (connectionError, client) => {\n  if (connectionError) {\n    return console.log(connectionError);\n  }\n\n  client.db('mongodb').collection('fanclub').count((countingError, count) => {\n    console.log('counted:', countingError, count);\n    client.close();\n  });\n});\n```\n\nThe above provides the same functionality as creating the tunnel using the bash\ncommand below and connecting to MongoDB via another terminal. Notice that\nconnection-model uses a random local port each time it creates a tunnel.\nUsing the command line, you'd have to replace `<random port>` with an actual\nport number.\n\n```bash\nssh -i ~/.ssh/my-key-aws-pair.pem -L <random port>:localhost:27017 ubuntu@ec2-11-111-111-111.compute-1.amazonaws.com\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `sshTunnel` | String | The desired SSH tunnel strategy. Possible values: `NONE`, `USER_PASSWORD`, `IDENTITY_FILE` | `undefined` |\n| `sshTunnelHostname` | String | The hostname of the SSH remote host | `undefined` |\n| `sshTunnelPort` | Port | The SSH port of the remote host | `22` |\n| `sshTunnelBindToLocalPort` | Port | Bind the localhost endpoint of the SSH Tunnel to this port | `undefined` |\n| `sshTunnelUsername` | String | The optional SSH username for the remote host | `undefined` |\n| `sshTunnelPassword` | String | The optional SSH password for the remote host | `undefined` |\n| `sshTunnelIdentityFile` | String/Array | The optional path to the SSH identity file for the remote host | `undefined` |\n| `sshTunnelPassphrase` | String | The optional passphrase for `sshTunnelIdentityFile` | `undefined` |\n\nDescription of `sshTunnel` values:\n\n- `NONE` - Do not use SSH tunneling.\n- `USER_PASSWORD` - The tunnel is created with SSH username and password only.\n- `IDENTITY_FILE` - The tunnel is created using an identity file.\n\n## Derived Properties\n\nDerived properties (also known as computed properties) are properties of the state object that depend on other properties to determine their value.\n\n```javascript\nconst c = new Connection();\nconst derivedProps = c.getAttributes({ derived: true });\n```\n\n| Derived Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `instanceId` | String | The mongoscope | `localhost:27017` |\n| `driverAuthMechanism` | String | Converts the value of `authStrategy` for humans into the `authMechanism` value for the driver | `undefined` |\n| `safeUrl` | String | The URL where a password is replaced with stars | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrl` | String | Use this URL in order to connect via DataService | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrlWithSsh` | String | Use this URL in order to connect via connection model itself | `mongodb://localhost:29201/?readPreference=primary&ssl=false` |\n| `driverOptions` | String | The second argument `mongoscope-server` passes to `mongodb.connect` | `{}` |\n\n## Events\n\n> New in mongodb-connection-model@5.0.0\n\n#### Example: SSH Tunnel\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', skipped: true,\n  reason: 'The selected SSL mode does not need to load any files.' }\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', complete: true}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n#### Example: SSL\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  ssl: 'ALL',\n  sslCA: '~/.ssl/my-ca.pem',\n  sslCert: '~/.ssl/my-server.pem',\n  sslKey: '~/.ssl/my-server.pem'\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', complete: true}\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', skipped: true,\n  reason: 'The selected SSH Tunnel mode is NONE.'}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n[workflow_img]: https://github.com/mongodb-js/connection-model/workflows/Check%20and%20Test/badge.svg?event=push\n[workflow_url]: https://github.com/mongodb-js/connection-model/actions?query=workflow%3A%22Check+and+Test%22\n[npm_img]: https://img.shields.io/npm/v/mongodb-connection-model.svg?style=flat-square\n[npm_url]: https://www.npmjs.org/package/mongodb-connection-model\n[gitter_img]: https://badges.gitter.im/Join%20Chat.svg\n[gitter_url]: http://gitter.im/mongodb-js/mongodb-js\n[enterprise_img]: https://img.shields.io/badge/MongoDB-Enterprise-blue.svg?style=flat-square\n[coming_soon_img]: https://img.shields.io/badge/-Coming%20Soon-ff69b4.svg?style=flat-square\n[kerberos-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/kerberos_tests.js\n[ldap-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ldap_tests.js\n[x509-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ssl_x509_tests.js\n[ns]: https://github.com/mongodb-js/ns\n[sf-ssh-tunnel]: http://serverfault.com/questions/597765/how-to-connect-to-mongodb-server-via-ssh-tunnel\n[ec2-key-pairs]: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html\n[driver-ssl-impl]: https://github.com/christkv/mongodb-core/blob/c3d21cb636d74d7a68134ecd3b9f6af536311279/lib/connection/connection.js#L365-L407\n[driver-ssl-tutorial]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/\n[driver-ssl-none]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#no-certificate-validation\n[driver-ssl-server]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate\n[driver-ssl-all]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate-and-present-valid-certificate\n","gitHead":"e182f845553cf87006baf04d22367061288c5226","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","check":"npm run lint && npm run depcheck","depcheck":"depcheck","test-check-ci":"npm run check"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.17.0+x64 (linux)","description":"MongoDB connection model","directories":{},"_nodeVersion":"16.17.0","compass:main":"index.js","dependencies":{"raf":"^3.4.1","debug":"^4.2.0","lodash":"^4.17.21","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.2.0","storage-mixin":"0.0.0-next-e182f845553cf87006baf04d22367061288c5226","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.2","@mongodb-js/ssh-tunnel":"0.0.0-next-e182f845553cf87006baf04d22367061288c5226","@mongodb-js/compass-utils":"0.0.0-next-e182f845553cf87006baf04d22367061288c5226","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.6.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"^5.5.0","depcheck":"^1.4.1","proxyquire":"^2.1.3","chai-subset":"^1.6.0","mock-require":"^3.0.3","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^5.5.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_0.0.0-next-e182f845553cf87006baf04d22367061288c5226_1685752348198_0.7068142496631749","host":"s3://npm-registry-packages"}},"0.0.0-next-2d8cfc600e1d4de8c32643b601d0c021734b31ed":{"name":"mongodb-connection-model","version":"0.0.0-next-2d8cfc600e1d4de8c32643b601d0c021734b31ed","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@0.0.0-next-2d8cfc600e1d4de8c32643b601d0c021734b31ed","maintainers":[{"name":"mongo-j","email":"james.wang@mongodb.com"},{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satya@mongodb.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"iteng@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"ed4e827d88218a1a10a4c02134d67fb6e5d87372","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-0.0.0-next-2d8cfc600e1d4de8c32643b601d0c021734b31ed.tgz","fileCount":20,"integrity":"sha512-/S5tFnZUkkr1mu/tfsq36gHjLd5FOsMZ+Ek3YpHOgovIhruBbjNTTDIeiEQZcXFAljj8eh0DmMEK+LSuuansgA==","signatures":[{"sig":"MEUCIQDAkeQN//aslY8vq7uCg80IalazhRRue2VcdXXMyPbtBwIgT7j8KvvHowdoQhgjqjDfparDqXmB7Rm41f2e99E07NA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":107810},"main":"index.js","readme":"# mongodb-connection-model [![][workflow_img]][workflow_url] [![][npm_img]][npm_url]\n\n> MongoDB connection model\n\nThe main purpose of the MongoDB connection model is to be a domain model around a MongoDB connection. It encapsulates generating a [Connection String URI](https://docs.mongodb.com/manual/reference/connection-string/) from a group of attributes and parses URI using the [MongoDB Node.JS Driver URI Parser](https://github.com/mongodb-js/mongodb-core/blob/master/lib/uri_parser.js).\n\n## Installation\n\n```\nnpm install --save mongodb-connection-model\n```\n\n## Usage\n\n### Building URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\nconst c = new Connection({ appname: 'My App Name' });\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://localhost:27017/?readPreference=primary&appname=My%20App&ssl=false'\n```\n\n### Parsing URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\n\nConnection.from(\n  'mongodb://someUsername:testPassword@localhost',\n  (error, result) => {\n    console.log(result);\n    >>> `{\n      hosts: [{ host: 'localhost', port: 27017 }],\n      hostname: 'localhost',\n      port: 27017,\n      auth: {\n        username: 'someUsername',\n        password: 'testPassword',\n        db: 'admin'\n      },\n      isSrvRecord: false,\n      authStrategy: 'MONGODB',\n      mongodbUsername: 'someUsername',\n      mongodbPassword: 'testPassword',\n      mongodbDatabaseName: 'admin',\n      extraOptions: {},\n      connectionType: 'NODE_DRIVER',\n      readPreference: 'primary',\n      kerberosCanonicalizeHostname: false,\n      sslMethod: 'NONE',\n      sshTunnel: 'NONE',\n      sshTunnelPort: 22\n    }`\n  }\n);\n```\n\n## Properties\n\nMongoDB connection model is based on Ampersand.js framework and consist of [props](https://ampersandjs.com/docs/#ampersand-state-props) and [derived props](https://ampersandjs.com/docs/#ampersand-state-derived). The props object describes the observable properties that MongoDB connection model gets from the Node.js Driver API.\n\n```javascript\nconst с = new Connection();\nconst props = с.getAttributes({ props: true });\n```\n\n#### See Also\n\n- [URI Generic Syntax](https://tools.ietf.org/html/rfc3986)\n- [URI Options Specification](https://github.com/mongodb/specifications/blob/master/source/uri-options/uri-options.rst)\n\n### General Properties\n\n```javascript\nconst c = new Connection({ isSrvRecord: true });\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ns` | String | A valid [ns][ns] the user can read from | `undefined` |\n| `isSrvRecord` | Boolean | Indicates SRV record | `false` |\n| `auth` | Object | Authentication from driver (username, user, db, password) | `undefined` |\n| `hostname` | String | Hostname of a MongoDB Instance. In case of the replica set the first host and port will be taken | `localhost` |\n| `port` | Number | TCP port of a MongoDB Instance | `27017` |\n| `hosts` | Array | Contains all hosts and ports for replica set | `[{ host: 'localhost', port: 27017 }]` |\n| `extraOptions` | Object | Extra options passed to the node driver as part of `driverOptions` | `{}` |\n| `connectionType` | String | The desired connection type. Possible values: `NODE_DRIVER`, `STITCH_ON_PREM`, `STITCH_ATLAS` | `NODE_DRIVER` |\n| `authStrategy` | String | The desired authentication strategy. Possible values: `NONE`, `MONGODB`, `X509`, `KERBEROS`, `LDAP`, `SCRAM-SHA-256` | `NONE` |\n\n### Connection string options\n\n```javascript\nconst c = new Connection({ appname: 'My App', replicaSet: 'testing' });\n```\n\n#### General connection string options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `replicaSet` | String | Specifies the name of the replica set, if the mongod is a member of a replica set | `undefined` |\n| `connectTimeoutMS` | Number | The time in milliseconds to attempt a connection before timing out | `undefined` |\n| `socketTimeoutMS` | Number | The time in milliseconds to attempt a send or receive on a socket before the attempt times out | `undefined` |\n| `compression` | Object | Object includes compressors and a compression level. The following compressors can be specified: `snappy`, `zlib` (Available in MongoDB 3.6 or greater) | `undefined` |\n\n#### Connection Pool Option\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `maxPoolSize` | Number | The maximum number of connections in the connection pool | `undefined` |\n| `minPoolSize` | Number | The minimum number of connections in the connection pool | `undefined` |\n| `maxIdleTimeMS` | Number | The maximum number of milliseconds that a connection can remain idle in the pool before being removed and closed | `undefined` |\n| `waitQueueMultiple` | Number | A number that the driver multiples the maxPoolSize value to, to provide the maximum number of threads allowed to wait for a connection to become available from the pool | `undefined` |\n| `waitQueueTimeoutMS` | Number | The maximum time in milliseconds that a thread can wait for a connection to become available | `undefined` |\n\n#### Write Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `w` | Number/String | Corresponds to the write concern [w Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-w) | `undefined` |\n| `wTimeoutMS` | Number | Corresponds to the write concern [wtimeout](https://docs.mongodb.com/manual/reference/write-concern/#wc-wtimeout) | `undefined` |\n| `journal` | Boolean | Corresponds to the write concern [j Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-j) | `undefined` |\n\n#### Read Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readConcernLevel` | String | The level of isolation | `undefined` |\n\n#### Read Preference Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readPreference` | String | Specifies the read preferences for this connection. Possible values: `PRIMARY`, `PRIMARY_PREFERRED`, `SECONDARY`, `SECONDARY_PREFERRED`, `NEAREST` | `PRIMARY` |\n| `maxStalenessSeconds` | Number | Specifies, in seconds, how stale a secondary can be before the client stops using it for read operations | `undefined` |\n| `readPreferenceTags` | Object | Default read preference tags for the client | `undefined` |\n\n#### Authentication Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `authSource` | String | Specify the database name associated with the user’s credentials | `undefined` |\n| `authMechanism` | String | Specifies the authentication mechanism that MongoDB will use to authenticate the connection. Possible values: `DEFAULT`, `GSSAPI`, `MONGODB-X509`, `PLAIN`, `SCRAM-SHA-256` | `undefined` |\n| `authMechanismProperties` | Object | Additional options provided for authentication (e.g. to enable hostname canonicalization for GSSAPI) | `undefined` |\n| `gssapiServiceName` | String | Set the Kerberos service name when connecting to Kerberized MongoDB instances | `undefined` |\n| `gssapiServiceRealm` | String | Set the Realm service name | `undefined` |\n| `gssapiCanonicalizeHostName` | Boolean | Whether canonicalized hostname | `undefined` |\n\n#### Server Selection and Discovery Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `localThresholdMS` | Number | The size (in milliseconds) of the latency window for selecting among multiple suitable MongoDB instances | `undefined` |\n| `serverSelectionTimeoutMS` | Number | Specifies how long (in milliseconds) to block for server selection before throwing an exception | `undefined` |\n| `serverSelectionTryOnce` | Boolean | Instructs the driver to scan the MongoDB deployment exactly once after server selection fails and then either select a server or raise an error | `undefined` |\n| `heartbeatFrequencyMS` | Number | Controls when the driver checks the state of the MongoDB deployment | `undefined` |\n\n#### Miscellaneous Configuration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `appname` | String | An application name passed to server as client metadata | `undefined` |\n| `retryWrites` | Boolean | Enable retryable writes | `undefined` |\n| `uuidRepresentation` | String | The legacy representation of UUID. Possible values: `standard`, `csharpLegacy`, `javaLegacy`, `pythonLegacy` | `undefined` |\n| `loadBalanced` | Boolean | Whether or not the server is running in load balanced mode | `undefined` |\n\n### Stitch attributes\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `stitchServiceName` | String | Stitch service name | `undefined` |\n| `stitchClientAppId` | String | Stitch сlient app ID | `undefined` |\n| `stitchGroupId` | String | Stitch group ID | `undefined` |\n| `stitchBaseUrl` | String | Stitch base Url | `undefined` |\n\n### MONGODB authentication\n\n```javascript\nconst c = new Connection({\n  mongodbUsername: 'arlo',\n  mongodbPassword: 'w@of'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/?slaveOk=true&authSource=admin'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `mongodbUsername` | String | MongoDB username | `undefined` |\n| `mongodbPassword` | String | MongoDB password | `undefined` |\n| `mongodbDatabaseName` | String | The database name associated with the user's credentials | `undefined` |\n| `promoteValues` | Boolean | Whether BSON values should be promoted to their JS type counterparts | `undefined` |\n\n### KERBEROS authentication\n\n```javascript\nconst c = new Connection({\n  kerberosServiceName: 'mongodb',\n  kerberosPrincipal: 'arlo/dog@krb5.mongodb.parts',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo%252Fdog%2540krb5.mongodb.parts@localhost:27017/toys?authMechanism=GSSAPI'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n> @note (imlucas): Kerberos on Windows is broken out as it's own state for UX consideration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `kerberosServiceName` | String | Any program or computer you access over a network | `undefined` |\n| `kerberosPrincipal` | String | The format of a typical Kerberos V5 principal is `primary/instance@REALM` | `undefined` |\n| `kerberosCanonicalizeHostname` | Boolean | Whether canonicalized kerberos hostname | `undefined` |\n\n#### See Also\n\n- [node.js driver Kerberos reference](http://bit.ly/mongodb-node-driver-kerberos)\n- [node.js driver Kerberos functional test][kerberos-functional]\n\n### LDAP authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  ldapUsername: 'arlo',\n  ldapPassword: 'w@of',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/toys?slaveOk=true&authMechanism=PLAIN'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ldapUsername` | String | LDAP username | `undefined` |\n| `ldapPassword` | String | LDAP password | `undefined` |\n\n#### See Also\n\n- [node.js driver LDAP reference](http://bit.ly/mongodb-node-driver-ldap)\n- [node.js driver X509 functional test][ldap-functional]\n\n### X509 authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  x509Username: 'CN=client,OU=arlo,O=MongoDB,L=Philadelphia,ST=Pennsylvania,C=US'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://CN%253Dclient%252COU%253Darlo%252CO%253DMongoDB%252CL%253DPhiladelphia%252CST%253DPennsylvania%252CC%253DUS@localhost:27017?slaveOk=true&authMechanism=MONGODB-X509'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `x509Username` | String | The x.509 certificate derived user name, e.g. `CN=user,OU=OrgUnit,O=myOrg,...` | `undefined` |\n\n#### See Also\n\n- [node.js driver X509 reference](http://bit.ly/mongodb-node-driver-x509)\n- [node.js driver X509 functional test][x509-functional]\n\n### SSL\n\n> **Note**: Not to be confused with `authentication=X509`\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ssl` | Number/String | A boolean to enable or disables TLS/SSL for the connection | `undefined` |\n| `sslMethod` | String | The desired ssl method. Possible values: `NONE`, `SYSTEMCA`, `IFAVAILABLE`, `UNVALIDATED`, `SERVER`, `ALL` | `NONE` |\n| `sslCA` | Buffer/String | Array of valid certificates | `undefined` |\n| `sslCert` | Buffer/String | The certificate | `undefined` |\n| `sslKey` | Buffer/String | The certificate private key | `undefined` |\n| `sslPass` | Buffer/String | The certificate password | `undefined` |\n\nDescription of `sslMethod` values:\n\n- `SYSTEMCA` - SSL required, validate using System CA, with host verification.\n- `IFAVAILABLE` - The driver should try SSL first, fall back to no SSL if unavailable, and use the system's Certificate Authority.\n- `SERVER` - The driver should validate the server certificate and fail to connect if validation fails. See also [node.js driver \"Validate Server Certificate\" docs][driver-ssl-server].\n- `ALL` - The driver must present a valid certificate and validate the server certificate. See also [node.js driver \"Validate Server Certificate and Present Valid Certificate\" docs][driver-ssl-all].\n- `NONE` - No SSL (Not recommended).\n- `UNVALIDATED` - Use SSL but do not perform any validation of the certificate chain. See also [node.js driver \"No Certificate Validation\" docs][driver-ssl-none]. **Very** not recommended and likely to be deprecated in future releases because it exposes potential Man-In-The-Middle attack vectors.\n\n#### See also\n\n- [node.js driver SSL implementation][driver-ssl-impl]\n- [node.js driver SSL tutorial][driver-ssl-tutorial]\n\n### SSH TUNNEL\n\n> New in mongodb-connection-model@5.0.0\n\nBecause [authentication](#authentication) is quite difficult for operators to migrate to, the most common method of securing a MongoDB deployment is to use an [SSH tunnel][sf-ssh-tunnel].  This allows operators to leverage their existing SSH security infrastructure to also provide secure access to MongoDB.  For a standard deployment of MongoDB on AWS, this is almost always to strategy.  Because of this, we now support creating SSH tunnels automatically when connecting to MongoDB.\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options, (connectionError, client) => {\n  if (connectionError) {\n    return console.log(connectionError);\n  }\n\n  client.db('mongodb').collection('fanclub').count((countingError, count) => {\n    console.log('counted:', countingError, count);\n    client.close();\n  });\n});\n```\n\nThe above provides the same functionality as creating the tunnel using the bash\ncommand below and connecting to MongoDB via another terminal. Notice that\nconnection-model uses a random local port each time it creates a tunnel.\nUsing the command line, you'd have to replace `<random port>` with an actual\nport number.\n\n```bash\nssh -i ~/.ssh/my-key-aws-pair.pem -L <random port>:localhost:27017 ubuntu@ec2-11-111-111-111.compute-1.amazonaws.com\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `sshTunnel` | String | The desired SSH tunnel strategy. Possible values: `NONE`, `USER_PASSWORD`, `IDENTITY_FILE` | `undefined` |\n| `sshTunnelHostname` | String | The hostname of the SSH remote host | `undefined` |\n| `sshTunnelPort` | Port | The SSH port of the remote host | `22` |\n| `sshTunnelBindToLocalPort` | Port | Bind the localhost endpoint of the SSH Tunnel to this port | `undefined` |\n| `sshTunnelUsername` | String | The optional SSH username for the remote host | `undefined` |\n| `sshTunnelPassword` | String | The optional SSH password for the remote host | `undefined` |\n| `sshTunnelIdentityFile` | String/Array | The optional path to the SSH identity file for the remote host | `undefined` |\n| `sshTunnelPassphrase` | String | The optional passphrase for `sshTunnelIdentityFile` | `undefined` |\n\nDescription of `sshTunnel` values:\n\n- `NONE` - Do not use SSH tunneling.\n- `USER_PASSWORD` - The tunnel is created with SSH username and password only.\n- `IDENTITY_FILE` - The tunnel is created using an identity file.\n\n## Derived Properties\n\nDerived properties (also known as computed properties) are properties of the state object that depend on other properties to determine their value.\n\n```javascript\nconst c = new Connection();\nconst derivedProps = c.getAttributes({ derived: true });\n```\n\n| Derived Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `instanceId` | String | The mongoscope | `localhost:27017` |\n| `driverAuthMechanism` | String | Converts the value of `authStrategy` for humans into the `authMechanism` value for the driver | `undefined` |\n| `safeUrl` | String | The URL where a password is replaced with stars | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrl` | String | Use this URL in order to connect via DataService | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrlWithSsh` | String | Use this URL in order to connect via connection model itself | `mongodb://localhost:29201/?readPreference=primary&ssl=false` |\n| `driverOptions` | String | The second argument `mongoscope-server` passes to `mongodb.connect` | `{}` |\n\n## Events\n\n> New in mongodb-connection-model@5.0.0\n\n#### Example: SSH Tunnel\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', skipped: true,\n  reason: 'The selected SSL mode does not need to load any files.' }\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', complete: true}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n#### Example: SSL\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  ssl: 'ALL',\n  sslCA: '~/.ssl/my-ca.pem',\n  sslCert: '~/.ssl/my-server.pem',\n  sslKey: '~/.ssl/my-server.pem'\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', complete: true}\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', skipped: true,\n  reason: 'The selected SSH Tunnel mode is NONE.'}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n[workflow_img]: https://github.com/mongodb-js/connection-model/workflows/Check%20and%20Test/badge.svg?event=push\n[workflow_url]: https://github.com/mongodb-js/connection-model/actions?query=workflow%3A%22Check+and+Test%22\n[npm_img]: https://img.shields.io/npm/v/mongodb-connection-model.svg?style=flat-square\n[npm_url]: https://www.npmjs.org/package/mongodb-connection-model\n[gitter_img]: https://badges.gitter.im/Join%20Chat.svg\n[gitter_url]: http://gitter.im/mongodb-js/mongodb-js\n[enterprise_img]: https://img.shields.io/badge/MongoDB-Enterprise-blue.svg?style=flat-square\n[coming_soon_img]: https://img.shields.io/badge/-Coming%20Soon-ff69b4.svg?style=flat-square\n[kerberos-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/kerberos_tests.js\n[ldap-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ldap_tests.js\n[x509-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ssl_x509_tests.js\n[ns]: https://github.com/mongodb-js/ns\n[sf-ssh-tunnel]: http://serverfault.com/questions/597765/how-to-connect-to-mongodb-server-via-ssh-tunnel\n[ec2-key-pairs]: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html\n[driver-ssl-impl]: https://github.com/christkv/mongodb-core/blob/c3d21cb636d74d7a68134ecd3b9f6af536311279/lib/connection/connection.js#L365-L407\n[driver-ssl-tutorial]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/\n[driver-ssl-none]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#no-certificate-validation\n[driver-ssl-server]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate\n[driver-ssl-all]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate-and-present-valid-certificate\n","gitHead":"2d8cfc600e1d4de8c32643b601d0c021734b31ed","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","check":"npm run lint && npm run depcheck","depcheck":"depcheck","test-check-ci":"npm run check"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.17.0+x64 (linux)","description":"MongoDB connection model","directories":{},"_nodeVersion":"16.17.0","compass:main":"index.js","dependencies":{"raf":"^3.4.1","debug":"^4.2.0","lodash":"^4.17.21","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.2.0","storage-mixin":"0.0.0-next-2d8cfc600e1d4de8c32643b601d0c021734b31ed","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.2","@mongodb-js/ssh-tunnel":"0.0.0-next-2d8cfc600e1d4de8c32643b601d0c021734b31ed","@mongodb-js/compass-utils":"0.0.0-next-2d8cfc600e1d4de8c32643b601d0c021734b31ed","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.6.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"^5.5.0","depcheck":"^1.4.1","proxyquire":"^2.1.3","chai-subset":"^1.6.0","mock-require":"^3.0.3","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^5.5.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_0.0.0-next-2d8cfc600e1d4de8c32643b601d0c021734b31ed_1685753624861_0.19199691858376244","host":"s3://npm-registry-packages"}},"0.0.0-next-c2ee6dc98a012b4f4494e197ec69ca57d395b8fa":{"name":"mongodb-connection-model","version":"0.0.0-next-c2ee6dc98a012b4f4494e197ec69ca57d395b8fa","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@0.0.0-next-c2ee6dc98a012b4f4494e197ec69ca57d395b8fa","maintainers":[{"name":"mongo-j","email":"james.wang@mongodb.com"},{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satya@mongodb.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"iteng@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"b0ed0d8fa528007c7fa331ee2a12ed5fe00a8a12","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-0.0.0-next-c2ee6dc98a012b4f4494e197ec69ca57d395b8fa.tgz","fileCount":20,"integrity":"sha512-kp7mpIZh4+V70hpWVOWZV4268WklDqLWELMHliEwR4kbjENdHElnkRcJ9GFjUbqbAAZKZy21pkYsSZPiOMDa2g==","signatures":[{"sig":"MEQCICOC5QLzqEB1wE/+eeZyusUKVA7drV6LAsIETHNgYkomAiAKrF1I2pGvTvF3hl7C++z2GOXD2YXldlnmtkQumqijKA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":107810},"main":"index.js","readme":"# mongodb-connection-model [![][workflow_img]][workflow_url] [![][npm_img]][npm_url]\n\n> MongoDB connection model\n\nThe main purpose of the MongoDB connection model is to be a domain model around a MongoDB connection. It encapsulates generating a [Connection String URI](https://docs.mongodb.com/manual/reference/connection-string/) from a group of attributes and parses URI using the [MongoDB Node.JS Driver URI Parser](https://github.com/mongodb-js/mongodb-core/blob/master/lib/uri_parser.js).\n\n## Installation\n\n```\nnpm install --save mongodb-connection-model\n```\n\n## Usage\n\n### Building URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\nconst c = new Connection({ appname: 'My App Name' });\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://localhost:27017/?readPreference=primary&appname=My%20App&ssl=false'\n```\n\n### Parsing URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\n\nConnection.from(\n  'mongodb://someUsername:testPassword@localhost',\n  (error, result) => {\n    console.log(result);\n    >>> `{\n      hosts: [{ host: 'localhost', port: 27017 }],\n      hostname: 'localhost',\n      port: 27017,\n      auth: {\n        username: 'someUsername',\n        password: 'testPassword',\n        db: 'admin'\n      },\n      isSrvRecord: false,\n      authStrategy: 'MONGODB',\n      mongodbUsername: 'someUsername',\n      mongodbPassword: 'testPassword',\n      mongodbDatabaseName: 'admin',\n      extraOptions: {},\n      connectionType: 'NODE_DRIVER',\n      readPreference: 'primary',\n      kerberosCanonicalizeHostname: false,\n      sslMethod: 'NONE',\n      sshTunnel: 'NONE',\n      sshTunnelPort: 22\n    }`\n  }\n);\n```\n\n## Properties\n\nMongoDB connection model is based on Ampersand.js framework and consist of [props](https://ampersandjs.com/docs/#ampersand-state-props) and [derived props](https://ampersandjs.com/docs/#ampersand-state-derived). The props object describes the observable properties that MongoDB connection model gets from the Node.js Driver API.\n\n```javascript\nconst с = new Connection();\nconst props = с.getAttributes({ props: true });\n```\n\n#### See Also\n\n- [URI Generic Syntax](https://tools.ietf.org/html/rfc3986)\n- [URI Options Specification](https://github.com/mongodb/specifications/blob/master/source/uri-options/uri-options.rst)\n\n### General Properties\n\n```javascript\nconst c = new Connection({ isSrvRecord: true });\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ns` | String | A valid [ns][ns] the user can read from | `undefined` |\n| `isSrvRecord` | Boolean | Indicates SRV record | `false` |\n| `auth` | Object | Authentication from driver (username, user, db, password) | `undefined` |\n| `hostname` | String | Hostname of a MongoDB Instance. In case of the replica set the first host and port will be taken | `localhost` |\n| `port` | Number | TCP port of a MongoDB Instance | `27017` |\n| `hosts` | Array | Contains all hosts and ports for replica set | `[{ host: 'localhost', port: 27017 }]` |\n| `extraOptions` | Object | Extra options passed to the node driver as part of `driverOptions` | `{}` |\n| `connectionType` | String | The desired connection type. Possible values: `NODE_DRIVER`, `STITCH_ON_PREM`, `STITCH_ATLAS` | `NODE_DRIVER` |\n| `authStrategy` | String | The desired authentication strategy. Possible values: `NONE`, `MONGODB`, `X509`, `KERBEROS`, `LDAP`, `SCRAM-SHA-256` | `NONE` |\n\n### Connection string options\n\n```javascript\nconst c = new Connection({ appname: 'My App', replicaSet: 'testing' });\n```\n\n#### General connection string options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `replicaSet` | String | Specifies the name of the replica set, if the mongod is a member of a replica set | `undefined` |\n| `connectTimeoutMS` | Number | The time in milliseconds to attempt a connection before timing out | `undefined` |\n| `socketTimeoutMS` | Number | The time in milliseconds to attempt a send or receive on a socket before the attempt times out | `undefined` |\n| `compression` | Object | Object includes compressors and a compression level. The following compressors can be specified: `snappy`, `zlib` (Available in MongoDB 3.6 or greater) | `undefined` |\n\n#### Connection Pool Option\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `maxPoolSize` | Number | The maximum number of connections in the connection pool | `undefined` |\n| `minPoolSize` | Number | The minimum number of connections in the connection pool | `undefined` |\n| `maxIdleTimeMS` | Number | The maximum number of milliseconds that a connection can remain idle in the pool before being removed and closed | `undefined` |\n| `waitQueueMultiple` | Number | A number that the driver multiples the maxPoolSize value to, to provide the maximum number of threads allowed to wait for a connection to become available from the pool | `undefined` |\n| `waitQueueTimeoutMS` | Number | The maximum time in milliseconds that a thread can wait for a connection to become available | `undefined` |\n\n#### Write Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `w` | Number/String | Corresponds to the write concern [w Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-w) | `undefined` |\n| `wTimeoutMS` | Number | Corresponds to the write concern [wtimeout](https://docs.mongodb.com/manual/reference/write-concern/#wc-wtimeout) | `undefined` |\n| `journal` | Boolean | Corresponds to the write concern [j Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-j) | `undefined` |\n\n#### Read Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readConcernLevel` | String | The level of isolation | `undefined` |\n\n#### Read Preference Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readPreference` | String | Specifies the read preferences for this connection. Possible values: `PRIMARY`, `PRIMARY_PREFERRED`, `SECONDARY`, `SECONDARY_PREFERRED`, `NEAREST` | `PRIMARY` |\n| `maxStalenessSeconds` | Number | Specifies, in seconds, how stale a secondary can be before the client stops using it for read operations | `undefined` |\n| `readPreferenceTags` | Object | Default read preference tags for the client | `undefined` |\n\n#### Authentication Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `authSource` | String | Specify the database name associated with the user’s credentials | `undefined` |\n| `authMechanism` | String | Specifies the authentication mechanism that MongoDB will use to authenticate the connection. Possible values: `DEFAULT`, `GSSAPI`, `MONGODB-X509`, `PLAIN`, `SCRAM-SHA-256` | `undefined` |\n| `authMechanismProperties` | Object | Additional options provided for authentication (e.g. to enable hostname canonicalization for GSSAPI) | `undefined` |\n| `gssapiServiceName` | String | Set the Kerberos service name when connecting to Kerberized MongoDB instances | `undefined` |\n| `gssapiServiceRealm` | String | Set the Realm service name | `undefined` |\n| `gssapiCanonicalizeHostName` | Boolean | Whether canonicalized hostname | `undefined` |\n\n#### Server Selection and Discovery Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `localThresholdMS` | Number | The size (in milliseconds) of the latency window for selecting among multiple suitable MongoDB instances | `undefined` |\n| `serverSelectionTimeoutMS` | Number | Specifies how long (in milliseconds) to block for server selection before throwing an exception | `undefined` |\n| `serverSelectionTryOnce` | Boolean | Instructs the driver to scan the MongoDB deployment exactly once after server selection fails and then either select a server or raise an error | `undefined` |\n| `heartbeatFrequencyMS` | Number | Controls when the driver checks the state of the MongoDB deployment | `undefined` |\n\n#### Miscellaneous Configuration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `appname` | String | An application name passed to server as client metadata | `undefined` |\n| `retryWrites` | Boolean | Enable retryable writes | `undefined` |\n| `uuidRepresentation` | String | The legacy representation of UUID. Possible values: `standard`, `csharpLegacy`, `javaLegacy`, `pythonLegacy` | `undefined` |\n| `loadBalanced` | Boolean | Whether or not the server is running in load balanced mode | `undefined` |\n\n### Stitch attributes\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `stitchServiceName` | String | Stitch service name | `undefined` |\n| `stitchClientAppId` | String | Stitch сlient app ID | `undefined` |\n| `stitchGroupId` | String | Stitch group ID | `undefined` |\n| `stitchBaseUrl` | String | Stitch base Url | `undefined` |\n\n### MONGODB authentication\n\n```javascript\nconst c = new Connection({\n  mongodbUsername: 'arlo',\n  mongodbPassword: 'w@of'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/?slaveOk=true&authSource=admin'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `mongodbUsername` | String | MongoDB username | `undefined` |\n| `mongodbPassword` | String | MongoDB password | `undefined` |\n| `mongodbDatabaseName` | String | The database name associated with the user's credentials | `undefined` |\n| `promoteValues` | Boolean | Whether BSON values should be promoted to their JS type counterparts | `undefined` |\n\n### KERBEROS authentication\n\n```javascript\nconst c = new Connection({\n  kerberosServiceName: 'mongodb',\n  kerberosPrincipal: 'arlo/dog@krb5.mongodb.parts',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo%252Fdog%2540krb5.mongodb.parts@localhost:27017/toys?authMechanism=GSSAPI'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n> @note (imlucas): Kerberos on Windows is broken out as it's own state for UX consideration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `kerberosServiceName` | String | Any program or computer you access over a network | `undefined` |\n| `kerberosPrincipal` | String | The format of a typical Kerberos V5 principal is `primary/instance@REALM` | `undefined` |\n| `kerberosCanonicalizeHostname` | Boolean | Whether canonicalized kerberos hostname | `undefined` |\n\n#### See Also\n\n- [node.js driver Kerberos reference](http://bit.ly/mongodb-node-driver-kerberos)\n- [node.js driver Kerberos functional test][kerberos-functional]\n\n### LDAP authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  ldapUsername: 'arlo',\n  ldapPassword: 'w@of',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/toys?slaveOk=true&authMechanism=PLAIN'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ldapUsername` | String | LDAP username | `undefined` |\n| `ldapPassword` | String | LDAP password | `undefined` |\n\n#### See Also\n\n- [node.js driver LDAP reference](http://bit.ly/mongodb-node-driver-ldap)\n- [node.js driver X509 functional test][ldap-functional]\n\n### X509 authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  x509Username: 'CN=client,OU=arlo,O=MongoDB,L=Philadelphia,ST=Pennsylvania,C=US'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://CN%253Dclient%252COU%253Darlo%252CO%253DMongoDB%252CL%253DPhiladelphia%252CST%253DPennsylvania%252CC%253DUS@localhost:27017?slaveOk=true&authMechanism=MONGODB-X509'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `x509Username` | String | The x.509 certificate derived user name, e.g. `CN=user,OU=OrgUnit,O=myOrg,...` | `undefined` |\n\n#### See Also\n\n- [node.js driver X509 reference](http://bit.ly/mongodb-node-driver-x509)\n- [node.js driver X509 functional test][x509-functional]\n\n### SSL\n\n> **Note**: Not to be confused with `authentication=X509`\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ssl` | Number/String | A boolean to enable or disables TLS/SSL for the connection | `undefined` |\n| `sslMethod` | String | The desired ssl method. Possible values: `NONE`, `SYSTEMCA`, `IFAVAILABLE`, `UNVALIDATED`, `SERVER`, `ALL` | `NONE` |\n| `sslCA` | Buffer/String | Array of valid certificates | `undefined` |\n| `sslCert` | Buffer/String | The certificate | `undefined` |\n| `sslKey` | Buffer/String | The certificate private key | `undefined` |\n| `sslPass` | Buffer/String | The certificate password | `undefined` |\n\nDescription of `sslMethod` values:\n\n- `SYSTEMCA` - SSL required, validate using System CA, with host verification.\n- `IFAVAILABLE` - The driver should try SSL first, fall back to no SSL if unavailable, and use the system's Certificate Authority.\n- `SERVER` - The driver should validate the server certificate and fail to connect if validation fails. See also [node.js driver \"Validate Server Certificate\" docs][driver-ssl-server].\n- `ALL` - The driver must present a valid certificate and validate the server certificate. See also [node.js driver \"Validate Server Certificate and Present Valid Certificate\" docs][driver-ssl-all].\n- `NONE` - No SSL (Not recommended).\n- `UNVALIDATED` - Use SSL but do not perform any validation of the certificate chain. See also [node.js driver \"No Certificate Validation\" docs][driver-ssl-none]. **Very** not recommended and likely to be deprecated in future releases because it exposes potential Man-In-The-Middle attack vectors.\n\n#### See also\n\n- [node.js driver SSL implementation][driver-ssl-impl]\n- [node.js driver SSL tutorial][driver-ssl-tutorial]\n\n### SSH TUNNEL\n\n> New in mongodb-connection-model@5.0.0\n\nBecause [authentication](#authentication) is quite difficult for operators to migrate to, the most common method of securing a MongoDB deployment is to use an [SSH tunnel][sf-ssh-tunnel].  This allows operators to leverage their existing SSH security infrastructure to also provide secure access to MongoDB.  For a standard deployment of MongoDB on AWS, this is almost always to strategy.  Because of this, we now support creating SSH tunnels automatically when connecting to MongoDB.\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options, (connectionError, client) => {\n  if (connectionError) {\n    return console.log(connectionError);\n  }\n\n  client.db('mongodb').collection('fanclub').count((countingError, count) => {\n    console.log('counted:', countingError, count);\n    client.close();\n  });\n});\n```\n\nThe above provides the same functionality as creating the tunnel using the bash\ncommand below and connecting to MongoDB via another terminal. Notice that\nconnection-model uses a random local port each time it creates a tunnel.\nUsing the command line, you'd have to replace `<random port>` with an actual\nport number.\n\n```bash\nssh -i ~/.ssh/my-key-aws-pair.pem -L <random port>:localhost:27017 ubuntu@ec2-11-111-111-111.compute-1.amazonaws.com\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `sshTunnel` | String | The desired SSH tunnel strategy. Possible values: `NONE`, `USER_PASSWORD`, `IDENTITY_FILE` | `undefined` |\n| `sshTunnelHostname` | String | The hostname of the SSH remote host | `undefined` |\n| `sshTunnelPort` | Port | The SSH port of the remote host | `22` |\n| `sshTunnelBindToLocalPort` | Port | Bind the localhost endpoint of the SSH Tunnel to this port | `undefined` |\n| `sshTunnelUsername` | String | The optional SSH username for the remote host | `undefined` |\n| `sshTunnelPassword` | String | The optional SSH password for the remote host | `undefined` |\n| `sshTunnelIdentityFile` | String/Array | The optional path to the SSH identity file for the remote host | `undefined` |\n| `sshTunnelPassphrase` | String | The optional passphrase for `sshTunnelIdentityFile` | `undefined` |\n\nDescription of `sshTunnel` values:\n\n- `NONE` - Do not use SSH tunneling.\n- `USER_PASSWORD` - The tunnel is created with SSH username and password only.\n- `IDENTITY_FILE` - The tunnel is created using an identity file.\n\n## Derived Properties\n\nDerived properties (also known as computed properties) are properties of the state object that depend on other properties to determine their value.\n\n```javascript\nconst c = new Connection();\nconst derivedProps = c.getAttributes({ derived: true });\n```\n\n| Derived Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `instanceId` | String | The mongoscope | `localhost:27017` |\n| `driverAuthMechanism` | String | Converts the value of `authStrategy` for humans into the `authMechanism` value for the driver | `undefined` |\n| `safeUrl` | String | The URL where a password is replaced with stars | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrl` | String | Use this URL in order to connect via DataService | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrlWithSsh` | String | Use this URL in order to connect via connection model itself | `mongodb://localhost:29201/?readPreference=primary&ssl=false` |\n| `driverOptions` | String | The second argument `mongoscope-server` passes to `mongodb.connect` | `{}` |\n\n## Events\n\n> New in mongodb-connection-model@5.0.0\n\n#### Example: SSH Tunnel\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', skipped: true,\n  reason: 'The selected SSL mode does not need to load any files.' }\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', complete: true}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n#### Example: SSL\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  ssl: 'ALL',\n  sslCA: '~/.ssl/my-ca.pem',\n  sslCert: '~/.ssl/my-server.pem',\n  sslKey: '~/.ssl/my-server.pem'\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', complete: true}\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', skipped: true,\n  reason: 'The selected SSH Tunnel mode is NONE.'}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n[workflow_img]: https://github.com/mongodb-js/connection-model/workflows/Check%20and%20Test/badge.svg?event=push\n[workflow_url]: https://github.com/mongodb-js/connection-model/actions?query=workflow%3A%22Check+and+Test%22\n[npm_img]: https://img.shields.io/npm/v/mongodb-connection-model.svg?style=flat-square\n[npm_url]: https://www.npmjs.org/package/mongodb-connection-model\n[gitter_img]: https://badges.gitter.im/Join%20Chat.svg\n[gitter_url]: http://gitter.im/mongodb-js/mongodb-js\n[enterprise_img]: https://img.shields.io/badge/MongoDB-Enterprise-blue.svg?style=flat-square\n[coming_soon_img]: https://img.shields.io/badge/-Coming%20Soon-ff69b4.svg?style=flat-square\n[kerberos-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/kerberos_tests.js\n[ldap-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ldap_tests.js\n[x509-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ssl_x509_tests.js\n[ns]: https://github.com/mongodb-js/ns\n[sf-ssh-tunnel]: http://serverfault.com/questions/597765/how-to-connect-to-mongodb-server-via-ssh-tunnel\n[ec2-key-pairs]: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html\n[driver-ssl-impl]: https://github.com/christkv/mongodb-core/blob/c3d21cb636d74d7a68134ecd3b9f6af536311279/lib/connection/connection.js#L365-L407\n[driver-ssl-tutorial]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/\n[driver-ssl-none]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#no-certificate-validation\n[driver-ssl-server]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate\n[driver-ssl-all]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate-and-present-valid-certificate\n","gitHead":"c2ee6dc98a012b4f4494e197ec69ca57d395b8fa","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","check":"npm run lint && npm run depcheck","depcheck":"depcheck","test-check-ci":"npm run check"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.17.0+x64 (linux)","description":"MongoDB connection model","directories":{},"_nodeVersion":"16.17.0","compass:main":"index.js","dependencies":{"raf":"^3.4.1","debug":"^4.2.0","lodash":"^4.17.21","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.2.0","storage-mixin":"0.0.0-next-c2ee6dc98a012b4f4494e197ec69ca57d395b8fa","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.2","@mongodb-js/ssh-tunnel":"0.0.0-next-c2ee6dc98a012b4f4494e197ec69ca57d395b8fa","@mongodb-js/compass-utils":"0.0.0-next-c2ee6dc98a012b4f4494e197ec69ca57d395b8fa","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.6.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"^5.5.0","depcheck":"^1.4.1","proxyquire":"^2.1.3","chai-subset":"^1.6.0","mock-require":"^3.0.3","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^5.5.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_0.0.0-next-c2ee6dc98a012b4f4494e197ec69ca57d395b8fa_1685754240895_0.5121525150717179","host":"s3://npm-registry-packages"}},"0.0.0-next-5d4d8579be24c292424443140492919b337a3b28":{"name":"mongodb-connection-model","version":"0.0.0-next-5d4d8579be24c292424443140492919b337a3b28","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@0.0.0-next-5d4d8579be24c292424443140492919b337a3b28","maintainers":[{"name":"mongo-j","email":"james.wang@mongodb.com"},{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satya@mongodb.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"iteng@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"0dbe9dd5c388a3a1b090231d151444d994f09cfb","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-0.0.0-next-5d4d8579be24c292424443140492919b337a3b28.tgz","fileCount":20,"integrity":"sha512-+XuPHv8cjFaO2Q5fFnc9wD8N4Z/exAp5UhSDbAiDoAF+65jbnDQG4/LyMh+oUmYmqUxa9tVhYeTEzInOye09dA==","signatures":[{"sig":"MEUCIQCNIrjqeOw+F6kZRNeiMRXpPwTvgEAV9YAaS8GI+ZfLPQIgJ8t1iq1sPkVdsaXg1XHeZfk0Fjt6pCB9WOzL3U4gNww=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":107810},"main":"index.js","readme":"# mongodb-connection-model [![][workflow_img]][workflow_url] [![][npm_img]][npm_url]\n\n> MongoDB connection model\n\nThe main purpose of the MongoDB connection model is to be a domain model around a MongoDB connection. It encapsulates generating a [Connection String URI](https://docs.mongodb.com/manual/reference/connection-string/) from a group of attributes and parses URI using the [MongoDB Node.JS Driver URI Parser](https://github.com/mongodb-js/mongodb-core/blob/master/lib/uri_parser.js).\n\n## Installation\n\n```\nnpm install --save mongodb-connection-model\n```\n\n## Usage\n\n### Building URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\nconst c = new Connection({ appname: 'My App Name' });\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://localhost:27017/?readPreference=primary&appname=My%20App&ssl=false'\n```\n\n### Parsing URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\n\nConnection.from(\n  'mongodb://someUsername:testPassword@localhost',\n  (error, result) => {\n    console.log(result);\n    >>> `{\n      hosts: [{ host: 'localhost', port: 27017 }],\n      hostname: 'localhost',\n      port: 27017,\n      auth: {\n        username: 'someUsername',\n        password: 'testPassword',\n        db: 'admin'\n      },\n      isSrvRecord: false,\n      authStrategy: 'MONGODB',\n      mongodbUsername: 'someUsername',\n      mongodbPassword: 'testPassword',\n      mongodbDatabaseName: 'admin',\n      extraOptions: {},\n      connectionType: 'NODE_DRIVER',\n      readPreference: 'primary',\n      kerberosCanonicalizeHostname: false,\n      sslMethod: 'NONE',\n      sshTunnel: 'NONE',\n      sshTunnelPort: 22\n    }`\n  }\n);\n```\n\n## Properties\n\nMongoDB connection model is based on Ampersand.js framework and consist of [props](https://ampersandjs.com/docs/#ampersand-state-props) and [derived props](https://ampersandjs.com/docs/#ampersand-state-derived). The props object describes the observable properties that MongoDB connection model gets from the Node.js Driver API.\n\n```javascript\nconst с = new Connection();\nconst props = с.getAttributes({ props: true });\n```\n\n#### See Also\n\n- [URI Generic Syntax](https://tools.ietf.org/html/rfc3986)\n- [URI Options Specification](https://github.com/mongodb/specifications/blob/master/source/uri-options/uri-options.rst)\n\n### General Properties\n\n```javascript\nconst c = new Connection({ isSrvRecord: true });\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ns` | String | A valid [ns][ns] the user can read from | `undefined` |\n| `isSrvRecord` | Boolean | Indicates SRV record | `false` |\n| `auth` | Object | Authentication from driver (username, user, db, password) | `undefined` |\n| `hostname` | String | Hostname of a MongoDB Instance. In case of the replica set the first host and port will be taken | `localhost` |\n| `port` | Number | TCP port of a MongoDB Instance | `27017` |\n| `hosts` | Array | Contains all hosts and ports for replica set | `[{ host: 'localhost', port: 27017 }]` |\n| `extraOptions` | Object | Extra options passed to the node driver as part of `driverOptions` | `{}` |\n| `connectionType` | String | The desired connection type. Possible values: `NODE_DRIVER`, `STITCH_ON_PREM`, `STITCH_ATLAS` | `NODE_DRIVER` |\n| `authStrategy` | String | The desired authentication strategy. Possible values: `NONE`, `MONGODB`, `X509`, `KERBEROS`, `LDAP`, `SCRAM-SHA-256` | `NONE` |\n\n### Connection string options\n\n```javascript\nconst c = new Connection({ appname: 'My App', replicaSet: 'testing' });\n```\n\n#### General connection string options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `replicaSet` | String | Specifies the name of the replica set, if the mongod is a member of a replica set | `undefined` |\n| `connectTimeoutMS` | Number | The time in milliseconds to attempt a connection before timing out | `undefined` |\n| `socketTimeoutMS` | Number | The time in milliseconds to attempt a send or receive on a socket before the attempt times out | `undefined` |\n| `compression` | Object | Object includes compressors and a compression level. The following compressors can be specified: `snappy`, `zlib` (Available in MongoDB 3.6 or greater) | `undefined` |\n\n#### Connection Pool Option\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `maxPoolSize` | Number | The maximum number of connections in the connection pool | `undefined` |\n| `minPoolSize` | Number | The minimum number of connections in the connection pool | `undefined` |\n| `maxIdleTimeMS` | Number | The maximum number of milliseconds that a connection can remain idle in the pool before being removed and closed | `undefined` |\n| `waitQueueMultiple` | Number | A number that the driver multiples the maxPoolSize value to, to provide the maximum number of threads allowed to wait for a connection to become available from the pool | `undefined` |\n| `waitQueueTimeoutMS` | Number | The maximum time in milliseconds that a thread can wait for a connection to become available | `undefined` |\n\n#### Write Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `w` | Number/String | Corresponds to the write concern [w Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-w) | `undefined` |\n| `wTimeoutMS` | Number | Corresponds to the write concern [wtimeout](https://docs.mongodb.com/manual/reference/write-concern/#wc-wtimeout) | `undefined` |\n| `journal` | Boolean | Corresponds to the write concern [j Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-j) | `undefined` |\n\n#### Read Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readConcernLevel` | String | The level of isolation | `undefined` |\n\n#### Read Preference Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readPreference` | String | Specifies the read preferences for this connection. Possible values: `PRIMARY`, `PRIMARY_PREFERRED`, `SECONDARY`, `SECONDARY_PREFERRED`, `NEAREST` | `PRIMARY` |\n| `maxStalenessSeconds` | Number | Specifies, in seconds, how stale a secondary can be before the client stops using it for read operations | `undefined` |\n| `readPreferenceTags` | Object | Default read preference tags for the client | `undefined` |\n\n#### Authentication Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `authSource` | String | Specify the database name associated with the user’s credentials | `undefined` |\n| `authMechanism` | String | Specifies the authentication mechanism that MongoDB will use to authenticate the connection. Possible values: `DEFAULT`, `GSSAPI`, `MONGODB-X509`, `PLAIN`, `SCRAM-SHA-256` | `undefined` |\n| `authMechanismProperties` | Object | Additional options provided for authentication (e.g. to enable hostname canonicalization for GSSAPI) | `undefined` |\n| `gssapiServiceName` | String | Set the Kerberos service name when connecting to Kerberized MongoDB instances | `undefined` |\n| `gssapiServiceRealm` | String | Set the Realm service name | `undefined` |\n| `gssapiCanonicalizeHostName` | Boolean | Whether canonicalized hostname | `undefined` |\n\n#### Server Selection and Discovery Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `localThresholdMS` | Number | The size (in milliseconds) of the latency window for selecting among multiple suitable MongoDB instances | `undefined` |\n| `serverSelectionTimeoutMS` | Number | Specifies how long (in milliseconds) to block for server selection before throwing an exception | `undefined` |\n| `serverSelectionTryOnce` | Boolean | Instructs the driver to scan the MongoDB deployment exactly once after server selection fails and then either select a server or raise an error | `undefined` |\n| `heartbeatFrequencyMS` | Number | Controls when the driver checks the state of the MongoDB deployment | `undefined` |\n\n#### Miscellaneous Configuration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `appname` | String | An application name passed to server as client metadata | `undefined` |\n| `retryWrites` | Boolean | Enable retryable writes | `undefined` |\n| `uuidRepresentation` | String | The legacy representation of UUID. Possible values: `standard`, `csharpLegacy`, `javaLegacy`, `pythonLegacy` | `undefined` |\n| `loadBalanced` | Boolean | Whether or not the server is running in load balanced mode | `undefined` |\n\n### Stitch attributes\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `stitchServiceName` | String | Stitch service name | `undefined` |\n| `stitchClientAppId` | String | Stitch сlient app ID | `undefined` |\n| `stitchGroupId` | String | Stitch group ID | `undefined` |\n| `stitchBaseUrl` | String | Stitch base Url | `undefined` |\n\n### MONGODB authentication\n\n```javascript\nconst c = new Connection({\n  mongodbUsername: 'arlo',\n  mongodbPassword: 'w@of'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/?slaveOk=true&authSource=admin'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `mongodbUsername` | String | MongoDB username | `undefined` |\n| `mongodbPassword` | String | MongoDB password | `undefined` |\n| `mongodbDatabaseName` | String | The database name associated with the user's credentials | `undefined` |\n| `promoteValues` | Boolean | Whether BSON values should be promoted to their JS type counterparts | `undefined` |\n\n### KERBEROS authentication\n\n```javascript\nconst c = new Connection({\n  kerberosServiceName: 'mongodb',\n  kerberosPrincipal: 'arlo/dog@krb5.mongodb.parts',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo%252Fdog%2540krb5.mongodb.parts@localhost:27017/toys?authMechanism=GSSAPI'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n> @note (imlucas): Kerberos on Windows is broken out as it's own state for UX consideration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `kerberosServiceName` | String | Any program or computer you access over a network | `undefined` |\n| `kerberosPrincipal` | String | The format of a typical Kerberos V5 principal is `primary/instance@REALM` | `undefined` |\n| `kerberosCanonicalizeHostname` | Boolean | Whether canonicalized kerberos hostname | `undefined` |\n\n#### See Also\n\n- [node.js driver Kerberos reference](http://bit.ly/mongodb-node-driver-kerberos)\n- [node.js driver Kerberos functional test][kerberos-functional]\n\n### LDAP authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  ldapUsername: 'arlo',\n  ldapPassword: 'w@of',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/toys?slaveOk=true&authMechanism=PLAIN'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ldapUsername` | String | LDAP username | `undefined` |\n| `ldapPassword` | String | LDAP password | `undefined` |\n\n#### See Also\n\n- [node.js driver LDAP reference](http://bit.ly/mongodb-node-driver-ldap)\n- [node.js driver X509 functional test][ldap-functional]\n\n### X509 authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  x509Username: 'CN=client,OU=arlo,O=MongoDB,L=Philadelphia,ST=Pennsylvania,C=US'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://CN%253Dclient%252COU%253Darlo%252CO%253DMongoDB%252CL%253DPhiladelphia%252CST%253DPennsylvania%252CC%253DUS@localhost:27017?slaveOk=true&authMechanism=MONGODB-X509'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `x509Username` | String | The x.509 certificate derived user name, e.g. `CN=user,OU=OrgUnit,O=myOrg,...` | `undefined` |\n\n#### See Also\n\n- [node.js driver X509 reference](http://bit.ly/mongodb-node-driver-x509)\n- [node.js driver X509 functional test][x509-functional]\n\n### SSL\n\n> **Note**: Not to be confused with `authentication=X509`\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ssl` | Number/String | A boolean to enable or disables TLS/SSL for the connection | `undefined` |\n| `sslMethod` | String | The desired ssl method. Possible values: `NONE`, `SYSTEMCA`, `IFAVAILABLE`, `UNVALIDATED`, `SERVER`, `ALL` | `NONE` |\n| `sslCA` | Buffer/String | Array of valid certificates | `undefined` |\n| `sslCert` | Buffer/String | The certificate | `undefined` |\n| `sslKey` | Buffer/String | The certificate private key | `undefined` |\n| `sslPass` | Buffer/String | The certificate password | `undefined` |\n\nDescription of `sslMethod` values:\n\n- `SYSTEMCA` - SSL required, validate using System CA, with host verification.\n- `IFAVAILABLE` - The driver should try SSL first, fall back to no SSL if unavailable, and use the system's Certificate Authority.\n- `SERVER` - The driver should validate the server certificate and fail to connect if validation fails. See also [node.js driver \"Validate Server Certificate\" docs][driver-ssl-server].\n- `ALL` - The driver must present a valid certificate and validate the server certificate. See also [node.js driver \"Validate Server Certificate and Present Valid Certificate\" docs][driver-ssl-all].\n- `NONE` - No SSL (Not recommended).\n- `UNVALIDATED` - Use SSL but do not perform any validation of the certificate chain. See also [node.js driver \"No Certificate Validation\" docs][driver-ssl-none]. **Very** not recommended and likely to be deprecated in future releases because it exposes potential Man-In-The-Middle attack vectors.\n\n#### See also\n\n- [node.js driver SSL implementation][driver-ssl-impl]\n- [node.js driver SSL tutorial][driver-ssl-tutorial]\n\n### SSH TUNNEL\n\n> New in mongodb-connection-model@5.0.0\n\nBecause [authentication](#authentication) is quite difficult for operators to migrate to, the most common method of securing a MongoDB deployment is to use an [SSH tunnel][sf-ssh-tunnel].  This allows operators to leverage their existing SSH security infrastructure to also provide secure access to MongoDB.  For a standard deployment of MongoDB on AWS, this is almost always to strategy.  Because of this, we now support creating SSH tunnels automatically when connecting to MongoDB.\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options, (connectionError, client) => {\n  if (connectionError) {\n    return console.log(connectionError);\n  }\n\n  client.db('mongodb').collection('fanclub').count((countingError, count) => {\n    console.log('counted:', countingError, count);\n    client.close();\n  });\n});\n```\n\nThe above provides the same functionality as creating the tunnel using the bash\ncommand below and connecting to MongoDB via another terminal. Notice that\nconnection-model uses a random local port each time it creates a tunnel.\nUsing the command line, you'd have to replace `<random port>` with an actual\nport number.\n\n```bash\nssh -i ~/.ssh/my-key-aws-pair.pem -L <random port>:localhost:27017 ubuntu@ec2-11-111-111-111.compute-1.amazonaws.com\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `sshTunnel` | String | The desired SSH tunnel strategy. Possible values: `NONE`, `USER_PASSWORD`, `IDENTITY_FILE` | `undefined` |\n| `sshTunnelHostname` | String | The hostname of the SSH remote host | `undefined` |\n| `sshTunnelPort` | Port | The SSH port of the remote host | `22` |\n| `sshTunnelBindToLocalPort` | Port | Bind the localhost endpoint of the SSH Tunnel to this port | `undefined` |\n| `sshTunnelUsername` | String | The optional SSH username for the remote host | `undefined` |\n| `sshTunnelPassword` | String | The optional SSH password for the remote host | `undefined` |\n| `sshTunnelIdentityFile` | String/Array | The optional path to the SSH identity file for the remote host | `undefined` |\n| `sshTunnelPassphrase` | String | The optional passphrase for `sshTunnelIdentityFile` | `undefined` |\n\nDescription of `sshTunnel` values:\n\n- `NONE` - Do not use SSH tunneling.\n- `USER_PASSWORD` - The tunnel is created with SSH username and password only.\n- `IDENTITY_FILE` - The tunnel is created using an identity file.\n\n## Derived Properties\n\nDerived properties (also known as computed properties) are properties of the state object that depend on other properties to determine their value.\n\n```javascript\nconst c = new Connection();\nconst derivedProps = c.getAttributes({ derived: true });\n```\n\n| Derived Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `instanceId` | String | The mongoscope | `localhost:27017` |\n| `driverAuthMechanism` | String | Converts the value of `authStrategy` for humans into the `authMechanism` value for the driver | `undefined` |\n| `safeUrl` | String | The URL where a password is replaced with stars | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrl` | String | Use this URL in order to connect via DataService | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrlWithSsh` | String | Use this URL in order to connect via connection model itself | `mongodb://localhost:29201/?readPreference=primary&ssl=false` |\n| `driverOptions` | String | The second argument `mongoscope-server` passes to `mongodb.connect` | `{}` |\n\n## Events\n\n> New in mongodb-connection-model@5.0.0\n\n#### Example: SSH Tunnel\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', skipped: true,\n  reason: 'The selected SSL mode does not need to load any files.' }\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', complete: true}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n#### Example: SSL\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  ssl: 'ALL',\n  sslCA: '~/.ssl/my-ca.pem',\n  sslCert: '~/.ssl/my-server.pem',\n  sslKey: '~/.ssl/my-server.pem'\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', complete: true}\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', skipped: true,\n  reason: 'The selected SSH Tunnel mode is NONE.'}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n[workflow_img]: https://github.com/mongodb-js/connection-model/workflows/Check%20and%20Test/badge.svg?event=push\n[workflow_url]: https://github.com/mongodb-js/connection-model/actions?query=workflow%3A%22Check+and+Test%22\n[npm_img]: https://img.shields.io/npm/v/mongodb-connection-model.svg?style=flat-square\n[npm_url]: https://www.npmjs.org/package/mongodb-connection-model\n[gitter_img]: https://badges.gitter.im/Join%20Chat.svg\n[gitter_url]: http://gitter.im/mongodb-js/mongodb-js\n[enterprise_img]: https://img.shields.io/badge/MongoDB-Enterprise-blue.svg?style=flat-square\n[coming_soon_img]: https://img.shields.io/badge/-Coming%20Soon-ff69b4.svg?style=flat-square\n[kerberos-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/kerberos_tests.js\n[ldap-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ldap_tests.js\n[x509-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ssl_x509_tests.js\n[ns]: https://github.com/mongodb-js/ns\n[sf-ssh-tunnel]: http://serverfault.com/questions/597765/how-to-connect-to-mongodb-server-via-ssh-tunnel\n[ec2-key-pairs]: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html\n[driver-ssl-impl]: https://github.com/christkv/mongodb-core/blob/c3d21cb636d74d7a68134ecd3b9f6af536311279/lib/connection/connection.js#L365-L407\n[driver-ssl-tutorial]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/\n[driver-ssl-none]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#no-certificate-validation\n[driver-ssl-server]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate\n[driver-ssl-all]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate-and-present-valid-certificate\n","gitHead":"5d4d8579be24c292424443140492919b337a3b28","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","check":"npm run lint && npm run depcheck","depcheck":"depcheck","test-check-ci":"npm run check"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.17.0+x64 (linux)","description":"MongoDB connection model","directories":{},"_nodeVersion":"16.17.0","compass:main":"index.js","dependencies":{"raf":"^3.4.1","debug":"^4.2.0","lodash":"^4.17.21","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.2.0","storage-mixin":"0.0.0-next-5d4d8579be24c292424443140492919b337a3b28","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.2","@mongodb-js/ssh-tunnel":"0.0.0-next-5d4d8579be24c292424443140492919b337a3b28","@mongodb-js/compass-utils":"0.0.0-next-5d4d8579be24c292424443140492919b337a3b28","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.6.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"^5.5.0","depcheck":"^1.4.1","proxyquire":"^2.1.3","chai-subset":"^1.6.0","mock-require":"^3.0.3","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^5.5.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_0.0.0-next-5d4d8579be24c292424443140492919b337a3b28_1685781339383_0.5551640482225455","host":"s3://npm-registry-packages"}},"22.4.0":{"name":"mongodb-connection-model","version":"22.4.0","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@22.4.0","maintainers":[{"name":"mongo-j","email":"james.wang@mongodb.com"},{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satya@mongodb.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"iteng@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"093d0ca5c62055926bc2217a6f95768bab89a8b3","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-22.4.0.tgz","fileCount":20,"integrity":"sha512-hmZ48CpUjMMy8P8GDBXzYpKad93McCnsGlgoOwJACm/wKU5rkuZl/gOZFspz2638oyJGdj94rgU1XAnpsGHQ+A==","signatures":[{"sig":"MEQCIEK7Quuzb54nw+r5f1VvUumEtOsv9U/p065GGX3Gmew1AiATHTb8deZfYfvhoc1KVu2tOKeCvK2qs6sRSCeaauVazQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":107630},"main":"index.js","gitHead":"129d5d5375a2815408e12ee15e1b6bd566f52600","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","check":"npm run lint && npm run depcheck","depcheck":"depcheck","test-check-ci":"npm run check"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.20.0+x64 (linux)","description":"MongoDB connection model","directories":{},"_nodeVersion":"16.20.0","compass:main":"index.js","dependencies":{"raf":"^3.4.1","debug":"^4.2.0","lodash":"^4.17.21","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.2.0","storage-mixin":"^5.1.5","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.2","@mongodb-js/ssh-tunnel":"^2.0.6","@mongodb-js/compass-utils":"^0.3.1","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.6.0"},"_hasShrinkwrap":false,"devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"^5.5.0","depcheck":"^1.4.1","proxyquire":"^2.1.3","chai-subset":"^1.6.0","mock-require":"^3.0.3","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^5.5.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_22.4.0_1685961278762_0.8203016669975289","host":"s3://npm-registry-packages"}},"0.0.0-next-5e0eb3ba4d40569bc6acb4383f7c85221ebc81fa":{"name":"mongodb-connection-model","version":"0.0.0-next-5e0eb3ba4d40569bc6acb4383f7c85221ebc81fa","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@0.0.0-next-5e0eb3ba4d40569bc6acb4383f7c85221ebc81fa","maintainers":[{"name":"mongo-j","email":"james.wang@mongodb.com"},{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satya@mongodb.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"iteng@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"6226665ab3cc091fef25e92aeaa9953df45d211c","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-0.0.0-next-5e0eb3ba4d40569bc6acb4383f7c85221ebc81fa.tgz","fileCount":20,"integrity":"sha512-fr2Jr2G72DuDbxm9xgFFTB9e56LoRY1bUevLxFX/6jYwm9+2GZGQVO3UMzVX3DELQbKDTMOXG0FMJXJ8/ixrTA==","signatures":[{"sig":"MEUCIQCzeoOjHgcV+tWYih/xNrX5xWqDP2oMo2K1MLjdlLEzyAIgJguf3jGqssNFXZvxpBVRUQQAiyj2wMMnjY5kpTlyZhg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":107810},"main":"index.js","readme":"# mongodb-connection-model [![][workflow_img]][workflow_url] [![][npm_img]][npm_url]\n\n> MongoDB connection model\n\nThe main purpose of the MongoDB connection model is to be a domain model around a MongoDB connection. It encapsulates generating a [Connection String URI](https://docs.mongodb.com/manual/reference/connection-string/) from a group of attributes and parses URI using the [MongoDB Node.JS Driver URI Parser](https://github.com/mongodb-js/mongodb-core/blob/master/lib/uri_parser.js).\n\n## Installation\n\n```\nnpm install --save mongodb-connection-model\n```\n\n## Usage\n\n### Building URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\nconst c = new Connection({ appname: 'My App Name' });\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://localhost:27017/?readPreference=primary&appname=My%20App&ssl=false'\n```\n\n### Parsing URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\n\nConnection.from(\n  'mongodb://someUsername:testPassword@localhost',\n  (error, result) => {\n    console.log(result);\n    >>> `{\n      hosts: [{ host: 'localhost', port: 27017 }],\n      hostname: 'localhost',\n      port: 27017,\n      auth: {\n        username: 'someUsername',\n        password: 'testPassword',\n        db: 'admin'\n      },\n      isSrvRecord: false,\n      authStrategy: 'MONGODB',\n      mongodbUsername: 'someUsername',\n      mongodbPassword: 'testPassword',\n      mongodbDatabaseName: 'admin',\n      extraOptions: {},\n      connectionType: 'NODE_DRIVER',\n      readPreference: 'primary',\n      kerberosCanonicalizeHostname: false,\n      sslMethod: 'NONE',\n      sshTunnel: 'NONE',\n      sshTunnelPort: 22\n    }`\n  }\n);\n```\n\n## Properties\n\nMongoDB connection model is based on Ampersand.js framework and consist of [props](https://ampersandjs.com/docs/#ampersand-state-props) and [derived props](https://ampersandjs.com/docs/#ampersand-state-derived). The props object describes the observable properties that MongoDB connection model gets from the Node.js Driver API.\n\n```javascript\nconst с = new Connection();\nconst props = с.getAttributes({ props: true });\n```\n\n#### See Also\n\n- [URI Generic Syntax](https://tools.ietf.org/html/rfc3986)\n- [URI Options Specification](https://github.com/mongodb/specifications/blob/master/source/uri-options/uri-options.rst)\n\n### General Properties\n\n```javascript\nconst c = new Connection({ isSrvRecord: true });\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ns` | String | A valid [ns][ns] the user can read from | `undefined` |\n| `isSrvRecord` | Boolean | Indicates SRV record | `false` |\n| `auth` | Object | Authentication from driver (username, user, db, password) | `undefined` |\n| `hostname` | String | Hostname of a MongoDB Instance. In case of the replica set the first host and port will be taken | `localhost` |\n| `port` | Number | TCP port of a MongoDB Instance | `27017` |\n| `hosts` | Array | Contains all hosts and ports for replica set | `[{ host: 'localhost', port: 27017 }]` |\n| `extraOptions` | Object | Extra options passed to the node driver as part of `driverOptions` | `{}` |\n| `connectionType` | String | The desired connection type. Possible values: `NODE_DRIVER`, `STITCH_ON_PREM`, `STITCH_ATLAS` | `NODE_DRIVER` |\n| `authStrategy` | String | The desired authentication strategy. Possible values: `NONE`, `MONGODB`, `X509`, `KERBEROS`, `LDAP`, `SCRAM-SHA-256` | `NONE` |\n\n### Connection string options\n\n```javascript\nconst c = new Connection({ appname: 'My App', replicaSet: 'testing' });\n```\n\n#### General connection string options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `replicaSet` | String | Specifies the name of the replica set, if the mongod is a member of a replica set | `undefined` |\n| `connectTimeoutMS` | Number | The time in milliseconds to attempt a connection before timing out | `undefined` |\n| `socketTimeoutMS` | Number | The time in milliseconds to attempt a send or receive on a socket before the attempt times out | `undefined` |\n| `compression` | Object | Object includes compressors and a compression level. The following compressors can be specified: `snappy`, `zlib` (Available in MongoDB 3.6 or greater) | `undefined` |\n\n#### Connection Pool Option\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `maxPoolSize` | Number | The maximum number of connections in the connection pool | `undefined` |\n| `minPoolSize` | Number | The minimum number of connections in the connection pool | `undefined` |\n| `maxIdleTimeMS` | Number | The maximum number of milliseconds that a connection can remain idle in the pool before being removed and closed | `undefined` |\n| `waitQueueMultiple` | Number | A number that the driver multiples the maxPoolSize value to, to provide the maximum number of threads allowed to wait for a connection to become available from the pool | `undefined` |\n| `waitQueueTimeoutMS` | Number | The maximum time in milliseconds that a thread can wait for a connection to become available | `undefined` |\n\n#### Write Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `w` | Number/String | Corresponds to the write concern [w Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-w) | `undefined` |\n| `wTimeoutMS` | Number | Corresponds to the write concern [wtimeout](https://docs.mongodb.com/manual/reference/write-concern/#wc-wtimeout) | `undefined` |\n| `journal` | Boolean | Corresponds to the write concern [j Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-j) | `undefined` |\n\n#### Read Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readConcernLevel` | String | The level of isolation | `undefined` |\n\n#### Read Preference Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readPreference` | String | Specifies the read preferences for this connection. Possible values: `PRIMARY`, `PRIMARY_PREFERRED`, `SECONDARY`, `SECONDARY_PREFERRED`, `NEAREST` | `PRIMARY` |\n| `maxStalenessSeconds` | Number | Specifies, in seconds, how stale a secondary can be before the client stops using it for read operations | `undefined` |\n| `readPreferenceTags` | Object | Default read preference tags for the client | `undefined` |\n\n#### Authentication Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `authSource` | String | Specify the database name associated with the user’s credentials | `undefined` |\n| `authMechanism` | String | Specifies the authentication mechanism that MongoDB will use to authenticate the connection. Possible values: `DEFAULT`, `GSSAPI`, `MONGODB-X509`, `PLAIN`, `SCRAM-SHA-256` | `undefined` |\n| `authMechanismProperties` | Object | Additional options provided for authentication (e.g. to enable hostname canonicalization for GSSAPI) | `undefined` |\n| `gssapiServiceName` | String | Set the Kerberos service name when connecting to Kerberized MongoDB instances | `undefined` |\n| `gssapiServiceRealm` | String | Set the Realm service name | `undefined` |\n| `gssapiCanonicalizeHostName` | Boolean | Whether canonicalized hostname | `undefined` |\n\n#### Server Selection and Discovery Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `localThresholdMS` | Number | The size (in milliseconds) of the latency window for selecting among multiple suitable MongoDB instances | `undefined` |\n| `serverSelectionTimeoutMS` | Number | Specifies how long (in milliseconds) to block for server selection before throwing an exception | `undefined` |\n| `serverSelectionTryOnce` | Boolean | Instructs the driver to scan the MongoDB deployment exactly once after server selection fails and then either select a server or raise an error | `undefined` |\n| `heartbeatFrequencyMS` | Number | Controls when the driver checks the state of the MongoDB deployment | `undefined` |\n\n#### Miscellaneous Configuration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `appname` | String | An application name passed to server as client metadata | `undefined` |\n| `retryWrites` | Boolean | Enable retryable writes | `undefined` |\n| `uuidRepresentation` | String | The legacy representation of UUID. Possible values: `standard`, `csharpLegacy`, `javaLegacy`, `pythonLegacy` | `undefined` |\n| `loadBalanced` | Boolean | Whether or not the server is running in load balanced mode | `undefined` |\n\n### Stitch attributes\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `stitchServiceName` | String | Stitch service name | `undefined` |\n| `stitchClientAppId` | String | Stitch сlient app ID | `undefined` |\n| `stitchGroupId` | String | Stitch group ID | `undefined` |\n| `stitchBaseUrl` | String | Stitch base Url | `undefined` |\n\n### MONGODB authentication\n\n```javascript\nconst c = new Connection({\n  mongodbUsername: 'arlo',\n  mongodbPassword: 'w@of'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/?slaveOk=true&authSource=admin'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `mongodbUsername` | String | MongoDB username | `undefined` |\n| `mongodbPassword` | String | MongoDB password | `undefined` |\n| `mongodbDatabaseName` | String | The database name associated with the user's credentials | `undefined` |\n| `promoteValues` | Boolean | Whether BSON values should be promoted to their JS type counterparts | `undefined` |\n\n### KERBEROS authentication\n\n```javascript\nconst c = new Connection({\n  kerberosServiceName: 'mongodb',\n  kerberosPrincipal: 'arlo/dog@krb5.mongodb.parts',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo%252Fdog%2540krb5.mongodb.parts@localhost:27017/toys?authMechanism=GSSAPI'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n> @note (imlucas): Kerberos on Windows is broken out as it's own state for UX consideration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `kerberosServiceName` | String | Any program or computer you access over a network | `undefined` |\n| `kerberosPrincipal` | String | The format of a typical Kerberos V5 principal is `primary/instance@REALM` | `undefined` |\n| `kerberosCanonicalizeHostname` | Boolean | Whether canonicalized kerberos hostname | `undefined` |\n\n#### See Also\n\n- [node.js driver Kerberos reference](http://bit.ly/mongodb-node-driver-kerberos)\n- [node.js driver Kerberos functional test][kerberos-functional]\n\n### LDAP authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  ldapUsername: 'arlo',\n  ldapPassword: 'w@of',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/toys?slaveOk=true&authMechanism=PLAIN'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ldapUsername` | String | LDAP username | `undefined` |\n| `ldapPassword` | String | LDAP password | `undefined` |\n\n#### See Also\n\n- [node.js driver LDAP reference](http://bit.ly/mongodb-node-driver-ldap)\n- [node.js driver X509 functional test][ldap-functional]\n\n### X509 authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  x509Username: 'CN=client,OU=arlo,O=MongoDB,L=Philadelphia,ST=Pennsylvania,C=US'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://CN%253Dclient%252COU%253Darlo%252CO%253DMongoDB%252CL%253DPhiladelphia%252CST%253DPennsylvania%252CC%253DUS@localhost:27017?slaveOk=true&authMechanism=MONGODB-X509'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `x509Username` | String | The x.509 certificate derived user name, e.g. `CN=user,OU=OrgUnit,O=myOrg,...` | `undefined` |\n\n#### See Also\n\n- [node.js driver X509 reference](http://bit.ly/mongodb-node-driver-x509)\n- [node.js driver X509 functional test][x509-functional]\n\n### SSL\n\n> **Note**: Not to be confused with `authentication=X509`\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ssl` | Number/String | A boolean to enable or disables TLS/SSL for the connection | `undefined` |\n| `sslMethod` | String | The desired ssl method. Possible values: `NONE`, `SYSTEMCA`, `IFAVAILABLE`, `UNVALIDATED`, `SERVER`, `ALL` | `NONE` |\n| `sslCA` | Buffer/String | Array of valid certificates | `undefined` |\n| `sslCert` | Buffer/String | The certificate | `undefined` |\n| `sslKey` | Buffer/String | The certificate private key | `undefined` |\n| `sslPass` | Buffer/String | The certificate password | `undefined` |\n\nDescription of `sslMethod` values:\n\n- `SYSTEMCA` - SSL required, validate using System CA, with host verification.\n- `IFAVAILABLE` - The driver should try SSL first, fall back to no SSL if unavailable, and use the system's Certificate Authority.\n- `SERVER` - The driver should validate the server certificate and fail to connect if validation fails. See also [node.js driver \"Validate Server Certificate\" docs][driver-ssl-server].\n- `ALL` - The driver must present a valid certificate and validate the server certificate. See also [node.js driver \"Validate Server Certificate and Present Valid Certificate\" docs][driver-ssl-all].\n- `NONE` - No SSL (Not recommended).\n- `UNVALIDATED` - Use SSL but do not perform any validation of the certificate chain. See also [node.js driver \"No Certificate Validation\" docs][driver-ssl-none]. **Very** not recommended and likely to be deprecated in future releases because it exposes potential Man-In-The-Middle attack vectors.\n\n#### See also\n\n- [node.js driver SSL implementation][driver-ssl-impl]\n- [node.js driver SSL tutorial][driver-ssl-tutorial]\n\n### SSH TUNNEL\n\n> New in mongodb-connection-model@5.0.0\n\nBecause [authentication](#authentication) is quite difficult for operators to migrate to, the most common method of securing a MongoDB deployment is to use an [SSH tunnel][sf-ssh-tunnel].  This allows operators to leverage their existing SSH security infrastructure to also provide secure access to MongoDB.  For a standard deployment of MongoDB on AWS, this is almost always to strategy.  Because of this, we now support creating SSH tunnels automatically when connecting to MongoDB.\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options, (connectionError, client) => {\n  if (connectionError) {\n    return console.log(connectionError);\n  }\n\n  client.db('mongodb').collection('fanclub').count((countingError, count) => {\n    console.log('counted:', countingError, count);\n    client.close();\n  });\n});\n```\n\nThe above provides the same functionality as creating the tunnel using the bash\ncommand below and connecting to MongoDB via another terminal. Notice that\nconnection-model uses a random local port each time it creates a tunnel.\nUsing the command line, you'd have to replace `<random port>` with an actual\nport number.\n\n```bash\nssh -i ~/.ssh/my-key-aws-pair.pem -L <random port>:localhost:27017 ubuntu@ec2-11-111-111-111.compute-1.amazonaws.com\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `sshTunnel` | String | The desired SSH tunnel strategy. Possible values: `NONE`, `USER_PASSWORD`, `IDENTITY_FILE` | `undefined` |\n| `sshTunnelHostname` | String | The hostname of the SSH remote host | `undefined` |\n| `sshTunnelPort` | Port | The SSH port of the remote host | `22` |\n| `sshTunnelBindToLocalPort` | Port | Bind the localhost endpoint of the SSH Tunnel to this port | `undefined` |\n| `sshTunnelUsername` | String | The optional SSH username for the remote host | `undefined` |\n| `sshTunnelPassword` | String | The optional SSH password for the remote host | `undefined` |\n| `sshTunnelIdentityFile` | String/Array | The optional path to the SSH identity file for the remote host | `undefined` |\n| `sshTunnelPassphrase` | String | The optional passphrase for `sshTunnelIdentityFile` | `undefined` |\n\nDescription of `sshTunnel` values:\n\n- `NONE` - Do not use SSH tunneling.\n- `USER_PASSWORD` - The tunnel is created with SSH username and password only.\n- `IDENTITY_FILE` - The tunnel is created using an identity file.\n\n## Derived Properties\n\nDerived properties (also known as computed properties) are properties of the state object that depend on other properties to determine their value.\n\n```javascript\nconst c = new Connection();\nconst derivedProps = c.getAttributes({ derived: true });\n```\n\n| Derived Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `instanceId` | String | The mongoscope | `localhost:27017` |\n| `driverAuthMechanism` | String | Converts the value of `authStrategy` for humans into the `authMechanism` value for the driver | `undefined` |\n| `safeUrl` | String | The URL where a password is replaced with stars | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrl` | String | Use this URL in order to connect via DataService | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrlWithSsh` | String | Use this URL in order to connect via connection model itself | `mongodb://localhost:29201/?readPreference=primary&ssl=false` |\n| `driverOptions` | String | The second argument `mongoscope-server` passes to `mongodb.connect` | `{}` |\n\n## Events\n\n> New in mongodb-connection-model@5.0.0\n\n#### Example: SSH Tunnel\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', skipped: true,\n  reason: 'The selected SSL mode does not need to load any files.' }\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', complete: true}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n#### Example: SSL\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  ssl: 'ALL',\n  sslCA: '~/.ssl/my-ca.pem',\n  sslCert: '~/.ssl/my-server.pem',\n  sslKey: '~/.ssl/my-server.pem'\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', complete: true}\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', skipped: true,\n  reason: 'The selected SSH Tunnel mode is NONE.'}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n[workflow_img]: https://github.com/mongodb-js/connection-model/workflows/Check%20and%20Test/badge.svg?event=push\n[workflow_url]: https://github.com/mongodb-js/connection-model/actions?query=workflow%3A%22Check+and+Test%22\n[npm_img]: https://img.shields.io/npm/v/mongodb-connection-model.svg?style=flat-square\n[npm_url]: https://www.npmjs.org/package/mongodb-connection-model\n[gitter_img]: https://badges.gitter.im/Join%20Chat.svg\n[gitter_url]: http://gitter.im/mongodb-js/mongodb-js\n[enterprise_img]: https://img.shields.io/badge/MongoDB-Enterprise-blue.svg?style=flat-square\n[coming_soon_img]: https://img.shields.io/badge/-Coming%20Soon-ff69b4.svg?style=flat-square\n[kerberos-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/kerberos_tests.js\n[ldap-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ldap_tests.js\n[x509-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ssl_x509_tests.js\n[ns]: https://github.com/mongodb-js/ns\n[sf-ssh-tunnel]: http://serverfault.com/questions/597765/how-to-connect-to-mongodb-server-via-ssh-tunnel\n[ec2-key-pairs]: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html\n[driver-ssl-impl]: https://github.com/christkv/mongodb-core/blob/c3d21cb636d74d7a68134ecd3b9f6af536311279/lib/connection/connection.js#L365-L407\n[driver-ssl-tutorial]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/\n[driver-ssl-none]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#no-certificate-validation\n[driver-ssl-server]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate\n[driver-ssl-all]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate-and-present-valid-certificate\n","gitHead":"5e0eb3ba4d40569bc6acb4383f7c85221ebc81fa","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","check":"npm run lint && npm run depcheck","depcheck":"depcheck","test-check-ci":"npm run check"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.17.0+x64 (linux)","description":"MongoDB connection model","directories":{},"_nodeVersion":"16.17.0","compass:main":"index.js","dependencies":{"raf":"^3.4.1","debug":"^4.2.0","lodash":"^4.17.21","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.2.0","storage-mixin":"0.0.0-next-5e0eb3ba4d40569bc6acb4383f7c85221ebc81fa","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.2","@mongodb-js/ssh-tunnel":"0.0.0-next-5e0eb3ba4d40569bc6acb4383f7c85221ebc81fa","@mongodb-js/compass-utils":"0.0.0-next-5e0eb3ba4d40569bc6acb4383f7c85221ebc81fa","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.6.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"^5.5.0","depcheck":"^1.4.1","proxyquire":"^2.1.3","chai-subset":"^1.6.0","mock-require":"^3.0.3","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^5.5.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_0.0.0-next-5e0eb3ba4d40569bc6acb4383f7c85221ebc81fa_1686050774077_0.46059337479076445","host":"s3://npm-registry-packages"}},"0.0.0-next-52e439f268b74410212a0d91a5ee39021eb44499":{"name":"mongodb-connection-model","version":"0.0.0-next-52e439f268b74410212a0d91a5ee39021eb44499","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@0.0.0-next-52e439f268b74410212a0d91a5ee39021eb44499","maintainers":[{"name":"mongo-j","email":"james.wang@mongodb.com"},{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satya@mongodb.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"iteng@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"8abecb318cc33009756aa05d99143c24c370c26c","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-0.0.0-next-52e439f268b74410212a0d91a5ee39021eb44499.tgz","fileCount":20,"integrity":"sha512-uutxPQKnBJJYxlPRIPcsqzNfkBY0dsGx5+Icd+/gfvYUgpf6uImHB9h4XeYZvqrLgADpgy0jIgKNTbcCquSHKQ==","signatures":[{"sig":"MEYCIQDbqEU08ofD9x10KrLtN5TL5/d1mw6Dxq2dWIIox2wdUgIhAJhUjcnGC2NBy8YsN4U8S+RK+mjRT0eTcJAqmOQXaOaa","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":107810},"main":"index.js","readme":"# mongodb-connection-model [![][workflow_img]][workflow_url] [![][npm_img]][npm_url]\n\n> MongoDB connection model\n\nThe main purpose of the MongoDB connection model is to be a domain model around a MongoDB connection. It encapsulates generating a [Connection String URI](https://docs.mongodb.com/manual/reference/connection-string/) from a group of attributes and parses URI using the [MongoDB Node.JS Driver URI Parser](https://github.com/mongodb-js/mongodb-core/blob/master/lib/uri_parser.js).\n\n## Installation\n\n```\nnpm install --save mongodb-connection-model\n```\n\n## Usage\n\n### Building URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\nconst c = new Connection({ appname: 'My App Name' });\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://localhost:27017/?readPreference=primary&appname=My%20App&ssl=false'\n```\n\n### Parsing URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\n\nConnection.from(\n  'mongodb://someUsername:testPassword@localhost',\n  (error, result) => {\n    console.log(result);\n    >>> `{\n      hosts: [{ host: 'localhost', port: 27017 }],\n      hostname: 'localhost',\n      port: 27017,\n      auth: {\n        username: 'someUsername',\n        password: 'testPassword',\n        db: 'admin'\n      },\n      isSrvRecord: false,\n      authStrategy: 'MONGODB',\n      mongodbUsername: 'someUsername',\n      mongodbPassword: 'testPassword',\n      mongodbDatabaseName: 'admin',\n      extraOptions: {},\n      connectionType: 'NODE_DRIVER',\n      readPreference: 'primary',\n      kerberosCanonicalizeHostname: false,\n      sslMethod: 'NONE',\n      sshTunnel: 'NONE',\n      sshTunnelPort: 22\n    }`\n  }\n);\n```\n\n## Properties\n\nMongoDB connection model is based on Ampersand.js framework and consist of [props](https://ampersandjs.com/docs/#ampersand-state-props) and [derived props](https://ampersandjs.com/docs/#ampersand-state-derived). The props object describes the observable properties that MongoDB connection model gets from the Node.js Driver API.\n\n```javascript\nconst с = new Connection();\nconst props = с.getAttributes({ props: true });\n```\n\n#### See Also\n\n- [URI Generic Syntax](https://tools.ietf.org/html/rfc3986)\n- [URI Options Specification](https://github.com/mongodb/specifications/blob/master/source/uri-options/uri-options.rst)\n\n### General Properties\n\n```javascript\nconst c = new Connection({ isSrvRecord: true });\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ns` | String | A valid [ns][ns] the user can read from | `undefined` |\n| `isSrvRecord` | Boolean | Indicates SRV record | `false` |\n| `auth` | Object | Authentication from driver (username, user, db, password) | `undefined` |\n| `hostname` | String | Hostname of a MongoDB Instance. In case of the replica set the first host and port will be taken | `localhost` |\n| `port` | Number | TCP port of a MongoDB Instance | `27017` |\n| `hosts` | Array | Contains all hosts and ports for replica set | `[{ host: 'localhost', port: 27017 }]` |\n| `extraOptions` | Object | Extra options passed to the node driver as part of `driverOptions` | `{}` |\n| `connectionType` | String | The desired connection type. Possible values: `NODE_DRIVER`, `STITCH_ON_PREM`, `STITCH_ATLAS` | `NODE_DRIVER` |\n| `authStrategy` | String | The desired authentication strategy. Possible values: `NONE`, `MONGODB`, `X509`, `KERBEROS`, `LDAP`, `SCRAM-SHA-256` | `NONE` |\n\n### Connection string options\n\n```javascript\nconst c = new Connection({ appname: 'My App', replicaSet: 'testing' });\n```\n\n#### General connection string options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `replicaSet` | String | Specifies the name of the replica set, if the mongod is a member of a replica set | `undefined` |\n| `connectTimeoutMS` | Number | The time in milliseconds to attempt a connection before timing out | `undefined` |\n| `socketTimeoutMS` | Number | The time in milliseconds to attempt a send or receive on a socket before the attempt times out | `undefined` |\n| `compression` | Object | Object includes compressors and a compression level. The following compressors can be specified: `snappy`, `zlib` (Available in MongoDB 3.6 or greater) | `undefined` |\n\n#### Connection Pool Option\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `maxPoolSize` | Number | The maximum number of connections in the connection pool | `undefined` |\n| `minPoolSize` | Number | The minimum number of connections in the connection pool | `undefined` |\n| `maxIdleTimeMS` | Number | The maximum number of milliseconds that a connection can remain idle in the pool before being removed and closed | `undefined` |\n| `waitQueueMultiple` | Number | A number that the driver multiples the maxPoolSize value to, to provide the maximum number of threads allowed to wait for a connection to become available from the pool | `undefined` |\n| `waitQueueTimeoutMS` | Number | The maximum time in milliseconds that a thread can wait for a connection to become available | `undefined` |\n\n#### Write Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `w` | Number/String | Corresponds to the write concern [w Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-w) | `undefined` |\n| `wTimeoutMS` | Number | Corresponds to the write concern [wtimeout](https://docs.mongodb.com/manual/reference/write-concern/#wc-wtimeout) | `undefined` |\n| `journal` | Boolean | Corresponds to the write concern [j Option](https://docs.mongodb.com/manual/reference/write-concern/#wc-j) | `undefined` |\n\n#### Read Concern Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readConcernLevel` | String | The level of isolation | `undefined` |\n\n#### Read Preference Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `readPreference` | String | Specifies the read preferences for this connection. Possible values: `PRIMARY`, `PRIMARY_PREFERRED`, `SECONDARY`, `SECONDARY_PREFERRED`, `NEAREST` | `PRIMARY` |\n| `maxStalenessSeconds` | Number | Specifies, in seconds, how stale a secondary can be before the client stops using it for read operations | `undefined` |\n| `readPreferenceTags` | Object | Default read preference tags for the client | `undefined` |\n\n#### Authentication Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `authSource` | String | Specify the database name associated with the user’s credentials | `undefined` |\n| `authMechanism` | String | Specifies the authentication mechanism that MongoDB will use to authenticate the connection. Possible values: `DEFAULT`, `GSSAPI`, `MONGODB-X509`, `PLAIN`, `SCRAM-SHA-256` | `undefined` |\n| `authMechanismProperties` | Object | Additional options provided for authentication (e.g. to enable hostname canonicalization for GSSAPI) | `undefined` |\n| `gssapiServiceName` | String | Set the Kerberos service name when connecting to Kerberized MongoDB instances | `undefined` |\n| `gssapiServiceRealm` | String | Set the Realm service name | `undefined` |\n| `gssapiCanonicalizeHostName` | Boolean | Whether canonicalized hostname | `undefined` |\n\n#### Server Selection and Discovery Options\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `localThresholdMS` | Number | The size (in milliseconds) of the latency window for selecting among multiple suitable MongoDB instances | `undefined` |\n| `serverSelectionTimeoutMS` | Number | Specifies how long (in milliseconds) to block for server selection before throwing an exception | `undefined` |\n| `serverSelectionTryOnce` | Boolean | Instructs the driver to scan the MongoDB deployment exactly once after server selection fails and then either select a server or raise an error | `undefined` |\n| `heartbeatFrequencyMS` | Number | Controls when the driver checks the state of the MongoDB deployment | `undefined` |\n\n#### Miscellaneous Configuration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `appname` | String | An application name passed to server as client metadata | `undefined` |\n| `retryWrites` | Boolean | Enable retryable writes | `undefined` |\n| `uuidRepresentation` | String | The legacy representation of UUID. Possible values: `standard`, `csharpLegacy`, `javaLegacy`, `pythonLegacy` | `undefined` |\n| `loadBalanced` | Boolean | Whether or not the server is running in load balanced mode | `undefined` |\n\n### Stitch attributes\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `stitchServiceName` | String | Stitch service name | `undefined` |\n| `stitchClientAppId` | String | Stitch сlient app ID | `undefined` |\n| `stitchGroupId` | String | Stitch group ID | `undefined` |\n| `stitchBaseUrl` | String | Stitch base Url | `undefined` |\n\n### MONGODB authentication\n\n```javascript\nconst c = new Connection({\n  mongodbUsername: 'arlo',\n  mongodbPassword: 'w@of'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/?slaveOk=true&authSource=admin'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `mongodbUsername` | String | MongoDB username | `undefined` |\n| `mongodbPassword` | String | MongoDB password | `undefined` |\n| `mongodbDatabaseName` | String | The database name associated with the user's credentials | `undefined` |\n| `promoteValues` | Boolean | Whether BSON values should be promoted to their JS type counterparts | `undefined` |\n\n### KERBEROS authentication\n\n```javascript\nconst c = new Connection({\n  kerberosServiceName: 'mongodb',\n  kerberosPrincipal: 'arlo/dog@krb5.mongodb.parts',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo%252Fdog%2540krb5.mongodb.parts@localhost:27017/toys?authMechanism=GSSAPI'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n> @note (imlucas): Kerberos on Windows is broken out as it's own state for UX consideration\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `kerberosServiceName` | String | Any program or computer you access over a network | `undefined` |\n| `kerberosPrincipal` | String | The format of a typical Kerberos V5 principal is `primary/instance@REALM` | `undefined` |\n| `kerberosCanonicalizeHostname` | Boolean | Whether canonicalized kerberos hostname | `undefined` |\n\n#### See Also\n\n- [node.js driver Kerberos reference](http://bit.ly/mongodb-node-driver-kerberos)\n- [node.js driver Kerberos functional test][kerberos-functional]\n\n### LDAP authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  ldapUsername: 'arlo',\n  ldapPassword: 'w@of',\n  ns: 'toys'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://arlo:w%40of@localhost:27017/toys?slaveOk=true&authMechanism=PLAIN'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ldapUsername` | String | LDAP username | `undefined` |\n| `ldapPassword` | String | LDAP password | `undefined` |\n\n#### See Also\n\n- [node.js driver LDAP reference](http://bit.ly/mongodb-node-driver-ldap)\n- [node.js driver X509 functional test][ldap-functional]\n\n### X509 authentication\n\n![][enterprise_img]\n\n```javascript\nconst c = new Connection({\n  x509Username: 'CN=client,OU=arlo,O=MongoDB,L=Philadelphia,ST=Pennsylvania,C=US'\n});\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://CN%253Dclient%252COU%253Darlo%252CO%253DMongoDB%252CL%253DPhiladelphia%252CST%253DPennsylvania%252CC%253DUS@localhost:27017?slaveOk=true&authMechanism=MONGODB-X509'\n\nconsole.log(c.driverOptions)\n>>> {\n  db: { readPreference: 'nearest' },\n  replSet: { }\n}\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `x509Username` | String | The x.509 certificate derived user name, e.g. `CN=user,OU=OrgUnit,O=myOrg,...` | `undefined` |\n\n#### See Also\n\n- [node.js driver X509 reference](http://bit.ly/mongodb-node-driver-x509)\n- [node.js driver X509 functional test][x509-functional]\n\n### SSL\n\n> **Note**: Not to be confused with `authentication=X509`\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `ssl` | Number/String | A boolean to enable or disables TLS/SSL for the connection | `undefined` |\n| `sslMethod` | String | The desired ssl method. Possible values: `NONE`, `SYSTEMCA`, `IFAVAILABLE`, `UNVALIDATED`, `SERVER`, `ALL` | `NONE` |\n| `sslCA` | Buffer/String | Array of valid certificates | `undefined` |\n| `sslCert` | Buffer/String | The certificate | `undefined` |\n| `sslKey` | Buffer/String | The certificate private key | `undefined` |\n| `sslPass` | Buffer/String | The certificate password | `undefined` |\n\nDescription of `sslMethod` values:\n\n- `SYSTEMCA` - SSL required, validate using System CA, with host verification.\n- `IFAVAILABLE` - The driver should try SSL first, fall back to no SSL if unavailable, and use the system's Certificate Authority.\n- `SERVER` - The driver should validate the server certificate and fail to connect if validation fails. See also [node.js driver \"Validate Server Certificate\" docs][driver-ssl-server].\n- `ALL` - The driver must present a valid certificate and validate the server certificate. See also [node.js driver \"Validate Server Certificate and Present Valid Certificate\" docs][driver-ssl-all].\n- `NONE` - No SSL (Not recommended).\n- `UNVALIDATED` - Use SSL but do not perform any validation of the certificate chain. See also [node.js driver \"No Certificate Validation\" docs][driver-ssl-none]. **Very** not recommended and likely to be deprecated in future releases because it exposes potential Man-In-The-Middle attack vectors.\n\n#### See also\n\n- [node.js driver SSL implementation][driver-ssl-impl]\n- [node.js driver SSL tutorial][driver-ssl-tutorial]\n\n### SSH TUNNEL\n\n> New in mongodb-connection-model@5.0.0\n\nBecause [authentication](#authentication) is quite difficult for operators to migrate to, the most common method of securing a MongoDB deployment is to use an [SSH tunnel][sf-ssh-tunnel].  This allows operators to leverage their existing SSH security infrastructure to also provide secure access to MongoDB.  For a standard deployment of MongoDB on AWS, this is almost always to strategy.  Because of this, we now support creating SSH tunnels automatically when connecting to MongoDB.\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options, (connectionError, client) => {\n  if (connectionError) {\n    return console.log(connectionError);\n  }\n\n  client.db('mongodb').collection('fanclub').count((countingError, count) => {\n    console.log('counted:', countingError, count);\n    client.close();\n  });\n});\n```\n\nThe above provides the same functionality as creating the tunnel using the bash\ncommand below and connecting to MongoDB via another terminal. Notice that\nconnection-model uses a random local port each time it creates a tunnel.\nUsing the command line, you'd have to replace `<random port>` with an actual\nport number.\n\n```bash\nssh -i ~/.ssh/my-key-aws-pair.pem -L <random port>:localhost:27017 ubuntu@ec2-11-111-111-111.compute-1.amazonaws.com\n```\n\n| Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `sshTunnel` | String | The desired SSH tunnel strategy. Possible values: `NONE`, `USER_PASSWORD`, `IDENTITY_FILE` | `undefined` |\n| `sshTunnelHostname` | String | The hostname of the SSH remote host | `undefined` |\n| `sshTunnelPort` | Port | The SSH port of the remote host | `22` |\n| `sshTunnelBindToLocalPort` | Port | Bind the localhost endpoint of the SSH Tunnel to this port | `undefined` |\n| `sshTunnelUsername` | String | The optional SSH username for the remote host | `undefined` |\n| `sshTunnelPassword` | String | The optional SSH password for the remote host | `undefined` |\n| `sshTunnelIdentityFile` | String/Array | The optional path to the SSH identity file for the remote host | `undefined` |\n| `sshTunnelPassphrase` | String | The optional passphrase for `sshTunnelIdentityFile` | `undefined` |\n\nDescription of `sshTunnel` values:\n\n- `NONE` - Do not use SSH tunneling.\n- `USER_PASSWORD` - The tunnel is created with SSH username and password only.\n- `IDENTITY_FILE` - The tunnel is created using an identity file.\n\n## Derived Properties\n\nDerived properties (also known as computed properties) are properties of the state object that depend on other properties to determine their value.\n\n```javascript\nconst c = new Connection();\nconst derivedProps = c.getAttributes({ derived: true });\n```\n\n| Derived Property | Type | Description | Default |\n| ----- | ---- | ---------- |  ----  |\n| `instanceId` | String | The mongoscope | `localhost:27017` |\n| `driverAuthMechanism` | String | Converts the value of `authStrategy` for humans into the `authMechanism` value for the driver | `undefined` |\n| `safeUrl` | String | The URL where a password is replaced with stars | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrl` | String | Use this URL in order to connect via DataService | `mongodb://localhost:27017/?readPreference=primary&ssl=false` |\n| `driverUrlWithSsh` | String | Use this URL in order to connect via connection model itself | `mongodb://localhost:29201/?readPreference=primary&ssl=false` |\n| `driverOptions` | String | The second argument `mongoscope-server` passes to `mongodb.connect` | `{}` |\n\n## Events\n\n> New in mongodb-connection-model@5.0.0\n\n#### Example: SSH Tunnel\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  sshTunnel: 'IDENTITY_FILE',\n  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',\n  sshTunnelUsername: 'ubuntu',\n  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', skipped: true,\n  reason: 'The selected SSL mode does not need to load any files.' }\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', complete: true}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n#### Example: SSL\n\n```javascript\nconst connect = require('mongodb-connection-model').connect;\nconst options = {\n  hostname: 'localhost',\n  port: 27017,\n  ssl: 'ALL',\n  sslCA: '~/.ssl/my-ca.pem',\n  sslCert: '~/.ssl/my-server.pem',\n  sslKey: '~/.ssl/my-server.pem'\n};\n\nconnect(options).on('status', (evt) => console.log('status:', evt));\n```\n\nThis will log the following events to the console:\n\n```javascript\n>>> status: { message: 'Validate', pending: true }\n>>> status: { message: 'Validate', complete: true }\n>>> status: { message: 'Load SSL files', pending: true }\n>>> status: { message: 'Load SSL files', complete: true}\n>>> status: { message: 'Create SSH Tunnel', pending: true }\n>>> status: { message: 'Create SSH Tunnel', skipped: true,\n  reason: 'The selected SSH Tunnel mode is NONE.'}\n>>> status: { message: 'Connect to MongoDB', pending: true }\n>>> status: { message: 'Connect to MongoDB', complete: true }\n```\n\n[workflow_img]: https://github.com/mongodb-js/connection-model/workflows/Check%20and%20Test/badge.svg?event=push\n[workflow_url]: https://github.com/mongodb-js/connection-model/actions?query=workflow%3A%22Check+and+Test%22\n[npm_img]: https://img.shields.io/npm/v/mongodb-connection-model.svg?style=flat-square\n[npm_url]: https://www.npmjs.org/package/mongodb-connection-model\n[gitter_img]: https://badges.gitter.im/Join%20Chat.svg\n[gitter_url]: http://gitter.im/mongodb-js/mongodb-js\n[enterprise_img]: https://img.shields.io/badge/MongoDB-Enterprise-blue.svg?style=flat-square\n[coming_soon_img]: https://img.shields.io/badge/-Coming%20Soon-ff69b4.svg?style=flat-square\n[kerberos-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/kerberos_tests.js\n[ldap-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ldap_tests.js\n[x509-functional]: https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/ssl_x509_tests.js\n[ns]: https://github.com/mongodb-js/ns\n[sf-ssh-tunnel]: http://serverfault.com/questions/597765/how-to-connect-to-mongodb-server-via-ssh-tunnel\n[ec2-key-pairs]: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html\n[driver-ssl-impl]: https://github.com/christkv/mongodb-core/blob/c3d21cb636d74d7a68134ecd3b9f6af536311279/lib/connection/connection.js#L365-L407\n[driver-ssl-tutorial]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/\n[driver-ssl-none]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#no-certificate-validation\n[driver-ssl-server]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate\n[driver-ssl-all]: http://mongodb.github.io/node-mongodb-native/2.2/tutorials/connect/ssl/#validate-server-certificate-and-present-valid-certificate\n","gitHead":"52e439f268b74410212a0d91a5ee39021eb44499","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","check":"npm run lint && npm run depcheck","depcheck":"depcheck","test-check-ci":"npm run check"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.17.0+x64 (linux)","description":"MongoDB connection model","directories":{},"_nodeVersion":"16.17.0","compass:main":"index.js","dependencies":{"raf":"^3.4.1","debug":"^4.2.0","lodash":"^4.17.21","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.2.0","storage-mixin":"0.0.0-next-52e439f268b74410212a0d91a5ee39021eb44499","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.2","@mongodb-js/ssh-tunnel":"0.0.0-next-52e439f268b74410212a0d91a5ee39021eb44499","@mongodb-js/compass-utils":"0.0.0-next-52e439f268b74410212a0d91a5ee39021eb44499","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.6.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","sinon":"^9.0.2","eslint":"^7.25.0","mongodb":"^5.5.0","depcheck":"^1.4.1","proxyquire":"^2.1.3","chai-subset":"^1.6.0","mock-require":"^3.0.3","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^5.5.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_0.0.0-next-52e439f268b74410212a0d91a5ee39021eb44499_1686050850592_0.6401969608959144","host":"s3://npm-registry-packages"}},"22.4.1":{"name":"mongodb-connection-model","version":"22.4.1","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@22.4.1","maintainers":[{"name":"mongo-j","email":"james.wang@mongodb.com"},{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satya@mongodb.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"iteng@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"09a1468ca68fa6ca80ec8df1d78eedb52463a407","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-22.4.1.tgz","fileCount":19,"integrity":"sha512-qHDE40p3be3LrTeKAbQKxJbhqJatJjfhzZ8j/mMvNuz2Yh+WO8h4u0w6k/EI5ykmu/VvUkEUVzQOzHD2h+gpuQ==","signatures":[{"sig":"MEYCIQCr7gzui8n9XSBvxnY3QJ1ZIgOQ4ckmnsVAz7p6008M9QIhAPcSjcNFsQcitOfJfFYgKNsQo+uPVQ86DeCjfFNzR98O","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":84194},"main":"index.js","gitHead":"1d02bfb24078b4391bee7a83e34cb3d7da39a731","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","check":"npm run lint && npm run depcheck","depcheck":"depcheck","test-check-ci":"npm run check"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.20.0+x64 (linux)","description":"MongoDB connection model","directories":{},"_nodeVersion":"16.20.0","compass:main":"index.js","dependencies":{"raf":"^3.4.1","lodash":"^4.17.21","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.2.0","storage-mixin":"^5.1.5","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.2","@mongodb-js/compass-utils":"^0.3.1","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.6.0"},"_hasShrinkwrap":false,"devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","eslint":"^7.25.0","mongodb":"^5.5.0","depcheck":"^1.4.1","proxyquire":"^2.1.3","chai-subset":"^1.6.0","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^5.5.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_22.4.1_1686081655651_0.07286361123780272","host":"s3://npm-registry-packages"}},"0.0.0-next-5dfa7c0dfa9690d09de616d9a4839fde1ab0e467":{"name":"mongodb-connection-model","version":"0.0.0-next-5dfa7c0dfa9690d09de616d9a4839fde1ab0e467","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@0.0.0-next-5dfa7c0dfa9690d09de616d9a4839fde1ab0e467","maintainers":[{"name":"mongo-j","email":"james.wang@mongodb.com"},{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satya@mongodb.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"iteng@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"71003e273d10bcba24ee0e425b2d307658437bd7","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-0.0.0-next-5dfa7c0dfa9690d09de616d9a4839fde1ab0e467.tgz","fileCount":19,"integrity":"sha512-ubWzjHLff6DOGSGzdSjcFB7jP//xW10izu8X8jixGbI6dPhxZNvc5K/QplO/0ajppbH4YrLQJlXu1Jn6aF4E4Q==","signatures":[{"sig":"MEUCIQDzAPYJcG4k9fBeeK+1SXDzsrFcBBdWkZbjBWaJ0xyWBAIgXd6c9TlsZ9pYQmXrYTZV1IpqGtYKEUHUqYhRhdQUCg0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":84329},"main":"index.js","readme":"# mongodb-connection-model  [![][npm_img]][npm_url]\n\n*Not recommended for use. This package will be be updated or removed in COMPASS-5490*\n\n## Usage\n\n### Building URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\nconst c = new Connection({ appname: 'My App Name' });\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://localhost:27017/?readPreference=primary&appname=My%20App&ssl=false'\n```\n\n### Parsing URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\n\nConnection.from(\n  'mongodb://someUsername:testPassword@localhost',\n  (error, result) => {\n    console.log(result);\n    >>> `{\n      hosts: [{ host: 'localhost', port: 27017 }],\n      hostname: 'localhost',\n      port: 27017,\n      auth: {\n        username: 'someUsername',\n        password: 'testPassword',\n        db: 'admin'\n      },\n      isSrvRecord: false,\n      authStrategy: 'MONGODB',\n      mongodbUsername: 'someUsername',\n      mongodbPassword: 'testPassword',\n      mongodbDatabaseName: 'admin',\n      extraOptions: {},\n      connectionType: 'NODE_DRIVER',\n      readPreference: 'primary',\n      kerberosCanonicalizeHostname: false,\n      sslMethod: 'NONE',\n      sshTunnel: 'NONE',\n      sshTunnelPort: 22\n    }`\n  }\n);\n```\n\n## Properties\n\nMongoDB connection model is based on Ampersand.js framework and consist of [props](https://ampersandjs.com/docs/#ampersand-state-props) and [derived props](https://ampersandjs.com/docs/#ampersand-state-derived). The props object describes the observable properties that MongoDB connection model gets from the Node.js Driver API.\n\n```javascript\nconst с = new Connection();\nconst props = с.getAttributes({ props: true });\n```\n## Derived Properties\n\nDerived properties (also known as computed properties) are properties of the state object that depend on other properties to determine their value.\n\n```javascript\nconst c = new Connection();\nconst derivedProps = c.getAttributes({ derived: true });\n```\n\n[npm_img]: https://img.shields.io/npm/v/mongodb-connection-model.svg?style=flat-square\n[npm_url]: https://www.npmjs.org/package/mongodb-connection-model","gitHead":"5dfa7c0dfa9690d09de616d9a4839fde1ab0e467","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","check":"npm run lint && npm run depcheck","depcheck":"depcheck","test-check-ci":"npm run check"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.17.0+x64 (linux)","description":"MongoDB connection model","directories":{},"_nodeVersion":"16.17.0","compass:main":"index.js","dependencies":{"raf":"^3.4.1","lodash":"^4.17.21","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.2.0","storage-mixin":"0.0.0-next-5dfa7c0dfa9690d09de616d9a4839fde1ab0e467","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.2","@mongodb-js/compass-utils":"0.0.0-next-5dfa7c0dfa9690d09de616d9a4839fde1ab0e467","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.6.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","eslint":"^7.25.0","mongodb":"^5.5.0","depcheck":"^1.4.1","proxyquire":"^2.1.3","chai-subset":"^1.6.0","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^5.5.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_0.0.0-next-5dfa7c0dfa9690d09de616d9a4839fde1ab0e467_1686207512022_0.8698625703799194","host":"s3://npm-registry-packages"}},"0.0.0-next-1d02bfb24078b4391bee7a83e34cb3d7da39a731":{"name":"mongodb-connection-model","version":"0.0.0-next-1d02bfb24078b4391bee7a83e34cb3d7da39a731","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@0.0.0-next-1d02bfb24078b4391bee7a83e34cb3d7da39a731","maintainers":[{"name":"mongo-j","email":"james.wang@mongodb.com"},{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satya@mongodb.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"iteng@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"66b69f908098bb98527a745fbba1fb7598486152","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-0.0.0-next-1d02bfb24078b4391bee7a83e34cb3d7da39a731.tgz","fileCount":19,"integrity":"sha512-v0hHUbDFtLx2UpAx/FmDeMSmlTiduDCcEdPnPPRKVyivEIp/skZWTfTqxXMgnCgVU79372xirdIlRNjVmf5S7Q==","signatures":[{"sig":"MEYCIQCZUxa9DI3iAlYIUnznlQEOHmHttfTCMgsuDX7YLllm+gIhANyAgOphxBOF2/0xuBkSUk/aXfDyIoFDUEdYTJVEV8gd","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":84329},"main":"index.js","readme":"# mongodb-connection-model  [![][npm_img]][npm_url]\n\n*Not recommended for use. This package will be be updated or removed in COMPASS-5490*\n\n## Usage\n\n### Building URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\nconst c = new Connection({ appname: 'My App Name' });\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://localhost:27017/?readPreference=primary&appname=My%20App&ssl=false'\n```\n\n### Parsing URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\n\nConnection.from(\n  'mongodb://someUsername:testPassword@localhost',\n  (error, result) => {\n    console.log(result);\n    >>> `{\n      hosts: [{ host: 'localhost', port: 27017 }],\n      hostname: 'localhost',\n      port: 27017,\n      auth: {\n        username: 'someUsername',\n        password: 'testPassword',\n        db: 'admin'\n      },\n      isSrvRecord: false,\n      authStrategy: 'MONGODB',\n      mongodbUsername: 'someUsername',\n      mongodbPassword: 'testPassword',\n      mongodbDatabaseName: 'admin',\n      extraOptions: {},\n      connectionType: 'NODE_DRIVER',\n      readPreference: 'primary',\n      kerberosCanonicalizeHostname: false,\n      sslMethod: 'NONE',\n      sshTunnel: 'NONE',\n      sshTunnelPort: 22\n    }`\n  }\n);\n```\n\n## Properties\n\nMongoDB connection model is based on Ampersand.js framework and consist of [props](https://ampersandjs.com/docs/#ampersand-state-props) and [derived props](https://ampersandjs.com/docs/#ampersand-state-derived). The props object describes the observable properties that MongoDB connection model gets from the Node.js Driver API.\n\n```javascript\nconst с = new Connection();\nconst props = с.getAttributes({ props: true });\n```\n## Derived Properties\n\nDerived properties (also known as computed properties) are properties of the state object that depend on other properties to determine their value.\n\n```javascript\nconst c = new Connection();\nconst derivedProps = c.getAttributes({ derived: true });\n```\n\n[npm_img]: https://img.shields.io/npm/v/mongodb-connection-model.svg?style=flat-square\n[npm_url]: https://www.npmjs.org/package/mongodb-connection-model","gitHead":"1d02bfb24078b4391bee7a83e34cb3d7da39a731","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","check":"npm run lint && npm run depcheck","depcheck":"depcheck","test-check-ci":"npm run check"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.17.0+x64 (linux)","description":"MongoDB connection model","directories":{},"_nodeVersion":"16.17.0","compass:main":"index.js","dependencies":{"raf":"^3.4.1","lodash":"^4.17.21","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.2.0","storage-mixin":"0.0.0-next-1d02bfb24078b4391bee7a83e34cb3d7da39a731","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.2","@mongodb-js/compass-utils":"0.0.0-next-1d02bfb24078b4391bee7a83e34cb3d7da39a731","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.6.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","eslint":"^7.25.0","mongodb":"^5.5.0","depcheck":"^1.4.1","proxyquire":"^2.1.3","chai-subset":"^1.6.0","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^5.5.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_0.0.0-next-1d02bfb24078b4391bee7a83e34cb3d7da39a731_1686207711268_0.10757705297055065","host":"s3://npm-registry-packages"}},"0.0.0-next-b2733835a3b65a4990e1af518669453fad1aba04":{"name":"mongodb-connection-model","version":"0.0.0-next-b2733835a3b65a4990e1af518669453fad1aba04","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@0.0.0-next-b2733835a3b65a4990e1af518669453fad1aba04","maintainers":[{"name":"mongo-j","email":"james.wang@mongodb.com"},{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satya@mongodb.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"iteng@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"017ace2d15cc23704a76038b4ed29df4e28532d7","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-0.0.0-next-b2733835a3b65a4990e1af518669453fad1aba04.tgz","fileCount":19,"integrity":"sha512-liNNiEjb3EMF9Xg8wOAdHCXID7OdcH2joqj72R86Ng7SDtcx6lOHQGHN72WlFyolXJC1PGh1few5C64B+y6pJA==","signatures":[{"sig":"MEQCIE8YW/8XqB4sPooDs7aamJLwjlnJk3XN+9lhVB7ik/B9AiBF3YjqxhYHy6ocK1TaUbTrjznHUmGD6pDsX2hYC7ZNWQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":84329},"main":"index.js","readme":"# mongodb-connection-model  [![][npm_img]][npm_url]\n\n*Not recommended for use. This package will be be updated or removed in COMPASS-5490*\n\n## Usage\n\n### Building URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\nconst c = new Connection({ appname: 'My App Name' });\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://localhost:27017/?readPreference=primary&appname=My%20App&ssl=false'\n```\n\n### Parsing URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\n\nConnection.from(\n  'mongodb://someUsername:testPassword@localhost',\n  (error, result) => {\n    console.log(result);\n    >>> `{\n      hosts: [{ host: 'localhost', port: 27017 }],\n      hostname: 'localhost',\n      port: 27017,\n      auth: {\n        username: 'someUsername',\n        password: 'testPassword',\n        db: 'admin'\n      },\n      isSrvRecord: false,\n      authStrategy: 'MONGODB',\n      mongodbUsername: 'someUsername',\n      mongodbPassword: 'testPassword',\n      mongodbDatabaseName: 'admin',\n      extraOptions: {},\n      connectionType: 'NODE_DRIVER',\n      readPreference: 'primary',\n      kerberosCanonicalizeHostname: false,\n      sslMethod: 'NONE',\n      sshTunnel: 'NONE',\n      sshTunnelPort: 22\n    }`\n  }\n);\n```\n\n## Properties\n\nMongoDB connection model is based on Ampersand.js framework and consist of [props](https://ampersandjs.com/docs/#ampersand-state-props) and [derived props](https://ampersandjs.com/docs/#ampersand-state-derived). The props object describes the observable properties that MongoDB connection model gets from the Node.js Driver API.\n\n```javascript\nconst с = new Connection();\nconst props = с.getAttributes({ props: true });\n```\n## Derived Properties\n\nDerived properties (also known as computed properties) are properties of the state object that depend on other properties to determine their value.\n\n```javascript\nconst c = new Connection();\nconst derivedProps = c.getAttributes({ derived: true });\n```\n\n[npm_img]: https://img.shields.io/npm/v/mongodb-connection-model.svg?style=flat-square\n[npm_url]: https://www.npmjs.org/package/mongodb-connection-model","gitHead":"b2733835a3b65a4990e1af518669453fad1aba04","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","check":"npm run lint && npm run depcheck","depcheck":"depcheck","test-check-ci":"npm run check"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.17.0+x64 (linux)","description":"MongoDB connection model","directories":{},"_nodeVersion":"16.17.0","compass:main":"index.js","dependencies":{"raf":"^3.4.1","lodash":"^4.17.21","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.2.0","storage-mixin":"0.0.0-next-b2733835a3b65a4990e1af518669453fad1aba04","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.2","@mongodb-js/compass-utils":"0.0.0-next-b2733835a3b65a4990e1af518669453fad1aba04","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.6.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","eslint":"^7.25.0","mongodb":"^5.5.0","depcheck":"^1.4.1","proxyquire":"^2.1.3","chai-subset":"^1.6.0","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^5.5.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_0.0.0-next-b2733835a3b65a4990e1af518669453fad1aba04_1686207976887_0.729548306431788","host":"s3://npm-registry-packages"}},"0.0.0-next-b308d1e92f7e65f426e7cdde2c630c5eb26cd4e1":{"name":"mongodb-connection-model","version":"0.0.0-next-b308d1e92f7e65f426e7cdde2c630c5eb26cd4e1","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@0.0.0-next-b308d1e92f7e65f426e7cdde2c630c5eb26cd4e1","maintainers":[{"name":"mongo-j","email":"james.wang@mongodb.com"},{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satya@mongodb.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"iteng@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"6b941a5c320a15dfb4fbdda47fdff227124c0f68","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-0.0.0-next-b308d1e92f7e65f426e7cdde2c630c5eb26cd4e1.tgz","fileCount":19,"integrity":"sha512-igh3HhRpLAtxj05++I9D+9SAo3AcvmWuKpq/YpxmHoyTp1GZTkQvCpZDrB0Px3vR4YEG51yWjNy63cNCcz76Qg==","signatures":[{"sig":"MEYCIQCwV/ViyGxTgZaxcVemO/kghWAYpgU3lIZMCbVw8VFkAQIhAM8hHTsm4AFVA+uGIVbTFp8TLzUaMlouYXx0yTo5ZZgU","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":84329},"main":"index.js","readme":"# mongodb-connection-model  [![][npm_img]][npm_url]\n\n*Not recommended for use. This package will be be updated or removed in COMPASS-5490*\n\n## Usage\n\n### Building URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\nconst c = new Connection({ appname: 'My App Name' });\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://localhost:27017/?readPreference=primary&appname=My%20App&ssl=false'\n```\n\n### Parsing URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\n\nConnection.from(\n  'mongodb://someUsername:testPassword@localhost',\n  (error, result) => {\n    console.log(result);\n    >>> `{\n      hosts: [{ host: 'localhost', port: 27017 }],\n      hostname: 'localhost',\n      port: 27017,\n      auth: {\n        username: 'someUsername',\n        password: 'testPassword',\n        db: 'admin'\n      },\n      isSrvRecord: false,\n      authStrategy: 'MONGODB',\n      mongodbUsername: 'someUsername',\n      mongodbPassword: 'testPassword',\n      mongodbDatabaseName: 'admin',\n      extraOptions: {},\n      connectionType: 'NODE_DRIVER',\n      readPreference: 'primary',\n      kerberosCanonicalizeHostname: false,\n      sslMethod: 'NONE',\n      sshTunnel: 'NONE',\n      sshTunnelPort: 22\n    }`\n  }\n);\n```\n\n## Properties\n\nMongoDB connection model is based on Ampersand.js framework and consist of [props](https://ampersandjs.com/docs/#ampersand-state-props) and [derived props](https://ampersandjs.com/docs/#ampersand-state-derived). The props object describes the observable properties that MongoDB connection model gets from the Node.js Driver API.\n\n```javascript\nconst с = new Connection();\nconst props = с.getAttributes({ props: true });\n```\n## Derived Properties\n\nDerived properties (also known as computed properties) are properties of the state object that depend on other properties to determine their value.\n\n```javascript\nconst c = new Connection();\nconst derivedProps = c.getAttributes({ derived: true });\n```\n\n[npm_img]: https://img.shields.io/npm/v/mongodb-connection-model.svg?style=flat-square\n[npm_url]: https://www.npmjs.org/package/mongodb-connection-model","gitHead":"b308d1e92f7e65f426e7cdde2c630c5eb26cd4e1","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","check":"npm run lint && npm run depcheck","depcheck":"depcheck","test-check-ci":"npm run check"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.17.0+x64 (linux)","description":"MongoDB connection model","directories":{},"_nodeVersion":"16.17.0","compass:main":"index.js","dependencies":{"raf":"^3.4.1","lodash":"^4.17.21","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.2.0","storage-mixin":"0.0.0-next-b308d1e92f7e65f426e7cdde2c630c5eb26cd4e1","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.2","@mongodb-js/compass-utils":"0.0.0-next-b308d1e92f7e65f426e7cdde2c630c5eb26cd4e1","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.6.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","eslint":"^7.25.0","mongodb":"^5.5.0","depcheck":"^1.4.1","proxyquire":"^2.1.3","chai-subset":"^1.6.0","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^5.5.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_0.0.0-next-b308d1e92f7e65f426e7cdde2c630c5eb26cd4e1_1686211838687_0.007067634915871812","host":"s3://npm-registry-packages"}},"0.0.0-next-a163d3eea7baaadc9ff00f56212f6befadf68cc1":{"name":"mongodb-connection-model","version":"0.0.0-next-a163d3eea7baaadc9ff00f56212f6befadf68cc1","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@0.0.0-next-a163d3eea7baaadc9ff00f56212f6befadf68cc1","maintainers":[{"name":"mongo-j","email":"james.wang@mongodb.com"},{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satya@mongodb.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"iteng@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"47fee9808766da01759be259530a3a38c6b2458b","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-0.0.0-next-a163d3eea7baaadc9ff00f56212f6befadf68cc1.tgz","fileCount":19,"integrity":"sha512-ux3dy0kX3GFyA0dran5z2gEJR4DbyBQwZoVa/zRs6ox3LBVfJXLTsY3AQUSalH9Cj0RnPRX9Y83ldfldrEY0Bg==","signatures":[{"sig":"MEUCIHMQrasJ/1+cqMrwa8L/qT1Gl7Gk6ZI6n278RqoWxpn8AiEAgxzZXbWcBTKLEXc6OZiVYWO1NvgUSWn67sLVO4gvDtE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":84329},"main":"index.js","readme":"# mongodb-connection-model  [![][npm_img]][npm_url]\n\n*Not recommended for use. This package will be be updated or removed in COMPASS-5490*\n\n## Usage\n\n### Building URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\nconst c = new Connection({ appname: 'My App Name' });\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://localhost:27017/?readPreference=primary&appname=My%20App&ssl=false'\n```\n\n### Parsing URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\n\nConnection.from(\n  'mongodb://someUsername:testPassword@localhost',\n  (error, result) => {\n    console.log(result);\n    >>> `{\n      hosts: [{ host: 'localhost', port: 27017 }],\n      hostname: 'localhost',\n      port: 27017,\n      auth: {\n        username: 'someUsername',\n        password: 'testPassword',\n        db: 'admin'\n      },\n      isSrvRecord: false,\n      authStrategy: 'MONGODB',\n      mongodbUsername: 'someUsername',\n      mongodbPassword: 'testPassword',\n      mongodbDatabaseName: 'admin',\n      extraOptions: {},\n      connectionType: 'NODE_DRIVER',\n      readPreference: 'primary',\n      kerberosCanonicalizeHostname: false,\n      sslMethod: 'NONE',\n      sshTunnel: 'NONE',\n      sshTunnelPort: 22\n    }`\n  }\n);\n```\n\n## Properties\n\nMongoDB connection model is based on Ampersand.js framework and consist of [props](https://ampersandjs.com/docs/#ampersand-state-props) and [derived props](https://ampersandjs.com/docs/#ampersand-state-derived). The props object describes the observable properties that MongoDB connection model gets from the Node.js Driver API.\n\n```javascript\nconst с = new Connection();\nconst props = с.getAttributes({ props: true });\n```\n## Derived Properties\n\nDerived properties (also known as computed properties) are properties of the state object that depend on other properties to determine their value.\n\n```javascript\nconst c = new Connection();\nconst derivedProps = c.getAttributes({ derived: true });\n```\n\n[npm_img]: https://img.shields.io/npm/v/mongodb-connection-model.svg?style=flat-square\n[npm_url]: https://www.npmjs.org/package/mongodb-connection-model","gitHead":"a163d3eea7baaadc9ff00f56212f6befadf68cc1","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","check":"npm run lint && npm run depcheck","depcheck":"depcheck","test-check-ci":"npm run check"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.17.0+x64 (linux)","description":"MongoDB connection model","directories":{},"_nodeVersion":"16.17.0","compass:main":"index.js","dependencies":{"raf":"^3.4.1","lodash":"^4.17.21","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.2.0","storage-mixin":"0.0.0-next-a163d3eea7baaadc9ff00f56212f6befadf68cc1","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.2","@mongodb-js/compass-utils":"0.0.0-next-a163d3eea7baaadc9ff00f56212f6befadf68cc1","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.6.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","eslint":"^7.25.0","mongodb":"^5.5.0","depcheck":"^1.4.1","proxyquire":"^2.1.3","chai-subset":"^1.6.0","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^5.5.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_0.0.0-next-a163d3eea7baaadc9ff00f56212f6befadf68cc1_1686365446384_0.6192656454120329","host":"s3://npm-registry-packages"}},"0.0.0-next-e35a108a54700c3d0f1f8d937fe870db23cb1682":{"name":"mongodb-connection-model","version":"0.0.0-next-e35a108a54700c3d0f1f8d937fe870db23cb1682","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@0.0.0-next-e35a108a54700c3d0f1f8d937fe870db23cb1682","maintainers":[{"name":"mongo-j","email":"james.wang@mongodb.com"},{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satya@mongodb.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"iteng@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"d79fef055bb24ce51e7f1d9230310457ab93e1ac","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-0.0.0-next-e35a108a54700c3d0f1f8d937fe870db23cb1682.tgz","fileCount":19,"integrity":"sha512-Qf7ySM1NaBD77cgBt/2ElHClvzMQ4WsgOVg9I1Q3m5Jb48SSnx1eTwjfs9JJBMb5zn1FvMWlW87YCqIOcFkoQQ==","signatures":[{"sig":"MEYCIQCajHi3k7yFfRoFSiLwOh23JDkm9U/WGLedmMKRUjfW2wIhAP8CSyYCif5UEkE+FyGt/VYjlpCxVIfkJKy8+hQ+d5Hv","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":84329},"main":"index.js","readme":"# mongodb-connection-model  [![][npm_img]][npm_url]\n\n*Not recommended for use. This package will be be updated or removed in COMPASS-5490*\n\n## Usage\n\n### Building URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\nconst c = new Connection({ appname: 'My App Name' });\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://localhost:27017/?readPreference=primary&appname=My%20App&ssl=false'\n```\n\n### Parsing URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\n\nConnection.from(\n  'mongodb://someUsername:testPassword@localhost',\n  (error, result) => {\n    console.log(result);\n    >>> `{\n      hosts: [{ host: 'localhost', port: 27017 }],\n      hostname: 'localhost',\n      port: 27017,\n      auth: {\n        username: 'someUsername',\n        password: 'testPassword',\n        db: 'admin'\n      },\n      isSrvRecord: false,\n      authStrategy: 'MONGODB',\n      mongodbUsername: 'someUsername',\n      mongodbPassword: 'testPassword',\n      mongodbDatabaseName: 'admin',\n      extraOptions: {},\n      connectionType: 'NODE_DRIVER',\n      readPreference: 'primary',\n      kerberosCanonicalizeHostname: false,\n      sslMethod: 'NONE',\n      sshTunnel: 'NONE',\n      sshTunnelPort: 22\n    }`\n  }\n);\n```\n\n## Properties\n\nMongoDB connection model is based on Ampersand.js framework and consist of [props](https://ampersandjs.com/docs/#ampersand-state-props) and [derived props](https://ampersandjs.com/docs/#ampersand-state-derived). The props object describes the observable properties that MongoDB connection model gets from the Node.js Driver API.\n\n```javascript\nconst с = new Connection();\nconst props = с.getAttributes({ props: true });\n```\n## Derived Properties\n\nDerived properties (also known as computed properties) are properties of the state object that depend on other properties to determine their value.\n\n```javascript\nconst c = new Connection();\nconst derivedProps = c.getAttributes({ derived: true });\n```\n\n[npm_img]: https://img.shields.io/npm/v/mongodb-connection-model.svg?style=flat-square\n[npm_url]: https://www.npmjs.org/package/mongodb-connection-model","gitHead":"e35a108a54700c3d0f1f8d937fe870db23cb1682","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","check":"npm run lint && npm run depcheck","depcheck":"depcheck","test-check-ci":"npm run check"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.17.0+x64 (linux)","description":"MongoDB connection model","directories":{},"_nodeVersion":"16.17.0","compass:main":"index.js","dependencies":{"raf":"^3.4.1","lodash":"^4.17.21","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.2.0","storage-mixin":"0.0.0-next-e35a108a54700c3d0f1f8d937fe870db23cb1682","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.2","@mongodb-js/compass-utils":"0.0.0-next-e35a108a54700c3d0f1f8d937fe870db23cb1682","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.6.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","eslint":"^7.25.0","mongodb":"^5.5.0","depcheck":"^1.4.1","proxyquire":"^2.1.3","chai-subset":"^1.6.0","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^5.5.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_0.0.0-next-e35a108a54700c3d0f1f8d937fe870db23cb1682_1686369511333_0.04001974841696376","host":"s3://npm-registry-packages"}},"0.0.0-next-80a9e175edd3eabee53daee876d77943872e4205":{"name":"mongodb-connection-model","version":"0.0.0-next-80a9e175edd3eabee53daee876d77943872e4205","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@0.0.0-next-80a9e175edd3eabee53daee876d77943872e4205","maintainers":[{"name":"mongo-j","email":"james.wang@mongodb.com"},{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satya@mongodb.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"iteng@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"a59dc534c3cca2816957c89e1d946eda3f63431b","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-0.0.0-next-80a9e175edd3eabee53daee876d77943872e4205.tgz","fileCount":19,"integrity":"sha512-ZLFdX7JPEKMlo2mAGXmuT99dapuOJ+jSbP+m6dQsLu47f4OlgzjLG9G3aM22yvHaIAQFVf2tJcZdzhAyku4x5Q==","signatures":[{"sig":"MEYCIQDuBGJOf2cWAugpasfaexQNSj3w4+pe8++c6KMZ7x0u1QIhALf4r0LJAEx7MzYAWgZjQ9Ca1978RkfkuJvUTWlysMfj","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":84329},"main":"index.js","readme":"# mongodb-connection-model  [![][npm_img]][npm_url]\n\n*Not recommended for use. This package will be be updated or removed in COMPASS-5490*\n\n## Usage\n\n### Building URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\nconst c = new Connection({ appname: 'My App Name' });\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://localhost:27017/?readPreference=primary&appname=My%20App&ssl=false'\n```\n\n### Parsing URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\n\nConnection.from(\n  'mongodb://someUsername:testPassword@localhost',\n  (error, result) => {\n    console.log(result);\n    >>> `{\n      hosts: [{ host: 'localhost', port: 27017 }],\n      hostname: 'localhost',\n      port: 27017,\n      auth: {\n        username: 'someUsername',\n        password: 'testPassword',\n        db: 'admin'\n      },\n      isSrvRecord: false,\n      authStrategy: 'MONGODB',\n      mongodbUsername: 'someUsername',\n      mongodbPassword: 'testPassword',\n      mongodbDatabaseName: 'admin',\n      extraOptions: {},\n      connectionType: 'NODE_DRIVER',\n      readPreference: 'primary',\n      kerberosCanonicalizeHostname: false,\n      sslMethod: 'NONE',\n      sshTunnel: 'NONE',\n      sshTunnelPort: 22\n    }`\n  }\n);\n```\n\n## Properties\n\nMongoDB connection model is based on Ampersand.js framework and consist of [props](https://ampersandjs.com/docs/#ampersand-state-props) and [derived props](https://ampersandjs.com/docs/#ampersand-state-derived). The props object describes the observable properties that MongoDB connection model gets from the Node.js Driver API.\n\n```javascript\nconst с = new Connection();\nconst props = с.getAttributes({ props: true });\n```\n## Derived Properties\n\nDerived properties (also known as computed properties) are properties of the state object that depend on other properties to determine their value.\n\n```javascript\nconst c = new Connection();\nconst derivedProps = c.getAttributes({ derived: true });\n```\n\n[npm_img]: https://img.shields.io/npm/v/mongodb-connection-model.svg?style=flat-square\n[npm_url]: https://www.npmjs.org/package/mongodb-connection-model","gitHead":"80a9e175edd3eabee53daee876d77943872e4205","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","check":"npm run lint && npm run depcheck","depcheck":"depcheck","test-check-ci":"npm run check"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.17.0+x64 (linux)","description":"MongoDB connection model","directories":{},"_nodeVersion":"16.17.0","compass:main":"index.js","dependencies":{"raf":"^3.4.1","lodash":"^4.17.21","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.2.0","storage-mixin":"0.0.0-next-80a9e175edd3eabee53daee876d77943872e4205","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.2","@mongodb-js/compass-utils":"0.0.0-next-80a9e175edd3eabee53daee876d77943872e4205","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.6.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","eslint":"^7.25.0","mongodb":"^5.5.0","depcheck":"^1.4.1","proxyquire":"^2.1.3","chai-subset":"^1.6.0","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^5.5.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_0.0.0-next-80a9e175edd3eabee53daee876d77943872e4205_1686610388988_0.9573801994851276","host":"s3://npm-registry-packages"}},"0.0.0-next-58b07e3b9faef89f8f737552ca57d6db6e0ea503":{"name":"mongodb-connection-model","version":"0.0.0-next-58b07e3b9faef89f8f737552ca57d6db6e0ea503","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@0.0.0-next-58b07e3b9faef89f8f737552ca57d6db6e0ea503","maintainers":[{"name":"mongo-j","email":"james.wang@mongodb.com"},{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satya@mongodb.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"iteng@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"1a380a692cda1539f4c157f52adc83edb0623f2e","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-0.0.0-next-58b07e3b9faef89f8f737552ca57d6db6e0ea503.tgz","fileCount":19,"integrity":"sha512-eLkYFq+lW9BvII70a+CaefaBRg1XjzmvFq6EVaCd0KzEAT+YChkTW1dczyAjSU8LX9anJU0fnn2nkGvynnNdmg==","signatures":[{"sig":"MEUCIDMpJpWs4lxwMvIab/dAHDr1gv9Zc2SDcHnpqsxbha04AiEA4SZ49Q6m0rI7Jsv/rXvuosbXoq4AaxwDHYOLaC/PXzU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":84329},"main":"index.js","readme":"# mongodb-connection-model  [![][npm_img]][npm_url]\n\n*Not recommended for use. This package will be be updated or removed in COMPASS-5490*\n\n## Usage\n\n### Building URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\nconst c = new Connection({ appname: 'My App Name' });\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://localhost:27017/?readPreference=primary&appname=My%20App&ssl=false'\n```\n\n### Parsing URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\n\nConnection.from(\n  'mongodb://someUsername:testPassword@localhost',\n  (error, result) => {\n    console.log(result);\n    >>> `{\n      hosts: [{ host: 'localhost', port: 27017 }],\n      hostname: 'localhost',\n      port: 27017,\n      auth: {\n        username: 'someUsername',\n        password: 'testPassword',\n        db: 'admin'\n      },\n      isSrvRecord: false,\n      authStrategy: 'MONGODB',\n      mongodbUsername: 'someUsername',\n      mongodbPassword: 'testPassword',\n      mongodbDatabaseName: 'admin',\n      extraOptions: {},\n      connectionType: 'NODE_DRIVER',\n      readPreference: 'primary',\n      kerberosCanonicalizeHostname: false,\n      sslMethod: 'NONE',\n      sshTunnel: 'NONE',\n      sshTunnelPort: 22\n    }`\n  }\n);\n```\n\n## Properties\n\nMongoDB connection model is based on Ampersand.js framework and consist of [props](https://ampersandjs.com/docs/#ampersand-state-props) and [derived props](https://ampersandjs.com/docs/#ampersand-state-derived). The props object describes the observable properties that MongoDB connection model gets from the Node.js Driver API.\n\n```javascript\nconst с = new Connection();\nconst props = с.getAttributes({ props: true });\n```\n## Derived Properties\n\nDerived properties (also known as computed properties) are properties of the state object that depend on other properties to determine their value.\n\n```javascript\nconst c = new Connection();\nconst derivedProps = c.getAttributes({ derived: true });\n```\n\n[npm_img]: https://img.shields.io/npm/v/mongodb-connection-model.svg?style=flat-square\n[npm_url]: https://www.npmjs.org/package/mongodb-connection-model","gitHead":"58b07e3b9faef89f8f737552ca57d6db6e0ea503","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","check":"npm run lint && npm run depcheck","depcheck":"depcheck","test-check-ci":"npm run check"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.17.0+x64 (linux)","description":"MongoDB connection model","directories":{},"_nodeVersion":"16.17.0","compass:main":"index.js","dependencies":{"raf":"^3.4.1","lodash":"^4.17.21","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.2.0","storage-mixin":"0.0.0-next-58b07e3b9faef89f8f737552ca57d6db6e0ea503","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.2","@mongodb-js/compass-utils":"0.0.0-next-58b07e3b9faef89f8f737552ca57d6db6e0ea503","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.6.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","eslint":"^7.25.0","mongodb":"^5.5.0","depcheck":"^1.4.1","proxyquire":"^2.1.3","chai-subset":"^1.6.0","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^5.5.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_0.0.0-next-58b07e3b9faef89f8f737552ca57d6db6e0ea503_1686783972952_0.8681484602749205","host":"s3://npm-registry-packages"}},"0.0.0-next-a6a1fbc898ffbe115f44ef184f30cf0d9348f9c2":{"name":"mongodb-connection-model","version":"0.0.0-next-a6a1fbc898ffbe115f44ef184f30cf0d9348f9c2","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@0.0.0-next-a6a1fbc898ffbe115f44ef184f30cf0d9348f9c2","maintainers":[{"name":"mongo-j","email":"james.wang@mongodb.com"},{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satya@mongodb.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"iteng@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"23666045cc0a476a72a9ecda6b42b39dfe913b7f","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-0.0.0-next-a6a1fbc898ffbe115f44ef184f30cf0d9348f9c2.tgz","fileCount":19,"integrity":"sha512-A6ocLj089E+FEHNPtGeKN1ZpnqMQjVD9G1m5obcEW96mfZnCV7ubVvWYmpXR7zTi2s0N/K1D8/+trBUYtXsvGw==","signatures":[{"sig":"MEYCIQDNdrAwXRsii4PIlP0nM+RU9v2CqxfbQW7+uOSyY0L75AIhANPldNmCD7d5lTOYnEpNyPxYUUvZKWnGc4HpqkIwLRgS","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":84329},"main":"index.js","readme":"# mongodb-connection-model  [![][npm_img]][npm_url]\n\n*Not recommended for use. This package will be be updated or removed in COMPASS-5490*\n\n## Usage\n\n### Building URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\nconst c = new Connection({ appname: 'My App Name' });\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://localhost:27017/?readPreference=primary&appname=My%20App&ssl=false'\n```\n\n### Parsing URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\n\nConnection.from(\n  'mongodb://someUsername:testPassword@localhost',\n  (error, result) => {\n    console.log(result);\n    >>> `{\n      hosts: [{ host: 'localhost', port: 27017 }],\n      hostname: 'localhost',\n      port: 27017,\n      auth: {\n        username: 'someUsername',\n        password: 'testPassword',\n        db: 'admin'\n      },\n      isSrvRecord: false,\n      authStrategy: 'MONGODB',\n      mongodbUsername: 'someUsername',\n      mongodbPassword: 'testPassword',\n      mongodbDatabaseName: 'admin',\n      extraOptions: {},\n      connectionType: 'NODE_DRIVER',\n      readPreference: 'primary',\n      kerberosCanonicalizeHostname: false,\n      sslMethod: 'NONE',\n      sshTunnel: 'NONE',\n      sshTunnelPort: 22\n    }`\n  }\n);\n```\n\n## Properties\n\nMongoDB connection model is based on Ampersand.js framework and consist of [props](https://ampersandjs.com/docs/#ampersand-state-props) and [derived props](https://ampersandjs.com/docs/#ampersand-state-derived). The props object describes the observable properties that MongoDB connection model gets from the Node.js Driver API.\n\n```javascript\nconst с = new Connection();\nconst props = с.getAttributes({ props: true });\n```\n## Derived Properties\n\nDerived properties (also known as computed properties) are properties of the state object that depend on other properties to determine their value.\n\n```javascript\nconst c = new Connection();\nconst derivedProps = c.getAttributes({ derived: true });\n```\n\n[npm_img]: https://img.shields.io/npm/v/mongodb-connection-model.svg?style=flat-square\n[npm_url]: https://www.npmjs.org/package/mongodb-connection-model","gitHead":"a6a1fbc898ffbe115f44ef184f30cf0d9348f9c2","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","check":"npm run lint && npm run depcheck","depcheck":"depcheck","test-check-ci":"npm run check"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.17.0+x64 (linux)","description":"MongoDB connection model","directories":{},"_nodeVersion":"16.17.0","compass:main":"index.js","dependencies":{"raf":"^3.4.1","lodash":"^4.17.21","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.2.0","storage-mixin":"0.0.0-next-a6a1fbc898ffbe115f44ef184f30cf0d9348f9c2","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.2","@mongodb-js/compass-utils":"0.0.0-next-a6a1fbc898ffbe115f44ef184f30cf0d9348f9c2","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.6.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","eslint":"^7.25.0","mongodb":"^5.5.0","depcheck":"^1.4.1","proxyquire":"^2.1.3","chai-subset":"^1.6.0","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^5.5.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_0.0.0-next-a6a1fbc898ffbe115f44ef184f30cf0d9348f9c2_1686784201341_0.044131684992522846","host":"s3://npm-registry-packages"}},"0.0.0-next-3ddf2b32a13c98a8713916c7c20185f8ae9a9327":{"name":"mongodb-connection-model","version":"0.0.0-next-3ddf2b32a13c98a8713916c7c20185f8ae9a9327","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@0.0.0-next-3ddf2b32a13c98a8713916c7c20185f8ae9a9327","maintainers":[{"name":"mongo-j","email":"james.wang@mongodb.com"},{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satya@mongodb.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"iteng@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"2f11661a61e8e34f3291507e9ae273713b3f60f8","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-0.0.0-next-3ddf2b32a13c98a8713916c7c20185f8ae9a9327.tgz","fileCount":19,"integrity":"sha512-cBliCEbwwrMQsD71OEiYe2hOGNjXI5yXtWMQcNvUCY2OBNmshvy8siyGOiQMdC9f2fC1VUGV+cNoSbnMnkyuEA==","signatures":[{"sig":"MEUCIHexirJer2WA1mDrd4gETVV83Z1Ux3kzezYJBcPRk3Z8AiEA8lwZXhNN3fJDDevVNFoGLlS3f7muyahlbVZdHb9PfYQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":84329},"main":"index.js","readme":"# mongodb-connection-model  [![][npm_img]][npm_url]\n\n*Not recommended for use. This package will be be updated or removed in COMPASS-5490*\n\n## Usage\n\n### Building URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\nconst c = new Connection({ appname: 'My App Name' });\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://localhost:27017/?readPreference=primary&appname=My%20App&ssl=false'\n```\n\n### Parsing URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\n\nConnection.from(\n  'mongodb://someUsername:testPassword@localhost',\n  (error, result) => {\n    console.log(result);\n    >>> `{\n      hosts: [{ host: 'localhost', port: 27017 }],\n      hostname: 'localhost',\n      port: 27017,\n      auth: {\n        username: 'someUsername',\n        password: 'testPassword',\n        db: 'admin'\n      },\n      isSrvRecord: false,\n      authStrategy: 'MONGODB',\n      mongodbUsername: 'someUsername',\n      mongodbPassword: 'testPassword',\n      mongodbDatabaseName: 'admin',\n      extraOptions: {},\n      connectionType: 'NODE_DRIVER',\n      readPreference: 'primary',\n      kerberosCanonicalizeHostname: false,\n      sslMethod: 'NONE',\n      sshTunnel: 'NONE',\n      sshTunnelPort: 22\n    }`\n  }\n);\n```\n\n## Properties\n\nMongoDB connection model is based on Ampersand.js framework and consist of [props](https://ampersandjs.com/docs/#ampersand-state-props) and [derived props](https://ampersandjs.com/docs/#ampersand-state-derived). The props object describes the observable properties that MongoDB connection model gets from the Node.js Driver API.\n\n```javascript\nconst с = new Connection();\nconst props = с.getAttributes({ props: true });\n```\n## Derived Properties\n\nDerived properties (also known as computed properties) are properties of the state object that depend on other properties to determine their value.\n\n```javascript\nconst c = new Connection();\nconst derivedProps = c.getAttributes({ derived: true });\n```\n\n[npm_img]: https://img.shields.io/npm/v/mongodb-connection-model.svg?style=flat-square\n[npm_url]: https://www.npmjs.org/package/mongodb-connection-model","gitHead":"3ddf2b32a13c98a8713916c7c20185f8ae9a9327","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","check":"npm run lint && npm run depcheck","depcheck":"depcheck","test-check-ci":"npm run check"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.17.0+x64 (linux)","description":"MongoDB connection model","directories":{},"_nodeVersion":"16.17.0","compass:main":"index.js","dependencies":{"raf":"^3.4.1","lodash":"^4.17.21","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.2.0","storage-mixin":"0.0.0-next-3ddf2b32a13c98a8713916c7c20185f8ae9a9327","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.2","@mongodb-js/compass-utils":"0.0.0-next-3ddf2b32a13c98a8713916c7c20185f8ae9a9327","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.6.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","eslint":"^7.25.0","mongodb":"^5.6.0","depcheck":"^1.4.1","proxyquire":"^2.1.3","chai-subset":"^1.6.0","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^5.6.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_0.0.0-next-3ddf2b32a13c98a8713916c7c20185f8ae9a9327_1687577964534_0.7441381458349172","host":"s3://npm-registry-packages"}},"0.0.0-next-f0a5a0fe0d39e23cbafd19676a6f8bc00f4480b5":{"name":"mongodb-connection-model","version":"0.0.0-next-f0a5a0fe0d39e23cbafd19676a6f8bc00f4480b5","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@0.0.0-next-f0a5a0fe0d39e23cbafd19676a6f8bc00f4480b5","maintainers":[{"name":"mongo-j","email":"james.wang@mongodb.com"},{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satya@mongodb.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"iteng@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"50d85d9e239f4b69325115d940d910af79daf481","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-0.0.0-next-f0a5a0fe0d39e23cbafd19676a6f8bc00f4480b5.tgz","fileCount":19,"integrity":"sha512-M2FefCi0N5Yv1w+6YeFMwc/MQS1BXEjw7okhzz7zOzY8P6B5kkkSVG9nTd7SFjhDyj3Owha9HxuijS694PiA/Q==","signatures":[{"sig":"MEUCIE287Nv0s5WsAmLv6ds4WvpCr8a6Wi01ZtO6IKVcatlXAiEA5ixxEJLzzZVBfC+yZYJ7w7mb1Y/k09PeJnWwD+ZBYoY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":84329},"main":"index.js","readme":"# mongodb-connection-model  [![][npm_img]][npm_url]\n\n*Not recommended for use. This package will be be updated or removed in COMPASS-5490*\n\n## Usage\n\n### Building URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\nconst c = new Connection({ appname: 'My App Name' });\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://localhost:27017/?readPreference=primary&appname=My%20App&ssl=false'\n```\n\n### Parsing URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\n\nConnection.from(\n  'mongodb://someUsername:testPassword@localhost',\n  (error, result) => {\n    console.log(result);\n    >>> `{\n      hosts: [{ host: 'localhost', port: 27017 }],\n      hostname: 'localhost',\n      port: 27017,\n      auth: {\n        username: 'someUsername',\n        password: 'testPassword',\n        db: 'admin'\n      },\n      isSrvRecord: false,\n      authStrategy: 'MONGODB',\n      mongodbUsername: 'someUsername',\n      mongodbPassword: 'testPassword',\n      mongodbDatabaseName: 'admin',\n      extraOptions: {},\n      connectionType: 'NODE_DRIVER',\n      readPreference: 'primary',\n      kerberosCanonicalizeHostname: false,\n      sslMethod: 'NONE',\n      sshTunnel: 'NONE',\n      sshTunnelPort: 22\n    }`\n  }\n);\n```\n\n## Properties\n\nMongoDB connection model is based on Ampersand.js framework and consist of [props](https://ampersandjs.com/docs/#ampersand-state-props) and [derived props](https://ampersandjs.com/docs/#ampersand-state-derived). The props object describes the observable properties that MongoDB connection model gets from the Node.js Driver API.\n\n```javascript\nconst с = new Connection();\nconst props = с.getAttributes({ props: true });\n```\n## Derived Properties\n\nDerived properties (also known as computed properties) are properties of the state object that depend on other properties to determine their value.\n\n```javascript\nconst c = new Connection();\nconst derivedProps = c.getAttributes({ derived: true });\n```\n\n[npm_img]: https://img.shields.io/npm/v/mongodb-connection-model.svg?style=flat-square\n[npm_url]: https://www.npmjs.org/package/mongodb-connection-model","gitHead":"f0a5a0fe0d39e23cbafd19676a6f8bc00f4480b5","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","check":"npm run lint && npm run depcheck","depcheck":"depcheck","test-check-ci":"npm run check"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.17.0+x64 (linux)","description":"MongoDB connection model","directories":{},"_nodeVersion":"16.17.0","compass:main":"index.js","dependencies":{"raf":"^3.4.1","lodash":"^4.17.21","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.2.0","storage-mixin":"0.0.0-next-f0a5a0fe0d39e23cbafd19676a6f8bc00f4480b5","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.2","@mongodb-js/compass-utils":"0.0.0-next-f0a5a0fe0d39e23cbafd19676a6f8bc00f4480b5","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.6.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","eslint":"^7.25.0","mongodb":"^5.6.0","depcheck":"^1.4.1","proxyquire":"^2.1.3","chai-subset":"^1.6.0","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^5.6.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_0.0.0-next-f0a5a0fe0d39e23cbafd19676a6f8bc00f4480b5_1687578119800_0.2618607869868548","host":"s3://npm-registry-packages"}},"0.0.0-next-99faf39dcaa3321ec39c2a4a4c7b67e04f3c753e":{"name":"mongodb-connection-model","version":"0.0.0-next-99faf39dcaa3321ec39c2a4a4c7b67e04f3c753e","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@0.0.0-next-99faf39dcaa3321ec39c2a4a4c7b67e04f3c753e","maintainers":[{"name":"mongo-j","email":"james.wang@mongodb.com"},{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satya@mongodb.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"iteng@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"fda356e6ef3a2a93233c8a56c2ddc41d55e28de2","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-0.0.0-next-99faf39dcaa3321ec39c2a4a4c7b67e04f3c753e.tgz","fileCount":19,"integrity":"sha512-bRPEVQuqxmIUIgWKOy5llm6tm3OA8NDZU+SizIi/h1eE4K5ATtTlTnyYGYHGKyYvezq+WlW2m/+ZJOLu+ObYJg==","signatures":[{"sig":"MEQCIBT3/mJ3KoHGbtEjqqeTemAwwQcjQ0ry0yjAkcdaS7SBAiAyy4HEi22/WDud2N9aP3UbApmScLdl8Fxk7MeebxPRDA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":84329},"main":"index.js","readme":"# mongodb-connection-model  [![][npm_img]][npm_url]\n\n*Not recommended for use. This package will be be updated or removed in COMPASS-5490*\n\n## Usage\n\n### Building URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\nconst c = new Connection({ appname: 'My App Name' });\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://localhost:27017/?readPreference=primary&appname=My%20App&ssl=false'\n```\n\n### Parsing URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\n\nConnection.from(\n  'mongodb://someUsername:testPassword@localhost',\n  (error, result) => {\n    console.log(result);\n    >>> `{\n      hosts: [{ host: 'localhost', port: 27017 }],\n      hostname: 'localhost',\n      port: 27017,\n      auth: {\n        username: 'someUsername',\n        password: 'testPassword',\n        db: 'admin'\n      },\n      isSrvRecord: false,\n      authStrategy: 'MONGODB',\n      mongodbUsername: 'someUsername',\n      mongodbPassword: 'testPassword',\n      mongodbDatabaseName: 'admin',\n      extraOptions: {},\n      connectionType: 'NODE_DRIVER',\n      readPreference: 'primary',\n      kerberosCanonicalizeHostname: false,\n      sslMethod: 'NONE',\n      sshTunnel: 'NONE',\n      sshTunnelPort: 22\n    }`\n  }\n);\n```\n\n## Properties\n\nMongoDB connection model is based on Ampersand.js framework and consist of [props](https://ampersandjs.com/docs/#ampersand-state-props) and [derived props](https://ampersandjs.com/docs/#ampersand-state-derived). The props object describes the observable properties that MongoDB connection model gets from the Node.js Driver API.\n\n```javascript\nconst с = new Connection();\nconst props = с.getAttributes({ props: true });\n```\n## Derived Properties\n\nDerived properties (also known as computed properties) are properties of the state object that depend on other properties to determine their value.\n\n```javascript\nconst c = new Connection();\nconst derivedProps = c.getAttributes({ derived: true });\n```\n\n[npm_img]: https://img.shields.io/npm/v/mongodb-connection-model.svg?style=flat-square\n[npm_url]: https://www.npmjs.org/package/mongodb-connection-model","gitHead":"99faf39dcaa3321ec39c2a4a4c7b67e04f3c753e","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","check":"npm run lint && npm run depcheck","depcheck":"depcheck","test-check-ci":"npm run check"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.17.0+x64 (linux)","description":"MongoDB connection model","directories":{},"_nodeVersion":"16.17.0","compass:main":"index.js","dependencies":{"raf":"^3.4.1","lodash":"^4.17.21","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.2.0","storage-mixin":"0.0.0-next-99faf39dcaa3321ec39c2a4a4c7b67e04f3c753e","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.2","@mongodb-js/compass-utils":"0.0.0-next-99faf39dcaa3321ec39c2a4a4c7b67e04f3c753e","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.6.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","eslint":"^7.25.0","mongodb":"^5.6.0","depcheck":"^1.4.1","proxyquire":"^2.1.3","chai-subset":"^1.6.0","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^5.6.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_0.0.0-next-99faf39dcaa3321ec39c2a4a4c7b67e04f3c753e_1687970068503_0.31012670698904676","host":"s3://npm-registry-packages"}},"0.0.0-next-c584ad92337ea0098e7068e83ed68dd13565b7da":{"name":"mongodb-connection-model","version":"0.0.0-next-c584ad92337ea0098e7068e83ed68dd13565b7da","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@0.0.0-next-c584ad92337ea0098e7068e83ed68dd13565b7da","maintainers":[{"name":"mongo-j","email":"james.wang@mongodb.com"},{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satya@mongodb.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"iteng@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"a9babef091a094dbb6e7cd42bea5bfd8fe02fb1d","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-0.0.0-next-c584ad92337ea0098e7068e83ed68dd13565b7da.tgz","fileCount":19,"integrity":"sha512-JW9CNm/qz85NHcn/3SWnQ5Fbls0Jl2Yx4dlqoy9ullQiQUzSGOdjgKE1AKuW+dOX4cU4cr76bD0Ui08JuyKuqA==","signatures":[{"sig":"MEUCICo/4ZQRaKhBw1XUv9GUlKTg4O1a+x2NCrtm/TYeDxDaAiEA+bTp39R+5kK/DqONHVPrfz3fA6VbDuBeJQYn67iBHeQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":84329},"main":"index.js","readme":"# mongodb-connection-model  [![][npm_img]][npm_url]\n\n*Not recommended for use. This package will be be updated or removed in COMPASS-5490*\n\n## Usage\n\n### Building URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\nconst c = new Connection({ appname: 'My App Name' });\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://localhost:27017/?readPreference=primary&appname=My%20App&ssl=false'\n```\n\n### Parsing URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\n\nConnection.from(\n  'mongodb://someUsername:testPassword@localhost',\n  (error, result) => {\n    console.log(result);\n    >>> `{\n      hosts: [{ host: 'localhost', port: 27017 }],\n      hostname: 'localhost',\n      port: 27017,\n      auth: {\n        username: 'someUsername',\n        password: 'testPassword',\n        db: 'admin'\n      },\n      isSrvRecord: false,\n      authStrategy: 'MONGODB',\n      mongodbUsername: 'someUsername',\n      mongodbPassword: 'testPassword',\n      mongodbDatabaseName: 'admin',\n      extraOptions: {},\n      connectionType: 'NODE_DRIVER',\n      readPreference: 'primary',\n      kerberosCanonicalizeHostname: false,\n      sslMethod: 'NONE',\n      sshTunnel: 'NONE',\n      sshTunnelPort: 22\n    }`\n  }\n);\n```\n\n## Properties\n\nMongoDB connection model is based on Ampersand.js framework and consist of [props](https://ampersandjs.com/docs/#ampersand-state-props) and [derived props](https://ampersandjs.com/docs/#ampersand-state-derived). The props object describes the observable properties that MongoDB connection model gets from the Node.js Driver API.\n\n```javascript\nconst с = new Connection();\nconst props = с.getAttributes({ props: true });\n```\n## Derived Properties\n\nDerived properties (also known as computed properties) are properties of the state object that depend on other properties to determine their value.\n\n```javascript\nconst c = new Connection();\nconst derivedProps = c.getAttributes({ derived: true });\n```\n\n[npm_img]: https://img.shields.io/npm/v/mongodb-connection-model.svg?style=flat-square\n[npm_url]: https://www.npmjs.org/package/mongodb-connection-model","gitHead":"c584ad92337ea0098e7068e83ed68dd13565b7da","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","check":"npm run lint && npm run depcheck","depcheck":"depcheck","test-check-ci":"npm run check"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.17.0+x64 (linux)","description":"MongoDB connection model","directories":{},"_nodeVersion":"16.17.0","compass:main":"index.js","dependencies":{"raf":"^3.4.1","lodash":"^4.17.21","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.2.0","storage-mixin":"0.0.0-next-c584ad92337ea0098e7068e83ed68dd13565b7da","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.2","@mongodb-js/compass-utils":"0.0.0-next-c584ad92337ea0098e7068e83ed68dd13565b7da","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.6.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","eslint":"^7.25.0","mongodb":"^5.6.0","depcheck":"^1.4.1","proxyquire":"^2.1.3","chai-subset":"^1.6.0","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^5.6.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_0.0.0-next-c584ad92337ea0098e7068e83ed68dd13565b7da_1688102542586_0.6310275852089628","host":"s3://npm-registry-packages"}},"0.0.0-next-835937ee6a94b541fd12d3d0c54d829fb2d0e492":{"name":"mongodb-connection-model","version":"0.0.0-next-835937ee6a94b541fd12d3d0c54d829fb2d0e492","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@0.0.0-next-835937ee6a94b541fd12d3d0c54d829fb2d0e492","maintainers":[{"name":"mongo-j","email":"james.wang@mongodb.com"},{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satya@mongodb.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"iteng@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"b3d43ebaef6f624fa554341e81ded7d46609b1cd","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-0.0.0-next-835937ee6a94b541fd12d3d0c54d829fb2d0e492.tgz","fileCount":19,"integrity":"sha512-qxH/1WBV1xfemRKDd67bMqzz2uSldh+yrbmKQUFU4hYEPuTtiIPNPvIG9o+eJciI3m0nj62fGbdVeBuj8aD7vA==","signatures":[{"sig":"MEYCIQDU5qV4EhGPN7UMzpd2Y5EKNqJSQ+TpF0Jd3JSfucgs2wIhAPjoRnJpEMVjyE0+5Sb1q/Szdm7aPtbqyV5a+mCbDbOJ","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":84329},"main":"index.js","readme":"# mongodb-connection-model  [![][npm_img]][npm_url]\n\n*Not recommended for use. This package will be be updated or removed in COMPASS-5490*\n\n## Usage\n\n### Building URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\nconst c = new Connection({ appname: 'My App Name' });\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://localhost:27017/?readPreference=primary&appname=My%20App&ssl=false'\n```\n\n### Parsing URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\n\nConnection.from(\n  'mongodb://someUsername:testPassword@localhost',\n  (error, result) => {\n    console.log(result);\n    >>> `{\n      hosts: [{ host: 'localhost', port: 27017 }],\n      hostname: 'localhost',\n      port: 27017,\n      auth: {\n        username: 'someUsername',\n        password: 'testPassword',\n        db: 'admin'\n      },\n      isSrvRecord: false,\n      authStrategy: 'MONGODB',\n      mongodbUsername: 'someUsername',\n      mongodbPassword: 'testPassword',\n      mongodbDatabaseName: 'admin',\n      extraOptions: {},\n      connectionType: 'NODE_DRIVER',\n      readPreference: 'primary',\n      kerberosCanonicalizeHostname: false,\n      sslMethod: 'NONE',\n      sshTunnel: 'NONE',\n      sshTunnelPort: 22\n    }`\n  }\n);\n```\n\n## Properties\n\nMongoDB connection model is based on Ampersand.js framework and consist of [props](https://ampersandjs.com/docs/#ampersand-state-props) and [derived props](https://ampersandjs.com/docs/#ampersand-state-derived). The props object describes the observable properties that MongoDB connection model gets from the Node.js Driver API.\n\n```javascript\nconst с = new Connection();\nconst props = с.getAttributes({ props: true });\n```\n## Derived Properties\n\nDerived properties (also known as computed properties) are properties of the state object that depend on other properties to determine their value.\n\n```javascript\nconst c = new Connection();\nconst derivedProps = c.getAttributes({ derived: true });\n```\n\n[npm_img]: https://img.shields.io/npm/v/mongodb-connection-model.svg?style=flat-square\n[npm_url]: https://www.npmjs.org/package/mongodb-connection-model","gitHead":"835937ee6a94b541fd12d3d0c54d829fb2d0e492","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","check":"npm run lint && npm run depcheck","depcheck":"depcheck","test-check-ci":"npm run check"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.17.0+x64 (linux)","description":"MongoDB connection model","directories":{},"_nodeVersion":"16.17.0","compass:main":"index.js","dependencies":{"raf":"^3.4.1","lodash":"^4.17.21","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.2.0","storage-mixin":"0.0.0-next-835937ee6a94b541fd12d3d0c54d829fb2d0e492","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.2","@mongodb-js/compass-utils":"0.0.0-next-835937ee6a94b541fd12d3d0c54d829fb2d0e492","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.6.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","eslint":"^7.25.0","mongodb":"^5.6.0","depcheck":"^1.4.1","proxyquire":"^2.1.3","chai-subset":"^1.6.0","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^5.6.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_0.0.0-next-835937ee6a94b541fd12d3d0c54d829fb2d0e492_1688150066672_0.43600753976869266","host":"s3://npm-registry-packages"}},"0.0.0-next-a7eb730693b63501028444f9ef6b634620af6e37":{"name":"mongodb-connection-model","version":"0.0.0-next-a7eb730693b63501028444f9ef6b634620af6e37","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@0.0.0-next-a7eb730693b63501028444f9ef6b634620af6e37","maintainers":[{"name":"mongo-j","email":"james.wang@mongodb.com"},{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satya@mongodb.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"iteng@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"598e0a293b22b9fc407321cde942ad4146a47d83","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-0.0.0-next-a7eb730693b63501028444f9ef6b634620af6e37.tgz","fileCount":19,"integrity":"sha512-Df9JE8UpSVXhfw+d1gl4aMd0mTn5mDd2tqYgRKnKJzyd4PVD/itbJfg/KAQPmSX1WsMufd8Dw6WB1S1P/aEZJA==","signatures":[{"sig":"MEUCIQDtAE6CenIgDJ7e4jmWxqA+RQc5Fset013l/AWzafNIVQIgA+laDlknC5r0KfJee1+sbfkHaXJN3iXJxd7btB0wF4g=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":84329},"main":"index.js","readme":"# mongodb-connection-model  [![][npm_img]][npm_url]\n\n*Not recommended for use. This package will be be updated or removed in COMPASS-5490*\n\n## Usage\n\n### Building URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\nconst c = new Connection({ appname: 'My App Name' });\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://localhost:27017/?readPreference=primary&appname=My%20App&ssl=false'\n```\n\n### Parsing URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\n\nConnection.from(\n  'mongodb://someUsername:testPassword@localhost',\n  (error, result) => {\n    console.log(result);\n    >>> `{\n      hosts: [{ host: 'localhost', port: 27017 }],\n      hostname: 'localhost',\n      port: 27017,\n      auth: {\n        username: 'someUsername',\n        password: 'testPassword',\n        db: 'admin'\n      },\n      isSrvRecord: false,\n      authStrategy: 'MONGODB',\n      mongodbUsername: 'someUsername',\n      mongodbPassword: 'testPassword',\n      mongodbDatabaseName: 'admin',\n      extraOptions: {},\n      connectionType: 'NODE_DRIVER',\n      readPreference: 'primary',\n      kerberosCanonicalizeHostname: false,\n      sslMethod: 'NONE',\n      sshTunnel: 'NONE',\n      sshTunnelPort: 22\n    }`\n  }\n);\n```\n\n## Properties\n\nMongoDB connection model is based on Ampersand.js framework and consist of [props](https://ampersandjs.com/docs/#ampersand-state-props) and [derived props](https://ampersandjs.com/docs/#ampersand-state-derived). The props object describes the observable properties that MongoDB connection model gets from the Node.js Driver API.\n\n```javascript\nconst с = new Connection();\nconst props = с.getAttributes({ props: true });\n```\n## Derived Properties\n\nDerived properties (also known as computed properties) are properties of the state object that depend on other properties to determine their value.\n\n```javascript\nconst c = new Connection();\nconst derivedProps = c.getAttributes({ derived: true });\n```\n\n[npm_img]: https://img.shields.io/npm/v/mongodb-connection-model.svg?style=flat-square\n[npm_url]: https://www.npmjs.org/package/mongodb-connection-model","gitHead":"a7eb730693b63501028444f9ef6b634620af6e37","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","check":"npm run lint && npm run depcheck","depcheck":"depcheck","test-check-ci":"npm run check"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.17.0+x64 (linux)","description":"MongoDB connection model","directories":{},"_nodeVersion":"16.17.0","compass:main":"index.js","dependencies":{"raf":"^3.4.1","lodash":"^4.17.21","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.2.0","storage-mixin":"0.0.0-next-a7eb730693b63501028444f9ef6b634620af6e37","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.2","@mongodb-js/compass-utils":"0.0.0-next-a7eb730693b63501028444f9ef6b634620af6e37","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.6.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","eslint":"^7.25.0","mongodb":"^5.6.0","depcheck":"^1.4.1","proxyquire":"^2.1.3","chai-subset":"^1.6.0","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^5.6.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_0.0.0-next-a7eb730693b63501028444f9ef6b634620af6e37_1688409923962_0.6365057857001493","host":"s3://npm-registry-packages"}},"0.0.0-next-247cba5e738b47e2c433fd1bc2e3d0ed48142ca5":{"name":"mongodb-connection-model","version":"0.0.0-next-247cba5e738b47e2c433fd1bc2e3d0ed48142ca5","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@0.0.0-next-247cba5e738b47e2c433fd1bc2e3d0ed48142ca5","maintainers":[{"name":"c-buckingham","email":"christopher.buckingham@mongodb.com"},{"name":"mongo-j","email":"james.wang@mongodb.com"},{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satya@mongodb.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"iteng@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"f45f97fd283d32110d43080825c27b078b4aee1b","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-0.0.0-next-247cba5e738b47e2c433fd1bc2e3d0ed48142ca5.tgz","fileCount":19,"integrity":"sha512-WvfQj24CvOTHEgGkFBlZnGXjvLp8cR+hJnjp9Jca3orX+yuk82kVGrBg/+cGLe+HjNmwAY/S0+emcT318jeDuw==","signatures":[{"sig":"MEUCIC+m2UXjCNyZgadTPusVchLdnnzxOuXGJWtMhHzDj0TNAiEA53C5ePQn/LZFSb5SSR/Frjm4I4Kls1+HdggVkH+1E9k=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":84329},"main":"index.js","readme":"# mongodb-connection-model  [![][npm_img]][npm_url]\n\n*Not recommended for use. This package will be be updated or removed in COMPASS-5490*\n\n## Usage\n\n### Building URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\nconst c = new Connection({ appname: 'My App Name' });\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://localhost:27017/?readPreference=primary&appname=My%20App&ssl=false'\n```\n\n### Parsing URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\n\nConnection.from(\n  'mongodb://someUsername:testPassword@localhost',\n  (error, result) => {\n    console.log(result);\n    >>> `{\n      hosts: [{ host: 'localhost', port: 27017 }],\n      hostname: 'localhost',\n      port: 27017,\n      auth: {\n        username: 'someUsername',\n        password: 'testPassword',\n        db: 'admin'\n      },\n      isSrvRecord: false,\n      authStrategy: 'MONGODB',\n      mongodbUsername: 'someUsername',\n      mongodbPassword: 'testPassword',\n      mongodbDatabaseName: 'admin',\n      extraOptions: {},\n      connectionType: 'NODE_DRIVER',\n      readPreference: 'primary',\n      kerberosCanonicalizeHostname: false,\n      sslMethod: 'NONE',\n      sshTunnel: 'NONE',\n      sshTunnelPort: 22\n    }`\n  }\n);\n```\n\n## Properties\n\nMongoDB connection model is based on Ampersand.js framework and consist of [props](https://ampersandjs.com/docs/#ampersand-state-props) and [derived props](https://ampersandjs.com/docs/#ampersand-state-derived). The props object describes the observable properties that MongoDB connection model gets from the Node.js Driver API.\n\n```javascript\nconst с = new Connection();\nconst props = с.getAttributes({ props: true });\n```\n## Derived Properties\n\nDerived properties (also known as computed properties) are properties of the state object that depend on other properties to determine their value.\n\n```javascript\nconst c = new Connection();\nconst derivedProps = c.getAttributes({ derived: true });\n```\n\n[npm_img]: https://img.shields.io/npm/v/mongodb-connection-model.svg?style=flat-square\n[npm_url]: https://www.npmjs.org/package/mongodb-connection-model","gitHead":"247cba5e738b47e2c433fd1bc2e3d0ed48142ca5","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","check":"npm run lint && npm run depcheck","depcheck":"depcheck","test-check-ci":"npm run check"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.17.0+x64 (linux)","description":"MongoDB connection model","directories":{},"_nodeVersion":"16.17.0","compass:main":"index.js","dependencies":{"raf":"^3.4.1","lodash":"^4.17.21","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.2.0","storage-mixin":"0.0.0-next-247cba5e738b47e2c433fd1bc2e3d0ed48142ca5","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.2","@mongodb-js/compass-utils":"0.0.0-next-247cba5e738b47e2c433fd1bc2e3d0ed48142ca5","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.6.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","eslint":"^7.25.0","mongodb":"^5.6.0","depcheck":"^1.4.1","proxyquire":"^2.1.3","chai-subset":"^1.6.0","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^5.6.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_0.0.0-next-247cba5e738b47e2c433fd1bc2e3d0ed48142ca5_1689216241288_0.7329843787295274","host":"s3://npm-registry-packages"}},"0.0.0-next-8c579fa95e9deb46d73653d702f7f3b0e41efeb8":{"name":"mongodb-connection-model","version":"0.0.0-next-8c579fa95e9deb46d73653d702f7f3b0e41efeb8","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@0.0.0-next-8c579fa95e9deb46d73653d702f7f3b0e41efeb8","maintainers":[{"name":"c-buckingham","email":"christopher.buckingham@mongodb.com"},{"name":"mongo-j","email":"james.wang@mongodb.com"},{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satya@mongodb.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"iteng@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"499072f8e557afc092a3a6a844ffc891f630068d","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-0.0.0-next-8c579fa95e9deb46d73653d702f7f3b0e41efeb8.tgz","fileCount":19,"integrity":"sha512-at7UG71wyA5ajaToul4uqgOsgkTvevDxGpIPnbFQJfztdm7y4tJ98U1FBQp/PWkAJKCFSild1zW129SOCCPWjw==","signatures":[{"sig":"MEUCIEqgI089MvheAE7hvfPHdrO08CSuZCe4P56tdBDuHOz6AiEAlz0lseHh+87QPhtHQNnYdvjfz79XLILN5x/CzTax5LY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":84329},"main":"index.js","readme":"# mongodb-connection-model  [![][npm_img]][npm_url]\n\n*Not recommended for use. This package will be be updated or removed in COMPASS-5490*\n\n## Usage\n\n### Building URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\nconst c = new Connection({ appname: 'My App Name' });\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://localhost:27017/?readPreference=primary&appname=My%20App&ssl=false'\n```\n\n### Parsing URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\n\nConnection.from(\n  'mongodb://someUsername:testPassword@localhost',\n  (error, result) => {\n    console.log(result);\n    >>> `{\n      hosts: [{ host: 'localhost', port: 27017 }],\n      hostname: 'localhost',\n      port: 27017,\n      auth: {\n        username: 'someUsername',\n        password: 'testPassword',\n        db: 'admin'\n      },\n      isSrvRecord: false,\n      authStrategy: 'MONGODB',\n      mongodbUsername: 'someUsername',\n      mongodbPassword: 'testPassword',\n      mongodbDatabaseName: 'admin',\n      extraOptions: {},\n      connectionType: 'NODE_DRIVER',\n      readPreference: 'primary',\n      kerberosCanonicalizeHostname: false,\n      sslMethod: 'NONE',\n      sshTunnel: 'NONE',\n      sshTunnelPort: 22\n    }`\n  }\n);\n```\n\n## Properties\n\nMongoDB connection model is based on Ampersand.js framework and consist of [props](https://ampersandjs.com/docs/#ampersand-state-props) and [derived props](https://ampersandjs.com/docs/#ampersand-state-derived). The props object describes the observable properties that MongoDB connection model gets from the Node.js Driver API.\n\n```javascript\nconst с = new Connection();\nconst props = с.getAttributes({ props: true });\n```\n## Derived Properties\n\nDerived properties (also known as computed properties) are properties of the state object that depend on other properties to determine their value.\n\n```javascript\nconst c = new Connection();\nconst derivedProps = c.getAttributes({ derived: true });\n```\n\n[npm_img]: https://img.shields.io/npm/v/mongodb-connection-model.svg?style=flat-square\n[npm_url]: https://www.npmjs.org/package/mongodb-connection-model","gitHead":"8c579fa95e9deb46d73653d702f7f3b0e41efeb8","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","check":"npm run lint && npm run depcheck","depcheck":"depcheck","test-check-ci":"npm run check"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.17.0+x64 (linux)","description":"MongoDB connection model","directories":{},"_nodeVersion":"16.17.0","compass:main":"index.js","dependencies":{"raf":"^3.4.1","lodash":"^4.17.21","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.2.0","storage-mixin":"0.0.0-next-8c579fa95e9deb46d73653d702f7f3b0e41efeb8","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.2","@mongodb-js/compass-utils":"0.0.0-next-8c579fa95e9deb46d73653d702f7f3b0e41efeb8","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.6.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","eslint":"^7.25.0","mongodb":"^5.6.0","depcheck":"^1.4.1","proxyquire":"^2.1.3","chai-subset":"^1.6.0","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^5.6.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_0.0.0-next-8c579fa95e9deb46d73653d702f7f3b0e41efeb8_1689907307201_0.3710782820272849","host":"s3://npm-registry-packages"}},"0.0.0-next-1d0257ec5ae772888fbfb677bbacf8cd7dfb3127":{"name":"mongodb-connection-model","version":"0.0.0-next-1d0257ec5ae772888fbfb677bbacf8cd7dfb3127","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@0.0.0-next-1d0257ec5ae772888fbfb677bbacf8cd7dfb3127","maintainers":[{"name":"c-buckingham","email":"christopher.buckingham@mongodb.com"},{"name":"mongo-j","email":"james.wang@mongodb.com"},{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satya@mongodb.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"iteng@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"ef91e22c646bafecfda9e3f432ea4ffdd62bedf7","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-0.0.0-next-1d0257ec5ae772888fbfb677bbacf8cd7dfb3127.tgz","fileCount":19,"integrity":"sha512-Nld3ouLlzlNXQ5QBtjB+BT2Wf9d+wvdcSWAhKlFnHMrdDmOhXC1p9GwPv/+4SI0lL1OtxXvqaPblMm9a4JzDtg==","signatures":[{"sig":"MEYCIQDq4PrenuAgXBFnuC4aH042C128RujMEbbmIGAb2fXxbAIhAJzDYO7CVrVSoLMtkBxh2Y6v5SysoZ6SLT0nFdYIZ+5/","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":84329},"main":"index.js","readme":"# mongodb-connection-model  [![][npm_img]][npm_url]\n\n*Not recommended for use. This package will be be updated or removed in COMPASS-5490*\n\n## Usage\n\n### Building URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\nconst c = new Connection({ appname: 'My App Name' });\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://localhost:27017/?readPreference=primary&appname=My%20App&ssl=false'\n```\n\n### Parsing URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\n\nConnection.from(\n  'mongodb://someUsername:testPassword@localhost',\n  (error, result) => {\n    console.log(result);\n    >>> `{\n      hosts: [{ host: 'localhost', port: 27017 }],\n      hostname: 'localhost',\n      port: 27017,\n      auth: {\n        username: 'someUsername',\n        password: 'testPassword',\n        db: 'admin'\n      },\n      isSrvRecord: false,\n      authStrategy: 'MONGODB',\n      mongodbUsername: 'someUsername',\n      mongodbPassword: 'testPassword',\n      mongodbDatabaseName: 'admin',\n      extraOptions: {},\n      connectionType: 'NODE_DRIVER',\n      readPreference: 'primary',\n      kerberosCanonicalizeHostname: false,\n      sslMethod: 'NONE',\n      sshTunnel: 'NONE',\n      sshTunnelPort: 22\n    }`\n  }\n);\n```\n\n## Properties\n\nMongoDB connection model is based on Ampersand.js framework and consist of [props](https://ampersandjs.com/docs/#ampersand-state-props) and [derived props](https://ampersandjs.com/docs/#ampersand-state-derived). The props object describes the observable properties that MongoDB connection model gets from the Node.js Driver API.\n\n```javascript\nconst с = new Connection();\nconst props = с.getAttributes({ props: true });\n```\n## Derived Properties\n\nDerived properties (also known as computed properties) are properties of the state object that depend on other properties to determine their value.\n\n```javascript\nconst c = new Connection();\nconst derivedProps = c.getAttributes({ derived: true });\n```\n\n[npm_img]: https://img.shields.io/npm/v/mongodb-connection-model.svg?style=flat-square\n[npm_url]: https://www.npmjs.org/package/mongodb-connection-model","gitHead":"1d0257ec5ae772888fbfb677bbacf8cd7dfb3127","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","check":"npm run lint && npm run depcheck","depcheck":"depcheck","test-check-ci":"npm run check"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.17.0+x64 (linux)","description":"MongoDB connection model","directories":{},"_nodeVersion":"16.17.0","compass:main":"index.js","dependencies":{"raf":"^3.4.1","lodash":"^4.17.21","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.2.0","storage-mixin":"0.0.0-next-1d0257ec5ae772888fbfb677bbacf8cd7dfb3127","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.2","@mongodb-js/compass-utils":"0.0.0-next-1d0257ec5ae772888fbfb677bbacf8cd7dfb3127","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.6.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","eslint":"^7.25.0","mongodb":"^5.6.0","depcheck":"^1.4.1","proxyquire":"^2.1.3","chai-subset":"^1.6.0","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^5.6.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_0.0.0-next-1d0257ec5ae772888fbfb677bbacf8cd7dfb3127_1689909831788_0.8562923716614168","host":"s3://npm-registry-packages"}},"0.0.0-next-5bb899576d8b95cb24b170e4fb80a7a4cc89beac":{"name":"mongodb-connection-model","version":"0.0.0-next-5bb899576d8b95cb24b170e4fb80a7a4cc89beac","keywords":["mongodb-js"],"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","_id":"mongodb-connection-model@0.0.0-next-5bb899576d8b95cb24b170e4fb80a7a4cc89beac","maintainers":[{"name":"c-buckingham","email":"christopher.buckingham@mongodb.com"},{"name":"mongo-j","email":"james.wang@mongodb.com"},{"name":"mabaasit","email":"baasit121@yahoo.com"},{"name":"alexander_schroll","email":"alexander.schroll+npm@mongodb.com"},{"name":"chuck.kalmanek","email":"chuck.kalmanek@10gen.com"},{"name":"mongodb-js-user","email":"dana.groff+mongodb-js@mongodb.com"},{"name":"rueckstiess","email":"thomas@rueckstiess.net"},{"name":"durran","email":"durran@gmail.com"},{"name":"lerouxb","email":"lerouxb@gmail.com"},{"name":"fredtruman","email":"fred.truman@mongodb.com"},{"name":"mbroadst","email":"mbroadst@gmail.com"},{"name":"hswolff","email":"hello@hswolff.com"},{"name":"satyasinha","email":"satya@mongodb.com"},{"name":"matt_d_rat","email":"matt@mattfairbrass.com"},{"name":"rhysm","email":"rhys.howell@10gen.com"},{"name":"tomhollander","email":"tomhollander@hotmail.com"},{"name":"alena.khineika","email":"alena.khineika@gmail.com"},{"name":"jeff-allen-mongo","email":"jeffrey.allen@10gen.com"},{"name":"mmarcon","email":"me@marcon.me"},{"name":"jonathan.balsano","email":"jonathan.balsano@mongodb.com"},{"name":"mongodb-build","email":"build-accounts@10gen.com"},{"name":"jack.weir","email":"johnjackweir@gmail.com"},{"name":"stennie","email":"stennie@cpan.org"},{"name":"mcasimir","email":"maurizio.cas@gmail.com"},{"name":"kristina.stefano","email":"kristina.stefanova@mongodb.com"},{"name":"jarjee","email":"nathan.smyth@10gen.com"},{"name":"shaketbaby","email":"shaketbaby@gmail.com"},{"name":"devtoolsbot","email":"iteng@mongodb.com"},{"name":"addaleax","email":"anna@addaleax.net"},{"name":"gribnoysup","email":"sergey.petushkov@protonmail.com"},{"name":"mutukrish","email":"mutukrish@gmail.com"},{"name":"wz3chen","email":"waleycz@gmail.com"},{"name":"imlucas","email":"hrabovsky.lucas@gmail.com"},{"name":"kangas","email":"kangas@gmail.com"},{"name":"judahschvimer","email":"judah@mongodb.com"}],"homepage":"https://github.com/mongodb-js/compass","bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"dist":{"shasum":"e7dc6e5a75821c765d126f22ac475b60aa99d439","tarball":"https://registry.npmjs.org/mongodb-connection-model/-/mongodb-connection-model-0.0.0-next-5bb899576d8b95cb24b170e4fb80a7a4cc89beac.tgz","fileCount":19,"integrity":"sha512-gwb+cqYL1lEAfAZkZIc/k1/uFfXNphZ4srKA1dXIMXSojgQXFF1UGg+QZpvE1wGQYvwnl3hqoBJnMcZ0x9lqDw==","signatures":[{"sig":"MEQCIEGdTHmrTy2cv69EFUHDfF9O/dDRG/p+gou9Znx7WYILAiB41DoKRydMiNTwcqaPlbyUXAyvjSNo6yfjdRzSLjbv7w==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":84329},"main":"index.js","readme":"# mongodb-connection-model  [![][npm_img]][npm_url]\n\n*Not recommended for use. This package will be be updated or removed in COMPASS-5490*\n\n## Usage\n\n### Building URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\nconst c = new Connection({ appname: 'My App Name' });\n\nconsole.log(c.driverUrl)\n>>> 'mongodb://localhost:27017/?readPreference=primary&appname=My%20App&ssl=false'\n```\n\n### Parsing URI\n\n```javascript\nconst Connection = require('mongodb-connection-model');\n\nConnection.from(\n  'mongodb://someUsername:testPassword@localhost',\n  (error, result) => {\n    console.log(result);\n    >>> `{\n      hosts: [{ host: 'localhost', port: 27017 }],\n      hostname: 'localhost',\n      port: 27017,\n      auth: {\n        username: 'someUsername',\n        password: 'testPassword',\n        db: 'admin'\n      },\n      isSrvRecord: false,\n      authStrategy: 'MONGODB',\n      mongodbUsername: 'someUsername',\n      mongodbPassword: 'testPassword',\n      mongodbDatabaseName: 'admin',\n      extraOptions: {},\n      connectionType: 'NODE_DRIVER',\n      readPreference: 'primary',\n      kerberosCanonicalizeHostname: false,\n      sslMethod: 'NONE',\n      sshTunnel: 'NONE',\n      sshTunnelPort: 22\n    }`\n  }\n);\n```\n\n## Properties\n\nMongoDB connection model is based on Ampersand.js framework and consist of [props](https://ampersandjs.com/docs/#ampersand-state-props) and [derived props](https://ampersandjs.com/docs/#ampersand-state-derived). The props object describes the observable properties that MongoDB connection model gets from the Node.js Driver API.\n\n```javascript\nconst с = new Connection();\nconst props = с.getAttributes({ props: true });\n```\n## Derived Properties\n\nDerived properties (also known as computed properties) are properties of the state object that depend on other properties to determine their value.\n\n```javascript\nconst c = new Connection();\nconst derivedProps = c.getAttributes({ derived: true });\n```\n\n[npm_img]: https://img.shields.io/npm/v/mongodb-connection-model.svg?style=flat-square\n[npm_url]: https://www.npmjs.org/package/mongodb-connection-model","gitHead":"5bb899576d8b95cb24b170e4fb80a7a4cc89beac","scripts":{"lint":"eslint \"./{src,lib,test,bin}/**/*.{js,jsx,ts,tsx}\" \"./*.js\" --no-error-on-unmatched-pattern","check":"npm run lint && npm run depcheck","depcheck":"depcheck","test-check-ci":"npm run check"},"_npmUser":{"name":"mcasimir","email":"maurizio.cas@gmail.com"},"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.17.0+x64 (linux)","description":"MongoDB connection model","directories":{},"_nodeVersion":"16.17.0","compass:main":"index.js","dependencies":{"raf":"^3.4.1","lodash":"^4.17.21","mongodb3":"npm:mongodb@^3.6.3","os-dns-native":"^1.2.0","storage-mixin":"0.0.0-next-5bb899576d8b95cb24b170e4fb80a7a4cc89beac","ampersand-model":"^8.0.1","resolve-mongodb-srv":"^1.1.2","@mongodb-js/compass-utils":"0.0.0-next-5bb899576d8b95cb24b170e4fb80a7a4cc89beac","ampersand-rest-collection":"^6.0.0","mongodb-connection-string-url":"^2.6.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.2.0","uuid":"^8.2.0","eslint":"^7.25.0","mongodb":"^5.6.0","depcheck":"^1.4.1","proxyquire":"^2.1.3","chai-subset":"^1.6.0","eslint-config-mongodb-js":"^5.0.3"},"peerDependencies":{"mongodb":"^5.6.0"},"_npmOperationalInternal":{"tmp":"tmp/mongodb-connection-model_0.0.0-next-5bb899576d8b95cb24b170e4fb80a7a4cc89beac_1690200348179_0.9869814984817351","host":"s3://npm-registry-packages"}}},"time":{"created":"2015-09-09T22:17:54.843Z","modified":"2026-07-15T15:35:54.743Z","0.0.1":"2015-09-09T22:17:54.843Z","0.0.2":"2015-09-18T16:55:20.528Z","0.0.3":"2015-09-25T16:29:40.937Z","1.0.0":"2015-10-08T22:58:33.543Z","1.0.1":"2015-10-09T00:08:56.092Z","1.0.2":"2015-10-09T01:11:38.433Z","2.0.0":"2015-10-21T20:56:12.587Z","2.0.1":"2015-10-21T21:09:35.646Z","3.0.0":"2015-10-25T23:48:47.675Z","3.0.1":"2015-10-27T00:25:11.430Z","3.0.2":"2015-10-27T22:43:30.073Z","3.0.3":"2015-10-28T15:51:49.074Z","3.0.4":"2015-10-28T17:11:53.757Z","3.0.5":"2015-10-28T20:13:36.031Z","3.0.6":"2015-10-30T18:18:43.776Z","3.0.7":"2015-11-13T21:23:15.709Z","3.0.8":"2015-11-20T05:51:03.853Z","3.0.9":"2015-11-23T23:35:16.498Z","3.0.10":"2015-12-16T01:16:59.946Z","4.0.0":"2016-02-05T03:41:32.452Z","4.0.1":"2016-03-13T01:04:01.098Z","4.0.2":"2016-03-14T20:57:05.243Z","4.0.3":"2016-04-19T14:09:45.284Z","4.0.4":"2016-05-23T20:17:08.942Z","4.1.0":"2016-05-23T20:17:33.389Z","4.2.0":"2016-06-01T13:25:40.527Z","4.3.0":"2016-06-07T14:03:11.426Z","5.0.0":"2016-07-26T17:13:38.370Z","5.0.1":"2016-07-27T14:36:28.626Z","5.0.2":"2016-07-28T15:13:29.317Z","5.0.3":"2016-08-21T19:45:53.286Z","5.1.0":"2016-08-23T17:43:28.698Z","6.0.0":"2016-09-22T21:30:43.583Z","6.1.0":"2016-10-24T11:22:23.506Z","6.2.0":"2016-10-31T16:02:29.032Z","6.3.0":"2016-11-01T20:05:10.618Z","6.3.1":"2016-11-08T02:51:02.338Z","6.3.2":"2016-11-15T08:33:33.679Z","6.3.3":"2016-11-18T05:13:26.406Z","6.3.4":"2016-12-09T01:40:50.221Z","6.3.5":"2017-01-10T05:44:53.101Z","6.4.0":"2017-02-14T06:39:30.881Z","6.4.1":"2017-03-01T03:19:04.520Z","6.4.2":"2017-03-01T16:24:01.926Z","6.4.3":"2017-03-06T15:56:16.246Z","6.5.0":"2017-04-21T03:45:00.479Z","6.5.1":"2017-04-24T02:16:11.505Z","6.5.2":"2017-04-26T18:18:59.750Z","7.0.0":"2017-05-23T00:30:10.434Z","8.0.0-beta.0":"2017-05-26T21:47:58.452Z","8.0.0-beta.1":"2017-05-29T13:13:45.152Z","8.0.0":"2017-06-03T18:34:49.673Z","8.0.1":"2017-06-08T13:11:34.945Z","9.0.0-beta.0":"2017-06-11T12:10:36.761Z","9.0.0":"2017-06-11T15:52:34.045Z","9.1.0":"2017-07-28T18:54:56.019Z","9.2.0":"2017-07-28T19:56:46.401Z","10.0.0":"2017-08-22T18:05:29.966Z","10.0.1":"2017-09-06T15:23:28.883Z","10.0.2":"2017-09-06T15:50:20.957Z","10.1.0":"2017-09-06T16:35:42.670Z","10.1.1":"2017-09-08T14:19:39.269Z","10.1.2":"2017-09-08T16:25:36.033Z","10.1.3":"2017-09-19T01:12:15.841Z","10.2.0":"2017-10-13T21:56:32.531Z","10.3.0":"2017-10-18T15:03:03.465Z","10.4.0":"2017-11-04T10:06:49.455Z","10.4.1":"2017-11-07T13:15:01.990Z","10.4.2":"2017-11-08T08:40:55.083Z","10.4.3":"2017-11-10T14:52:41.232Z","10.5.0":"2017-11-12T12:10:22.633Z","10.6.0":"2017-11-14T18:16:52.657Z","10.7.0":"2017-11-14T19:34:39.602Z","10.7.1":"2018-01-03T23:46:20.248Z","11.0.0":"2018-01-11T10:54:32.970Z","12.0.0":"2018-01-27T11:07:32.386Z","12.0.1":"2018-01-27T11:13:20.438Z","12.0.2":"2018-01-27T14:05:12.801Z","12.0.3":"2018-03-08T19:07:14.592Z","12.0.4":"2018-04-02T17:52:37.053Z","12.0.5":"2018-04-03T16:07:57.627Z","12.1.0":"2018-04-10T12:36:32.780Z","12.2.0":"2018-04-18T11:17:46.350Z","12.3.0":"2018-07-03T14:50:50.341Z","12.3.1":"2018-07-05T14:43:02.048Z","12.3.2":"2018-07-09T11:26:29.752Z","12.4.0":"2018-08-28T13:27:25.993Z","12.4.1":"2018-09-21T08:04:41.863Z","12.4.2":"2018-11-01T12:50:26.002Z","12.5.0":"2018-11-06T13:37:19.319Z","12.5.1":"2018-11-11T11:05:39.494Z","12.5.2":"2018-11-27T18:22:29.491Z","12.5.3":"2018-11-27T19:37:19.957Z","12.5.4":"2018-11-28T13:21:11.483Z","12.5.5":"2018-11-30T11:41:39.609Z","12.5.6":"2019-02-13T14:25:35.376Z","13.0.0":"2019-02-28T11:58:29.257Z","13.0.1":"2019-02-28T16:20:18.620Z","13.1.0":"2019-03-29T16:03:38.243Z","13.1.1":"2019-03-29T16:12:07.041Z","13.1.2":"2019-03-29T16:18:57.672Z","13.1.3":"2019-03-29T16:21:10.732Z","13.1.4":"2019-03-29T16:25:34.216Z","13.1.5":"2019-04-17T14:14:35.835Z","14.0.0":"2019-07-01T12:40:14.661Z","14.0.1":"2019-07-16T12:02:13.682Z","13.1.6":"2019-08-12T12:30:14.236Z","14.0.2":"2019-08-13T11:03:44.724Z","14.0.3":"2019-08-16T09:53:24.596Z","14.1.0":"2019-08-23T12:43:29.229Z","14.1.1":"2019-08-25T21:33:45.911Z","14.2.0":"2019-09-09T14:50:27.484Z","14.2.2":"2019-09-10T10:06:01.980Z","14.2.3":"2019-09-10T10:39:00.446Z","14.2.4":"2019-09-10T13:03:57.929Z","14.2.5":"2019-09-12T09:58:56.438Z","14.2.6":"2019-09-13T09:29:10.395Z","14.2.7":"2019-09-18T13:22:31.374Z","14.2.8":"2019-09-24T18:05:30.713Z","14.3.0":"2019-09-30T10:39:36.432Z","14.3.1":"2019-09-30T11:53:28.321Z","14.3.2":"2019-10-28T13:58:00.406Z","14.3.3":"2019-11-25T16:07:42.497Z","14.3.4":"2019-11-26T14:35:33.633Z","14.3.5":"2019-11-27T17:50:58.650Z","14.3.6":"2019-12-05T15:48:39.612Z","14.3.7":"2019-12-12T22:55:51.020Z","14.4.0":"2020-01-06T17:43:09.187Z","14.4.1":"2020-01-14T16:51:23.912Z","14.4.2":"2020-01-14T16:52:59.586Z","14.5.0":"2020-01-15T18:39:43.375Z","14.4.3":"2020-01-20T14:49:07.434Z","14.5.1":"2020-02-07T13:02:39.054Z","14.6.0":"2020-02-10T16:13:35.154Z","14.6.1":"2020-02-11T15:32:42.102Z","14.6.2":"2020-02-17T14:29:53.522Z","14.6.3":"2020-04-16T11:05:18.799Z","14.6.4":"2020-04-17T12:12:32.572Z","14.6.5":"2020-04-17T13:22:19.250Z","14.6.6":"2020-04-21T08:51:42.502Z","16.0.0":"2020-04-21T11:50:06.534Z","16.0.1":"2020-05-11T18:48:20.656Z","16.1.0":"2020-05-18T11:33:40.996Z","16.1.1":"2020-05-18T16:49:23.615Z","16.1.2":"2020-05-20T10:06:06.653Z","16.1.3":"2020-06-11T15:50:01.880Z","16.1.4":"2020-07-09T15:50:43.216Z","16.1.5":"2020-08-13T12:08:39.569Z","16.1.6":"2020-09-07T09:03:52.622Z","16.1.7":"2020-09-08T11:07:30.155Z","16.1.8":"2020-09-21T14:44:55.926Z","17.0.0":"2020-09-25T16:08:16.942Z","17.0.1":"2020-10-26T10:37:57.030Z","17.0.2":"2020-11-11T11:08:28.603Z","17.0.3":"2020-11-16T15:35:22.854Z","17.1.0":"2020-12-04T08:38:09.278Z","17.2.0":"2020-12-07T16:29:30.427Z","17.3.0":"2020-12-14T19:28:58.788Z","18.0.0":"2020-12-15T19:26:28.280Z","18.0.1":"2020-12-16T18:42:52.930Z","18.1.0":"2020-12-17T10:54:10.059Z","19.0.0":"2021-01-08T12:52:32.964Z","19.0.1":"2021-01-12T10:47:16.229Z","19.0.2":"2021-01-19T16:40:25.765Z","19.0.3":"2021-02-09T19:19:18.251Z","19.1.0":"2021-03-04T16:28:16.210Z","19.1.1":"2021-03-31T16:26:18.948Z","19.2.0":"2021-05-26T18:16:28.913Z","19.2.1":"2021-05-27T16:07:02.133Z","20.0.0":"2021-06-03T19:11:06.563Z","20.1.0":"2021-06-09T13:58:08.833Z","20.2.0":"2021-06-16T17:38:05.584Z","21.0.0":"2021-06-18T15:27:08.920Z","21.1.0":"2021-06-21T09:25:31.019Z","21.2.0":"2021-06-22T07:32:05.456Z","21.3.0":"2021-06-28T08:49:28.411Z","21.4.0":"2021-06-30T07:51:58.173Z","21.5.0":"2021-07-01T07:11:48.405Z","21.5.1":"2021-07-02T13:57:24.445Z","21.5.2":"2021-07-09T18:11:22.433Z","21.5.3":"2021-07-12T10:51:06.027Z","21.5.4":"2021-08-05T11:58:26.932Z","21.6.0":"2021-08-11T11:37:49.364Z","21.7.0":"2021-08-24T15:21:32.630Z","21.8.0":"2021-09-15T10:50:42.396Z","21.9.0":"2021-11-19T11:09:11.857Z","21.10.0":"2021-12-21T14:15:08.095Z","21.11.0":"2022-01-07T18:15:00.987Z","21.11.1":"2022-01-11T21:06:00.220Z","21.12.0":"2022-02-03T13:34:20.270Z","21.12.1":"2022-02-03T18:54:30.416Z","21.12.2":"2022-02-25T13:39:29.869Z","21.13.0":"2022-02-25T14:09:42.862Z","21.14.0":"2022-03-03T14:36:50.324Z","21.15.0":"2022-03-30T17:14:08.485Z","21.16.0":"2022-04-27T16:30:45.005Z","21.17.0":"2022-05-12T09:05:02.886Z","21.18.0":"2022-06-27T07:47:54.114Z","21.19.0":"2022-07-12T18:15:10.291Z","21.19.1":"2022-07-13T08:47:25.006Z","22.0.0":"2022-08-09T13:25:35.008Z","22.1.1":"2022-09-22T15:14:13.827Z","0.0.0-experimental-1c53312ce4905234885618d41ae95fde9c21aa18":"2022-09-26T13:26:13.970Z","0.0.0-next-e30a9e850a8a66b70770fbf6658a3e35cf1ff8b8":"2022-09-26T14:07:27.667Z","0.0.0-next-25b11de63d51aa4ca7fda0f3eae67999e3418ca5":"2022-09-28T16:53:57.392Z","0.0.0-next-dfa464112f63969f158bde32322e393fa2b77940":"2022-09-28T22:05:25.136Z","0.0.0-next-e42d58083be39ce9f112e6ec7f9fd1fdcb666e3e":"2022-09-29T16:07:33.022Z","0.0.0-next-5f69e8129e0242b4e507fee055188a8a83e1f1c1":"2022-10-05T11:10:49.216Z","0.0.0-next-823f55a862f13d28437b87fb594450b2208c0d4f":"2022-10-05T16:14:56.903Z","0.0.0-next-01a3ac56d52443bc859ccdcf7ed301ffbdea7a47":"2022-10-06T09:46:48.795Z","0.0.0-next-cd3c5c1303c464ef7900dc08adb8154d15c7f3a9":"2022-10-06T14:44:03.337Z","0.0.0-next-d9691f3c8230e21aeb2817ac2c984aba0d79f09c":"2022-10-07T19:44:39.874Z","0.0.0-next-1cb9ea1724d90e58422b33fe089df5b774e0be10":"2022-10-07T19:49:28.803Z","0.0.0-next-4216a27cdf41425fff35938bb42040bb93c2d246":"2022-10-07T20:00:14.394Z","22.1.2":"2022-11-02T09:50:10.007Z","0.0.0-next-10815be8fd57f3bfd89d061e1592eb7136d4a0fb":"2022-11-02T11:30:48.557Z","0.0.0-next-59e1f6f134da2a3417bd69a71c7788320608ee5d":"2022-11-04T03:10:06.787Z","0.0.0-next-ea4f317e964c0504e54c01d83c385280a9135bba":"2022-11-04T03:18:13.706Z","0.0.0-next-bfa0f33f79b0349abe5ad03576e17682f507fe04":"2022-11-08T21:27:19.007Z","0.0.0-next-5f5cecf01c890c348e17907482b03cea2f8c5f21":"2022-11-09T23:44:27.671Z","0.0.0-next-51a8e00f16dc1652cb0f0674c540570614a8895e":"2022-11-09T23:50:12.637Z","0.0.0-next-6d1491390706ac21857752412a5e4d10e112a29a":"2022-11-09T23:54:26.768Z","0.0.0-next-44318443f2cd1088082181789b25fc26a7a11bb2":"2022-11-09T23:56:07.336Z","0.0.0-next-3b50f8232d3349fe79554f36417d7fbb45b6352a":"2022-11-10T00:00:28.828Z","0.0.0-next-47b085701d7c0b212b54bcac46f6106d34ec429e":"2022-11-10T12:46:01.819Z","0.0.0-next-9e3b266e199e346a30e2c20aac373d48c2ea9888":"2022-11-11T20:43:38.734Z","0.0.0-next-91daa029e219b08cf0b775b6648d35867f2272d0":"2022-11-16T23:12:33.449Z","0.0.0-next-7f1112246f97f222dc289edb7b9f0359d8f020cb":"2022-11-17T02:50:11.689Z","0.0.0-next-c12720c09369b6620405de027fa85d469db43e9c":"2022-11-18T04:59:42.958Z","0.0.0-next-2122563cf622c0d212372dee10ec2a4a664d8006":"2022-11-18T05:09:32.643Z","0.0.0-next-c31c6db319e5099ee073b5782609b1dcfa2370d8":"2022-11-19T06:50:18.198Z","0.0.0-next-981f8ae49e299320ca0add5ae8e58c8738baa699":"2022-11-19T07:03:56.719Z","0.0.0-next-6a646700444fec2ae51cd86f87f6a29e58f774b0":"2022-11-19T07:06:30.913Z","0.0.0-next-112bf8f8b20d7181824478f76e627ee32d6e03d7":"2022-11-19T20:42:36.044Z","0.0.0-next-19de7da29c34177349014132e37b723c1cb16ebd":"2022-11-19T22:16:57.686Z","0.0.0-next-6e34a0d07479c665cdfa3bddb6bfd864365f6b8a":"2022-11-22T02:41:36.794Z","0.0.0-next-31a3fe49cf0eba4c3afe85c4a4139ce198cb0e51":"2022-11-22T02:44:32.310Z","0.0.0-next-bb1a39e78c30cda5ef910174e54d2c9708186388":"2022-11-22T02:50:06.764Z","0.0.0-next-b5a88ca5d89936f4997a6df7c6e08614f25de0a1":"2022-11-22T02:52:14.474Z","0.0.0-next-9a3af5fc8cc6a9ccc96866e1b71d0a33c14d7c08":"2022-11-22T02:59:48.739Z","0.0.0-next-2cde0fe836b81baa0f68d274840a5f97b8dae0c6":"2022-11-22T03:05:01.861Z","0.0.0-next-feb0121be4234a831e6bce640173de34ce95dd7a":"2022-11-23T01:39:14.745Z","0.0.0-next-64ed9e6634006598c90fc79f71c554ec401bfc8e":"2022-11-23T02:15:55.434Z","0.0.0-next-a005ee4428ffd61a00127102fa0c29212a52fc83":"2022-11-24T03:21:58.285Z","0.0.0-next-e06434c386fd387cc5650fc9c0906b46cb4d6c34":"2022-11-24T03:35:43.830Z","0.0.0-next-8d44ba9084fbf5b834ca7df8b77135d3c8fc6896":"2022-11-24T20:19:59.206Z","0.0.0-next-74685ebe9d7b81dd4a870c8ffd51152622741526":"2022-11-24T20:26:26.056Z","0.0.0-next-92270b35885e90f6eb7b153275848f7a2be21278":"2022-11-25T10:01:31.869Z","0.0.0-next-f9347a106881d77aa4b1f7f37daed25d73c5f92c":"2022-11-25T22:47:21.591Z","0.0.0-next-94f03d5249971d1eea1868df296db6e766f40f9f":"2022-11-25T23:48:15.705Z","22.1.3":"2022-11-29T13:43:44.497Z","0.0.0-next-449f5b693a70d24bf653fcbd3719d8d88d91d899":"2022-11-29T23:35:27.242Z","0.0.0-next-9ee9b0963df24390835a677f1a9081d9bc53ca2a":"2022-11-29T23:39:53.986Z","0.0.0-next-98550b9ab2651e46658429899a0b7353249a18c0":"2022-12-01T09:47:08.260Z","0.0.0-next-6a5d526328ecfce1da82bf064daeb19f1c2bf6a5":"2022-12-04T22:31:36.454Z","0.0.0-next-2f189f8218b434e8d36a7472a2ac843f17147b9b":"2022-12-06T00:52:24.181Z","0.0.0-next-faf899c161858cffa138dc64f4fbf9c0da2145e0":"2022-12-06T00:54:06.037Z","0.0.0-next-1336f6ccd01a8b5f63ed6bea289fa9f8fc4d9557":"2022-12-09T02:44:22.100Z","0.0.0-next-d43728ce0cf99f511bd2d2aebad966bc49276179":"2022-12-09T02:46:48.295Z","0.0.0-next-0d9e77c42a99b49fd4ecc7167d0c769866f92ef2":"2022-12-09T02:56:27.232Z","0.0.0-next-907430527b638cb96704541b347715ec1dcc648b":"2022-12-12T21:33:09.485Z","0.0.0-next-3888dd701d06bedcc2b043270c5dc626b9997eb0":"2022-12-12T21:38:10.078Z","0.0.0-next-dc4590988660016a4419dbc587f3182af207ed15":"2022-12-14T18:28:25.042Z","0.0.0-next-cb3371cdb3289f37402f09c6388269e88c943a81":"2023-01-13T17:38:44.853Z","0.0.0-next-f6dcd616f47e1d3843402c3e0f47d541edec53f3":"2023-01-14T19:48:48.227Z","0.0.0-next-6900ac52ffc5e2e7ef959752bc33235dc12946e4":"2023-01-16T14:42:56.419Z","0.0.0-next-d09be9dbbff785d6692110b819e06b0186bd3ac7":"2023-01-16T21:59:31.917Z","0.0.0-next-b72d7d0f94c6cd6b83966a08494549408ed56560":"2023-01-20T15:15:06.858Z","0.0.0-next-288585a9b69e86c5bb1bfcf4b6df1f5db45ad7bf":"2023-01-26T02:24:30.438Z","22.2.0":"2023-02-02T09:37:11.755Z","0.0.0-next-cfe9a829fd77fc84e090f2c7b38663167071ebc5":"2023-02-02T22:41:39.674Z","0.0.0-next-6e4c984eb458cbfc675ec138ae979303ef32bcb5":"2023-02-02T23:25:03.455Z","0.0.0-next-3e67b8063fbcd84b0bfd6451e2568968fbdba25a":"2023-02-06T20:34:39.944Z","0.0.0-next-7bfb57937adf16eda85ca92547ea5711d120b4c1":"2023-02-06T20:38:44.944Z","0.0.0-next-3b389244f7eb06219ec1e923cac29b45a6ec3e84":"2023-02-06T20:40:03.064Z","22.2.1":"2023-02-07T13:20:58.772Z","0.0.0-next-014cd3f52319f9c3e62d458f4c10e0af7ae98052":"2023-02-13T23:32:39.814Z","0.0.0-next-c5eba7335c2da0b9754b4e52495c98f48ec15463":"2023-02-15T10:49:21.083Z","0.0.0-next-9acb1d074fcbf6aa34b275f617178f0f155ff495":"2023-02-20T21:34:05.228Z","22.2.2":"2023-02-24T20:46:49.239Z","0.0.0-next-7675c98b3881009dcc19690b66a6e63e65e1a13c":"2023-02-26T18:50:58.548Z","22.2.3":"2023-03-03T09:41:56.310Z","0.0.0-next-e0e7275f55471eecce19ff3b75439fb06dce1fad":"2023-03-03T12:29:18.719Z","0.0.0-next-04ba59a8ace9d68fd90d540d8a8936985115e22e":"2023-03-18T12:33:37.118Z","0.0.0-next-ed8f90bd71f084cb541f99b15caf3833ec6a953c":"2023-03-20T20:56:58.213Z","0.0.0-next-97c3945c3938ec09f9aa141b791f53d15bd47600":"2023-03-20T20:57:41.697Z","0.0.0-next-a863ce6adfb98ced08f9644a294f5b63b110c7d8":"2023-03-28T19:41:11.344Z","0.0.0-next-c3291a871fc2c07d3e2038cc1ad275c102e1d321":"2023-03-30T09:35:26.095Z","0.0.0-next-da0d016fdae6992001ca3f3347c293c36815df43":"2023-03-31T20:57:39.649Z","0.0.0-next-30478c108fea9fe7d84759fb032faee28e0bbfbb":"2023-04-19T12:30:51.851Z","0.0.0-next-1f064ba7669c838cc646f440aedd0cf45c4df973":"2023-04-19T20:52:33.701Z","0.0.0-next-259fb95ccf1d41c3210676266488d0705f9b544e":"2023-04-20T01:48:23.519Z","22.3.0":"2023-04-21T10:19:14.567Z","0.0.0-next-604fdbd72ed8b3cb7869997416b51ea07fd77400":"2023-04-26T09:23:19.546Z","0.0.0-next-35420eb38f659fbfc4bff9e72644deebafef275e":"2023-04-27T01:56:54.753Z","0.0.0-next-f8695ae3010acc2686c0a530f153ebb01ddb040a":"2023-04-27T09:19:17.849Z","0.0.0-next-5965a9bfaeadf7fcf283dfd3fe19aa58f68c5c1c":"2023-04-27T21:45:21.564Z","0.0.0-next-07a892207f0c33a49a10f047b8e98d59fb1df676":"2023-05-03T06:04:08.382Z","0.0.0-next-3871489afff599d3c0e5827b05c6cd97787625bb":"2023-05-03T17:50:48.778Z","0.0.0-next-28d3c6ea9e684b19e4fcfd38c8b4e94fba06844f":"2023-05-04T07:28:21.206Z","0.0.0-next-0189b6f6005b078db9424856c7565117e3b45ef3":"2023-06-02T23:41:30.353Z","0.0.0-next-2bd69249c64bee9c103212c46e5c582418f87054":"2023-06-02T23:43:08.066Z","0.0.0-next-e182f845553cf87006baf04d22367061288c5226":"2023-06-03T00:32:28.406Z","0.0.0-next-2d8cfc600e1d4de8c32643b601d0c021734b31ed":"2023-06-03T00:53:45.048Z","0.0.0-next-c2ee6dc98a012b4f4494e197ec69ca57d395b8fa":"2023-06-03T01:04:01.077Z","0.0.0-next-5d4d8579be24c292424443140492919b337a3b28":"2023-06-03T08:35:39.620Z","22.4.0":"2023-06-05T10:34:39.011Z","0.0.0-next-5e0eb3ba4d40569bc6acb4383f7c85221ebc81fa":"2023-06-06T11:26:14.352Z","0.0.0-next-52e439f268b74410212a0d91a5ee39021eb44499":"2023-06-06T11:27:30.853Z","22.4.1":"2023-06-06T20:00:55.843Z","0.0.0-next-5dfa7c0dfa9690d09de616d9a4839fde1ab0e467":"2023-06-08T06:58:32.177Z","0.0.0-next-1d02bfb24078b4391bee7a83e34cb3d7da39a731":"2023-06-08T07:01:51.404Z","0.0.0-next-b2733835a3b65a4990e1af518669453fad1aba04":"2023-06-08T07:06:17.065Z","0.0.0-next-b308d1e92f7e65f426e7cdde2c630c5eb26cd4e1":"2023-06-08T08:10:38.857Z","0.0.0-next-a163d3eea7baaadc9ff00f56212f6befadf68cc1":"2023-06-10T02:50:46.621Z","0.0.0-next-e35a108a54700c3d0f1f8d937fe870db23cb1682":"2023-06-10T03:58:31.457Z","0.0.0-next-80a9e175edd3eabee53daee876d77943872e4205":"2023-06-12T22:53:09.215Z","0.0.0-next-58b07e3b9faef89f8f737552ca57d6db6e0ea503":"2023-06-14T23:06:13.119Z","0.0.0-next-a6a1fbc898ffbe115f44ef184f30cf0d9348f9c2":"2023-06-14T23:10:01.669Z","0.0.0-next-3ddf2b32a13c98a8713916c7c20185f8ae9a9327":"2023-06-24T03:39:24.691Z","0.0.0-next-f0a5a0fe0d39e23cbafd19676a6f8bc00f4480b5":"2023-06-24T03:41:59.953Z","0.0.0-next-99faf39dcaa3321ec39c2a4a4c7b67e04f3c753e":"2023-06-28T16:34:28.722Z","0.0.0-next-c584ad92337ea0098e7068e83ed68dd13565b7da":"2023-06-30T05:22:22.777Z","0.0.0-next-835937ee6a94b541fd12d3d0c54d829fb2d0e492":"2023-06-30T18:34:26.875Z","0.0.0-next-a7eb730693b63501028444f9ef6b634620af6e37":"2023-07-03T18:45:24.192Z","0.0.0-next-247cba5e738b47e2c433fd1bc2e3d0ed48142ca5":"2023-07-13T02:44:01.451Z","0.0.0-next-8c579fa95e9deb46d73653d702f7f3b0e41efeb8":"2023-07-21T02:41:47.447Z","0.0.0-next-1d0257ec5ae772888fbfb677bbacf8cd7dfb3127":"2023-07-21T03:23:51.981Z","0.0.0-next-5bb899576d8b95cb24b170e4fb80a7a4cc89beac":"2023-07-24T12:05:48.375Z"},"bugs":{"url":"https://jira.mongodb.org/projects/COMPASS/issues","email":"compass@mongodb.com"},"author":{"name":"Lucas Hrabovsky","email":"lucas@mongodb.com"},"license":"SSPL","homepage":"https://github.com/mongodb-js/compass","keywords":["mongodb-js"],"repository":{"url":"git+https://github.com/mongodb-js/compass.git","type":"git"},"description":"MongoDB connection model","maintainers":[{"email":"satya@mongodb.com","name":"satyasinha"},{"email":"kristina.stefanova@mongodb.com","name":"kristina.stefano"},{"email":"nathan.smyth@10gen.com","name":"jarjee"},{"email":"iteng@mongodb.com","name":"devtoolsbot"},{"email":"james.wang@mongodb.com","name":"mongo-j"},{"email":"neal.beeken@mongodb.com","name":"nbbeeken"},{"email":"dbx-node@mongodb.com","name":"dbx-node"},{"email":"devtools-npm-user@mongodb.com","name":"devtools-npm-user"},{"email":"waleycz@gmail.com","name":"wz3chen"},{"email":"hrabovsky.lucas@gmail.com","name":"imlucas"},{"email":"me@tomr.au","name":"rueckstiess"},{"email":"kangas@gmail.com","name":"kangas"},{"email":"judah@mongodb.com","name":"judahschvimer"},{"email":"dana.groff+mongodb-js@mongodb.com","name":"mongodb-js-user"}],"readme":"","readmeFilename":"","users":{"cova4":true}}