mongodb 2.2.29 → 2.2.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/HISTORY.md CHANGED
@@ -1,3 +1,11 @@
1
+ 2.2.30 2017-07-07
2
+ -----------------
3
+ * Update mongodb-core to 2.2.14
4
+ * MongoClient
5
+ * add `appname` to list of valid option names
6
+ * added test for passing appname as option
7
+ * NODE-1052 ensure user options are applied while parsing connection string uris
8
+
1
9
  2.2.29 2017-06-19
2
10
  -----------------
3
11
  * Update mongodb-core to 2.1.13
@@ -38,7 +38,7 @@ var validOptionNames = ['poolSize', 'ssl', 'sslValidate', 'sslCA', 'sslCert',
38
38
  'serializeFunctions', 'ignoreUndefined', 'raw', 'promoteLongs', 'bufferMaxEntries',
39
39
  'readPreference', 'pkFactory', 'promiseLibrary', 'readConcern', 'maxStalenessSeconds',
40
40
  'loggerLevel', 'logger', 'promoteValues', 'promoteBuffers', 'promoteLongs',
41
- 'domainsEnabled', 'keepAliveInitialDelay', 'checkServerIdentity', 'validateOptions'];
41
+ 'domainsEnabled', 'keepAliveInitialDelay', 'checkServerIdentity', 'validateOptions', 'appname'];
42
42
  var ignoreOptionNames = ['native_parser'];
43
43
  var legacyOptionNames = ['server', 'replset', 'replSet', 'mongos', 'db'];
44
44
 
@@ -132,6 +132,7 @@ function MongoClient() {
132
132
  * @param {object} [options.readConcern=null] Specify a read concern for the collection. (only MongoDB 3.2 or higher supported)
133
133
  * @param {string} [options.readConcern.level='local'] Specify a read concern level for the collection operations, one of [local|majority]. (only MongoDB 3.2 or higher supported)
134
134
  * @param {number} [options.maxStalenessSeconds=undefined] The max staleness to secondary reads (values under 10 seconds cannot be guaranteed);
135
+ * @param {string} [options.appname=undefined] The name of the application that created this MongoClient instance. MongoDB 3.4 and newer will print this value in the server log upon establishing each connection. It is also recorded in the slow query log and profile collections.
135
136
  * @param {string} [options.loggerLevel=undefined] The logging level (error/warn/info/debug)
136
137
  * @param {object} [options.logger=undefined] Custom logger object
137
138
  * @param {object} [options.validateOptions=false] Validate MongoClient passed in options for correctness.
@@ -200,6 +201,7 @@ var define = MongoClient.define = new Define('MongoClient', MongoClient, false);
200
201
  * @param {object} [options.readConcern=null] Specify a read concern for the collection. (only MongoDB 3.2 or higher supported)
201
202
  * @param {string} [options.readConcern.level='local'] Specify a read concern level for the collection operations, one of [local|majority]. (only MongoDB 3.2 or higher supported)
202
203
  * @param {number} [options.maxStalenessSeconds=undefined] The max staleness to secondary reads (values under 10 seconds cannot be guaranteed);
204
+ * @param {string} [options.appname=undefined] The name of the application that created this MongoClient instance. MongoDB 3.4 and newer will print this value in the server log upon establishing each connection. It is also recorded in the slow query log and profile collections.
203
205
  * @param {string} [options.loggerLevel=undefined] The logging level (error/warn/info/debug)
204
206
  * @param {object} [options.logger=undefined] Custom logger object
205
207
  * @param {object} [options.validateOptions=false] Validate MongoClient passed in options for correctness.
package/lib/url_parser.js CHANGED
@@ -2,9 +2,10 @@
2
2
 
3
3
  var ReadPreference = require('./read_preference'),
4
4
  parser = require('url'),
5
- f = require('util').format;
5
+ f = require('util').format,
6
+ assign = require('./utils').assign;
6
7
 
7
- module.exports = function(url) {
8
+ module.exports = function(url, options) {
8
9
  // Variables
9
10
  var connection_part = '';
10
11
  var auth_part = '';
@@ -398,8 +399,12 @@ module.exports = function(url) {
398
399
  dbOptions.readPreference = 'primary';
399
400
  }
400
401
 
402
+ // make sure that user-provided options are applied with priority
403
+ dbOptions = assign(dbOptions, options);
404
+
401
405
  // Add servers to result
402
406
  object.servers = servers;
407
+
403
408
  // Returned parsed object
404
409
  return object;
405
410
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mongodb",
3
- "version": "2.2.29",
3
+ "version": "2.2.30",
4
4
  "description": "The official MongoDB driver for Node.js",
5
5
  "main": "index.js",
6
6
  "repository": {
@@ -14,7 +14,7 @@
14
14
  ],
15
15
  "dependencies": {
16
16
  "es6-promise": "3.2.1",
17
- "mongodb-core": "2.1.13",
17
+ "mongodb-core": "2.1.14",
18
18
  "readable-stream": "2.2.7"
19
19
  },
20
20
  "devDependencies": {