mongodb-core
Advanced tools
Comparing version 1.2.12 to 1.2.13
@@ -0,1 +1,5 @@ | ||
1.2.13 09-18-2015 | ||
----------------- | ||
- Added BSON serializer ignoreUndefined option for insert/update/remove/command/cursor. | ||
1.2.12 09-08-2015 | ||
@@ -2,0 +6,0 @@ ----------------- |
@@ -63,2 +63,3 @@ "use strict"; | ||
this.serializeFunctions = typeof options.serializeFunctions == 'boolean' ? options.serializeFunctions : false; | ||
this.ignoreUndefined = typeof options.ignoreUndefined == 'boolean' ? options.ignoreUndefined : false; | ||
this.maxBsonSize = options.maxBsonSize || 1024 * 1024 * 16; | ||
@@ -126,3 +127,4 @@ this.checkKeys = typeof options.checkKeys == 'boolean' ? options.checkKeys : true; | ||
, true | ||
, this.serializeFunctions) | ||
, this.serializeFunctions | ||
, 0, this.ignoreUndefined); | ||
@@ -134,3 +136,3 @@ // Add query document | ||
// Serialize the projection document | ||
projection = self.bson.serialize(this.returnFieldSelector, this.checkKeys, true, this.serializeFunctions); | ||
projection = self.bson.serialize(this.returnFieldSelector, this.checkKeys, true, this.serializeFunctions, this.ignoreUndefined); | ||
// Add projection document | ||
@@ -137,0 +139,0 @@ buffers.push(projection); |
@@ -600,3 +600,3 @@ "use strict"; | ||
// Get the right wire protocol command | ||
self.query = self.server.wireProtocolHandler.command(self.bson, self.ns, self.cmd, self.cursorState, self.topology, self.options); | ||
self.query = self.server.wireProtocolHandler.command(self.bson, self.ns, self.cmd, self.cursorState, self.topology, self.options); | ||
} catch(err) { | ||
@@ -603,0 +603,0 @@ return callback(err); |
@@ -433,2 +433,4 @@ "use strict"; | ||
* @param {object} [options.writeConcern={}] Write concern for the operation | ||
* @param {Boolean} [options.serializeFunctions=false] Specify if functions on an object should be serialized. | ||
* @param {Boolean} [options.ignoreUndefined=false] Specify if the BSON serializer should ignore undefined fields. | ||
* @param {opResultCallback} callback A callback function | ||
@@ -456,2 +458,4 @@ */ | ||
* @param {object} [options.writeConcern={}] Write concern for the operation | ||
* @param {Boolean} [options.serializeFunctions=false] Specify if functions on an object should be serialized. | ||
* @param {Boolean} [options.ignoreUndefined=false] Specify if the BSON serializer should ignore undefined fields. | ||
* @param {opResultCallback} callback A callback function | ||
@@ -479,2 +483,4 @@ */ | ||
* @param {object} [options.writeConcern={}] Write concern for the operation | ||
* @param {Boolean} [options.serializeFunctions=false] Specify if functions on an object should be serialized. | ||
* @param {Boolean} [options.ignoreUndefined=false] Specify if the BSON serializer should ignore undefined fields. | ||
* @param {opResultCallback} callback A callback function | ||
@@ -502,2 +508,4 @@ */ | ||
* @param {Connection} [options.connection] Specify connection object to execute command against | ||
* @param {Boolean} [options.serializeFunctions=false] Specify if functions on an object should be serialized. | ||
* @param {Boolean} [options.ignoreUndefined=false] Specify if the BSON serializer should ignore undefined fields. | ||
* @param {opResultCallback} callback A callback function | ||
@@ -568,2 +576,4 @@ */ | ||
* @param {ReadPreference} [options.readPreference] Specify read preference if command supports it | ||
* @param {Boolean} [options.serializeFunctions=false] Specify if functions on an object should be serialized. | ||
* @param {Boolean} [options.ignoreUndefined=false] Specify if the BSON serializer should ignore undefined fields. | ||
* @param {opResultCallback} callback A callback function | ||
@@ -570,0 +580,0 @@ */ |
@@ -336,2 +336,4 @@ "use strict"; | ||
* @param {ReadPreference} [options.readPreference] Specify read preference if command supports it | ||
* @param {Boolean} [options.serializeFunctions=false] Specify if functions on an object should be serialized. | ||
* @param {Boolean} [options.ignoreUndefined=false] Specify if the BSON serializer should ignore undefined fields. | ||
* @param {opResultCallback} callback A callback function | ||
@@ -388,2 +390,4 @@ */ | ||
* @param {Connection} [options.connection] Specify connection object to execute command against | ||
* @param {Boolean} [options.serializeFunctions=false] Specify if functions on an object should be serialized. | ||
* @param {Boolean} [options.ignoreUndefined=false] Specify if the BSON serializer should ignore undefined fields. | ||
* @param {opResultCallback} callback A callback function | ||
@@ -461,2 +465,4 @@ */ | ||
* @param {object} [options.writeConcern={}] Write concern for the operation | ||
* @param {Boolean} [options.serializeFunctions=false] Specify if functions on an object should be serialized. | ||
* @param {Boolean} [options.ignoreUndefined=false] Specify if the BSON serializer should ignore undefined fields. | ||
* @param {opResultCallback} callback A callback function | ||
@@ -484,2 +490,4 @@ */ | ||
* @param {object} [options.writeConcern={}] Write concern for the operation | ||
* @param {Boolean} [options.serializeFunctions=false] Specify if functions on an object should be serialized. | ||
* @param {Boolean} [options.ignoreUndefined=false] Specify if the BSON serializer should ignore undefined fields. | ||
* @param {opResultCallback} callback A callback function | ||
@@ -507,2 +515,4 @@ */ | ||
* @param {object} [options.writeConcern={}] Write concern for the operation | ||
* @param {Boolean} [options.serializeFunctions=false] Specify if functions on an object should be serialized. | ||
* @param {Boolean} [options.ignoreUndefined=false] Specify if the BSON serializer should ignore undefined fields. | ||
* @param {opResultCallback} callback A callback function | ||
@@ -509,0 +519,0 @@ */ |
@@ -768,2 +768,4 @@ "use strict"; | ||
* @param {Connection} [options.connection] Specify connection object to execute command against | ||
* @param {Boolean} [options.serializeFunctions=false] Specify if functions on an object should be serialized. | ||
* @param {Boolean} [options.ignoreUndefined=false] Specify if the BSON serializer should ignore undefined fields. | ||
* @param {opResultCallback} callback A callback function | ||
@@ -806,2 +808,5 @@ */ | ||
// Ignore undefined values | ||
var ignoreUndefined = typeof options.ignoreUndefined == 'boolean' ? options.ignoreUndefined : false; | ||
// Query options | ||
@@ -812,3 +817,5 @@ var queryOptions = { | ||
// Set up the serialize functions and ignore undefined | ||
if(serializeFunctions) queryOptions.serializeFunctions = serializeFunctions; | ||
if(ignoreUndefined) queryOptions.ignoreUndefined = ignoreUndefined; | ||
@@ -918,2 +925,4 @@ // Single operation execution | ||
* @param {object} [options.writeConcern={}] Write concern for the operation | ||
* @param {Boolean} [options.serializeFunctions=false] Specify if functions on an object should be serialized. | ||
* @param {Boolean} [options.ignoreUndefined=false] Specify if the BSON serializer should ignore undefined fields. | ||
* @param {opResultCallback} callback A callback function | ||
@@ -945,2 +954,4 @@ */ | ||
* @param {object} [options.writeConcern={}] Write concern for the operation | ||
* @param {Boolean} [options.serializeFunctions=false] Specify if functions on an object should be serialized. | ||
* @param {Boolean} [options.ignoreUndefined=false] Specify if the BSON serializer should ignore undefined fields. | ||
* @param {opResultCallback} callback A callback function | ||
@@ -972,2 +983,4 @@ */ | ||
* @param {object} [options.writeConcern={}] Write concern for the operation | ||
* @param {Boolean} [options.serializeFunctions=false] Specify if functions on an object should be serialized. | ||
* @param {Boolean} [options.ignoreUndefined=false] Specify if the BSON serializer should ignore undefined fields. | ||
* @param {opResultCallback} callback A callback function | ||
@@ -1152,2 +1165,4 @@ */ | ||
* @param {ReadPreference} [options.readPreference] Specify read preference if command supports it | ||
* @param {Boolean} [options.serializeFunctions=false] Specify if functions on an object should be serialized. | ||
* @param {Boolean} [options.ignoreUndefined=false] Specify if the BSON serializer should ignore undefined fields. | ||
* @param {opResultCallback} callback A callback function | ||
@@ -1154,0 +1169,0 @@ */ |
@@ -209,2 +209,8 @@ "use strict"; | ||
// Set up the serialize and ignoreUndefined fields | ||
var serializeFunctions = typeof options.serializeFunctions == 'boolean' | ||
? options.serializeFunctions : false; | ||
var ignoreUndefined = typeof options.ignoreUndefined == 'boolean' | ||
? options.ignoreUndefined : false; | ||
// Build Query object | ||
@@ -214,2 +220,3 @@ var query = new Query(bson, ns, findCmd, { | ||
, checkKeys: false, returnFieldSelector: cmd.fields | ||
, serializeFunctions: serializeFunctions, ignoreUndefined: ignoreUndefined | ||
}); | ||
@@ -263,6 +270,15 @@ | ||
// Serialize functions | ||
var serializeFunctions = typeof options.serializeFunctions == 'boolean' | ||
? options.serializeFunctions : false; | ||
// Set up the serialize and ignoreUndefined fields | ||
var ignoreUndefined = typeof options.ignoreUndefined == 'boolean' | ||
? options.ignoreUndefined : false; | ||
// Build Query object | ||
var query = new Query(bson, f('%s.$cmd', parts.shift()), finalCmd, { | ||
numberToSkip: 0, numberToReturn: -1 | ||
, checkKeys: false | ||
, checkKeys: false, serializeFunctions: serializeFunctions | ||
, ignoreUndefined: ignoreUndefined | ||
}); | ||
@@ -269,0 +285,0 @@ |
@@ -46,2 +46,3 @@ "use strict"; | ||
if(options.serializeFunctions) opts.serializeFunctions = options.serializeFunctions; | ||
if(options.ignoreUndefined) opts.ignoreUndefined = options.ignoreUndefined; | ||
// Execute command | ||
@@ -198,2 +199,4 @@ topology.command(f("%s.$cmd", d), writeCommand, opts, callback); | ||
? options.serializeFunctions : false; | ||
var ignoreUndefined = typeof options.ignoreUndefined == 'boolean' | ||
? options.ignoreUndefined : false; | ||
@@ -205,2 +208,3 @@ // Build Query object | ||
, serializeFunctions: serializeFunctions | ||
, ignoreUndefined: ignoreUndefined | ||
}); | ||
@@ -250,2 +254,5 @@ | ||
var ignoreUndefined = typeof options.ignoreUndefined == 'boolean' | ||
? options.ignoreUndefined : false; | ||
// Throw on majority readConcern passed in | ||
@@ -263,2 +270,3 @@ if(cmd.readConcern && cmd.readConcern.level != 'local') { | ||
, checkKeys: false, serializeFunctions: serializeFunctions | ||
, ignoreUndefined: ignoreUndefined | ||
}); | ||
@@ -265,0 +273,0 @@ |
@@ -53,2 +53,3 @@ "use strict"; | ||
if(options.serializeFunctions) opts.serializeFunctions = options.serializeFunctions; | ||
if(options.ignoreUndefined) opts.ignoreUndefined = options.ignoreUndefined; | ||
// Execute command | ||
@@ -416,2 +417,8 @@ topology.command(f("%s.$cmd", d), writeCommand, opts, callback); | ||
// Set up the serialize and ignoreUndefined fields | ||
var serializeFunctions = typeof options.serializeFunctions == 'boolean' | ||
? options.serializeFunctions : false; | ||
var ignoreUndefined = typeof options.ignoreUndefined == 'boolean' | ||
? options.ignoreUndefined : false; | ||
// Build Query object | ||
@@ -421,2 +428,3 @@ var query = new Query(bson, commandns, findCmd, { | ||
, checkKeys: false, returnFieldSelector: null | ||
, serializeFunctions: serializeFunctions, ignoreUndefined: ignoreUndefined | ||
}); | ||
@@ -455,6 +463,15 @@ | ||
// Serialize functions | ||
var serializeFunctions = typeof options.serializeFunctions == 'boolean' | ||
? options.serializeFunctions : false; | ||
// Set up the serialize and ignoreUndefined fields | ||
var ignoreUndefined = typeof options.ignoreUndefined == 'boolean' | ||
? options.ignoreUndefined : false; | ||
// Build Query object | ||
var query = new Query(bson, f('%s.$cmd', parts.shift()), finalCmd, { | ||
numberToSkip: 0, numberToReturn: -1 | ||
, checkKeys: false | ||
, checkKeys: false, serializeFunctions: serializeFunctions | ||
, ignoreUndefined: ignoreUndefined | ||
}); | ||
@@ -461,0 +478,0 @@ |
@@ -32,2 +32,3 @@ "use strict"; | ||
this.serializeFunctions = typeof options.serializeFunctions == 'boolean' ? options.serializeFunctions : false; | ||
this.ignoreUndefined = typeof options.ignoreUndefined == 'boolean' ? options.ignoreUndefined : false; | ||
this.checkKeys = typeof options.checkKeys == 'boolean' ? options.checkKeys : true; | ||
@@ -62,3 +63,4 @@ this.continueOnError = typeof options.continueOnError == 'boolean' ? options.continueOnError : false; | ||
, true | ||
, this.serializeFunctions); | ||
, this.serializeFunctions | ||
, 0, this.ignoreUndefined); | ||
@@ -142,2 +144,3 @@ // Document is larger than maxBsonObjectSize, terminate serialization | ||
this.serializeFunctions = typeof options.serializeFunctions == 'boolean' ? options.serializeFunctions : false; | ||
this.ignoreUndefined = typeof options.ignoreUndefined == 'boolean' ? options.ignoreUndefined : false; | ||
this.checkKeys = typeof options.checkKeys == 'boolean' ? options.checkKeys : false; | ||
@@ -179,3 +182,4 @@ | ||
, true | ||
, this.serializeFunctions); | ||
, this.serializeFunctions | ||
, 0, this.ignoreUndefined); | ||
buffers.push(selector); | ||
@@ -188,3 +192,4 @@ totalLength = totalLength + selector.length; | ||
, true | ||
, this.serializeFunctions); | ||
, this.serializeFunctions | ||
, 0, this.ignoreUndefined); | ||
buffers.push(update); | ||
@@ -261,2 +266,3 @@ totalLength = totalLength + update.length; | ||
this.serializeFunctions = typeof options.serializeFunctions == 'boolean' ? options.serializeFunctions : false; | ||
this.ignoreUndefined = typeof options.ignoreUndefined == 'boolean' ? options.ignoreUndefined : false; | ||
this.checkKeys = typeof options.checkKeys == 'boolean' ? options.checkKeys : false; | ||
@@ -295,3 +301,4 @@ | ||
, true | ||
, this.serializeFunctions); | ||
, this.serializeFunctions | ||
, 0, this.ignoreUndefined); | ||
buffers.push(selector); | ||
@@ -298,0 +305,0 @@ totalLength = totalLength + selector.length; |
{ | ||
"name": "mongodb-core", | ||
"version": "1.2.12", | ||
"version": "1.2.13", | ||
"description": "Core MongoDB driver functionality, no bells and whistles and meant for integration not end applications", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
431063
8644