mongodb-connection-model

22.4.1 • Public • Published

mongodb-connection-model

Not recommended for use. This package will be be updated or removed in COMPASS-5490

Usage

Building URI

const Connection = require('mongodb-connection-model');
const c = new Connection({ appname: 'My App Name' });

console.log(c.driverUrl)
>>> 'mongodb://localhost:27017/?readPreference=primary&appname=My%20App&ssl=false'

Parsing URI

const Connection = require('mongodb-connection-model');

Connection.from(
  'mongodb://someUsername:testPassword@localhost',
  (error, result) => {
    console.log(result);
    >>> `{
      hosts: [{ host: 'localhost', port: 27017 }],
      hostname: 'localhost',
      port: 27017,
      auth: {
        username: 'someUsername',
        password: 'testPassword',
        db: 'admin'
      },
      isSrvRecord: false,
      authStrategy: 'MONGODB',
      mongodbUsername: 'someUsername',
      mongodbPassword: 'testPassword',
      mongodbDatabaseName: 'admin',
      extraOptions: {},
      connectionType: 'NODE_DRIVER',
      readPreference: 'primary',
      kerberosCanonicalizeHostname: false,
      sslMethod: 'NONE',
      sshTunnel: 'NONE',
      sshTunnelPort: 22
    }`
  }
);

Properties

MongoDB connection model is based on Ampersand.js framework and consist of props and derived props. The props object describes the observable properties that MongoDB connection model gets from the Node.js Driver API.

const с = new Connection();
const props = с.getAttributes({ props: true });

Derived Properties

Derived properties (also known as computed properties) are properties of the state object that depend on other properties to determine their value.

const c = new Connection();
const derivedProps = c.getAttributes({ derived: true });

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
0.0.0-experimental-1c53312ce4905234885618d41ae95fde9c21aa180experimental
22.4.12latest
0.0.0-next-5bb899576d8b95cb24b170e4fb80a7a4cc89beac0next

Version History

