-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
Closed
Description
What was unclear or otherwise insufficient?
I can't use options from mongoDb 6, for example maxPoolSize, otherwise I get error that poolSize is not supported.
buildConnectionOptions(options) {
const mongoOptions = {};
for (let index = 0; index < this.validOptionNames.length; index++) {
const optionName = this.validOptionNames[index];
if (options.extra && optionName in options.extra) {
mongoOptions[optionName] = options.extra[optionName];
}
else if (optionName in options) {
mongoOptions[optionName] = options[optionName];
}
}
return mongoOptions;
}
validOptionNames is invalid here.
For mySql its looks like this
return Object.assign({}, {
resourceArn: options.resourceArn,
secretArn: options.secretArn,
database: options.database,
region: options.region,
type: options.type,
}, {
host: credentials.host,
user: credentials.username,
password: credentials.password,
database: credentials.database,
port: credentials.port,
ssl: options.ssl,
}, options.extra || {});
Fix may be looks like this
buildConnectionOptions(options) {
const mongoOptions = {};
for (let index = 0; index < this.validOptionNames.length; index++) {
const optionName = this.validOptionNames[index];
if (optionName in options) {
mongoOptions[optionName] = options[optionName];
}
}
return Object.assign(mongoOptions, options.extra ?? {});
}
Recommended Fix
Give posibility add any extra (with options.extra) connection options
Additional Context
No response
Are you willing to resolve this issue by submitting a Pull Request?
No, I don’t have the time and I’m okay to wait for the community / maintainers to resolve this issue.