diff --git a/lib/mongo_client.js b/lib/mongo_client.js index 85c1b0eb4a..a98204caa4 100644 --- a/lib/mongo_client.js +++ b/lib/mongo_client.js @@ -46,6 +46,7 @@ var validOptionNames = [ 'autoReconnect', 'noDelay', 'keepAlive', + 'keepAliveInitialDelay', 'connectTimeoutMS', 'family', 'socketTimeoutMS', @@ -77,7 +78,6 @@ var validOptionNames = [ 'promoteBuffers', 'promoteLongs', 'domainsEnabled', - 'keepAliveInitialDelay', 'checkServerIdentity', 'validateOptions', 'appname', @@ -89,7 +89,6 @@ var validOptionNames = [ 'fsync', 'readPreferenceTags', 'numberOfRetries', - 'autoReconnect', 'auto_reconnect' ]; @@ -137,10 +136,11 @@ function validOptions(options) { * @param {Buffer} [options.sslCRL=undefined] SSL Certificate revocation list binary buffer * @param {boolean} [options.autoReconnect=true] Enable autoReconnect for single server instances * @param {boolean} [options.noDelay=true] TCP Connection no delay - * @param {boolean} [options.keepAlive=0] The number of milliseconds to wait before initiating keepAlive on the TCP socket. + * @param {boolean} [options.keepAlive=true] TCP Connection keep alive enabled + * @param {boolean} [options.keepAliveInitialDelay=30000] The number of milliseconds to wait before initiating keepAlive on the TCP socket. * @param {number} [options.connectTimeoutMS=30000] TCP Connection timeout setting * @param {number} [options.family=4] Version of IP stack. Defaults to 4. - * @param {number} [options.socketTimeoutMS=30000] TCP Socket timeout setting + * @param {number} [options.socketTimeoutMS=360000] TCP Socket timeout setting * @param {number} [options.reconnectTries=30] Server attempt to reconnect #times * @param {number} [options.reconnectInterval=1000] Server will wait # milliseconds between retries * @param {boolean} [options.ha=true] Control if high availability monitoring runs for Replicaset or Mongos proxies. @@ -168,10 +168,20 @@ function validOptions(options) { * @param {object} [options.logger=undefined] Custom logger object * @param {boolean} [options.promoteValues=true] Promotes BSON values to native types where possible, set to false to only receive wrapper types. * @param {boolean} [options.promoteBuffers=false] Promotes Binary BSON values to native Node Buffers. - * @param {boolean} [options.promoteLongs=true] Promotes Long values to number if they fit inside the 53 bits resolution. + * @param {boolean} [options.promoteLongs=true] Promotes long values to number if they fit inside the 53 bits resolution. * @param {boolean} [options.domainsEnabled=false] Enable the wrapping of the callback in the current domain, disabled by default to avoid perf hit. * @param {boolean|function} [options.checkServerIdentity=true] Ensure we check server identify during SSL, set to false to disable checking. Only works for Node 0.12.x or higher. You can pass in a boolean or your own checkServerIdentity override function. * @param {object} [options.validateOptions=false] Validate MongoClient passed in options for correctness. + * @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. + * @param {string} [options.auth.user=undefined] The username for auth + * @param {string} [options.auth.password=undefined] The password for auth + * @param {string} [options.authMechanism=undefined] Mechanism for authentication: MDEFAULT, GSSAPI, PLAIN, MONGODB-X509, SCRAM-SHA-1 or MONGODB-CR + * @param {object} [options.compression=null] Type of compression to use: snappy or zlib + * @param {boolean} [options.fsync=false] Specify a file sync write concern + * @param {array} [options.readPreferenceTags=null] Read preference tags + * @param {number} [options.numberOfRetries=5] The number of retries for a tailable cursor + * @param {boolean} [options.auto_reconnect=true] Enable autoReconnect for single server instances + * @param {MongoClient~connectCallback} [callback] The command result callback * @return {MongoClient} a MongoClient instance. */ function MongoClient(url, options) { @@ -389,7 +399,8 @@ MongoClient.prototype.isConnected = function(options) { * @param {Buffer} [options.sslCRL=undefined] SSL Certificate revocation list binary buffer * @param {boolean} [options.autoReconnect=true] Enable autoReconnect for single server instances * @param {boolean} [options.noDelay=true] TCP Connection no delay - * @param {boolean} [options.keepAlive=30000] The number of milliseconds to wait before initiating keepAlive on the TCP socket. + * @param {boolean} [options.keepAlive=true] TCP Connection keep alive enabled + * @param {boolean} [options.keepAliveInitialDelay=30000] The number of milliseconds to wait before initiating keepAlive on the TCP socket. * @param {number} [options.connectTimeoutMS=30000] TCP Connection timeout setting * @param {number} [options.family=4] Version of IP stack. Defaults to 4. * @param {number} [options.socketTimeoutMS=360000] TCP Socket timeout setting @@ -420,13 +431,19 @@ MongoClient.prototype.isConnected = function(options) { * @param {object} [options.logger=undefined] Custom logger object * @param {boolean} [options.promoteValues=true] Promotes BSON values to native types where possible, set to false to only receive wrapper types. * @param {boolean} [options.promoteBuffers=false] Promotes Binary BSON values to native Node Buffers. - * @param {boolean} [options.promoteLongs=true] Promotes Long values to number if they fit inside the 53 bits resolution. + * @param {boolean} [options.promoteLongs=true] Promotes long values to number if they fit inside the 53 bits resolution. * @param {boolean} [options.domainsEnabled=false] Enable the wrapping of the callback in the current domain, disabled by default to avoid perf hit. * @param {boolean|function} [options.checkServerIdentity=true] Ensure we check server identify during SSL, set to false to disable checking. Only works for Node 0.12.x or higher. You can pass in a boolean or your own checkServerIdentity override function. - * @param {string} [options.auth.user=undefined] The username for auth - * @param {string} [options.auth.password=undefined] The username for auth - * @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. * @param {object} [options.validateOptions=false] Validate MongoClient passed in options for correctness. + * @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. + * @param {string} [options.auth.user=undefined] The username for auth + * @param {string} [options.auth.password=undefined] The password for auth + * @param {string} [options.authMechanism=undefined] Mechanism for authentication: MDEFAULT, GSSAPI, PLAIN, MONGODB-X509, SCRAM-SHA-1 or MONGODB-CR + * @param {object} [options.compression=null] Type of compression to use: snappy or zlib + * @param {boolean} [options.fsync=false] Specify a file sync write concern + * @param {array} [options.readPreferenceTags=null] Read preference tags + * @param {number} [options.numberOfRetries=5] The number of retries for a tailable cursor + * @param {boolean} [options.auto_reconnect=true] Enable autoReconnect for single server instances * @param {MongoClient~connectCallback} [callback] The command result callback * @return {Promise} returns Promise if no callback passed */