Skip to content

Commit fde6e5d

Browse files
Jessica Lordmbroadst
Jessica Lord
authored andcommitted
fix(docs): Represent each valid option in docs in both places
1 parent 4819a7b commit fde6e5d

File tree

1 file changed

+27
-10
lines changed

1 file changed

+27
-10
lines changed

lib/mongo_client.js

+27-10
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ var validOptionNames = [
4646
'autoReconnect',
4747
'noDelay',
4848
'keepAlive',
49+
'keepAliveInitialDelay',
4950
'connectTimeoutMS',
5051
'family',
5152
'socketTimeoutMS',
@@ -77,7 +78,6 @@ var validOptionNames = [
7778
'promoteBuffers',
7879
'promoteLongs',
7980
'domainsEnabled',
80-
'keepAliveInitialDelay',
8181
'checkServerIdentity',
8282
'validateOptions',
8383
'appname',
@@ -89,7 +89,6 @@ var validOptionNames = [
8989
'fsync',
9090
'readPreferenceTags',
9191
'numberOfRetries',
92-
'autoReconnect',
9392
'auto_reconnect'
9493
];
9594

@@ -137,10 +136,11 @@ function validOptions(options) {
137136
* @param {Buffer} [options.sslCRL=undefined] SSL Certificate revocation list binary buffer
138137
* @param {boolean} [options.autoReconnect=true] Enable autoReconnect for single server instances
139138
* @param {boolean} [options.noDelay=true] TCP Connection no delay
140-
* @param {boolean} [options.keepAlive=0] The number of milliseconds to wait before initiating keepAlive on the TCP socket.
139+
* @param {boolean} [options.keepAlive=true] TCP Connection keep alive enabled
140+
* @param {boolean} [options.keepAliveInitialDelay=30000] The number of milliseconds to wait before initiating keepAlive on the TCP socket.
141141
* @param {number} [options.connectTimeoutMS=30000] TCP Connection timeout setting
142142
* @param {number} [options.family=4] Version of IP stack. Defaults to 4.
143-
* @param {number} [options.socketTimeoutMS=30000] TCP Socket timeout setting
143+
* @param {number} [options.socketTimeoutMS=360000] TCP Socket timeout setting
144144
* @param {number} [options.reconnectTries=30] Server attempt to reconnect #times
145145
* @param {number} [options.reconnectInterval=1000] Server will wait # milliseconds between retries
146146
* @param {boolean} [options.ha=true] Control if high availability monitoring runs for Replicaset or Mongos proxies.
@@ -168,10 +168,20 @@ function validOptions(options) {
168168
* @param {object} [options.logger=undefined] Custom logger object
169169
* @param {boolean} [options.promoteValues=true] Promotes BSON values to native types where possible, set to false to only receive wrapper types.
170170
* @param {boolean} [options.promoteBuffers=false] Promotes Binary BSON values to native Node Buffers.
171-
* @param {boolean} [options.promoteLongs=true] Promotes Long values to number if they fit inside the 53 bits resolution.
171+
* @param {boolean} [options.promoteLongs=true] Promotes long values to number if they fit inside the 53 bits resolution.
172172
* @param {boolean} [options.domainsEnabled=false] Enable the wrapping of the callback in the current domain, disabled by default to avoid perf hit.
173173
* @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.
174174
* @param {object} [options.validateOptions=false] Validate MongoClient passed in options for correctness.
175+
* @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.
176+
* @param {string} [options.auth.user=undefined] The username for auth
177+
* @param {string} [options.auth.password=undefined] The password for auth
178+
* @param {string} [options.authMechanism=undefined] Mechanism for authentication: MDEFAULT, GSSAPI, PLAIN, MONGODB-X509, SCRAM-SHA-1 or MONGODB-CR
179+
* @param {object} [options.compression=null] Type of compression to use: snappy or zlib
180+
* @param {boolean} [options.fsync=false] Specify a file sync write concern
181+
* @param {array} [options.readPreferenceTags=null] Read preference tags
182+
* @param {number} [options.numberOfRetries=5] The number of retries for a tailable cursor
183+
* @param {boolean} [options.auto_reconnect=true] Enable autoReconnect for single server instances
184+
* @param {MongoClient~connectCallback} [callback] The command result callback
175185
* @return {MongoClient} a MongoClient instance.
176186
*/
177187
function MongoClient(url, options) {
@@ -389,7 +399,8 @@ MongoClient.prototype.isConnected = function(options) {
389399
* @param {Buffer} [options.sslCRL=undefined] SSL Certificate revocation list binary buffer
390400
* @param {boolean} [options.autoReconnect=true] Enable autoReconnect for single server instances
391401
* @param {boolean} [options.noDelay=true] TCP Connection no delay
392-
* @param {boolean} [options.keepAlive=30000] The number of milliseconds to wait before initiating keepAlive on the TCP socket.
402+
* @param {boolean} [options.keepAlive=true] TCP Connection keep alive enabled
403+
* @param {boolean} [options.keepAliveInitialDelay=30000] The number of milliseconds to wait before initiating keepAlive on the TCP socket.
393404
* @param {number} [options.connectTimeoutMS=30000] TCP Connection timeout setting
394405
* @param {number} [options.family=4] Version of IP stack. Defaults to 4.
395406
* @param {number} [options.socketTimeoutMS=360000] TCP Socket timeout setting
@@ -420,13 +431,19 @@ MongoClient.prototype.isConnected = function(options) {
420431
* @param {object} [options.logger=undefined] Custom logger object
421432
* @param {boolean} [options.promoteValues=true] Promotes BSON values to native types where possible, set to false to only receive wrapper types.
422433
* @param {boolean} [options.promoteBuffers=false] Promotes Binary BSON values to native Node Buffers.
423-
* @param {boolean} [options.promoteLongs=true] Promotes Long values to number if they fit inside the 53 bits resolution.
434+
* @param {boolean} [options.promoteLongs=true] Promotes long values to number if they fit inside the 53 bits resolution.
424435
* @param {boolean} [options.domainsEnabled=false] Enable the wrapping of the callback in the current domain, disabled by default to avoid perf hit.
425436
* @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.
426-
* @param {string} [options.auth.user=undefined] The username for auth
427-
* @param {string} [options.auth.password=undefined] The username for auth
428-
* @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.
429437
* @param {object} [options.validateOptions=false] Validate MongoClient passed in options for correctness.
438+
* @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.
439+
* @param {string} [options.auth.user=undefined] The username for auth
440+
* @param {string} [options.auth.password=undefined] The password for auth
441+
* @param {string} [options.authMechanism=undefined] Mechanism for authentication: MDEFAULT, GSSAPI, PLAIN, MONGODB-X509, SCRAM-SHA-1 or MONGODB-CR
442+
* @param {object} [options.compression=null] Type of compression to use: snappy or zlib
443+
* @param {boolean} [options.fsync=false] Specify a file sync write concern
444+
* @param {array} [options.readPreferenceTags=null] Read preference tags
445+
* @param {number} [options.numberOfRetries=5] The number of retries for a tailable cursor
446+
* @param {boolean} [options.auto_reconnect=true] Enable autoReconnect for single server instances
430447
* @param {MongoClient~connectCallback} [callback] The command result callback
431448
* @return {Promise} returns Promise if no callback passed
432449
*/

0 commit comments

Comments
 (0)