DatabaseOptions

Properties
NameTypeDescription
allowPublicExplainBoolean

Set to true to allow Parse.Query.explain without master key.

⚠️ Enabling this option may expose sensitive query performance data to unauthorized users and could potentially be exploited for malicious purposes.

appNameString

The MongoDB driver option to specify the name of the application that created this MongoClient instance.

authMechanismString

The MongoDB driver option to specify the authentication mechanism that MongoDB will use to authenticate the connection.

authMechanismPropertiesAny

The MongoDB driver option to specify properties for the specified authMechanism as a comma-separated list of colon-separated key-value pairs.

authSourceString

The MongoDB driver option to specify the database name associated with the user's credentials.

autoSelectFamilyBoolean

The MongoDB driver option to set whether the socket attempts to connect to IPv6 and IPv4 addresses until a connection is established. If available, the driver will select the first IPv6 address.

autoSelectFamilyAttemptTimeoutNumber

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.

batchSizeNumber

The number of documents per batch for MongoDB cursor getMore operations. A lower value reduces memory usage per batch; a higher value reduces the number of network round-trips.

clientMetadataDatabaseOptionsClientMetadata

Custom metadata to append to database client connections for identifying Parse Server instances in database logs. If set, this metadata will be visible in database logs during connection handshakes. This can help with debugging and monitoring in deployments with multiple database clients. Set name to identify your application (e.g., 'MyApp') and version to your application's version. Leave undefined (default) to disable this feature and avoid the additional data transfer overhead.

compressorsUnion

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.

connectTimeoutMSNumber

The MongoDB driver option to specify the amount of time, in milliseconds, to wait to establish a single TCP socket connection to the server before raising an error. Specifying 0 disables the connection timeout.

createIndexRoleNameBoolean

Set to true to automatically create a unique index on the name field of the _Role collection on server start. Set to false to skip index creation. Default is true.

⚠️ 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.

createIndexUserEmailBoolean

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.

⚠️ 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.

createIndexUserEmailCaseInsensitiveBoolean

Set to true to automatically create a case-insensitive index on the email field of the _User collection on server start. Set to false to skip index creation. Default is true.

⚠️ 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.

createIndexUserEmailVerifyTokenBoolean

Set to true to automatically create an index on the _email_verify_token field of the _User collection on server start. Set to false to skip index creation. Default is true.

⚠️ 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.

createIndexUserPasswordResetTokenBoolean

Set to true to automatically create an index on the _perishable_token field of the _User collection on server start. Set to false to skip index creation. Default is true.

⚠️ 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.

createIndexUserUsernameBoolean

Set to true to automatically create indexes on the username field of the _User collection on server start. Set to false to skip index creation. Default is true.

⚠️ 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.

createIndexUserUsernameCaseInsensitiveBoolean

Set to true to automatically create a case-insensitive index on the username field of the _User collection on server start. Set to false to skip index creation. Default is true.

⚠️ 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.

directConnectionBoolean

The MongoDB driver option to force a Single topology type with a connection string containing one host.

disableIndexFieldValidationBoolean

Set to true to disable validation of index fields. When disabled, indexes can be created even if the fields do not exist in the schema. This can be useful when creating indexes on fields that will be added later.

enableSchemaHooksBoolean

Enables database real-time hooks to update single schema cache. Set to true if using multiple Parse Servers instances connected to the same database. Failing to do so will cause a schema change to not propagate to all instances and re-syncing will only happen when the instances restart. To use this feature with MongoDB, a replica set cluster with change stream support is required.

forceServerObjectIdBoolean

The MongoDB driver option to force server to assign _id values instead of driver.

heartbeatFrequencyMSNumber

The MongoDB driver option to specify the frequency in milliseconds at which the driver checks the state of the MongoDB deployment.

loadBalancedBoolean

The MongoDB driver option to instruct the driver it is connecting to a load balancer fronting a mongos like service.

localThresholdMSNumber

The MongoDB driver option to specify the size (in milliseconds) of the latency window for selecting among multiple suitable MongoDB instances.

