3.0.0 • Published 6 months ago
mongodb-connection-string-url v3.0.0
mongodb-connection-string-url
MongoDB connection strings, based on the WhatWG URL API
import ConnectionString from 'mongodb-connection-string-url';
const cs = new ConnectionString('mongodb://localhost');
cs.searchParams.set('readPreference', 'secondary');
console.log(cs.href); // 'mongodb://localhost/?readPreference=secondary'
Deviations from the WhatWG URL package
- URL parameters are case-insensitive
- The
.host
,.hostname
and.port
properties cannot be set, and reading them does not return meaningful results (and are typed asnever
in TypeScript) - The
.hosts
property contains a list of all hosts in the connection string - The
.href
property cannot be set, only read - There is an additional
.isSRV
property, set totrue
formongodb+srv://
- There is an additional
.clone()
utility method on the prototype
LICENSE
Apache-2.0
3.0.0
6 months ago
2.6.0
1 year ago
2.5.4
2 years ago
2.5.3
2 years ago
2.5.2
2 years ago
2.3.0
2 years ago
2.5.0
2 years ago
2.4.1
2 years ago
2.3.2
2 years ago
2.4.0
2 years ago
2.3.1
2 years ago
2.5.1
2 years ago
2.4.2
2 years ago
2.2.0
2 years ago
2.1.0
3 years ago
2.0.0
3 years ago
1.1.1
3 years ago
1.1.2
3 years ago
1.0.2
3 years ago
1.1.0
3 years ago
1.0.1
3 years ago
1.0.0
3 years ago