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
• Remove six deprecated MongoDB connection options from driver
• Update test cases to remove deprecated option references
• Update CI and sample configuration files accordingly
• Add migration guide for deprecated MongoDB options
• Removed six deprecated MongoDB connection options from validOptionNames array
• Removed options: appname, fsync, j, useNewUrlParser, useUnifiedTopology, wtimeout
• Removed associated TODO comment about removal in next major version
• Added new MongoDB section documenting removed connection options
• Created migration table showing deprecated options and their replacements
• Moved getMongoRepository and getMongoManager deprecation section earlier in MongoDB section
• Provided clear migration paths for each removed option
Removed MongoDB options are now silently ignored (not forwarded to the MongoDB driver) with no
validation/warning, which can change behavior for existing configs—especially write-concern related
options—and be very hard to diagnose.
- // Undocumented deprecated options- // todo: remove next major version- "appname",- "fsync",- "j",- "useNewUrlParser",- "useUnifiedTopology",- "wtimeout",
Evidence
MongoDriver only forwards allowlisted keys to MongoClient via buildConnectionOptions, while
validateOptions is effectively empty; after this PR, the removed keys are no longer allowlisted, so
they will be dropped without any user-visible warning/error.
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution
## Issue description
MongoDB deprecated options were removed from the forwarding allowlist. Today, if users still provide these keys (either as top-level DataSource options in JS, or via MongoDB URL query params), TypeORM will silently ignore them because `buildConnectionOptions()` only forwards allowlisted keys and `validateOptions()` does nothing.
This creates a silent misconfiguration mode and may change behavior (notably for write concern-related options) without any diagnostics.
## Issue Context
- URL query params are parsed into a flat object and merged into driver options.
- Only keys in `validOptionNames` are forwarded to the MongoDB driver.
- The PR removed several keys from `validOptionNames`, so they are now dropped.
## Fix Focus Areas
- src/driver/mongodb/MongoDriver.ts[160-211]
- src/driver/mongodb/MongoDriver.ts[521-527]
- src/driver/mongodb/MongoDriver.ts[575-595]
- src/driver/DriverUtils.ts[250-307]
## Suggested approach
1. After options are fully built (post-URL-parse merge), detect presence of removed keys: `appname`, `fsync`, `j`, `useNewUrlParser`, `useUnifiedTopology`, `wtimeout`.
2. Throw a clear `TypeORMError` (or log a deprecation-removal warning) describing how to migrate.
3. (Optional) Add a small compatibility mapping for the non-nested equivalents where safe:
- `appname` -> `appName`
- `wtimeout` -> `wtimeoutMS`
Keep `fsync`/`j` as hard errors (or map into `writeConcern` if you explicitly support that), but still warn/throw.
4. Add/adjust a test to assert that providing one of the removed options causes the expected warning/error.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
2. Silent Mongo option drop 🐞 Bug⛯ Reliability
Description
Removed MongoDB options are now silently ignored (not forwarded to the MongoDB driver) with no
validation/warning, which can change behavior for existing configs—especially write-concern related
options—and be very hard to diagnose.
- // Undocumented deprecated options- // todo: remove next major version- "appname",- "fsync",- "j",- "useNewUrlParser",- "useUnifiedTopology",- "wtimeout",
Evidence
MongoDriver only forwards allowlisted keys to MongoClient via buildConnectionOptions, while
validateOptions is effectively empty; after this PR, the removed keys are no longer allowlisted, so
they will be dropped without any user-visible warning/error.
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution
## Issue description
MongoDB deprecated options were removed from the forwarding allowlist. Today, if users still provide these keys (either as top-level DataSource options in JS, or via MongoDB URL query params), TypeORM will silently ignore them because `buildConnectionOptions()` only forwards allowlisted keys and `validateOptions()` does nothing.
This creates a silent misconfiguration mode and may change behavior (notably for write concern-related options) without any diagnostics.
## Issue Context
- URL query params are parsed into a flat object and merged into driver options.
- Only keys in `validOptionNames` are forwarded to the MongoDB driver.
- The PR removed several keys from `validOptionNames`, so they are now dropped.
## Fix Focus Areas
- src/driver/mongodb/MongoDriver.ts[160-211]
- src/driver/mongodb/MongoDriver.ts[521-527]
- src/driver/mongodb/MongoDriver.ts[575-595]
- src/driver/DriverUtils.ts[250-307]
## Suggested approach
1. After options are fully built (post-URL-parse merge), detect presence of removed keys: `appname`, `fsync`, `j`, `useNewUrlParser`, `useUnifiedTopology`, `wtimeout`.
2. Throw a clear `TypeORMError` (or log a deprecation-removal warning) describing how to migrate.
3. (Optional) Add a small compatibility mapping for the non-nested equivalents where safe:
- `appname` -> `appName`
- `wtimeout` -> `wtimeoutMS`
Keep `fsync`/`j` as hard errors (or map into `writeConcern` if you explicitly support that), but still warn/throw.
4. Add/adjust a test to assert that providing one of the removed options causes the expected warning/error.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
3. Issue test not functional 📘 Rule violation⛯ Reliability
Description
The PR updates MongoDB URL parsing coverage only in test/github-issues, not in test/functional
as required for issue-related test coverage. This risks regressions slipping past the functional
suite and violates the testing location policy.
describe("github issues > #7437 MongoDB options never parse in connectionUrl and after my fix was parse incorrect", () => {
it("should parse options in ConnectionUrl", () => {
const options = DriverUtils.buildMongoDBDriverOptions({
- url: "mongodb://testuser:testpwd@test-primary.example.com:27017/testdb?retryWrites=true&w=majority&useUnifiedTopology=true",+ url: "mongodb://testuser:testpwd@test-primary.example.com:27017/testdb?retryWrites=true&w=majority",
})
Evidence
Compliance ID 3 requires issue fixes/coverage to live in test/functional, but the updated parsing
assertion remains in an issue-scoped test under test/github-issues/7437. The diff shows the
URL/options assertion being modified in that location rather than adding/updating a functional test.
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution
## Issue description
The PR modifies MongoDB URL parsing coverage only in `test/github-issues`, but the compliance requirement prefers issue fixes/coverage to be in the functional test suite.
## Issue Context
The updated test for MongoDB URL options parsing remains under `test/github-issues/7437`, which is discouraged as the primary/only validation location for behavioral changes.
## Fix Focus Areas
- test/github-issues/7437/issue-7437.test.ts[5-34]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
4. URI migration guidance gap 🐞 Bug✓ Correctness
Description
The migration guide recommends replacing removed options with nested writeConcern/camelCase keys,
but it doesn’t clarify what to do for connection-string-only setups where TypeORM only parses flat
query params and does not translate aliases/casing.
+## MongoDB++### Deprecated connection options removed++The following MongoDB connection options have been removed:++| Removed option | Action |+| -------------------- | ------------------------------------------------ |+| `appname` | Use `appName` (camelCase) instead |+| `fsync` | Use `writeConcern: { journal: true }` instead |+| `j` | Use `writeConcern: { journal: true }` instead |+| `useNewUrlParser` | Remove — no-op since MongoDB Driver v4.0 |+| `useUnifiedTopology` | Remove — no-op since MongoDB Driver v4.0 |+| `wtimeout` | Use `writeConcern: { wtimeoutMS: 2500 }` instead |+
Evidence
TypeORM’s MongoDB URL parser copies query parameters as flat key/value pairs without alias
translation, and MongoDriver only forwards allowlisted keys. Therefore, URI users who previously
used appname/wtimeout/j/fsync in the query string will see them dropped, and the guide
doesn’t explicitly call out the URI-specific replacements (e.g., appName=... or wtimeoutMS=...)
or the need to move these settings into object options.
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution
## Issue description
The migration guide lists replacements for removed MongoDB connection options, but it doesn’t explicitly explain how to migrate if a user configures MongoDB exclusively via the connection string query params. In TypeORM, URI query params are parsed as a flat map and aliases/casing are not translated.
## Issue Context
- `parseMongoDBConnectionUrl()` copies query params as-is into a flat object.
- Only allowlisted keys are forwarded to the MongoDB driver.
- Some replacements in the guide are expressed as nested objects (`writeConcern: { ... }`), which users cannot represent directly in a URI.
## Fix Focus Areas
- docs/docs/guides/8-migration-v1.md[94-108]
- src/driver/DriverUtils.ts[250-307]
## Suggested doc improvements
1. Add a short note under the table like:
- "If you configure MongoDB via a URI query string, use `appName` (camelCase) and `wtimeoutMS` (not `wtimeout`) as query params, or move write concern options into `DataSource` options."
2. Provide a URI example:
- `mongodb://.../db?retryWrites=true&w=majority&appName=myapp&wtimeoutMS=2500`
3. For `j`/`fsync`, explicitly say they cannot be migrated via URI query params in TypeORM and should be expressed via `writeConcern` in the DataSource options.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
5. URI migration guidance gap 🐞 Bug✓ Correctness
Description
The migration guide recommends replacing removed options with nested writeConcern/camelCase keys,
but it doesn’t clarify what to do for connection-string-only setups where TypeORM only parses flat
query params and does not translate aliases/casing.
+## MongoDB++### Deprecated connection options removed++The following MongoDB connection options have been removed:++| Removed option | Action |+| -------------------- | ------------------------------------------------ |+| `appname` | Use `appName` (camelCase) instead |+| `fsync` | Use `writeConcern: { journal: true }` instead |+| `j` | Use `writeConcern: { journal: true }` instead |+| `useNewUrlParser` | Remove — no-op since MongoDB Driver v4.0 |+| `useUnifiedTopology` | Remove — no-op since MongoDB Driver v4.0 |+| `wtimeout` | Use `writeConcern: { wtimeoutMS: 2500 }` instead |+
Evidence
TypeORM’s MongoDB URL parser copies query parameters as flat key/value pairs without alias
translation, and MongoDriver only forwards allowlisted keys. Therefore, URI users who previously
used appname/wtimeout/j/fsync in the query string will see them dropped, and the guide
doesn’t explicitly call out the URI-specific replacements (e.g., appName=... or wtimeoutMS=...)
or the need to move these settings into object options.
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution
## Issue description
The migration guide lists replacements for removed MongoDB connection options, but it doesn’t explicitly explain how to migrate if a user configures MongoDB exclusively via the connection string query params. In TypeORM, URI query params are parsed as a flat map and aliases/casing are not translated.
## Issue Context
- `parseMongoDBConnectionUrl()` copies query params as-is into a flat object.
- Only allowlisted keys are forwarded to the MongoDB driver.
- Some replacements in the guide are expressed as nested objects (`writeConcern: { ... }`), which users cannot represent directly in a URI.
## Fix Focus Areas
- docs/docs/guides/8-migration-v1.md[94-108]
- src/driver/DriverUtils.ts[250-307]
## Suggested doc improvements
1. Add a short note under the table like:
- "If you configure MongoDB via a URI query string, use `appName` (camelCase) and `wtimeoutMS` (not `wtimeout`) as query params, or move write concern options into `DataSource` options."
2. Provide a URI example:
- `mongodb://.../db?retryWrites=true&w=majority&appName=myapp&wtimeoutMS=2500`
3. For `j`/`fsync`, explicitly say they cannot be migrated via URI query params in TypeORM and should be expressed via `writeConcern` in the DataSource options.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
6. Changelog now misleading 🐞 Bug✓ Correctness
Description
After documenting removal of useUnifiedTopology in the migration guide, the repo changelog still
states it was added as a supported config parameter, which may confuse upgrades and conflict with
the new guide.
+## MongoDB++### Deprecated connection options removed++The following MongoDB connection options have been removed:++| Removed option | Action |+| -------------------- | ------------------------------------------------ |+| `appname` | Use `appName` (camelCase) instead |+| `fsync` | Use `writeConcern: { journal: true }` instead |+| `j` | Use `writeConcern: { journal: true }` instead |+| `useNewUrlParser` | Remove — no-op since MongoDB Driver v4.0 |+| `useUnifiedTopology` | Remove — no-op since MongoDB Driver v4.0 |+| `wtimeout` | Use `writeConcern: { wtimeoutMS: 2500 }` instead |
Evidence
The PR’s migration guide explicitly states useUnifiedTopology was removed, but the existing
changelog still advertises it as a config feature, which can send mixed signals to users reading
historical docs during upgrades.
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution
## Issue description
Migration docs now say `useUnifiedTopology` is removed, but CHANGELOG.md still contains an entry that it was added as a config parameter. While historically true, it becomes misleading in the context of upgrades.
## Issue Context
Users often consult CHANGELOG during upgrades; conflicting signals between the migration guide and changelog can slow debugging/migrations.
## Fix Focus Areas
- CHANGELOG.md[1913-1918]
- docs/docs/guides/8-migration-v1.md[94-107]
## Suggested approach
1. Add a short follow-up entry in an appropriate section (or a v1 changelog area) that explicitly states the option was removed in v1.
2. Optionally cross-link to the migration guide section for MongoDB deprecated options removal.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
7. Changelog now misleading 🐞 Bug✓ Correctness
Description
After documenting removal of useUnifiedTopology in the migration guide, the repo changelog still
states it was added as a supported config parameter, which may confuse upgrades and conflict with
the new guide.
+## MongoDB++### Deprecated connection options removed++The following MongoDB connection options have been removed:++| Removed option | Action |+| -------------------- | ------------------------------------------------ |+| `appname` | Use `appName` (camelCase) instead |+| `fsync` | Use `writeConcern: { journal: true }` instead |+| `j` | Use `writeConcern: { journal: true }` instead |+| `useNewUrlParser` | Remove — no-op since MongoDB Driver v4.0 |+| `useUnifiedTopology` | Remove — no-op since MongoDB Driver v4.0 |+| `wtimeout` | Use `writeConcern: { wtimeoutMS: 2500 }` instead |
Evidence
The PR’s migration guide explicitly states useUnifiedTopology was removed, but the existing
changelog still advertises it as a config feature, which can send mixed signals to users reading
historical docs during upgrades.
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution
## Issue description
Migration docs now say `useUnifiedTopology` is removed, but CHANGELOG.md still contains an entry that it was added as a config parameter. While historically true, it becomes misleading in the context of upgrades.
## Issue Context
Users often consult CHANGELOG during upgrades; conflicting signals between the migration guide and changelog can slow debugging/migrations.
## Fix Focus Areas
- CHANGELOG.md[1913-1918]
- docs/docs/guides/8-migration-v1.md[94-107]
## Suggested approach
1. Add a short follow-up entry in an appropriate section (or a v1 changelog area) that explicitly states the option was removed in v1.
2. Optionally cross-link to the migration guide section for MongoDB deprecated options removal.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
ⓘ The new review experience is currently in Beta. Learn more
Removed MongoDB options are now silently ignored (not forwarded to the MongoDB driver) with no
validation/warning, which can change behavior for existing configs—especially write-concern related
options—and be very hard to diagnose.
- // Undocumented deprecated options- // todo: remove next major version- "appname",- "fsync",- "j",- "useNewUrlParser",- "useUnifiedTopology",- "wtimeout",
Evidence
MongoDriver only forwards allowlisted keys to MongoClient via buildConnectionOptions, while
validateOptions is effectively empty; after this PR, the removed keys are no longer allowlisted, so
they will be dropped without any user-visible warning/error.
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution
## Issue description
MongoDB deprecated options were removed from the forwarding allowlist. Today, if users still provide these keys (either as top-level DataSource options in JS, or via MongoDB URL query params), TypeORM will silently ignore them because `buildConnectionOptions()` only forwards allowlisted keys and `validateOptions()` does nothing.
This creates a silent misconfiguration mode and may change behavior (notably for write concern-related options) without any diagnostics.
## Issue Context
- URL query params are parsed into a flat object and merged into driver options.
- Only keys in `validOptionNames` are forwarded to the MongoDB driver.
- The PR removed several keys from `validOptionNames`, so they are now dropped.
## Fix Focus Areas
- src/driver/mongodb/MongoDriver.ts[160-211]
- src/driver/mongodb/MongoDriver.ts[521-527]
- src/driver/mongodb/MongoDriver.ts[575-595]
- src/driver/DriverUtils.ts[250-307]
## Suggested approach
1. After options are fully built (post-URL-parse merge), detect presence of removed keys: `appname`, `fsync`, `j`, `useNewUrlParser`, `useUnifiedTopology`, `wtimeout`.
2. Throw a clear `TypeORMError` (or log a deprecation-removal warning) describing how to migrate.
3. (Optional) Add a small compatibility mapping for the non-nested equivalents where safe:
- `appname` -> `appName`
- `wtimeout` -> `wtimeoutMS`
Keep `fsync`/`j` as hard errors (or map into `writeConcern` if you explicitly support that), but still warn/throw.
4. Add/adjust a test to assert that providing one of the removed options causes the expected warning/error.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
2. Issue test not functional 📘 Rule violation⛯ Reliability⭐ New
Description
The PR updates MongoDB URL parsing coverage only in test/github-issues, not in test/functional
as required for issue-related test coverage. This risks regressions slipping past the functional
suite and violates the testing location policy.
describe("github issues > #7437 MongoDB options never parse in connectionUrl and after my fix was parse incorrect", () => {
it("should parse options in ConnectionUrl", () => {
const options = DriverUtils.buildMongoDBDriverOptions({
- url: "mongodb://testuser:testpwd@test-primary.example.com:27017/testdb?retryWrites=true&w=majority&useUnifiedTopology=true",+ url: "mongodb://testuser:testpwd@test-primary.example.com:27017/testdb?retryWrites=true&w=majority",
})
Evidence
Compliance ID 3 requires issue fixes/coverage to live in test/functional, but the updated parsing
assertion remains in an issue-scoped test under test/github-issues/7437. The diff shows the
URL/options assertion being modified in that location rather than adding/updating a functional test.
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution
## Issue description
The PR modifies MongoDB URL parsing coverage only in `test/github-issues`, but the compliance requirement prefers issue fixes/coverage to be in the functional test suite.
## Issue Context
The updated test for MongoDB URL options parsing remains under `test/github-issues/7437`, which is discouraged as the primary/only validation location for behavioral changes.
## Fix Focus Areas
- test/github-issues/7437/issue-7437.test.ts[5-34]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
3. URI migration guidance gap 🐞 Bug✓ Correctness
Description
The migration guide recommends replacing removed options with nested writeConcern/camelCase keys,
but it doesn’t clarify what to do for connection-string-only setups where TypeORM only parses flat
query params and does not translate aliases/casing.
+## MongoDB++### Deprecated connection options removed++The following MongoDB connection options have been removed:++| Removed option | Action |+| -------------------- | ------------------------------------------------ |+| `appname` | Use `appName` (camelCase) instead |+| `fsync` | Use `writeConcern: { journal: true }` instead |+| `j` | Use `writeConcern: { journal: true }` instead |+| `useNewUrlParser` | Remove — no-op since MongoDB Driver v4.0 |+| `useUnifiedTopology` | Remove — no-op since MongoDB Driver v4.0 |+| `wtimeout` | Use `writeConcern: { wtimeoutMS: 2500 }` instead |+
Evidence
TypeORM’s MongoDB URL parser copies query parameters as flat key/value pairs without alias
translation, and MongoDriver only forwards allowlisted keys. Therefore, URI users who previously
used appname/wtimeout/j/fsync in the query string will see them dropped, and the guide
doesn’t explicitly call out the URI-specific replacements (e.g., appName=... or wtimeoutMS=...)
or the need to move these settings into object options.
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution
## Issue description
The migration guide lists replacements for removed MongoDB connection options, but it doesn’t explicitly explain how to migrate if a user configures MongoDB exclusively via the connection string query params. In TypeORM, URI query params are parsed as a flat map and aliases/casing are not translated.
## Issue Context
- `parseMongoDBConnectionUrl()` copies query params as-is into a flat object.
- Only allowlisted keys are forwarded to the MongoDB driver.
- Some replacements in the guide are expressed as nested objects (`writeConcern: { ... }`), which users cannot represent directly in a URI.
## Fix Focus Areas
- docs/docs/guides/8-migration-v1.md[94-108]
- src/driver/DriverUtils.ts[250-307]
## Suggested doc improvements
1. Add a short note under the table like:
- "If you configure MongoDB via a URI query string, use `appName` (camelCase) and `wtimeoutMS` (not `wtimeout`) as query params, or move write concern options into `DataSource` options."
2. Provide a URI example:
- `mongodb://.../db?retryWrites=true&w=majority&appName=myapp&wtimeoutMS=2500`
3. For `j`/`fsync`, explicitly say they cannot be migrated via URI query params in TypeORM and should be expressed via `writeConcern` in the DataSource options.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
4. Changelog now misleading 🐞 Bug✓ Correctness
Description
After documenting removal of useUnifiedTopology in the migration guide, the repo changelog still
states it was added as a supported config parameter, which may confuse upgrades and conflict with
the new guide.
+## MongoDB++### Deprecated connection options removed++The following MongoDB connection options have been removed:++| Removed option | Action |+| -------------------- | ------------------------------------------------ |+| `appname` | Use `appName` (camelCase) instead |+| `fsync` | Use `writeConcern: { journal: true }` instead |+| `j` | Use `writeConcern: { journal: true }` instead |+| `useNewUrlParser` | Remove — no-op since MongoDB Driver v4.0 |+| `useUnifiedTopology` | Remove — no-op since MongoDB Driver v4.0 |+| `wtimeout` | Use `writeConcern: { wtimeoutMS: 2500 }` instead |
Evidence
The PR’s migration guide explicitly states useUnifiedTopology was removed, but the existing
changelog still advertises it as a config feature, which can send mixed signals to users reading
historical docs during upgrades.
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution
## Issue description
Migration docs now say `useUnifiedTopology` is removed, but CHANGELOG.md still contains an entry that it was added as a config parameter. While historically true, it becomes misleading in the context of upgrades.
## Issue Context
Users often consult CHANGELOG during upgrades; conflicting signals between the migration guide and changelog can slow debugging/migrations.
## Fix Focus Areas
- CHANGELOG.md[1913-1918]
- docs/docs/guides/8-migration-v1.md[94-107]
## Suggested approach
1. Add a short follow-up entry in an appropriate section (or a v1 changelog area) that explicitly states the option was removed in v1.
2. Optionally cross-link to the migration guide section for MongoDB deprecated options removal.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
Removed MongoDB options are now silently ignored (not forwarded to the MongoDB driver) with no
validation/warning, which can change behavior for existing configs—especially write-concern related
options—and be very hard to diagnose.
- // Undocumented deprecated options- // todo: remove next major version- "appname",- "fsync",- "j",- "useNewUrlParser",- "useUnifiedTopology",- "wtimeout",
Evidence
MongoDriver only forwards allowlisted keys to MongoClient via buildConnectionOptions, while
validateOptions is effectively empty; after this PR, the removed keys are no longer allowlisted, so
they will be dropped without any user-visible warning/error.
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution
## Issue description
MongoDB deprecated options were removed from the forwarding allowlist. Today, if users still provide these keys (either as top-level DataSource options in JS, or via MongoDB URL query params), TypeORM will silently ignore them because `buildConnectionOptions()` only forwards allowlisted keys and `validateOptions()` does nothing.
This creates a silent misconfiguration mode and may change behavior (notably for write concern-related options) without any diagnostics.
## Issue Context
- URL query params are parsed into a flat object and merged into driver options.
- Only keys in `validOptionNames` are forwarded to the MongoDB driver.
- The PR removed several keys from `validOptionNames`, so they are now dropped.
## Fix Focus Areas
- src/driver/mongodb/MongoDriver.ts[160-211]
- src/driver/mongodb/MongoDriver.ts[521-527]
- src/driver/mongodb/MongoDriver.ts[575-595]
- src/driver/DriverUtils.ts[250-307]
## Suggested approach
1. After options are fully built (post-URL-parse merge), detect presence of removed keys: `appname`, `fsync`, `j`, `useNewUrlParser`, `useUnifiedTopology`, `wtimeout`.
2. Throw a clear `TypeORMError` (or log a deprecation-removal warning) describing how to migrate.
3. (Optional) Add a small compatibility mapping for the non-nested equivalents where safe:
- `appname` -> `appName`
- `wtimeout` -> `wtimeoutMS`
Keep `fsync`/`j` as hard errors (or map into `writeConcern` if you explicitly support that), but still warn/throw.
4. Add/adjust a test to assert that providing one of the removed options causes the expected warning/error.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
2. URI migration guidance gap 🐞 Bug✓ Correctness
Description
The migration guide recommends replacing removed options with nested writeConcern/camelCase keys,
but it doesn’t clarify what to do for connection-string-only setups where TypeORM only parses flat
query params and does not translate aliases/casing.
+## MongoDB++### Deprecated connection options removed++The following MongoDB connection options have been removed:++| Removed option | Action |+| -------------------- | ------------------------------------------------ |+| `appname` | Use `appName` (camelCase) instead |+| `fsync` | Use `writeConcern: { journal: true }` instead |+| `j` | Use `writeConcern: { journal: true }` instead |+| `useNewUrlParser` | Remove — no-op since MongoDB Driver v4.0 |+| `useUnifiedTopology` | Remove — no-op since MongoDB Driver v4.0 |+| `wtimeout` | Use `writeConcern: { wtimeoutMS: 2500 }` instead |+
Evidence
TypeORM’s MongoDB URL parser copies query parameters as flat key/value pairs without alias
translation, and MongoDriver only forwards allowlisted keys. Therefore, URI users who previously
used appname/wtimeout/j/fsync in the query string will see them dropped, and the guide
doesn’t explicitly call out the URI-specific replacements (e.g., appName=... or wtimeoutMS=...)
or the need to move these settings into object options.
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution
## Issue description
The migration guide lists replacements for removed MongoDB connection options, but it doesn’t explicitly explain how to migrate if a user configures MongoDB exclusively via the connection string query params. In TypeORM, URI query params are parsed as a flat map and aliases/casing are not translated.
## Issue Context
- `parseMongoDBConnectionUrl()` copies query params as-is into a flat object.
- Only allowlisted keys are forwarded to the MongoDB driver.
- Some replacements in the guide are expressed as nested objects (`writeConcern: { ... }`), which users cannot represent directly in a URI.
## Fix Focus Areas
- docs/docs/guides/8-migration-v1.md[94-108]
- src/driver/DriverUtils.ts[250-307]
## Suggested doc improvements
1. Add a short note under the table like:
- "If you configure MongoDB via a URI query string, use `appName` (camelCase) and `wtimeoutMS` (not `wtimeout`) as query params, or move write concern options into `DataSource` options."
2. Provide a URI example:
- `mongodb://.../db?retryWrites=true&w=majority&appName=myapp&wtimeoutMS=2500`
3. For `j`/`fsync`, explicitly say they cannot be migrated via URI query params in TypeORM and should be expressed via `writeConcern` in the DataSource options.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
3. Changelog now misleading 🐞 Bug✧ Quality
Description
After documenting removal of useUnifiedTopology in the migration guide, the repo changelog still
states it was added as a supported config parameter, which may confuse upgrades and conflict with
the new guide.
+## MongoDB++### Deprecated connection options removed++The following MongoDB connection options have been removed:++| Removed option | Action |+| -------------------- | ------------------------------------------------ |+| `appname` | Use `appName` (camelCase) instead |+| `fsync` | Use `writeConcern: { journal: true }` instead |+| `j` | Use `writeConcern: { journal: true }` instead |+| `useNewUrlParser` | Remove — no-op since MongoDB Driver v4.0 |+| `useUnifiedTopology` | Remove — no-op since MongoDB Driver v4.0 |+| `wtimeout` | Use `writeConcern: { wtimeoutMS: 2500 }` instead |
Evidence
The PR’s migration guide explicitly states useUnifiedTopology was removed, but the existing
changelog still advertises it as a config feature, which can send mixed signals to users reading
historical docs during upgrades.
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution
## Issue description
Migration docs now say `useUnifiedTopology` is removed, but CHANGELOG.md still contains an entry that it was added as a config parameter. While historically true, it becomes misleading in the context of upgrades.
## Issue Context
Users often consult CHANGELOG during upgrades; conflicting signals between the migration guide and changelog can slow debugging/migrations.
## Fix Focus Areas
- CHANGELOG.md[1913-1918]
- docs/docs/guides/8-migration-v1.md[94-107]
## Suggested approach
1. Add a short follow-up entry in an appropriate section (or a v1 changelog area) that explicitly states the option was removed in v1.
2. Optionally cross-link to the migration guide section for MongoDB deprecated options removal.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Removes six deprecated MongoDB connection options from
MongoDriver.validOptionNames:useNewUrlParser— no-op since MongoDB Driver v4.0useUnifiedTopology— no-op since MongoDB Driver v4.0appname— replaced byappName(camelCase), already in the listfsync— deprecated write concern option, usewriteConcern: { journal: true }j— deprecated write concern option, usewriteConcern: { journal: true }wtimeout— deprecated write concern option, usewriteConcern: { wtimeoutMS: ... }These were either no-ops or deprecated aliases since MongoDB Node.js Driver v4.0.0 and only produced deprecation warnings in CI logs.
Also updates CI/sample config files, the URL-parsing test, and adds a migration guide entry.
Part of #11603.