VersionDownloads (Last 7 Days)Published
0.0.0-next-5bb899576d8b95cb24b170e4fb80a7a4cc89beac0
0.0.0-next-1d0257ec5ae772888fbfb677bbacf8cd7dfb31270
0.0.0-next-8c579fa95e9deb46d73653d702f7f3b0e41efeb80
0.0.0-next-247cba5e738b47e2c433fd1bc2e3d0ed48142ca50
0.0.0-next-a7eb730693b63501028444f9ef6b634620af6e370
0.0.0-next-835937ee6a94b541fd12d3d0c54d829fb2d0e4920
0.0.0-next-c584ad92337ea0098e7068e83ed68dd13565b7da0
0.0.0-next-99faf39dcaa3321ec39c2a4a4c7b67e04f3c753e0
0.0.0-next-f0a5a0fe0d39e23cbafd19676a6f8bc00f4480b50
0.0.0-next-3ddf2b32a13c98a8713916c7c20185f8ae9a93270
0.0.0-next-a6a1fbc898ffbe115f44ef184f30cf0d9348f9c20
0.0.0-next-58b07e3b9faef89f8f737552ca57d6db6e0ea5030
0.0.0-next-80a9e175edd3eabee53daee876d77943872e42050
0.0.0-next-e35a108a54700c3d0f1f8d937fe870db23cb16820
0.0.0-next-a163d3eea7baaadc9ff00f56212f6befadf68cc10
0.0.0-next-b308d1e92f7e65f426e7cdde2c630c5eb26cd4e10
0.0.0-next-b2733835a3b65a4990e1af518669453fad1aba040
0.0.0-next-1d02bfb24078b4391bee7a83e34cb3d7da39a7310
0.0.0-next-5dfa7c0dfa9690d09de616d9a4839fde1ab0e4670
22.4.12
0.0.0-next-52e439f268b74410212a0d91a5ee39021eb444990
0.0.0-next-5e0eb3ba4d40569bc6acb4383f7c85221ebc81fa0
22.4.00
0.0.0-next-5d4d8579be24c292424443140492919b337a3b280
0.0.0-next-c2ee6dc98a012b4f4494e197ec69ca57d395b8fa0
0.0.0-next-2d8cfc600e1d4de8c32643b601d0c021734b31ed0
0.0.0-next-e182f845553cf87006baf04d22367061288c52260
0.0.0-next-2bd69249c64bee9c103212c46e5c582418f870540
0.0.0-next-0189b6f6005b078db9424856c7565117e3b45ef30
0.0.0-next-28d3c6ea9e684b19e4fcfd38c8b4e94fba06844f0
0.0.0-next-3871489afff599d3c0e5827b05c6cd97787625bb0
0.0.0-next-07a892207f0c33a49a10f047b8e98d59fb1df6760
0.0.0-next-5965a9bfaeadf7fcf283dfd3fe19aa58f68c5c1c0
0.0.0-next-f8695ae3010acc2686c0a530f153ebb01ddb040a0
0.0.0-next-35420eb38f659fbfc4bff9e72644deebafef275e0
0.0.0-next-604fdbd72ed8b3cb7869997416b51ea07fd774000
22.3.011
0.0.0-next-259fb95ccf1d41c3210676266488d0705f9b544e0
0.0.0-next-1f064ba7669c838cc646f440aedd0cf45c4df9730
0.0.0-next-30478c108fea9fe7d84759fb032faee28e0bbfbb0
0.0.0-next-da0d016fdae6992001ca3f3347c293c36815df430
0.0.0-next-c3291a871fc2c07d3e2038cc1ad275c102e1d3210
0.0.0-next-a863ce6adfb98ced08f9644a294f5b63b110c7d80
0.0.0-next-97c3945c3938ec09f9aa141b791f53d15bd476000
0.0.0-next-ed8f90bd71f084cb541f99b15caf3833ec6a953c0
0.0.0-next-04ba59a8ace9d68fd90d540d8a8936985115e22e0
0.0.0-next-e0e7275f55471eecce19ff3b75439fb06dce1fad0
22.2.30
0.0.0-next-7675c98b3881009dcc19690b66a6e63e65e1a13c0
22.2.20
0.0.0-next-9acb1d074fcbf6aa34b275f617178f0f155ff4950
0.0.0-next-c5eba7335c2da0b9754b4e52495c98f48ec154630
0.0.0-next-014cd3f52319f9c3e62d458f4c10e0af7ae980520
22.2.10
0.0.0-next-3b389244f7eb06219ec1e923cac29b45a6ec3e840
0.0.0-next-7bfb57937adf16eda85ca92547ea5711d120b4c10
0.0.0-next-3e67b8063fbcd84b0bfd6451e2568968fbdba25a0
0.0.0-next-6e4c984eb458cbfc675ec138ae979303ef32bcb50
0.0.0-next-cfe9a829fd77fc84e090f2c7b38663167071ebc50
22.2.00
0.0.0-next-288585a9b69e86c5bb1bfcf4b6df1f5db45ad7bf0
0.0.0-next-b72d7d0f94c6cd6b83966a08494549408ed565600
0.0.0-next-d09be9dbbff785d6692110b819e06b0186bd3ac70
0.0.0-next-6900ac52ffc5e2e7ef959752bc33235dc12946e40
0.0.0-next-f6dcd616f47e1d3843402c3e0f47d541edec53f30
0.0.0-next-cb3371cdb3289f37402f09c6388269e88c943a810
0.0.0-next-dc4590988660016a4419dbc587f3182af207ed150
0.0.0-next-3888dd701d06bedcc2b043270c5dc626b9997eb00
0.0.0-next-907430527b638cb96704541b347715ec1dcc648b0
0.0.0-next-0d9e77c42a99b49fd4ecc7167d0c769866f92ef20
0.0.0-next-d43728ce0cf99f511bd2d2aebad966bc492761790
0.0.0-next-1336f6ccd01a8b5f63ed6bea289fa9f8fc4d95570
0.0.0-next-faf899c161858cffa138dc64f4fbf9c0da2145e00
0.0.0-next-2f189f8218b434e8d36a7472a2ac843f17147b9b0
0.0.0-next-6a5d526328ecfce1da82bf064daeb19f1c2bf6a50
0.0.0-next-98550b9ab2651e46658429899a0b7353249a18c00
0.0.0-next-9ee9b0963df24390835a677f1a9081d9bc53ca2a0
0.0.0-next-449f5b693a70d24bf653fcbd3719d8d88d91d8990
22.1.30
0.0.0-next-94f03d5249971d1eea1868df296db6e766f40f9f0
0.0.0-next-f9347a106881d77aa4b1f7f37daed25d73c5f92c0
0.0.0-next-92270b35885e90f6eb7b153275848f7a2be212780
0.0.0-next-74685ebe9d7b81dd4a870c8ffd511526227415260
0.0.0-next-8d44ba9084fbf5b834ca7df8b77135d3c8fc68960
0.0.0-next-e06434c386fd387cc5650fc9c0906b46cb4d6c340
0.0.0-next-a005ee4428ffd61a00127102fa0c29212a52fc830
0.0.0-next-64ed9e6634006598c90fc79f71c554ec401bfc8e0
0.0.0-next-feb0121be4234a831e6bce640173de34ce95dd7a0
0.0.0-next-2cde0fe836b81baa0f68d274840a5f97b8dae0c60
0.0.0-next-9a3af5fc8cc6a9ccc96866e1b71d0a33c14d7c080
0.0.0-next-b5a88ca5d89936f4997a6df7c6e08614f25de0a10
0.0.0-next-bb1a39e78c30cda5ef910174e54d2c97081863880
0.0.0-next-31a3fe49cf0eba4c3afe85c4a4139ce198cb0e510
0.0.0-next-6e34a0d07479c665cdfa3bddb6bfd864365f6b8a0
0.0.0-next-19de7da29c34177349014132e37b723c1cb16ebd0
0.0.0-next-112bf8f8b20d7181824478f76e627ee32d6e03d70
0.0.0-next-6a646700444fec2ae51cd86f87f6a29e58f774b00
0.0.0-next-981f8ae49e299320ca0add5ae8e58c8738baa6990
0.0.0-next-c31c6db319e5099ee073b5782609b1dcfa2370d80
0.0.0-next-2122563cf622c0d212372dee10ec2a4a664d80060
0.0.0-next-c12720c09369b6620405de027fa85d469db43e9c0
0.0.0-next-7f1112246f97f222dc289edb7b9f0359d8f020cb0
0.0.0-next-91daa029e219b08cf0b775b6648d35867f2272d00
0.0.0-next-9e3b266e199e346a30e2c20aac373d48c2ea98880
0.0.0-next-47b085701d7c0b212b54bcac46f6106d34ec429e0
0.0.0-next-3b50f8232d3349fe79554f36417d7fbb45b6352a0
0.0.0-next-44318443f2cd1088082181789b25fc26a7a11bb20
0.0.0-next-6d1491390706ac21857752412a5e4d10e112a29a0
0.0.0-next-51a8e00f16dc1652cb0f0674c540570614a8895e0
0.0.0-next-5f5cecf01c890c348e17907482b03cea2f8c5f210
0.0.0-next-bfa0f33f79b0349abe5ad03576e17682f507fe040
0.0.0-next-ea4f317e964c0504e54c01d83c385280a9135bba0
0.0.0-next-59e1f6f134da2a3417bd69a71c7788320608ee5d0
0.0.0-next-10815be8fd57f3bfd89d061e1592eb7136d4a0fb0
22.1.20
0.0.0-next-4216a27cdf41425fff35938bb42040bb93c2d2460
0.0.0-next-1cb9ea1724d90e58422b33fe089df5b774e0be100
0.0.0-next-d9691f3c8230e21aeb2817ac2c984aba0d79f09c0
0.0.0-next-cd3c5c1303c464ef7900dc08adb8154d15c7f3a90
0.0.0-next-01a3ac56d52443bc859ccdcf7ed301ffbdea7a470
0.0.0-next-823f55a862f13d28437b87fb594450b2208c0d4f0
0.0.0-next-5f69e8129e0242b4e507fee055188a8a83e1f1c10
0.0.0-next-e42d58083be39ce9f112e6ec7f9fd1fdcb666e3e0
0.0.0-next-dfa464112f63969f158bde32322e393fa2b779400
0.0.0-next-25b11de63d51aa4ca7fda0f3eae67999e3418ca50
0.0.0-next-e30a9e850a8a66b70770fbf6658a3e35cf1ff8b80
0.0.0-experimental-1c53312ce4905234885618d41ae95fde9c21aa180
22.1.10
22.0.00
21.19.10
21.19.00
21.18.00
21.17.00
21.16.00
21.15.00
21.14.01
21.13.00
21.12.20
21.12.10
21.12.00
21.11.10
21.11.00
21.10.00
21.9.00
21.8.00
21.7.00
21.6.00
21.5.40
21.5.31
21.5.20
21.5.10
21.5.00
21.4.00
21.3.00
21.2.00
21.1.00
21.0.00
20.2.00
20.1.00
20.0.00
19.2.10
19.2.00
19.1.10
19.1.00
19.0.30
19.0.22
19.0.10
19.0.00
18.1.00
18.0.10
18.0.00
17.3.00
17.2.00
17.1.00
17.0.31
17.0.21
17.0.10
17.0.00
16.1.85
16.1.70
16.1.60
16.1.50
16.1.40
16.1.30
16.1.20
16.1.10
16.1.00
16.0.10
16.0.00
14.6.60
14.6.50
14.6.40
14.6.30
14.6.20
14.6.10
14.6.00
14.5.10
14.4.30
14.5.00
14.4.20
14.4.10
14.4.00
14.3.70
14.3.60
14.3.50
14.3.40
14.3.30
14.3.20
14.3.10
14.3.00
14.2.80
14.2.70
14.2.60
14.2.50
14.2.40
14.2.30
14.2.20
14.2.00
14.1.10
14.1.00
14.0.30
14.0.20
13.1.60
14.0.10
14.0.00
13.1.50
13.1.40
13.1.30
13.1.20
13.1.10
13.1.00
13.0.10
13.0.00
12.5.60
12.5.50
12.5.40
12.5.30
12.5.20
12.5.10
12.5.00
12.4.20
12.4.10
12.4.00
12.3.20
12.3.10
12.3.00
12.2.00
12.1.00
12.0.50
12.0.40
12.0.30
12.0.20
12.0.10
12.0.00
11.0.00
10.7.10
10.7.00
10.6.00
10.5.00
10.4.30
10.4.20
10.4.10
10.4.00
10.3.00
10.2.00
10.1.30
10.1.20
10.1.10
10.1.00
10.0.20
10.0.10
10.0.00
9.2.04
9.1.00
9.0.00
9.0.0-beta.00
8.0.10
8.0.00
8.0.0-beta.10
8.0.0-beta.00
7.0.00
6.5.29
6.5.10
6.5.00
6.4.30
6.4.20
6.4.10
6.4.00
6.3.50
6.3.40
6.3.30
6.3.20
6.3.10
6.3.00
6.2.00
6.1.00
6.0.00
5.1.00
5.0.30
5.0.20
5.0.10
5.0.00
4.3.00
4.2.00
4.1.00
4.0.40
4.0.30
4.0.20
4.0.10
4.0.00
3.0.100
3.0.90
3.0.80
3.0.70
3.0.60
3.0.50
3.0.40
3.0.30
3.0.20
3.0.10
3.0.00
2.0.10
2.0.00
1.0.20
1.0.10
1.0.00
0.0.30
0.0.20
0.0.10

Package Sidebar

Install

npm i mongodb-connection-model

Weekly Downloads

37

Version

22.4.1

License

SSPL

Unpacked Size

84.2 kB

Total Files

19

Last publish

Collaborators

  • mongodb-js-user
  • rueckstiess
  • durran
  • alexander_schroll
  • mbroadst
  • hswolff
  • satyasinha
  • matt_d_rat
  • jeff-allen-mongo
  • jonathan.balsano
  • mongodb-build
  • jack.weir
  • mcasimir
  • kristina.stefano
  • jarjee
  • shaketbaby
  • devtoolsbot
  • addaleax
  • gribnoysup
  • mutukrish
  • mongo-j
  • nbbeeken
  • dbx-node
  • nirinchev
  • pearsb1
  • wz3chen
  • imlucas
  • kangas
  • judahschvimer