opusdev/vector-similarity-api
1
1# mongodb-connection-string-url2 3MongoDB connection strings, based on the WhatWG URL API4 5```js6import ConnectionString from 'mongodb-connection-string-url';7 8const cs = new ConnectionString('mongodb://localhost');9cs.searchParams.set('readPreference', 'secondary');10console.log(cs.href); // 'mongodb://localhost/?readPreference=secondary'11```12 13## Deviations from the WhatWG URL package14 15- URL parameters are case-insensitive16- The `.host`, `.hostname` and `.port` properties cannot be set, and reading17 them does not return meaningful results (and are typed as `never`in TypeScript)18- The `.hosts` property contains a list of all hosts in the connection string19- The `.href` property cannot be set, only read20- There is an additional `.isSRV` property, set to `true` for `mongodb+srv://`21- There is an additional `.clone()` utility method on the prototype22 23## LICENSE24 25Apache-2.026 