You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// See https://github.com/mongodb/node-mongodb-native/blob/3.7/lib/mongo_client.js#L94
234
+
// See https://www.mongodb.com/docs/manual/reference/connection-string
234
235
constvalidOptionNames=[
235
-
'poolSize',
236
-
'ssl',
237
-
'sslValidate',
238
-
'sslCA',
239
-
'sslCert',
240
-
'sslKey',
241
-
'sslPass',
242
-
'sslCRL',
236
+
'replicaSet',
237
+
/** Enables or disables TLS/SSL for the connection. */
243
238
'tls',
239
+
/** A boolean to enable or disables TLS/SSL for the connection. (The ssl option is equivalent to the tls option.) */
240
+
'ssl',
241
+
/**
242
+
* Specifies the location of a local TLS Certificate
243
+
* @deprecated Will be removed in the next major version. Please use tlsCertificateKeyFile instead.
244
+
*/
245
+
'tlsCertificateFile',
246
+
/** Specifies the location of a local .pem file that contains either the client's TLS/SSL certificate and key or only the client's TLS/SSL key when tlsCertificateFile is used to provide the certificate. */
244
247
'tlsCertificateKeyFile',
248
+
/** Specifies the password to de-crypt the tlsCertificateKeyFile. */
245
249
'tlsCertificateKeyFilePassword',
250
+
/** Specifies the location of a local .pem file that contains the root certificate chain from the Certificate Authority. This file is used to validate the certificate presented by the mongod/mongos instance. */
251
+
'tlsCAFile',
252
+
/** Bypasses validation of the certificates presented by the mongod/mongos instance */
246
253
'tlsAllowInvalidCertificates',
254
+
/** Disables hostname validation of the certificate presented by the mongod/mongos instance. */
247
255
'tlsAllowInvalidHostnames',
256
+
/** Disables various certificate validations. */
248
257
'tlsInsecure',
249
-
'tlsCAFile',
250
-
'autoReconnect',
251
-
'noDelay',
252
-
'keepAlive',
253
-
'keepAliveInitialDelay',
258
+
/** The time in milliseconds to attempt a connection before timing out. */
254
259
'connectTimeoutMS',
255
-
'serverSelectionTimeoutMS',
256
-
'family',
260
+
/** The time in milliseconds to attempt a send or receive on a socket before the attempt times out. */
257
261
'socketTimeoutMS',
258
-
'reconnectTries',
259
-
'reconnectInterval',
260
-
'ha',
261
-
'haInterval',
262
-
'replicaSet',
263
-
'secondaryAcceptableLatencyMS',
264
-
'acceptableLatencyMS',
265
-
'connectWithNoPrimary',
266
-
'authSource',
267
-
'forceServerObjectId',
268
-
'serializeFunctions',
269
-
'ignoreUndefined',
270
-
'raw',
271
-
'bufferMaxEntries',
272
-
'readPreference',
273
-
'pkFactory',
274
-
'promiseLibrary',
262
+
/** An array or comma-delimited string of compressors to enable network compression for communication between this client and a mongod/mongos instance. */
263
+
'compressors',
264
+
/** An integer that specifies the compression level if using zlib for network compression. */
265
+
'zlibCompressionLevel',
266
+
/** The maximum number of hosts to connect to when using an srv connection string, a setting of `0` means unlimited hosts */
* Querying this DNS URI is expected to respond with SRV records
274
+
*/
275
+
'srvServiceName',
276
+
/** The maximum number of connections in the connection pool. */
277
+
'maxPoolSize',
278
+
/** The minimum number of connections in the connection pool. */
279
+
'minPoolSize',
280
+
/** The maximum number of connections that may be in the process of being established concurrently by the connection pool. */
281
+
'maxConnecting',
282
+
/** The maximum number of milliseconds that a connection can remain idle in the pool before being removed and closed. */
283
+
'maxIdleTimeMS',
284
+
/** The maximum time in milliseconds that a thread can wait for a connection to become available. */
285
+
'waitQueueTimeoutMS',
286
+
/** Specify a read concern for the collection (only MongoDB 3.2 or higher supported) */
275
287
'readConcern',
288
+
/** The level of isolation */
289
+
'readConcernLevel',
290
+
/** Specifies the read preferences for this connection */
291
+
'readPreference',
292
+
/** Specifies, in seconds, how stale a secondary can be before the client stops using it for read operations. */
276
293
'maxStalenessSeconds',
277
-
'loggerLevel',
278
-
'logger',
279
-
'promoteValues',
280
-
'promoteBuffers',
281
-
'promoteLongs',
282
-
'domainsEnabled',
283
-
'checkServerIdentity',
284
-
'validateOptions',
285
-
'appname',
294
+
/** Specifies the tags document as a comma-separated list of colon-separated key-value pairs. */
295
+
'readPreferenceTags',
296
+
/** The auth settings for when connection to server. */
286
297
'auth',
298
+
/** Specify the database name associated with the user’s credentials. */
299
+
'authSource',
300
+
/** Specify the authentication mechanism that MongoDB will use to authenticate the connection. */
287
301
'authMechanism',
288
-
'compression',
289
-
'readPreferenceTags',
290
-
'numberOfRetries',
291
-
'auto_reconnect',
292
-
'minSize',
293
-
'useNewUrlParser',
294
-
'useUnifiedTopology',
295
-
'writeConcern',
296
-
// Ignored options
297
-
'native_parser',
298
-
// Legacy options
299
-
'server',
300
-
'replset',
301
-
'replSet',
302
-
'mongos',
303
-
'db',
302
+
/** Specify properties for the specified authMechanism as a comma-separated list of colon-separated key-value pairs. */
303
+
'authMechanismProperties',
304
+
/** The size (in milliseconds) of the latency window for selecting among multiple suitable MongoDB instances. */
305
+
'localThresholdMS',
306
+
/** Specifies how long (in milliseconds) to block for server selection before throwing an exception. */
307
+
'serverSelectionTimeoutMS',
308
+
/** heartbeatFrequencyMS controls when the driver checks the state of the MongoDB deployment. Specify the interval (in milliseconds) between checks, counted from the end of the previous check until the beginning of the next one. */
309
+
'heartbeatFrequencyMS',
310
+
/** Sets the minimum heartbeat frequency. In the event that the driver has to frequently re-check a server's availability, it will wait at least this long since the previous check to avoid wasted effort. */
311
+
'minHeartbeatFrequencyMS',
312
+
/** 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 */
313
+
'appName',
314
+
/** Enables retryable reads. */
315
+
'retryReads',
316
+
/** Enable retryable writes. */
317
+
'retryWrites',
318
+
/** Allow a driver to force a Single topology type with a connection string containing one host */
319
+
'directConnection',
320
+
/** Instruct the driver it is connecting to a load balancer fronting a mongos like service */
321
+
'loadBalanced',
322
+
/**
323
+
* The write concern w value
324
+
* @deprecated Please use the `writeConcern` option instead
325
+
*/
304
326
'w',
305
-
'wtimeout',
306
-
'j',
327
+
/**
328
+
* The write concern timeout
329
+
* @deprecated Please use the `writeConcern` option instead
330
+
*/
331
+
'wtimeoutMS',
332
+
/**
333
+
* The journal write concern
334
+
* @deprecated Please use the `writeConcern` option instead
335
+
*/
307
336
'journal',
308
-
'fsync',
337
+
/**
338
+
* A MongoDB WriteConcern, which describes the level of acknowledgement
* Validate mongod server certificate against Certificate Authority
346
+
* @deprecated Will be removed in the next major version. Please use tlsAllowInvalidCertificates instead.
347
+
*/
348
+
'sslValidate',
349
+
/**
350
+
* SSL Certificate file path.
351
+
* @deprecated Will be removed in the next major version. Please use tlsCAFile instead.
352
+
*/
353
+
'sslCA',
354
+
/**
355
+
* SSL Certificate file path.
356
+
* @deprecated Will be removed in the next major version. Please use tlsCertificateKeyFile instead.
357
+
*/
358
+
'sslCert',
359
+
/**
360
+
* SSL Key file file path.
361
+
* @deprecated Will be removed in the next major version. Please use tlsCertificateKeyFile instead.
362
+
*/
363
+
'sslKey',
364
+
/**
365
+
* SSL Certificate pass phrase.
366
+
* @deprecated Will be removed in the next major version. Please use tlsCertificateKeyFilePassword instead.
367
+
*/
368
+
'sslPass',
369
+
/**
370
+
* SSL Certificate revocation list file path.
371
+
* @deprecated Will be removed in the next major version. Please use tlsCertificateKeyFile instead.
372
+
*/
373
+
'sslCRL',
374
+
/** TCP Connection no delay */
375
+
'noDelay',
376
+
/** @deprecated TCP Connection keep alive enabled. Will not be able to turn off in the future. */
377
+
'keepAlive',
378
+
/**
379
+
* @deprecated The number of milliseconds to wait before initiating keepAlive on the TCP socket.
380
+
* Will not be configurable in the future.
381
+
*/
382
+
'keepAliveInitialDelay',
383
+
/** Force server to assign `_id` values instead of driver */
384
+
'forceServerObjectId',
385
+
/** A primary key factory function for generation of custom `_id` keys */
386
+
'pkFactory',
387
+
/** Enable command monitoring for this client */
388
+
'monitorCommands',
389
+
/** Server API version */
390
+
'serverApi',
391
+
/**
392
+
* Optionally enable in-use auto encryption
393
+
*
394
+
* @remarks
395
+
* Automatic encryption is an enterprise only feature that only applies to operations on a collection. Automatic encryption is not supported for operations on a database or view, and operations that are not bypassed will result in error
396
+
* (see [libmongocrypt: Auto Encryption Allow-List](https://github.com/mongodb/specifications/blob/master/source/client-side-encryption/client-side-encryption.rst#libmongocrypt-auto-encryption-allow-list)). To bypass automatic encryption for all operations, set bypassAutoEncryption=true in AutoEncryptionOpts.
397
+
*
398
+
* Automatic encryption requires the authenticated user to have the [listCollections privilege action](https://www.mongodb.com/docs/manual/reference/command/listCollections/#dbcmd.listCollections).
399
+
*
400
+
* If a MongoClient with a limited connection pool size (i.e a non-zero maxPoolSize) is configured with AutoEncryptionOptions, a separate internal MongoClient is created if any of the following are true:
401
+
* - AutoEncryptionOptions.keyVaultClient is not passed.
402
+
* - AutoEncryptionOptions.bypassAutomaticEncryption is false.
403
+
*
404
+
* If an internal MongoClient is created, it is configured with the same options as the parent MongoClient except minPoolSize is set to 0 and AutoEncryptionOptions is omitted.
405
+
*/
406
+
'autoEncryption',
407
+
/** Allows a wrapping driver to amend the client metadata generated by the driver to include information about the wrapping driver */
408
+
'driverInfo',
409
+
/** Configures a Socks5 proxy host used for creating TCP connections. */
410
+
'proxyHost',
411
+
/** Configures a Socks5 proxy port used for creating TCP connections. */
412
+
'proxyPort',
413
+
/** Configures a Socks5 proxy username when the proxy in proxyHost requires username/password authentication. */
414
+
'proxyUsername',
415
+
/** Configures a Socks5 proxy password when the proxy in proxyHost requires username/password authentication. */
0 commit comments