Giter Club home page Giter Club logo

connection-model's Introduction

mongodb-connection-model

MongoDB connection model

The main purpose of the MongoDB connection model is to be a domain model around a MongoDB connection. It encapsulates generating a Connection String URI from a group of attributes and parses URI using the MongoDB Node.JS Driver URI Parser.

Installation

npm install --save mongodb-connection-model

Usage

Building URI

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

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 });

See Also

General Properties

const c = new Connection({ isSrvRecord: true });
Property Type Description Default
ns String A valid ns the user can read from undefined
isSrvRecord Boolean Indicates SRV record false
auth Object Authentication from driver (username, user, db, password) undefined
hostname String Hostname of a MongoDB Instance. In case of the replica set the first host and port will be taken localhost
port Number TCP port of a MongoDB Instance 27017
hosts Array Contains all hosts and ports for replica set [{ host: 'localhost', port: 27017 }]
extraOptions Object Extra options passed to the node driver as part of driverOptions {}
connectionType String The desired connection type. Possible values: NODE_DRIVER, STITCH_ON_PREM, STITCH_ATLAS NODE_DRIVER
authStrategy String The desired authentication strategy. Possible values: NONE, MONGODB, X509, KERBEROS, LDAP, SCRAM-SHA-256 NONE

Connection string options

const c = new Connection({ appname: 'My App', replicaSet: 'testing' });

General connection string options

Property Type Description Default
replicaSet String Specifies the name of the replica set, if the mongod is a member of a replica set undefined
connectTimeoutMS Number The time in milliseconds to attempt a connection before timing out undefined
socketTimeoutMS Number The time in milliseconds to attempt a send or receive on a socket before the attempt times out undefined
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

Connection Pool Option

Property Type Description Default
maxPoolSize Number The maximum number of connections in the connection pool undefined
minPoolSize Number The minimum number of connections in the connection pool undefined
maxIdleTimeMS Number The maximum number of milliseconds that a connection can remain idle in the pool before being removed and closed undefined
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
waitQueueTimeoutMS Number The maximum time in milliseconds that a thread can wait for a connection to become available undefined

Write Concern Options

Property Type Description Default
w Number/String Corresponds to the write concern w Option undefined
wTimeoutMS Number Corresponds to the write concern wtimeout undefined
journal Boolean Corresponds to the write concern j Option undefined

Read Concern Options

Property Type Description Default
readConcernLevel String The level of isolation undefined

Read Preference Options

Property Type Description Default
readPreference String Specifies the read preferences for this connection. Possible values: PRIMARY, PRIMARY_PREFERRED, SECONDARY, SECONDARY_PREFERRED, NEAREST PRIMARY
maxStalenessSeconds Number Specifies, in seconds, how stale a secondary can be before the client stops using it for read operations undefined
readPreferenceTags Object Default read preference tags for the client undefined

Authentication Options

Property Type Description Default
authSource String Specify the database name associated with the user’s credentials undefined
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
authMechanismProperties Object Additional options provided for authentication (e.g. to enable hostname canonicalization for GSSAPI) undefined
gssapiServiceName String Set the Kerberos service name when connecting to Kerberized MongoDB instances undefined
gssapiServiceRealm String Set the Realm service name undefined
gssapiCanonicalizeHostName Boolean Whether canonicalized hostname undefined

Server Selection and Discovery Options

Property Type Description Default
localThresholdMS Number The size (in milliseconds) of the latency window for selecting among multiple suitable MongoDB instances undefined
serverSelectionTimeoutMS Number Specifies how long (in milliseconds) to block for server selection before throwing an exception undefined
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
heartbeatFrequencyMS Number Controls when the driver checks the state of the MongoDB deployment undefined

Miscellaneous Configuration

Property Type Description Default
appname String An application name passed to server as client metadata undefined
retryWrites Boolean Enable retryable writes undefined
uuidRepresentation String The legacy representation of UUID. Possible values: standard, csharpLegacy, javaLegacy, pythonLegacy undefined

Stitch attributes

Property Type Description Default
stitchServiceName String Stitch service name undefined
stitchClientAppId String Stitch сlient app ID undefined
stitchGroupId String Stitch group ID undefined
stitchBaseUrl String Stitch base Url undefined

MONGODB authentication

