fix: add directConnection options to MongoDB connection (#9955)

Co-authored-by: afournier <afournier@solocal.com>
This commit is contained in:
Alexis Fournier 2023-04-17 18:03:00 +02:00 committed by GitHub
parent 68aa573262
commit e0165e75ee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 10 additions and 0 deletions

View File

@ -506,6 +506,8 @@ Different RDBMS-es have their own specific options.
- `authMechanism` - Sets the authentication mechanism that MongoDB will use to authenticate the connection.
- `directConnection` - Specifies whether to force dispatch all operations to the specified host.
## `sql.js` data source options
- `database`: The raw UInt8Array database that should be imported.

View File

@ -375,6 +375,8 @@
- `authMechanism` - 设置MongoDB用于验证连接的身份验证机制。
- `directConnection` - 指定是否强制将所有操作分派到指定的主机。
> 注: 由于译者对MongoDB理解不够深入故一些翻译直接使用了机翻因此会有些词不达意如有更好的翻译选项请提交PR进行完善。
## `sql.js`

View File

@ -46,6 +46,11 @@ export interface MongoConnectionOptions extends BaseDataSourceOptions {
*/
readonly database?: string
/**
* Specifies whether to force dispatch all operations to the specified host. Default: false
*/
readonly directConnection?: boolean
/**
* The driver object
* This defaults to require("mongodb")

View File

@ -217,6 +217,7 @@ export class MongoDriver implements Driver {
"useUnifiedTopology",
"autoEncryption",
"retryWrites",
"directConnection",
]
cteCapabilities: CteCapabilities = {