Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

MongoDB connection strings, based on the WhatWG URL API

License

NotificationsYou must be signed in to change notification settings

mongodb-js/mongodb-connection-string-url

Repository files navigation

MongoDB connection strings, based on the WhatWG URL API

importConnectionStringfrom'mongodb-connection-string-url';constcs=newConnectionString('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 readingthem does not return meaningful results (and are typed asneverin 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

About

MongoDB connection strings, based on the WhatWG URL API

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors16


[8]ページ先頭

©2009-2025 Movatter.jp