const c = new Connection({
  mongodbUsername: 'arlo',
  mongodbPassword: 'w@of'
});

console.log(c.driverUrl)
>>> 'mongodb://arlo:w%40of@localhost:27017/?slaveOk=true&authSource=admin'

console.log(c.driverOptions)
>>> {
  db: { readPreference: 'nearest' },
  replSet: { connectWithNoPrimary: true }
}
Property Type Description Default
mongodbUsername String MongoDB username undefined
mongodbPassword String MongoDB password undefined
mongodbDatabaseName String The database name associated with the user's credentials undefined
promoteValues Boolean Whether BSON values should be promoted to their JS type counterparts undefined

KERBEROS authentication

const c = new Connection({
  kerberosServiceName: 'mongodb',
  kerberosPrincipal: 'arlo/[email protected]',
  ns: 'toys'
});

console.log(c.driverUrl)
>>> 'mongodb://arlo%252Fdog%2540krb5.mongodb.parts@localhost:27017/toys?slaveOk=true&gssapiServiceName=mongodb&authMechanism=GSSAPI'

console.log(c.driverOptions)
>>> {
  db: { readPreference: 'nearest' },
  replSet: { connectWithNoPrimary: true }
}

@note (imlucas): Kerberos on Windows is broken out as it's own state for UX consideration

Property Type Description Default
kerberosServiceName String Any program or computer you access over a network undefined
kerberosPrincipal String The format of a typical Kerberos V5 principal is primary/instance@REALM undefined
kerberosCanonicalizeHostname Boolean Whether canonicalized kerberos hostname undefined

See Also

LDAP authentication

const c = new Connection({
  ldapUsername: 'arlo',
  ldapPassword: 'w@of',
  ns: 'toys'
});

console.log(c.driverUrl)
>>> 'mongodb://arlo:w%40of@localhost:27017/toys?slaveOk=true&authMechanism=PLAIN'

console.log(c.driverOptions)
>>> {
  db: { readPreference: 'nearest' },
  replSet: { connectWithNoPrimary: true }
}
Property Type Description Default
ldapUsername String LDAP username undefined
ldapPassword String LDAP password undefined

See Also

X509 authentication

const c = new Connection({
  x509Username: 'CN=client,OU=arlo,O=MongoDB,L=Philadelphia,ST=Pennsylvania,C=US'
});

console.log(c.driverUrl)
>>> 'mongodb://CN%253Dclient%252COU%253Darlo%252CO%253DMongoDB%252CL%253DPhiladelphia%252CST%253DPennsylvania%252CC%253DUS@localhost:27017?slaveOk=true&authMechanism=MONGODB-X509'

console.log(c.driverOptions)
>>> {
  db: { readPreference: 'nearest' },
  replSet: { connectWithNoPrimary: true }
}
Property Type Description Default
x509Username String The x.509 certificate derived user name, e.g. CN=user,OU=OrgUnit,O=myOrg,... undefined

See Also

SSL

Note: Not to be confused with authentication=X509

Property Type Description Default
ssl Number/String A boolean to enable or disables TLS/SSL for the connection undefined
sslMethod String The desired ssl method. Possible values: NONE, SYSTEMCA, IFAVAILABLE, UNVALIDATED, SERVER, ALL NONE
sslCA Buffer/String Array of valid certificates undefined
sslCert Buffer/String The certificate undefined
sslKey Buffer/String The certificate private key undefined
sslPass Buffer/String The certificate password undefined

Description of sslMethod values:

See also

SSH TUNNEL

New in [email protected]

Because authentication is quite difficult for operators to migrate to, the most common method of securing a MongoDB deployment is to use an 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.

const connect = require('mongodb-connection-model').connect;
const options = {
  hostname: 'localhost',
  port: 27017,
  sshTunnel: 'IDENTITY_FILE',
  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',
  sshTunnelUsername: 'ubuntu',
  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']
};

connect(options, (connectionError, client) => {
  if (connectionError) {
    return console.log(connectionError);
  }

  client.db('mongodb').collection('fanclub').count((countingError, count) => {
    console.log('counted:', countingError, count);
    client.close();
  });
});

The above provides the same functionality as creating the tunnel using the bash command below and connecting to MongoDB via another terminal. Notice that connection-model uses a random local port each time it creates a tunnel. Using the command line, you'd have to replace <random port> with an actual port number.