logClientEventsArray.<LogClientEvent>

An array of MongoDB client event configurations to enable logging of specific events.

maxConnectingNumber

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.

maxIdleTimeMSNumber

The MongoDB driver option to specify the amount of time in milliseconds that a connection can remain idle in the connection pool before being removed and closed.

maxPoolSizeNumber

The MongoDB driver option to set the maximum number of opened, cached, ready-to-use database connections maintained by the driver.

maxStalenessSecondsNumber

The MongoDB driver option to set the maximum replication lag for reads from secondary nodes.

maxTimeMSNumber

The MongoDB driver option to set a cumulative time limit in milliseconds for processing operations on a cursor.

minPoolSizeNumber

The MongoDB driver option to set the minimum number of opened, cached, ready-to-use database connections maintained by the driver.

proxyHostString

The MongoDB driver option to configure a Socks5 proxy host used for creating TCP connections.

proxyPasswordString

The MongoDB driver option to configure a Socks5 proxy password when the proxy requires username/password authentication.

proxyPortNumber

The MongoDB driver option to configure a Socks5 proxy port used for creating TCP connections.

proxyUsernameString

The MongoDB driver option to configure a Socks5 proxy username when the proxy requires username/password authentication.

readConcernLevelString

The MongoDB driver option to specify the level of isolation.

readPreferenceString

The MongoDB driver option to specify the read preferences for this connection.

readPreferenceTagsArray.<Any>

The MongoDB driver option to specify the tags document as a comma-separated list of colon-separated key-value pairs.

replicaSetString

The MongoDB driver option to specify the name of the replica set, if the mongod is a member of a replica set.

retryReadsBoolean

The MongoDB driver option to enable retryable reads.

retryWritesBoolean

The MongoDB driver option to set whether to retry failed writes.

schemaCacheTtlNumber

The duration in seconds after which the schema cache expires and will be refetched from the database. Use this option if using multiple Parse Servers instances connected to the same database. A low duration will cause the schema cache to be updated too often, causing unnecessary database reads. A high duration will cause the schema to be updated too rarely, increasing the time required until schema changes propagate to all server instances. This feature can be used as an alternative or in conjunction with the option enableSchemaHooks. Default is infinite which means the schema cache never expires.

serverMonitoringModeString

The MongoDB driver option to instruct the driver monitors to use a specific monitoring mode.

serverSelectionTimeoutMSNumber

The MongoDB driver option to specify the amount of time in milliseconds for a server to be considered suitable for selection.

socketTimeoutMSNumber

The MongoDB driver option to specify the amount of time, in milliseconds, spent attempting to send or receive on a socket before timing out. Specifying 0 means no timeout.

srvMaxHostsNumber

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.

srvServiceNameString

The MongoDB driver option to modify the srv URI service name.

sslBoolean

The MongoDB driver option to enable or disable TLS/SSL for the connection (equivalent to tls option).

tlsBoolean

The MongoDB driver option to enable or disable TLS/SSL for the connection.

tlsAllowInvalidCertificatesBoolean

The MongoDB driver option to bypass validation of the certificates presented by the mongod/mongos instance.

tlsAllowInvalidHostnamesBoolean

The MongoDB driver option to disable hostname validation of the certificate presented by the mongod/mongos instance.

tlsCAFileString

The MongoDB driver option to specify the location of a local .pem file that contains the root certificate chain from the Certificate Authority.

tlsCertificateKeyFileString

The MongoDB driver option to specify the location of a local .pem file that contains the client's TLS/SSL certificate and key.

tlsCertificateKeyFilePasswordString

The MongoDB driver option to specify the password to decrypt the tlsCertificateKeyFile.

tlsInsecureBoolean

The MongoDB driver option to disable various certificate validations.

waitQueueTimeoutMSNumber

The MongoDB driver option to specify the maximum time in milliseconds that a thread can wait for a connection to become available.

zlibCompressionLevelNumber

The MongoDB driver option to specify the compression level if using zlib for network compression (0-9).