feat: Add support for more MongoDB driver options (#9911)

This commit is contained in:
Manuel
2025-11-07 21:41:59 +01:00
committed by GitHub
parent 412406915f
commit cff451eabd
5 changed files with 372 additions and 21 deletions

View File

@@ -638,6 +638,70 @@ export interface DatabaseOptions {
autoSelectFamily: ?boolean;
/* The MongoDB driver option to specify the amount of time in milliseconds to wait for a connection attempt to finish before trying the next address when using the autoSelectFamily option. If set to a positive integer less than 10, the value 10 is used instead. */
autoSelectFamilyAttemptTimeout: ?number;
/* The MongoDB driver option to specify the maximum number of connections that may be in the process of being established concurrently by the connection pool. */
maxConnecting: ?number;
/* The MongoDB driver option to specify the maximum time in milliseconds that a thread can wait for a connection to become available. */
waitQueueTimeoutMS: ?number;
/* The MongoDB driver option to specify the name of the replica set, if the mongod is a member of a replica set. */
replicaSet: ?string;
/* The MongoDB driver option to force a Single topology type with a connection string containing one host. */
directConnection: ?boolean;
/* The MongoDB driver option to instruct the driver it is connecting to a load balancer fronting a mongos like service. */
loadBalanced: ?boolean;
/* The MongoDB driver option to specify the size (in milliseconds) of the latency window for selecting among multiple suitable MongoDB instances. */
localThresholdMS: ?number;
/* The MongoDB driver option to specify the maximum number of hosts to connect to when using an srv connection string, a setting of 0 means unlimited hosts. */
srvMaxHosts: ?number;
/* The MongoDB driver option to modify the srv URI service name. */
srvServiceName: ?string;
/* The MongoDB driver option to enable or disable TLS/SSL for the connection. */
tls: ?boolean;
/* The MongoDB driver option to enable or disable TLS/SSL for the connection (equivalent to tls option). */
ssl: ?boolean;
/* The MongoDB driver option to specify the location of a local .pem file that contains the client's TLS/SSL certificate and key. */
tlsCertificateKeyFile: ?string;
/* The MongoDB driver option to specify the password to decrypt the tlsCertificateKeyFile. */
tlsCertificateKeyFilePassword: ?string;
/* The MongoDB driver option to specify the location of a local .pem file that contains the root certificate chain from the Certificate Authority. */
tlsCAFile: ?string;
/* The MongoDB driver option to bypass validation of the certificates presented by the mongod/mongos instance. */
tlsAllowInvalidCertificates: ?boolean;
/* The MongoDB driver option to disable hostname validation of the certificate presented by the mongod/mongos instance. */
tlsAllowInvalidHostnames: ?boolean;
/* The MongoDB driver option to disable various certificate validations. */
tlsInsecure: ?boolean;
/* The MongoDB driver option to specify an array or comma-delimited string of compressors to enable network compression for communication between this client and a mongod/mongos instance. */
compressors: ?(string[] | string);
/* The MongoDB driver option to specify the compression level if using zlib for network compression (0-9). */
zlibCompressionLevel: ?number;
/* The MongoDB driver option to specify the read preferences for this connection. */
readPreference: ?string;
/* The MongoDB driver option to specify the tags document as a comma-separated list of colon-separated key-value pairs. */
readPreferenceTags: ?(any[]);
/* The MongoDB driver option to specify the level of isolation. */
readConcernLevel: ?string;
/* The MongoDB driver option to specify the database name associated with the user's credentials. */
authSource: ?string;
/* The MongoDB driver option to specify the authentication mechanism that MongoDB will use to authenticate the connection. */
authMechanism: ?string;
/* The MongoDB driver option to specify properties for the specified authMechanism as a comma-separated list of colon-separated key-value pairs. */
authMechanismProperties: ?any;
/* The MongoDB driver option to specify the name of the application that created this MongoClient instance. */
appName: ?string;
/* The MongoDB driver option to enable retryable reads. */
retryReads: ?boolean;
/* The MongoDB driver option to force server to assign _id values instead of driver. */
forceServerObjectId: ?boolean;
/* The MongoDB driver option to instruct the driver monitors to use a specific monitoring mode. */
serverMonitoringMode: ?string;
/* The MongoDB driver option to configure a Socks5 proxy host used for creating TCP connections. */
proxyHost: ?string;
/* The MongoDB driver option to configure a Socks5 proxy port used for creating TCP connections. */
proxyPort: ?number;
/* The MongoDB driver option to configure a Socks5 proxy username when the proxy requires username/password authentication. */
proxyUsername: ?string;
/* The MongoDB driver option to configure a Socks5 proxy password when the proxy requires username/password authentication. */
proxyPassword: ?string;
/* Set to `true` to automatically create indexes on the email field of the _User collection on server start. Set to `false` to skip index creation. Default is `true`.<br><br>⚠️ When setting this option to `false` to manually create the index, keep in mind that the otherwise automatically created index may change in the future to be optimized for the internal usage by Parse Server.
:DEFAULT: true */
createIndexUserEmail: ?boolean;