ssh -i ~/.ssh/my-key-aws-pair.pem -L <random port>:localhost:27017 [email protected]
Property Type Description Default
sshTunnel String The desired SSH tunnel strategy. Possible values: NONE, USER_PASSWORD, IDENTITY_FILE undefined
sshTunnelHostname String The hostname of the SSH remote host undefined
sshTunnelPort Port The SSH port of the remote host 22
sshTunnelBindToLocalPort Port Bind the localhost endpoint of the SSH Tunnel to this port undefined
sshTunnelUsername String The optional SSH username for the remote host undefined
sshTunnelPassword String The optional SSH password for the remote host undefined
sshTunnelIdentityFile String/Array The optional path to the SSH identity file for the remote host undefined
sshTunnelPassphrase String The optional passphrase for sshTunnelIdentityFile undefined

Description of sshTunnel values:

  • NONE - Do not use SSH tunneling.
  • USER_PASSWORD - The tunnel is created with SSH username and password only.
  • IDENTITY_FILE - The tunnel is created using an identity file.

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 });
Derived Property Type Description Default
instanceId String The mongoscope localhost:27017
driverAuthMechanism String Converts the value of authStrategy for humans into the authMechanism value for the driver undefined
safeUrl String The URL where a password is replaced with stars mongodb://localhost:27017/?readPreference=primary&ssl=false
driverUrl String Use this URL in order to connect via DataService mongodb://localhost:27017/?readPreference=primary&ssl=false
driverUrlWithSsh String Use this URL in order to connect via connection model itself mongodb://localhost:29201/?readPreference=primary&ssl=false
driverOptions String The second argument mongoscope-server passes to mongodb.connect {}

Events

New in [email protected]

Example: SSH Tunnel

const connect = require('mongodb-connection-model').connect;
const options = {
  hostname: 'localhost',
  port: 27017,
  sshTunnel: 'IDENTITY_FILE',
  sshTunnelHostname: 'ec2-11-111-111-111.compute-1.amazonaws.com',
  sshTunnelUsername: 'ubuntu',
  sshTunnelIdentityFile: ['/Users/albert/.ssh/my-key-aws-pair.pem']
};

connect(options).on('status', (evt) => console.log('status:', evt));

This will log the following events to the console:

>>> status: { message: 'Validate', pending: true }
>>> status: { message: 'Validate', complete: true }
>>> status: { message: 'Load SSL files', pending: true }
>>> status: { message: 'Load SSL files', skipped: true,
  reason: 'The selected SSL mode does not need to load any files.' }
>>> status: { message: 'Create SSH Tunnel', pending: true }
>>> status: { message: 'Create SSH Tunnel', complete: true}
>>> status: { message: 'Connect to MongoDB', pending: true }
>>> status: { message: 'Connect to MongoDB', complete: true }

Example: SSL

const connect = require('mongodb-connection-model').connect;
const options = {
  hostname: 'localhost',
  port: 27017,
  ssl: 'ALL',
  sslCA: '~/.ssl/my-ca.pem',
  sslCert: '~/.ssl/my-server.pem',
  sslKey: '~/.ssl/my-server.pem'
};

connect(options).on('status', (evt) => console.log('status:', evt));

This will log the following events to the console:

>>> status: { message: 'Validate', pending: true }
>>> status: { message: 'Validate', complete: true }
>>> status: { message: 'Load SSL files', pending: true }
>>> status: { message: 'Load SSL files', complete: true}
>>> status: { message: 'Create SSH Tunnel', pending: true }
>>> status: { message: 'Create SSH Tunnel', skipped: true,
  reason: 'The selected SSH Tunnel mode is NONE.'}
>>> status: { message: 'Connect to MongoDB', pending: true }
>>> status: { message: 'Connect to MongoDB', complete: true }

License

Apache 2.0

connection-model's People

Contributors

addaleax avatar aherlihy avatar alenakhineika avatar anemy avatar dependabot-preview[bot] avatar durran avatar greenkeeper[bot] avatar greenkeeperio-bot avatar gribnoysup avatar imlucas avatar judahschvimer avatar kangas avatar lrlna avatar mcasimir avatar pzrq avatar rose-m avatar rueckstiess avatar waleychen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

