Skip to content

Commit 61aaa3d

Browse files
committed
doc: document options supported by the unified topology
This documents three new options supported when the unified topology is enabled. Additionally, documentation between the two connect methods has been synchronized. NODE-2534
1 parent f778ef5 commit 61aaa3d

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

lib/mongo_client.js

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,9 @@ const validOptions = require('./operations/connect').validOptions;
143143
* @param {number} [options.minSize] If present, the connection pool will be initialized with minSize connections, and will never dip below minSize connections
144144
* @param {boolean} [options.useNewUrlParser=true] Determines whether or not to use the new url parser. Enables the new, spec-compliant, url parser shipped in the core driver. This url parser fixes a number of problems with the original parser, and aims to outright replace that parser in the near future. Defaults to true, and must be explicitly set to false to use the legacy url parser.
145145
* @param {boolean} [options.useUnifiedTopology] Enables the new unified topology layer
146+
* @param {Number} [options.localThresholdMS=15] **Only applies to the unified topology** The size of the latency window for selecting among multiple suitable servers
147+
* @param {Number} [options.serverSelectionTimeoutMS=30000] **Only applies to the unified topology** How long to block for server selection before throwing an error
148+
* @param {Number} [options.heartbeatFrequencyMS=10000] **Only applies to the unified topology** The frequency with which topology updates are scheduled
146149
* @param {AutoEncrypter~AutoEncryptionOptions} [options.autoEncryption] Optionally enable client side auto encryption
147150
* @param {DriverInfoOptions} [options.driverInfo] Allows a wrapping driver to amend the client metadata generated by the driver to include information about the wrapping driver
148151
* @param {MongoClient~connectCallback} [callback] The command result callback
@@ -344,7 +347,7 @@ MongoClient.prototype.isConnected = function(options) {
344347
* @param {object} [options] Optional settings
345348
* @param {number} [options.poolSize=5] The maximum size of the individual server pool
346349
* @param {boolean} [options.ssl=false] Enable SSL connection. *deprecated* use `tls` variants
347-
* @param {boolean} [options.sslValidate=false] Validate mongod server certificate against Certificate Authority *deprecated* use `tls` variants
350+
* @param {boolean} [options.sslValidate=false] Validate mongod server certificate against Certificate Authority
348351
* @param {buffer} [options.sslCA=undefined] SSL Certificate store binary buffer *deprecated* use `tls` variants
349352
* @param {buffer} [options.sslCert=undefined] SSL Certificate binary buffer *deprecated* use `tls` variants
350353
* @param {buffer} [options.sslKey=undefined] SSL Key file binary buffer *deprecated* use `tls` variants
@@ -361,7 +364,7 @@ MongoClient.prototype.isConnected = function(options) {
361364
* @param {boolean} [options.autoReconnect=true] Enable autoReconnect for single server instances
362365
* @param {boolean} [options.noDelay=true] TCP Connection no delay
363366
* @param {boolean} [options.keepAlive=true] TCP Connection keep alive enabled
364-
* @param {boolean} [options.keepAliveInitialDelay=30000] The number of milliseconds to wait before initiating keepAlive on the TCP socket
367+
* @param {number} [options.keepAliveInitialDelay=30000] The number of milliseconds to wait before initiating keepAlive on the TCP socket
365368
* @param {number} [options.connectTimeoutMS=10000] How long to wait for a connection to be established before timing out
366369
* @param {number} [options.socketTimeoutMS=360000] How long a send or receive on a socket can take before timing out
367370
* @param {number} [options.family] Version of IP stack. Can be 4, 6 or null (default).
@@ -405,7 +408,15 @@ MongoClient.prototype.isConnected = function(options) {
405408
* @param {array} [options.readPreferenceTags] Read preference tags
406409
* @param {number} [options.numberOfRetries=5] The number of retries for a tailable cursor
407410
* @param {boolean} [options.auto_reconnect=true] Enable auto reconnecting for single server instances
411+
* @param {boolean} [options.monitorCommands=false] Enable command monitoring for this client
408412
* @param {number} [options.minSize] If present, the connection pool will be initialized with minSize connections, and will never dip below minSize connections
413+
* @param {boolean} [options.useNewUrlParser=true] Determines whether or not to use the new url parser. Enables the new, spec-compliant, url parser shipped in the core driver. This url parser fixes a number of problems with the original parser, and aims to outright replace that parser in the near future. Defaults to true, and must be explicitly set to false to use the legacy url parser.
414+
* @param {boolean} [options.useUnifiedTopology] Enables the new unified topology layer
415+
* @param {Number} [options.localThresholdMS=15] **Only applies to the unified topology** The size of the latency window for selecting among multiple suitable servers
416+
* @param {Number} [options.serverSelectionTimeoutMS=30000] **Only applies to the unified topology** How long to block for server selection before throwing an error
417+
* @param {Number} [options.heartbeatFrequencyMS=10000] **Only applies to the unified topology** The frequency with which topology updates are scheduled
418+
* @param {AutoEncrypter~AutoEncryptionOptions} [options.autoEncryption] Optionally enable client side auto encryption
419+
* @param {DriverInfoOptions} [options.driverInfo] Allows a wrapping driver to amend the client metadata generated by the driver to include information about the wrapping driver
409420
* @param {MongoClient~connectCallback} [callback] The command result callback
410421
* @return {Promise<MongoClient>} returns Promise if no callback passed
411422
*/

0 commit comments

Comments
 (0)