connection-model's Issues

Connect successfully but error when try to read data

Hi,
Thank you for your help in advance. In my app.js I wrote a function to read data from a remote MongoDB on AWS for index.html. When I first run node app.js it works fine and the console returnsstatus: { message: 'Validate', complete: true } status: { message: 'Load SSL files', pending: true } status: { message: 'Load SSL files', skipped: true, reason: 'The selected SSL mode does not need to load any files.' } status: { message: 'Create SSH Tunnel', pending: true } status: { message: 'Create SSH Tunnel', complete: true } status: { message: 'Connect to MongoDB', pending: true } status: { message: 'Connect to MongoDB', complete: true }
Then I try to open localhost:4000 (I set the port 4000 to listen in app.js) then there is an error my appication\node_modules\mongodb-connection-model\lib\connect.js:284 throw err; ^ Error: Error creating SSH Tunnel: Local port 29580 (chosen randomly) is already in use. You can click connect to try again with a different port. at Object._errnoException (util.js:1024:11) at _exceptionWithHostPort (util.js:1046:20) at Server.setupListenHandle [as _listen2] (net.js:1351:14) at listenInCluster (net.js:1392:12) at doListen (net.js:1501:7) at _combinedTickCallback (internal/process/next_tick.js:141:11)

I am not sure whether I successfully connected to that or not? Although the command works fine by equal ssh command.

An in-range update of pre-commit is breaking the build 🚨

Version 1.2.0 of pre-commit just got published.

Branch Build failing 🚨
Dependency pre-commit
Current Version 1.1.3
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As pre-commit is “only” a devDependency of this project it might not break production or downstream projects, but “only” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this 💪


Status Details
  • continuous-integration/travis-ci/push The Travis CI build failed Details
Commits

The new version differs by 8 commits .

  • 1689e3e [dist] 1.2.0 - Better windows support
  • a9c9732 solves the windows issue (with symlinks) (#84)
  • 4167676 chore(package): update mocha to version 3.2.0 (#86)
  • 3cf4cf7 chore(package): update dependencies (#85)
  • 7154dee Update dep to remove warn about cross-spaw (#76)
  • ead9484 cross-spawn@4 (#77)
  • fec48cb [ci] Remove NPM hack and old npm
  • 18da668 [deps] Fix npmgate

See the full diff.

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

An in-range update of async is breaking the build 🚨

Version 2.1.4 of async just got published.

Branch Build failing 🚨
Dependency async
Current Version 2.1.2
Type dependency

This version is covered by your current version range and after updating it in your project the build failed.

As async is a direct dependency of this project this is very likely breaking your project right now. If other packages depend on you it’s very likely also breaking them.
I recommend you give this issue a very high priority. I’m sure you can resolve this 💪


Status Details
  • continuous-integration/travis-ci/push The Travis CI build failed Details
Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

An in-range update of mongodb is breaking the build 🚨

Version 2.2.12 of mongodb just got published.

Branch Build failing 🚨
Dependency mongodb
Current Version 2.2.11
Type dependency

This version is covered by your current version range and after updating it in your project the build failed.

As mongodb is a direct dependency of this project this is very likely breaking your project right now. If other packages depend on you it’s very likely also breaking them.
I recommend you give this issue a very high priority. I’m sure you can resolve this 💪


Status Details
  • continuous-integration/travis-ci/push The Travis CI build failed Details
Commits

The new version differs by 32 commits .

  • 4a77151 updated history
  • f98951d NODE-864 close event not emits during network issues using single server topology
  • 9f5fd14 fixed const issues
  • c31092e fixed sni test
  • 5d2b36c Merge branch '2.2' of github.com:mongodb/node-mongodb-native into 2.2
  • 05b8770 Introduced maxStalenessSeconds
  • a26e04f Merge pull request #1443 from perrin4869/2.2
  • b501b69 Fix createIndex name option type
  • 5b84ba5 Merge pull request #1429 from LPGhatguy/patch-1
  • 0a67df4 Merge pull request #1432 from CaselIT/patch-1
  • c5e8f20 fixed sni tests to work correctly
  • 9d1bb79 Added SNI test and updated runner and gitignore
  • 7aa7160 NODE-843 Executing bulk operations overwrites write concern parameter
  • 9bb3ddc NODE-846 Create notice for all third party libraries
  • c5bb3fb NODE-840 Added CRUD specification test cases and fix minor issues with upserts reporting matchedCount > 0

There are 32 commits in total. See the full diff.

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

An in-range update of lodash is breaking the build 🚨

Version 4.17.3 of lodash just got published.

Branch Build failing 🚨
Dependency lodash
Current Version 4.17.2
Type dependency

This version is covered by your current version range and after updating it in your project the build failed.

As lodash is a direct dependency of this project this is very likely breaking your project right now. If other packages depend on you it’s very likely also breaking them.
I recommend you give this issue a very high priority. I’m sure you can resolve this 💪


Status Details
  • continuous-integration/travis-ci/push The Travis CI build failed Details
Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

An in-range update of async is breaking the build 🚨

Version 2.1.5 of async just got published.

Branch Build failing 🚨
Dependency async
Current Version 2.1.4
Type dependency

This version is covered by your current version range and after updating it in your project the build failed.

As async is a direct dependency of this project this is very likely breaking your project right now. If other packages depend on you it’s very likely also breaking them.
I recommend you give this issue a very high priority. I’m sure you can resolve this 💪


Status Details
  • continuous-integration/travis-ci/push The Travis CI build failed Details
Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

An in-range update of mongodb is breaking the build 🚨

Version 2.2.13 of mongodb just got published.

Branch Build failing 🚨
Dependency mongodb
Current Version 2.2.12
Type dependency

This version is covered by your current version range and after updating it in your project the build failed.

As mongodb is a direct dependency of this project this is very likely breaking your project right now. If other packages depend on you it’s very likely also breaking them.
I recommend you give this issue a very high priority. I’m sure you can resolve this 💪


Status Details
  • continuous-integration/travis-ci/push The Travis CI build failed Details
Commits

The new version differs by 11 commits .

  • adbebca Updated package, history and installation guide
  • 537a5c4 Expose parserType as property on topology objects
  • b034c83 NODE-889 Fixed issue where legacy killcursor wire protocol messages would not be sent when APM is enableD
  • 3a88709 force build
  • d18f58e run tests against local mongodb
  • 0e1801e disable containers
  • 16f4547 try travis containers again
  • 7f6f65c force build
  • 4cfa6c3 All test cases passing for bson-ext
  • 1f7b0ff integrated the new bson parser and mongodb-core 2.1.0
  • 52f3b3c Update HISTORY.md

See the full diff.

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

An in-range update of debug is breaking the build 🚨

Version 2.4.0 of debug just got published.

Branch Build failing 🚨
Dependency debug
Current Version 2.3.3
Type dependency

This version is covered by your current version range and after updating it in your project the build failed.

As debug is a direct dependency of this project this is very likely breaking your project right now. If other packages depend on you it’s very likely also breaking them.
I recommend you give this issue a very high priority. I’m sure you can resolve this 💪


Status Details
  • continuous-integration/travis-ci/push The Travis CI build failed Details
Commits

The new version differs by 7 commits .

  • b82d4e6 release 2.4.0
  • 41002f1 Update bower.json (#342)
  • e58d54b Node: configurable util.inspect() options (#327)
  • 00f3046 Node: %O (big O) pretty-prints the object (#322)
  • bd9faa1 allow colours in workers (#335)
  • 501521f Use same color for same namespace. (#338)
  • e2a1955 Revert "handle regex special characters"

See the full diff.

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

An in-range update of debug is breaking the build 🚨

Version 2.4.5 of debug just got published.

Branch Build failing 🚨
Dependency debug
Current Version 2.4.4
Type dependency

This version is covered by your current version range and after updating it in your project the build failed.

As debug is a direct dependency of this project this is very likely breaking your project right now. If other packages depend on you it’s very likely also breaking them.
I recommend you give this issue a very high priority. I’m sure you can resolve this 💪


Status Details
  • continuous-integration/travis-ci/push The Travis CI build failed Details
Commits

The new version differs by 6 commits .

  • 7e741fc release 2.4.5
  • 17d0e0b check for navigator (#376)
  • 50ffa9d Enable use of custom log function (#379)
  • 1c625d4 bit of cleanup + linting fixes
  • 932b24a rm non-maintainted dist/ dir (#375)
  • cea345a docs: Simplified language in the opening paragraph. Closes #340 (#373)

See the full diff.

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

An in-range update of mongodb is breaking the build 🚨

Version 2.2.23 of mongodb just got published.

Branch Build failing 🚨
Dependency mongodb
Current Version 2.2.22
Type dependency

This version is covered by your current version range and after updating it in your project the build failed.

As mongodb is a direct dependency of this project this is very likely breaking your project right now. If other packages depend on you it’s very likely also breaking them.
I recommend you give this issue a very high priority. I’m sure you can resolve this 💪


Status Details
  • continuous-integration/travis-ci/push The Travis CI build failed Details
Commits

The new version differs by 17 commits .

  • 47e519f some fixes for proxy tests to attempt to avoid travis running issues
  • 671f286 Merge branch '2.2' of github.com:mongodb/node-mongodb-native into 2.2
  • 2603748 updated history and package.json to V2.2.23
  • 941417e Merge pull request #1470 from ra4king/patch-1
  • dac57e9 Merge pull request #1477 from oBusk/patch-1
  • a24c252 Merge pull request #1476 from maicss/patch-1
  • fe04423 Fix typo in node quickstart
  • 16ede54 https://jira.mongodb.org/browse/NODE-932
  • d1a4e15 fixed test
  • 7050663 minor test fix and mongo_client options validation
  • 39102e1 NODE-931 Validates all the options for MongoClient.connect and fixes missing connection settings
  • 38c037c NODE-929 Update SSL tutorial to correctly reflect the non-need for server/mongos/replset subobjects
  • 7832ca9 Merge branch '2.2' of github.com:mongodb/node-mongodb-native into 2.2:
  • 636444b link driver to mongodb-core 2.0 branch for dev
  • e4f5999 Merge pull request #1473 from Annoraaq/patch-1

There are 17 commits in total. See the full diff.

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

An in-range update of debug is breaking the build 🚨

Version 2.3.3 of debug just got published.

Branch Build failing 🚨
Dependency debug
Current Version 2.3.2
Type dependency

This version is covered by your current version range and after updating it in your project the build failed.

As debug is a direct dependency of this project this is very likely breaking your project right now. If other packages depend on you it’s very likely also breaking them.
I recommend you give this issue a very high priority. I’m sure you can resolve this 💪


Status Details
  • continuous-integration/travis-ci/push The Travis CI build failed Details
Commits

The new version differs by 7 commits .

  • 3ad8df7 Release 2.3.3
  • 8e09edf browser: whitespace
  • 3491ad6 Merge pull request #195 from jalleyne/master
  • 2caf4ef Merge pull request #331 from levithomason/patch-1
  • 20c37fd fix(browser): do not override ls debug if found
  • a746d52 don't create an empty object when no process
  • 6830d9f Catch JSON stringily errors.

See the full diff.

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

Connect Error

We are attempting to access a mongo DB via a shell as shown in your example. We are getting an error when trying to connect with the following options:

const connect = require('mongodb-connection-model').connect;
const options = {
  hostname: 'localhost',
  port: 27017,
  ssh_tunnel: 'IDENTITY_FILE',
  ssh_tunnel_hostname: 'ec2-##-###-###-###.compute-1.amazonaws.com',
  ssh_tunnel_username: 'ubuntu',
  ssh_tunnel_identity_file: ['FILE.pem'],
  mongodb_username: 'mongoUser',
  mongodb_password: '######',
  mongodb_database_name:'mongoDataBase'
};

Below is how we are calling the function

 connect(options, (e, db) => {
      if (e) {
        return console.log('E', e);
      }
      db.db('mongoDataBase').collection('myCollect').count((err2, count) => {
        console.log('counted:', err2, count);
        db.close();
      });
    }).on('status', (evt) => console.log('status:', evt));

The error message that we are getting is:

 MongoClient {
  domain: null,
  _events: {},
  _eventsCount: 0,
  _maxListeners: undefined,
  s: 
   { url: 'mongodb://mongoUser:[email protected]:29464/?readPreference=primary&authSource='mongoDataBase',
     options: { useNewUrlParser: true },
     promiseLibrary: [Function: Promise],
     dbCache: {},

When we look at the status values we get:

status: { message: 'Create SSH Tunnel', complete: true }
status: { message: 'Connect to MongoDB', pending: true }
status: { message: 'Connect to MongoDB', complete: true }

One of the concerns that I see is that thought the port in options is defined as 27017 each time I attempt to call the connect function a different port is used. (ie: 29464 as shown above). I believe that this may be the root to the problem but unsure how to resolve. Additionally we never get to the db calls that are being used. Any ideas what could be going wrong here?

An in-range update of mongodb is breaking the build 🚨

Version 2.2.17 of mongodb just got published.

Branch Build failing 🚨
Dependency mongodb
Current Version 2.2.16
Type dependency

This version is covered by your current version range and after updating it in your project the build failed.

As mongodb is a direct dependency of this project this is very likely breaking your project right now. If other packages depend on you it’s very likely also breaking them.
I recommend you give this issue a very high priority. I’m sure you can resolve this 💪


Status Details
  • continuous-integration/travis-ci/push The Travis CI build failed Details
Commits

The new version differs by 6 commits .

  • 2bb9a7b Test fixes and upgraded topology manager
  • 8f768ef updated createCollection doc options and linked to create command
  • 897dabc Made some tests more robust
  • bcaf5c7 moved test to generator test case file
  • 83ba471 Added test to verify connectTimeoutMS and socketTimeoutMS are passed down correctly for mongos topology
  • b55176b Added test ensuring uri socketTimeoutMS and connectTimeoutMS passed down correctly

See the full diff.

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

How do I disconnect the ssh tunnel ?

I found that behaviour of connect function is different to what is documented in README.md

connect(options, (db) => {
  db.connect(() => {
    db.db('mydb').collection('customers').count((err2, count) => {
      console.log('counted:', err2, count);
      db.close();
    });
  });
});

running db.close() closes mongo connection, but is there anyway I can disconnect the tunnel connection gracefully?

Thank you.

Update README.md

Hi,
Could you please update info and samples in the README.md about driver options "replSet", which was deleted since v.12.1.0.
Thanks!

An in-range update of mocha is breaking the build 🚨

Version 3.2.0 of mocha just got published.

Branch Build failing 🚨
Dependency mocha
Current Version 3.1.2
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As mocha is “only” a devDependency of this project it might not break production or downstream projects, but “only” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this 💪


Status Details
  • continuous-integration/travis-ci/push The Travis CI build failed Details
Release Notes testing-coma

3.2.0 / 2016-11-24

📰 News

Mocha is now a JS Foundation Project!

Mocha is proud to have joined the JS Foundation. For more information, read the announcement.

Contributor License Agreement

Under the foundation, all contributors to Mocha must sign the JS Foundation CLA before their code can be merged. When sending a PR--if you have not already signed the CLA--a friendly bot will ask you to do so.

Mocha remains licensed under the MIT license.

🐛 Bug Fix

  • #2535: Fix crash when --watch encounters broken symlinks (@villesau)
  • #2593: Fix (old) regression; incorrect symbol shown in list reporter (@Aldaviva)
  • #2584: Fix potential error when running XUnit reporter (@vobujs)

🎉 Enhancement

🔩 Other

Thanks to all our contributors, sponsors and backers! Keep on the lookout for a public roadmap and new contribution guide coming soon.

Commits

The new version differs by 21 commits .

  • b51e360 Release v3.2.0
  • 5badf0b rebuild mocha.js for release v3.2.0 [ci skip]
  • b1d6b49 update CHANGELOG.md for v3.2.0 [ci skip]
  • 7a05a6c use spec reporter in tests by default; closes #2594
  • 004389f tweak timeout messaging; see #2294
  • 12afaf7 cleanup .gitignore [ci skip]
  • edde033 fix XUnit reporter output. Closes #2584
  • f5bef7c Revert test pass symbol in List reporter
  • 4a2e85a ignore files files which are not found by files() (#2538)
  • 79d7414 Add Browser Support Matrix to README.md (#2590) [ci skip]
  • 1d52fd3 use karma-mocha; closes #2570
  • 8941442 adds info about --inspect flag to options in --help
  • 71e7a1e rename some fixture files that had the wrong extension
  • 1a45929 typo in comment
  • b5a424a Link license from current branch

There are 21 commits in total. See the full diff.

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.