Skip to content

refactor!: remove deprecated findByIds from Repository and EntityManager#12114

Merged
pkuczynski merged 12 commits intomasterfrom
refactor/remove-find-by-ids
Mar 11, 2026
Merged

refactor!: remove deprecated findByIds from Repository and EntityManager#12114
pkuczynski merged 12 commits intomasterfrom
refactor/remove-find-by-ids

Conversation

@pkuczynski
Copy link
Copy Markdown
Member

@pkuczynski pkuczynski commented Mar 6, 2026

Removes the deprecated findByIds method from all public APIs:

  • EntityManager.findByIds()
  • Repository.findByIds()
  • BaseEntity.findByIds()
  • MongoEntityManager.findByIds()
  • MongoRepository.findByIds()

The method was deprecated in favor of findBy with the In operator:

// Before
const users = await repository.findByIds([1, 2, 3])

// After
import { In } from "typeorm"
const users = await repository.findBy({ id: In([1, 2, 3]) })

Internal callers have been refactored:

  • PlainObjectToDatabaseEntityTransformer now uses createQueryBuilder().whereInIds().getMany()
  • SubjectDatabaseEntityLoader MongoDB path now uses createEntityCursor with _id.$in directly

Tests that directly called findByIds have been removed. Remaining test titles that referenced findByIds have been updated to reflect the actual methods being tested. The migration guide has been updated.

Closes #12077

Part of #11603.

@pkuczynski pkuczynski self-assigned this Mar 6, 2026
@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages bot commented Mar 6, 2026

Deploying typeorm with  Cloudflare Pages  Cloudflare Pages

Latest commit: 69ff7a8
Status: ✅  Deploy successful!
Preview URL: https://937a0d2d.typeorm.pages.dev
Branch Preview URL: https://refactor-remove-find-by-ids.typeorm.pages.dev

View logs

@qodo-free-for-open-source-projects
Copy link
Copy Markdown

Review Summary by Qodo

Remove deprecated findByIds method from all public APIs

🐞 Bug fix

Grey Divider

Walkthroughs

Description
• Remove deprecated findByIds method from public APIs
  - Removed from EntityManager, Repository, BaseEntity
  - Removed from MongoEntityManager, MongoRepository
• Refactor internal callers to use alternative approaches
  - PlainObjectToDatabaseEntityTransformer uses createQueryBuilder().whereInIds()
  - SubjectDatabaseEntityLoader uses createEntityCursor with _id.$in
• Remove tests that directly called findByIds
• Update test titles and migration guide documentation
Diagram
flowchart LR
  A["findByIds deprecated methods"] -->|removed from| B["EntityManager<br/>Repository<br/>BaseEntity"]
  A -->|removed from| C["MongoEntityManager<br/>MongoRepository"]
  D["Internal callers"] -->|refactored to| E["createQueryBuilder<br/>whereInIds"]
  D -->|refactored to| F["createEntityCursor<br/>_id.$in"]
  G["Tests & Docs"] -->|updated to| H["findBy with In operator"]
Loading

Grey Divider

File Changes

1. src/entity-manager/EntityManager.ts 🐞 Bug fix +0/-27

Remove findByIds method from EntityManager

src/entity-manager/EntityManager.ts


2. src/entity-manager/MongoEntityManager.ts 🐞 Bug fix +0/-62

Remove findByIds method from MongoEntityManager

src/entity-manager/MongoEntityManager.ts


3. src/repository/Repository.ts 🐞 Bug fix +0/-14

Remove findByIds method from Repository

src/repository/Repository.ts


View more (13)
4. src/repository/MongoRepository.ts 🐞 Bug fix +0/-15

Remove findByIds method from MongoRepository

src/repository/MongoRepository.ts


5. src/repository/BaseEntity.ts 🐞 Bug fix +0/-17

Remove findByIds static method from BaseEntity

src/repository/BaseEntity.ts


6. src/persistence/SubjectDatabaseEntityLoader.ts 🐞 Bug fix +39/-5

Refactor MongoDB path to use createEntityCursor

src/persistence/SubjectDatabaseEntityLoader.ts


7. src/query-builder/transformer/PlainObjectToDatabaseEntityTransformer.ts 🐞 Bug fix +7/-10

Refactor to use createQueryBuilder with whereInIds

src/query-builder/transformer/PlainObjectToDatabaseEntityTransformer.ts


8. test/functional/mongodb/basic/mongo-repository/mongo-repository.test.ts 🧪 Tests +0/-33

Remove test for findByIds with ObjectId and strings

test/functional/mongodb/basic/mongo-repository/mongo-repository.test.ts


9. test/functional/mongodb/basic/repository-actions/mongodb-repository-actions.test.ts 🧪 Tests +0/-16

Remove test assertions for findByIds method

test/functional/mongodb/basic/repository-actions/mongodb-repository-actions.test.ts


10. test/functional/repository/find-methods/repostiory-find-methods.test.ts 🧪 Tests +0/-30

Remove findByIds test suite

test/functional/repository/find-methods/repostiory-find-methods.test.ts


11. test/github-issues/1118/issue-1118.test.ts 🧪 Tests +0/-41

Remove test file for findByIds empty array handling

test/github-issues/1118/issue-1118.test.ts


12. test/github-issues/1118/entity/Post.ts 🧪 Tests +0/-10

Remove Post entity file for issue 1118

test/github-issues/1118/entity/Post.ts


13. test/github-issues/1233/issue-1233.test.ts 🧪 Tests +1/-1

Update test title to reflect actual method tested

test/github-issues/1233/issue-1233.test.ts


14. test/github-issues/1245/issue-1245.test.ts 🧪 Tests +3/-3

Update test titles from findByIds to findBy with In

test/github-issues/1245/issue-1245.test.ts


15. test/github-issues/1929/issue-1929.test.ts 🧪 Tests +2/-2

Update test titles to reflect actual methods tested

test/github-issues/1929/issue-1929.test.ts


16. docs/docs/guides/8-migration-v1.md 📝 Documentation +14/-0

Add migration guide for findByIds removal

docs/docs/guides/8-migration-v1.md


Grey Divider

Qodo Logo

@gioboa gioboa requested a review from alumni March 6, 2026 16:48
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Mar 6, 2026

commit: 69ff7a8

@pkuczynski pkuczynski force-pushed the refactor/remove-find-by-ids branch from 62be6fe to 12b3421 Compare March 6, 2026 16:48
@qodo-free-for-open-source-projects
Copy link
Copy Markdown

qodo-free-for-open-source-projects bot commented Mar 6, 2026

Code Review by Qodo

🐞 Bugs (21) 📘 Rule violations (28) 📎 Requirement gaps (0)

Grey Divider


Action required

1. Mongo docs suggest In()🐞 Bug ✓ Correctness
Description
The migration guide says findByIds removal applies to MongoDB APIs and recommends `findBy({ id:
In([...]) })`, but Mongo find paths pass the filter directly to MongoDB with no translation of
TypeORM FindOperator (like In) and Mongo id filtering uses _id (not id). Mongo users
following the guide will likely get empty results or incorrect queries.
Code

docs/docs/guides/8-migration-v1.md[R232-244]

+### `findByIds`
+
+The deprecated `findByIds` method has been removed from `EntityManager`, `Repository`, `BaseEntity`, `MongoEntityManager`, and `MongoRepository`. Use `findBy` with the `In` operator instead:
+
+```typescript
+// Before
+const users = await repository.findByIds([1, 2, 3])
+
+// After
+import { In } from "typeorm"
+
+const users = await repository.findBy({ id: In([1, 2, 3]) })
+```
Evidence
The guide explicitly includes MongoDB managers/repositories yet shows the SQL-style In()
replacement. In MongoDB, findBy/find ultimately call collection.find(filter) with the provided
where/filter object; there is no code in the Mongo path that recognizes/rewrites TypeORM
FindOperator (produced by In()) into Mongo $in. Existing Mongo tests also demonstrate querying
ObjectId columns via _id, not id.

docs/docs/guides/8-migration-v1.md[232-244]
src/entity-manager/MongoEntityManager.ts[965-983]
src/entity-manager/MongoEntityManager.ts[1198-1235]
src/driver/mongodb/MongoQueryRunner.ts[151-153]
src/find-options/operator/In.ts[8-12]
src/find-options/FindOperator.ts[12-67]
test/functional/mongodb/basic/object-id/mongodb-object-id.test.ts[69-71]

Agent prompt
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 currently states that `findByIds` was removed from MongoDB APIs too, but it recommends the relational replacement (`findBy` + `In`) which is not translated in the MongoDB codepath.
### Issue Context
MongoDB find methods pass the filter object directly into `collection.find(...)` without converting TypeORM `FindOperator` instances (like `In`) into Mongo operators (like `$in`). Mongo tests also show querying ObjectId columns via `_id`.
### Fix Focus Areas
- docs/docs/guides/8-migration-v1.md[232-244]
### Suggested change
Adjust the section to:
1) Clearly label the existing snippet as **SQL/relational**.
2) Add a **MongoDB** snippet, e.g.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


2. as unknown as type bypass📘 Rule violation ✓ Correctness
Description
New code uses as unknown as MongoEntityManager and (id: any) which bypasses type safety and
matches the checklist's prohibited any-casts. This can hide real typing issues and make MongoDB-id
normalization logic easier to break during refactors.
Code

src/query-builder/transformer/PlainObjectToDatabaseEntityTransformer.ts[R139-152]

+                    const mongoManager = this
+                        .manager as unknown as MongoEntityManager
+                    const targetMetadata = this.manager.connection.getMetadata(
+                        targetWithIds.target,
              )
+                    const objectIdInstance =
+                        PlatformTools.load("mongodb").ObjectId
+                    const cursor =
+                        mongoManager.createEntityCursor<ObjectLiteral>(
+                            targetWithIds.target,
+                            {
+                                _id: {
+                                    $in: targetWithIds.ids.map((id: any) => {
+                                        if (typeof id === "string") {
Evidence
PR Compliance ID 4 forbids introducing any casts or similar type-bypass patterns. The new
implementation explicitly adds as unknown as MongoEntityManager and a callback parameter typed as
any.

Rule 4: Remove AI-generated noise
src/query-builder/transformer/PlainObjectToDatabaseEntityTransformer.ts[139-152]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The refactor introduces type-bypass casts (`as unknown as MongoEntityManager` and `(id: any)`), which violates the project requirement to avoid `any`-casts/type-safety bypasses.
## Issue Context
The code already branches on `isMongoDb`, so it should be possible to narrow types without `unknown`/`any` and keep id-normalization type-safe.
## Fix Focus Areas
- src/query-builder/transformer/PlainObjectToDatabaseEntityTransformer.ts[139-152]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


3. as unknown as type bypass📘 Rule violation ✓ Correctness
Description
New code uses as unknown as MongoEntityManager and (id: any) which bypasses type safety and
matches the checklist's prohibited any-casts. This can hide real typing issues and make MongoDB-id
normalization logic easier to break during refactors.
Code

src/query-builder/transformer/PlainObjectToDatabaseEntityTransformer.ts[R139-152]

+                    const mongoManager = this
+                        .manager as unknown as MongoEntityManager
+                    const targetMetadata = this.manager.connection.getMetadata(
+                        targetWithIds.target,
             )
+                    const objectIdInstance =
+                        PlatformTools.load("mongodb").ObjectId
+                    const cursor =
+                        mongoManager.createEntityCursor<ObjectLiteral>(
+                            targetWithIds.target,
+                            {
+                                _id: {
+                                    $in: targetWithIds.ids.map((id: any) => {
+                                        if (typeof id === "string") {
Evidence
PR Compliance ID 4 forbids introducing any casts or similar type-bypass patterns. The new
implementation explicitly adds as unknown as MongoEntityManager and a callback parameter typed as
any.

Rule 4: Remove AI-generated noise
src/query-builder/transformer/PlainObjectToDatabaseEntityTransformer.ts[139-152]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The refactor introduces type-bypass casts (`as unknown as MongoEntityManager` and `(id: any)`), which violates the project requirement to avoid `any`-casts/type-safety bypasses.
## Issue Context
The code already branches on `isMongoDb`, so it should be possible to narrow types without `unknown`/`any` and keep id-normalization type-safe.
## Fix Focus Areas
- src/query-builder/transformer/PlainObjectToDatabaseEntityTransformer.ts[139-152]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


View more (34)
4. findByIds still public📘 Rule violation ✓ Correctness
Description
The migration guide states findByIds was removed from MongoEntityManager, but the PR
reintroduces a public MongoEntityManager.findByIds() method. This makes the docs inaccurate for
users relying on the stated public API changes.
Code

src/entity-manager/MongoEntityManager.ts[R961-993]

+    /**
+     * Finds entities by an array of ids, resolving ObjectId types as needed.
+     * @param entityClassOrName
+     * @param ids
+     */
+    async findByIds<Entity extends ObjectLiteral>(
+        entityClassOrName: EntityTarget<Entity>,
+        ids: any[],
+    ): Promise<Entity[]> {
+        const metadata = this.connection.getMetadata(entityClassOrName)
+        const objectIdInstance = PlatformTools.load("mongodb").ObjectId
+        const cursor = this.createEntityCursor<Entity>(entityClassOrName, {
+            _id: {
+                $in: ids.map((id) => {
+                    if (typeof id === "string") {
+                        return new objectIdInstance(id)
+                    }
+                    if (typeof id === "object") {
+                        if (id instanceof objectIdInstance) {
+                            return id
+                        }
+                        const propertyName =
+                            metadata.objectIdColumn!.propertyName
+                        if (id[propertyName] instanceof objectIdInstance) {
+                            return id[propertyName]
+                        }
+                    }
+                    return id
+                }),
+            },
+        } as Filter<Entity>)
+        return cursor.toArray()
+    }
Evidence
Compliance requires docs to accurately reflect user-facing API changes; the migration guide claims
findByIds was removed from MongoEntityManager, but the PR adds async findByIds(...) without
protected/private, meaning it remains publicly accessible.

Rule 2: Docs updated for user-facing changes
docs/docs/guides/8-migration-v1.md[232-235]
src/entity-manager/MongoEntityManager.ts[961-993]

Agent prompt
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 says `findByIds` was removed from `MongoEntityManager`, but the PR adds `MongoEntityManager.findByIds()` as a public method (no `protected`/`private`). This makes the docs inaccurate and keeps a deprecated-looking API surface.
## Issue Context
The migration guide explicitly lists `MongoEntityManager` among the APIs where `findByIds` was removed. Internal code paths in this PR call `mongoManager.findByIds(...)`, which also implies the API still exists.
## Fix Focus Areas
- src/entity-manager/MongoEntityManager.ts[961-993]
- src/persistence/SubjectDatabaseEntityLoader.ts[114-119]
- src/query-builder/transformer/PlainObjectToDatabaseEntityTransformer.ts[132-153]
- docs/docs/guides/8-migration-v1.md[232-235]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


5. Mongo docs suggest In()🐞 Bug ✓ Correctness
Description
The migration guide says findByIds removal applies to MongoDB APIs and recommends `findBy({ id:
In([...]) })`, but Mongo find paths pass the filter directly to MongoDB with no translation of
TypeORM FindOperator (like In) and Mongo id filtering uses _id (not id). Mongo users
following the guide will likely get empty results or incorrect queries.
Code

docs/docs/guides/8-migration-v1.md[R232-244]

+### `findByIds`
+
+The deprecated `findByIds` method has been removed from `EntityManager`, `Repository`, `BaseEntity`, `MongoEntityManager`, and `MongoRepository`. Use `findBy` with the `In` operator instead:
+
+```typescript
+// Before
+const users = await repository.findByIds([1, 2, 3])
+
+// After
+import { In } from "typeorm"
+
+const users = await repository.findBy({ id: In([1, 2, 3]) })
+```
Evidence
The guide explicitly includes MongoDB managers/repositories yet shows the SQL-style In()
replacement. In MongoDB, findBy/find ultimately call collection.find(filter) with the provided
where/filter object; there is no code in the Mongo path that recognizes/rewrites TypeORM
FindOperator (produced by In()) into Mongo $in. Existing Mongo tests also demonstrate querying
ObjectId columns via _id, not id.

docs/docs/guides/8-migration-v1.md[232-244]
src/entity-manager/MongoEntityManager.ts[965-983]
src/entity-manager/MongoEntityManager.ts[1198-1235]
src/driver/mongodb/MongoQueryRunner.ts[151-153]
src/find-options/operator/In.ts[8-12]
src/find-options/FindOperator.ts[12-67]
test/functional/mongodb/basic/object-id/mongodb-object-id.test.ts[69-71]

Agent prompt
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 currently states that `findByIds` was removed from MongoDB APIs too, but it recommends the relational replacement (`findBy` + `In`) which is not translated in the MongoDB codepath.
### Issue Context
MongoDB find methods pass the filter object directly into `collection.find(...)` without converting TypeORM `FindOperator` instances (like `In`) into Mongo operators (like `$in`). Mongo tests also show querying ObjectId columns via `_id`.
### Fix Focus Areas
- docs/docs/guides/8-migration-v1.md[232-244]
### Suggested change
Adjust the section to:
1) Clearly label the existing snippet as **SQL/relational**.
2) Add a **MongoDB** snippet, e.g.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


6. as unknown as type bypass📘 Rule violation ✓ Correctness
Description
New code uses as unknown as MongoEntityManager and (id: any) which bypasses type safety and
matches the checklist's prohibited any-casts. This can hide real typing issues and make MongoDB-id
normalization logic easier to break during refactors.
Code

src/query-builder/transformer/PlainObjectToDatabaseEntityTransformer.ts[R139-152]

+                    const mongoManager = this
+                        .manager as unknown as MongoEntityManager
+                    const targetMetadata = this.manager.connection.getMetadata(
+                        targetWithIds.target,
             )
+                    const objectIdInstance =
+                        PlatformTools.load("mongodb").ObjectId
+                    const cursor =
+                        mongoManager.createEntityCursor<ObjectLiteral>(
+                            targetWithIds.target,
+                            {
+                                _id: {
+                                    $in: targetWithIds.ids.map((id: any) => {
+                                        if (typeof id === "string") {
Evidence
PR Compliance ID 4 forbids introducing any casts or similar type-bypass patterns. The new
implementation explicitly adds as unknown as MongoEntityManager and a callback parameter typed as
any.

Rule 4: Remove AI-generated noise
src/query-builder/transformer/PlainObjectToDatabaseEntityTransformer.ts[139-152]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The refactor introduces type-bypass casts (`as unknown as MongoEntityManager` and `(id: any)`), which violates the project requirement to avoid `any`-casts/type-safety bypasses.
## Issue Context
The code already branches on `isMongoDb`, so it should be possible to narrow types without `unknown`/`any` and keep id-normalization type-safe.
## Fix Focus Areas
- src/query-builder/transformer/PlainObjectToDatabaseEntityTransformer.ts[139-152]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


7. as unknown as type bypass📘 Rule violation ✓ Correctness
Description
New code uses as unknown as MongoEntityManager and (id: any) which bypasses type safety and
matches the checklist's prohibited any-casts. This can hide real typing issues and make MongoDB-id
normalization logic easier to break during refactors.
Code

src/query-builder/transformer/PlainObjectToDatabaseEntityTransformer.ts[R139-152]

+                    const mongoManager = this
+                        .manager as unknown as MongoEntityManager
+                    const targetMetadata = this.manager.connection.getMetadata(
+                        targetWithIds.target,
            )
+                    const objectIdInstance =
+                        PlatformTools.load("mongodb").ObjectId
+                    const cursor =
+                        mongoManager.createEntityCursor<ObjectLiteral>(
+                            targetWithIds.target,
+                            {
+                                _id: {
+                                    $in: targetWithIds.ids.map((id: any) => {
+                                        if (typeof id === "string") {
Evidence
PR Compliance ID 4 forbids introducing any casts or similar type-bypass patterns. The new
implementation explicitly adds as unknown as MongoEntityManager and a callback parameter typed as
any.

Rule 4: Remove AI-generated noise
src/query-builder/transformer/PlainObjectToDatabaseEntityTransformer.ts[139-152]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The refactor introduces type-bypass casts (`as unknown as MongoEntityManager` and `(id: any)`), which violates the project requirement to avoid `any`-casts/type-safety bypasses.
## Issue Context
The code already branches on `isMongoDb`, so it should be possible to narrow types without `unknown`/`any` and keep id-normalization type-safe.
## Fix Focus Areas
- src/query-builder/transformer/PlainObjectToDatabaseEntityTransformer.ts[139-152]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


8. as unknown as type bypass📘 Rule violation ✓ Correctness
Description
New code uses as unknown as MongoEntityManager and (id: any) which bypasses type safety and
matches the checklist's prohibited any-casts. This can hide real typing issues and make MongoDB-id
normalization logic easier to break during refactors.
Code

src/query-builder/transformer/PlainObjectToDatabaseEntityTransformer.ts[R139-152]

+                    const mongoManager = this
+                        .manager as unknown as MongoEntityManager
+                    const targetMetadata = this.manager.connection.getMetadata(
+                        targetWithIds.target,
               )
+                    const objectIdInstance =
+                        PlatformTools.load("mongodb").ObjectId
+                    const cursor =
+                        mongoManager.createEntityCursor<ObjectLiteral>(
+                            targetWithIds.target,
+                            {
+                                _id: {
+                                    $in: targetWithIds.ids.map((id: any) => {
+                                        if (typeof id === "string") {
Evidence
PR Compliance ID 4 forbids introducing any casts or similar type-bypass patterns. The new
implementation explicitly adds as unknown as MongoEntityManager and a callback parameter typed as
any.

Rule 4: Remove AI-generated noise
src/query-builder/transformer/PlainObjectToDatabaseEntityTransformer.ts[139-152]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The refactor introduces type-bypass casts (`as unknown as MongoEntityManager` and `(id: any)`), which violates the project requirement to avoid `any`-casts/type-safety bypasses.
## Issue Context
The code already branches on `isMongoDb`, so it should be possible to narrow types without `unknown`/`any` and keep id-normalization type-safe.
## Fix Focus Areas
- src/query-builder/transformer/PlainObjectToDatabaseEntityTransformer.ts[139-152]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


9. as unknown as type bypass📘 Rule violation ✓ Correctness
Description
New code uses as unknown as MongoEntityManager and (id: any) which bypasses type safety and
matches the checklist's prohibited any-casts. This can hide real typing issues and make MongoDB-id
normalization logic easier to break during refactors.
Code

src/query-builder/transformer/PlainObjectToDatabaseEntityTransformer.ts[R139-152]

+                    const mongoManager = this
+                        .manager as unknown as MongoEntityManager
+                    const targetMetadata = this.manager.connection.getMetadata(
+                        targetWithIds.target,
              )
+                    const objectIdInstance =
+                        PlatformTools.load("mongodb").ObjectId
+                    const cursor =
+                        mongoManager.createEntityCursor<ObjectLiteral>(
+                            targetWithIds.target,
+                            {
+                                _id: {
+                                    $in: targetWithIds.ids.map((id: any) => {
+                                        if (typeof id === "string") {
Evidence
PR Compliance ID 4 forbids introducing any casts or similar type-bypass patterns. The new
implementation explicitly adds as unknown as MongoEntityManager and a callback parameter typed as
any.

Rule 4: Remove AI-generated noise
src/query-builder/transformer/PlainObjectToDatabaseEntityTransformer.ts[139-152]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The refactor introduces type-bypass casts (`as unknown as MongoEntityManager` and `(id: any)`), which violates the project requirement to avoid `any`-casts/type-safety bypasses.
## Issue Context
The code already branches on `isMongoDb`, so it should be possible to narrow types without `unknown`/`any` and keep id-normalization type-safe.
## Fix Focus Areas
- src/query-builder/transformer/PlainObjectToDatabaseEntityTransformer.ts[139-152]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


10. findByIds still public📘 Rule violation ✓ Correctness
Description
The migration guide states findByIds was removed from MongoEntityManager, but the PR
reintroduces a public MongoEntityManager.findByIds() method. This makes the docs inaccurate for
users relying on the stated public API changes.
Code

src/entity-manager/MongoEntityManager.ts[R961-993]

+    /**
+     * Finds entities by an array of ids, resolving ObjectId types as needed.
+     * @param entityClassOrName
+     * @param ids
+     */
+    async findByIds<Entity extends ObjectLiteral>(
+        entityClassOrName: EntityTarget<Entity>,
+        ids: any[],
+    ): Promise<Entity[]> {
+        const metadata = this.connection.getMetadata(entityClassOrName)
+        const objectIdInstance = PlatformTools.load("mongodb").ObjectId
+        const cursor = this.createEntityCursor<Entity>(entityClassOrName, {
+            _id: {
+                $in: ids.map((id) => {
+                    if (typeof id === "string") {
+                        return new objectIdInstance(id)
+                    }
+                    if (typeof id === "object") {
+                        if (id instanceof objectIdInstance) {
+                            return id
+                        }
+                        const propertyName =
+                            metadata.objectIdColumn!.propertyName
+                        if (id[propertyName] instanceof objectIdInstance) {
+                            return id[propertyName]
+                        }
+                    }
+                    return id
+                }),
+            },
+        } as Filter<Entity>)
+        return cursor.toArray()
+    }
Evidence
Compliance requires docs to accurately reflect user-facing API changes; the migration guide claims
findByIds was removed from MongoEntityManager, but the PR adds async findByIds(...) without
protected/private, meaning it remains publicly accessible.

Rule 2: Docs updated for user-facing changes
docs/docs/guides/8-migration-v1.md[232-235]
src/entity-manager/MongoEntityManager.ts[961-993]

Agent prompt
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 says `findByIds` was removed from `MongoEntityManager`, but the PR adds `MongoEntityManager.findByIds()` as a public method (no `protected`/`private`). This makes the docs inaccurate and keeps a deprecated-looking API surface.
## Issue Context
The migration guide explicitly lists `MongoEntityManager` among the APIs where `findByIds` was removed. Internal code paths in this PR call `mongoManager.findByIds(...)`, which also implies the API still exists.
## Fix Focus Areas
- src/entity-manager/MongoEntityManager.ts[961-993]
- src/persistence/SubjectDatabaseEntityLoader.ts[114-119]
- src/query-builder/transformer/PlainObjectToDatabaseEntityTransformer.ts[132-153]
- docs/docs/guides/8-migration-v1.md[232-235]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


11. Mongo docs suggest In()🐞 Bug ✓ Correctness
Description
The migration guide says findByIds removal applies to MongoDB APIs and recommends `findBy({ id:
In([...]) })`, but Mongo find paths pass the filter directly to MongoDB with no translation of
TypeORM FindOperator (like In) and Mongo id filtering uses _id (not id). Mongo users
following the guide will likely get empty results or incorrect queries.
Code

docs/docs/guides/8-migration-v1.md[R232-244]

+### `findByIds`
+
+The deprecated `findByIds` method has been removed from `EntityManager`, `Repository`, `BaseEntity`, `MongoEntityManager`, and `MongoRepository`. Use `findBy` with the `In` operator instead:
+
+```typescript
+// Before
+const users = await repository.findByIds([1, 2, 3])
+
+// After
+import { In } from "typeorm"
+
+const users = await repository.findBy({ id: In([1, 2, 3]) })
+```
Evidence
The guide explicitly includes MongoDB managers/repositories yet shows the SQL-style In()
replacement. In MongoDB, findBy/find ultimately call collection.find(filter) with the provided
where/filter object; there is no code in the Mongo path that recognizes/rewrites TypeORM
FindOperator (produced by In()) into Mongo $in. Existing Mongo tests also demonstrate querying
ObjectId columns via _id, not id.

docs/docs/guides/8-migration-v1.md[232-244]
src/entity-manager/MongoEntityManager.ts[965-983]
src/entity-manager/MongoEntityManager.ts[1198-1235]
src/driver/mongodb/MongoQueryRunner.ts[151-153]
src/find-options/operator/In.ts[8-12]
src/find-options/FindOperator.ts[12-67]
test/functional/mongodb/basic/object-id/mongodb-object-id.test.ts[69-71]

Agent prompt
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 currently states that `findByIds` was removed from MongoDB APIs too, but it recommends the relational replacement (`findBy` + `In`) which is not translated in the MongoDB codepath.
### Issue Context
MongoDB find methods pass the filter object directly into `collection.find(...)` without converting TypeORM `FindOperator` instances (like `In`) into Mongo operators (like `$in`). Mongo tests also show querying ObjectId columns via `_id`.
### Fix Focus Areas
- docs/docs/guides/8-migration-v1.md[232-244]
### Suggested change
Adjust the section to:
1) Clearly label the existing snippet as **SQL/relational**.
2) Add a **MongoDB** snippet, e.g.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


12. as unknown as type bypass📘 Rule violation ✓ Correctness
Description
New code uses as unknown as MongoEntityManager and (id: any) which bypasses type safety and
matches the checklist's prohibited any-casts. This can hide real typing issues and make MongoDB-id
normalization logic easier to break during refactors.
Code

src/query-builder/transformer/PlainObjectToDatabaseEntityTransformer.ts[R139-152]

+                    const mongoManager = this
+                        .manager as unknown as MongoEntityManager
+                    const targetMetadata = this.manager.connection.getMetadata(
+                        targetWithIds.target,
              )
+                    const objectIdInstance =
+                        PlatformTools.load("mongodb").ObjectId
+                    const cursor =
+                        mongoManager.createEntityCursor<ObjectLiteral>(
+                            targetWithIds.target,
+                            {
+                                _id: {
+                                    $in: targetWithIds.ids.map((id: any) => {
+                                        if (typeof id === "string") {
Evidence
PR Compliance ID 4 forbids introducing any casts or similar type-bypass patterns. The new
implementation explicitly adds as unknown as MongoEntityManager and a callback parameter typed as
any.

Rule 4: Remove AI-generated noise
src/query-builder/transformer/PlainObjectToDatabaseEntityTransformer.ts[139-152]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The refactor introduces type-bypass casts (`as unknown as MongoEntityManager` and `(id: any)`), which violates the project requirement to avoid `any`-casts/type-safety bypasses.
## Issue Context
The code already branches on `isMongoDb`, so it should be possible to narrow types without `unknown`/`any` and keep id-normalization type-safe.
## Fix Focus Areas
- src/query-builder/transformer/PlainObjectToDatabaseEntityTransformer.ts[139-152]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


13. as unknown as type bypass📘 Rule violation ✓ Correctness
Description
New code uses as unknown as MongoEntityManager and (id: any) which bypasses type safety and
matches the checklist's prohibited any-casts. This can hide real typing issues and make MongoDB-id
normalization logic easier to break during refactors.
Code

src/query-builder/transformer/PlainObjectToDatabaseEntityTransformer.ts[R139-152]

+                    const mongoManager = this
+                        .manager as unknown as MongoEntityManager
+                    const targetMetadata = this.manager.connection.getMetadata(
+                        targetWithIds.target,
             )
+                    const objectIdInstance =
+                        PlatformTools.load("mongodb").ObjectId
+                    const cursor =
+                        mongoManager.createEntityCursor<ObjectLiteral>(
+                            targetWithIds.target,
+                            {
+                                _id: {
+                                    $in: targetWithIds.ids.map((id: any) => {
+                                        if (typeof id === "string") {
Evidence
PR Compliance ID 4 forbids introducing any casts or similar type-bypass patterns. The new
implementation explicitly adds as unknown as MongoEntityManager and a callback parameter typed as
any.

Rule 4: Remove AI-generated noise
src/query-builder/transformer/PlainObjectToDatabaseEntityTransformer.ts[139-152]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The refactor introduces type-bypass casts (`as unknown as MongoEntityManager` and `(id: any)`), which violates the project requirement to avoid `any`-casts/type-safety bypasses.
## Issue Context
The code already branches on `isMongoDb`, so it should be possible to narrow types without `unknown`/`any` and keep id-normalization type-safe.
## Fix Focus Areas
- src/query-builder/transformer/PlainObjectToDatabaseEntityTransformer.ts[139-152]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


14. Mongo docs suggest In()🐞 Bug ✓ Correctness
Description
The migration guide says findByIds removal applies to MongoDB APIs and recommends `findBy({ id:
In([...]) })`, but Mongo find paths pass the filter directly to MongoDB with no translation of
TypeORM FindOperator (like In) and Mongo id filtering uses _id (not id). Mongo users
following the guide will likely get empty results or incorrect queries.
Code

docs/docs/guides/8-migration-v1.md[R232-244]

+### `findByIds`
+
+The deprecated `findByIds` method has been removed from `EntityManager`, `Repository`, `BaseEntity`, `MongoEntityManager`, and `MongoRepository`. Use `findBy` with the `In` operator instead:
+
+```typescript
+// Before
+const users = await repository.findByIds([1, 2, 3])
+
+// After
+import { In } from "typeorm"
+
+const users = await repository.findBy({ id: In([1, 2, 3]) })
+```
Evidence
The guide explicitly includes MongoDB managers/repositories yet shows the SQL-style In()
replacement. In MongoDB, findBy/find ultimately call collection.find(filter) with the provided
where/filter object; there is no code in the Mongo path that recognizes/rewrites TypeORM
FindOperator (produced by In()) into Mongo $in. Existing Mongo tests also demonstrate querying
ObjectId columns via _id, not id.

docs/docs/guides/8-migration-v1.md[232-244]
src/entity-manager/MongoEntityManager.ts[965-983]
src/entity-manager/MongoEntityManager.ts[1198-1235]
src/driver/mongodb/MongoQueryRunner.ts[151-153]
src/find-options/operator/In.ts[8-12]
src/find-options/FindOperator.ts[12-67]
test/functional/mongodb/basic/object-id/mongodb-object-id.test.ts[69-71]

Agent prompt
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 currently states that `findByIds` was removed from MongoDB APIs too, but it recommends the relational replacement (`findBy` + `In`) which is not translated in the MongoDB codepath.
### Issue Context
MongoDB find methods pass the filter object directly into `collection.find(...)` without converting TypeORM `FindOperator` instances (like `In`) into Mongo operators (like `$in`). Mongo tests also show querying ObjectId columns via `_id`.
### Fix Focus Areas
- docs/docs/guides/8-migration-v1.md[232-244]
### Suggested change
Adjust the section to:
1) Clearly label the existing snippet as **SQL/relational**.
2) Add a **MongoDB** snippet, e.g.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


15. as unknown as type bypass📘 Rule violation ✓ Correctness
Description
New code uses as unknown as MongoEntityManager and (id: any) which bypasses type safety and
matches the checklist's prohibited any-casts. This can hide real typing issues and make MongoDB-id
normalization logic easier to break during refactors.
Code

src/query-builder/transformer/PlainObjectToDatabaseEntityTransformer.ts[R139-152]

+                    const mongoManager = this
+                        .manager as unknown as MongoEntityManager
+                    const targetMetadata = this.manager.connection.getMetadata(
+                        targetWithIds.target,
             )
+                    const objectIdInstance =
+                        PlatformTools.load("mongodb").ObjectId
+                    const cursor =
+                        mongoManager.createEntityCursor<ObjectLiteral>(
+                            targetWithIds.target,
+                            {
+                                _id: {
+                                    $in: targetWithIds.ids.map((id: any) => {
+                                        if (typeof id === "string") {
Evidence
PR Compliance ID 4 forbids introducing any casts or similar type-bypass patterns. The new
implementation explicitly adds as unknown as MongoEntityManager and a callback parameter typed as
any.

Rule 4: Remove AI-generated noise
src/query-builder/transformer/PlainObjectToDatabaseEntityTransformer.ts[139-152]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The refactor introduces type-bypass casts (`as unknown as MongoEntityManager` and `(id: any)`), which violates the project requirement to avoid `any`-casts/type-safety bypasses.
## Issue Context
The code already branches on `isMongoDb`, so it should be possible to narrow types without `unknown`/`any` and keep id-normalization type-safe.
## Fix Focus Areas
- src/query-builder/transformer/PlainObjectToDatabaseEntityTransformer.ts[139-152]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


16. as unknown as type bypass📘 Rule violation ✓ Correctness
Description
New code uses as unknown as MongoEntityManager and (id: any) which bypasses type safety and
matches the checklist's prohibited any-casts. This can hide real typing issues and make MongoDB-id
normalization logic easier to break during refactors.
Code

src/query-builder/transformer/PlainObjectToDatabaseEntityTransformer.ts[R139-152]

+                    const mongoManager = this
+                        .manager as unknown as MongoEntityManager
+                    const targetMetadata = this.manager.connection.getMetadata(
+                        targetWithIds.target,
            )
+                    const objectIdInstance =
+                        PlatformTools.load("mongodb").ObjectId
+                    const cursor =
+                        mongoManager.createEntityCursor<ObjectLiteral>(
+                            targetWithIds.target,
+                            {
+                                _id: {
+                                    $in: targetWithIds.ids.map((id: any) => {
+                                        if (typeof id === "string") {
Evidence
PR Compliance ID 4 forbids introducing any casts or similar type-bypass patterns. The new
implementation explicitly adds as unknown as MongoEntityManager and a callback parameter typed as
any.

Rule 4: Remove AI-generated noise
src/query-builder/transformer/PlainObjectToDatabaseEntityTransformer.ts[139-152]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The refactor introduces type-bypass casts (`as unknown as MongoEntityManager` and `(id: any)`), which violates the project requirement to avoid `any`-casts/type-safety bypasses.
## Issue Context
The code already branches on `isMongoDb`, so it should be possible to narrow types without `unknown`/`any` and keep id-normalization type-safe.
## Fix Focus Areas
- src/query-builder/transformer/PlainObjectToDatabaseEntityTransformer.ts[139-152]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


17. findByIds still public📘 Rule violation ✓ Correctness
Description
The migration guide states findByIds was removed from MongoEntityManager, but the PR
reintroduces a public MongoEntityManager.findByIds() method. This makes the docs inaccurate for
users relying on the stated public API changes.
Code

src/entity-manager/MongoEntityManager.ts[R961-993]

+    /**
+     * Finds entities by an array of ids, resolving ObjectId types as needed.
+     * @param entityClassOrName
+     * @param ids
+     */
+    async findByIds<Entity extends ObjectLiteral>(
+        entityClassOrName: EntityTarget<Entity>,
+        ids: any[],
+    ): Promise<Entity[]> {
+        const metadata = this.connection.getMetadata(entityClassOrName)
+        const objectIdInstance = PlatformTools.load("mongodb").ObjectId
+        const cursor = this.createEntityCursor<Entity>(entityClassOrName, {
+            _id: {
+                $in: ids.map((id) => {
+                    if (typeof id === "string") {
+                        return new objectIdInstance(id)
+                    }
+                    if (typeof id === "object") {
+                        if (id instanceof objectIdInstance) {
+                            return id
+                        }
+                        const propertyName =
+                            metadata.objectIdColumn!.propertyName
+                        if (id[propertyName] instanceof objectIdInstance) {
+                            return id[propertyName]
+                        }
+                    }
+                    return id
+                }),
+            },
+        } as Filter<Entity>)
+        return cursor.toArray()
+    }
Evidence
Compliance requires docs to accurately reflect user-facing API changes; the migration guide claims
findByIds was removed from MongoEntityManager, but the PR adds async findByIds(...) without
protected/private, meaning it remains publicly accessible.

Rule 2: Docs updated for user-facing changes
docs/docs/guides/8-migration-v1.md[232-235]
src/entity-manager/MongoEntityManager.ts[961-993]

Agent prompt
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 says `findByIds` was removed from `MongoEntityManager`, but the PR adds `MongoEntityManager.findByIds()` as a public method (no `protected`/`private`). This makes the docs inaccurate and keeps a deprecated-looking API surface.
## Issue Context
The migration guide explicitly lists `MongoEntityManager` among the APIs where `findByIds` was removed. Internal code paths in this PR call `mongoManager.findByIds(...)`, which also implies the API still exists.
## Fix Focus Areas
- src/entity-manager/MongoEntityManager.ts[961-993]
- src/persistence/SubjectDatabaseEntityLoader.ts[114-119]
- src/query-builder/transformer/PlainObjectToDatabaseEntityTransformer.ts[132-153]
- docs/docs/guides/8-migration-v1.md[232-235]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


18. Mongo docs suggest In()🐞 Bug ✓ Correctness
Description
The migration guide says findByIds removal applies to MongoDB APIs and recommends `findBy({ id:
In([...]) })`, but Mongo find paths pass the filter directly to MongoDB with no translation of
TypeORM FindOperator (like In) and Mongo id filtering uses _id (not id). Mongo users
following the guide will likely get empty results or incorrect queries.
Code

docs/docs/guides/8-migration-v1.md[R232-244]

+### `findByIds`
+
+The deprecated `findByIds` method has been removed from `EntityManager`, `Repository`, `BaseEntity`, `MongoEntityManager`, and `MongoRepository`. Use `findBy` with the `In` operator instead:
+
+```typescript
+// Before
+const users = await repository.findByIds([1, 2, 3])
+
+// After
+import { In } from "typeorm"
+
+const users = await repository.findBy({ id: In([1, 2, 3]) })
+```
Evidence
The guide explicitly includes MongoDB managers/repositories yet shows the SQL-style In()
replacement. In MongoDB, findBy/find ultimately call collection.find(filter) with the provided
where/filter object; there is no code in the Mongo path that recognizes/rewrites TypeORM
FindOperator (produced by In()) into Mongo $in. Existing Mongo tests also demonstrate querying
ObjectId columns via _id, not id.

docs/docs/guides/8-migration-v1.md[232-244]
src/entity-manager/MongoEntityManager.ts[965-983]
src/entity-manager/MongoEntityManager.ts[1198-1235]
src/driver/mongodb/MongoQueryRunner.ts[151-153]
src/find-options/operator/In.ts[8-12]
src/find-options/FindOperator.ts[12-67]
test/functional/mongodb/basic/object-id/mongodb-object-id.test.ts[69-71]

Agent prompt
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 currently states that `findByIds` was removed from MongoDB APIs too, but it recommends the relational replacement (`findBy` + `In`) which is not translated in the MongoDB codepath.
### Issue Context
MongoDB find methods pass the filter object directly into `collection.find(...)` without converting TypeORM `FindOperator` instances (like `In`) into Mongo operators (like `$in`). Mongo tests also show querying ObjectId columns via `_id`.
### Fix Focus Areas
- docs/docs/guides/8-migration-v1.md[232-244]
### Suggested change
Adjust the section to:
1) Clearly label the existing snippet as **SQL/relational**.
2) Add a **MongoDB** snippet, e.g.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


19. as unknown as type bypass📘 Rule violation ✓ Correctness
Description
New code uses as unknown as MongoEntityManager and (id: any) which bypasses type safety and
matches the checklist's...

@qodo-free-for-open-source-projects
Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (1) 📘 Rule violations (1) 📎 Requirement gaps (0)

Grey Divider


Action required

1. as unknown as type bypass 📘 Rule violation ✓ Correctness
Description
New code uses as unknown as MongoEntityManager and (id: any) which bypasses type safety and
matches the checklist's prohibited any-casts. This can hide real typing issues and make MongoDB-id
normalization logic easier to break during refactors.
Code

src/query-builder/transformer/PlainObjectToDatabaseEntityTransformer.ts[R139-152]

+                    const mongoManager = this
+                        .manager as unknown as MongoEntityManager
+                    const targetMetadata = this.manager.connection.getMetadata(
+                        targetWithIds.target,
                    )
+                    const objectIdInstance =
+                        PlatformTools.load("mongodb").ObjectId
+                    const cursor =
+                        mongoManager.createEntityCursor<ObjectLiteral>(
+                            targetWithIds.target,
+                            {
+                                _id: {
+                                    $in: targetWithIds.ids.map((id: any) => {
+                                        if (typeof id === "string") {
Evidence
PR Compliance ID 4 forbids introducing any casts or similar type-bypass patterns. The new
implementation explicitly adds as unknown as MongoEntityManager and a callback parameter typed as
any.

Rule 4: Remove AI-generated noise
src/query-builder/transformer/PlainObjectToDatabaseEntityTransformer.ts[139-152]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The refactor introduces type-bypass casts (`as unknown as MongoEntityManager` and `(id: any)`), which violates the project requirement to avoid `any`-casts/type-safety bypasses.

## Issue Context
The code already branches on `isMongoDb`, so it should be possible to narrow types without `unknown`/`any` and keep id-normalization type-safe.

## Fix Focus Areas
- src/query-builder/transformer/PlainObjectToDatabaseEntityTransformer.ts[139-152]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Remediation recommended

2. Mongo migration doc mismatch 🐞 Bug ✓ Correctness
Description
The migration guide recommends replacing findByIds with findBy + In, including for MongoDB,
but MongoDB find/findBy passes the where object directly to the Mongo driver without translating
FindOperator (e.g., In()) into $in. This makes the documented replacement misleading for Mongo
users and can cause queries to return no results.
Code

docs/docs/guides/8-migration-v1.md[R232-244]

+### `findByIds`
+
+The deprecated `findByIds` method has been removed from `EntityManager`, `Repository`, `BaseEntity`, `MongoEntityManager`, and `MongoRepository`. Use `findBy` with the `In` operator instead:
+
+```typescript
+// Before
+const users = await repository.findByIds([1, 2, 3])
+
+// After
+import { In } from "typeorm"
+
+const users = await repository.findBy({ id: In([1, 2, 3]) })
+```
Evidence
The guide explicitly claims the replacement applies to MongoEntityManager/MongoRepository and
shows In(...). However, MongoEntityManager’s executeFind builds a query by returning
options.where verbatim (or the conditions object itself) and then hands that object directly to
createEntityCursor, which ultimately calls collection.find(filter) without any conversion layer.
Since In() returns a TypeORM FindOperator("in", ...) object, it will be sent as-is to MongoDB
rather than as a $in expression. The PR’s own internal refactors for Mongo use _id: { $in: ... }
with ObjectId conversion, underscoring that $in is the correct Mongo form.

docs/docs/guides/8-migration-v1.md[232-244]
src/find-options/operator/In.ts[8-12]
src/entity-manager/MongoEntityManager.ts[965-983]
src/entity-manager/MongoEntityManager.ts[1198-1210]
src/driver/mongodb/MongoQueryRunner.ts[151-153]
src/persistence/SubjectDatabaseEntityLoader.ts[120-151]
src/query-builder/transformer/PlainObjectToDatabaseEntityTransformer.ts[144-176]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
The v1 migration guide states that `findByIds` removal applies to MongoDB APIs too and recommends replacing it with `findBy` + `In()`. In the current MongoDB implementation, `In()` produces a TypeORM `FindOperator` object and Mongo query execution passes the `where` object directly to `collection.find(...)` without translating `FindOperator` into MongoDB operators like `$in`.

### Issue Context
This becomes user-impacting now that `MongoRepository.findByIds`/`MongoEntityManager.findByIds` are removed and the guide is the primary migration path.

### Fix Focus Areas
- docs/docs/guides/8-migration-v1.md[232-244]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

ⓘ The new review experience is currently in Beta. Learn more

Grey Divider

Qodo Logo

@qodo-free-for-open-source-projects
Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (3) 📘 Rule violations (1) 📎 Requirement gaps (0)

Grey Divider


Action required

1. as unknown as type bypass 📘 Rule violation ✓ Correctness
Description
New code uses as unknown as MongoEntityManager and (id: any) which bypasses type safety and
matches the checklist's prohibited any-casts. This can hide real typing issues and make MongoDB-id
normalization logic easier to break during refactors.
Code

src/query-builder/transformer/PlainObjectToDatabaseEntityTransformer.ts[R139-152]

+                    const mongoManager = this
+                        .manager as unknown as MongoEntityManager
+                    const targetMetadata = this.manager.connection.getMetadata(
+                        targetWithIds.target,
                   )
+                    const objectIdInstance =
+                        PlatformTools.load("mongodb").ObjectId
+                    const cursor =
+                        mongoManager.createEntityCursor<ObjectLiteral>(
+                            targetWithIds.target,
+                            {
+                                _id: {
+                                    $in: targetWithIds.ids.map((id: any) => {
+                                        if (typeof id === "string") {
Evidence
PR Compliance ID 4 forbids introducing any casts or similar type-bypass patterns. The new
implementation explicitly adds as unknown as MongoEntityManager and a callback parameter typed as
any.

Rule 4: Remove AI-generated noise
src/query-builder/transformer/PlainObjectToDatabaseEntityTransformer.ts[139-152]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The refactor introduces type-bypass casts (`as unknown as MongoEntityManager` and `(id: any)`), which violates the project requirement to avoid `any`-casts/type-safety bypasses.
## Issue Context
The code already branches on `isMongoDb`, so it should be possible to narrow types without `unknown`/`any` and keep id-normalization type-safe.
## Fix Focus Areas
- src/query-builder/transformer/PlainObjectToDatabaseEntityTransformer.ts[139-152]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Remediation recommended

2. Mongo options bypassed 🐞 Bug ✓ Correctness ⭐ New
Description
The MongoDB branch in SubjectDatabaseEntityLoader now calls createEntityCursor(...).toArray()
directly, so any FindManyOptions behavior (projection/skip/take/order and soft-delete filtering)
provided by MongoEntityManager.find() will be ignored. This creates cross-driver inconsistency
(SQL uses setFindOptions(findOptions)), and makes future option changes in this code path silently
ineffective on MongoDB.
Code

src/persistence/SubjectDatabaseEntityLoader.ts[R115-153]

+                    const mongoManager = this.queryRunner
+                        .manager as MongoEntityManager
+                    const metadata = this.queryRunner.connection.getMetadata(
+                        subjectGroup.target,
+                    )
+                    const objectIdInstance =
+                        PlatformTools.load("mongodb").ObjectId
+                    const cursor =
+                        mongoManager.createEntityCursor<ObjectLiteral>(
                            subjectGroup.target,
-                        ) as MongoRepository<ObjectLiteral>
-                    entities = await mongoRepo.findByIds(allIds, findOptions)
+                            {
+                                _id: {
+                                    $in: allIds.map((id) => {
+                                        if (typeof id === "string") {
+                                            return new objectIdInstance(id)
+                                        }
+                                        if (typeof id === "object") {
+                                            if (
+                                                id instanceof objectIdInstance
+                                            ) {
+                                                return id
+                                            }
+                                            const propertyName =
+                                                metadata.objectIdColumn!
+                                                    .propertyName
+                                            if (
+                                                id[propertyName] instanceof
+                                                objectIdInstance
+                                            ) {
+                                                return id[propertyName]
+                                            }
+                                        }
+                                        return id
+                                    }),
+                                },
+                            },
+                        )
+                    entities = await cursor.toArray()
                } else {
Evidence
SubjectDatabaseEntityLoader constructs findOptions and applies it only for SQL via
setFindOptions(findOptions), but the MongoDB branch bypasses options entirely by using a raw
cursor and toArray(). Meanwhile, MongoEntityManager.find() shows the standard Mongo path where
FindManyOptions (select/skip/take/order/withDeleted) are applied and soft-deletes are filtered
unless withDeleted is set.

src/persistence/SubjectDatabaseEntityLoader.ts[99-160]
src/entity-manager/MongoEntityManager.ts[103-140]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
`SubjectDatabaseEntityLoader` builds a `findOptions` object (used on SQL via `setFindOptions`) but the MongoDB branch bypasses TypeORM’s standard `find` option handling by using `createEntityCursor(...).toArray()` directly.

### Issue Context
MongoEntityManager’s `find()` applies `FindManyOptions` fields like `select/skip/take/order` and soft-delete filtering (`withDeleted`). The loader’s Mongo path should ideally align with that behavior (and at minimum not silently ignore options).

### Fix Focus Areas
- src/persistence/SubjectDatabaseEntityLoader.ts[99-160]
- src/entity-manager/MongoEntityManager.ts[103-140]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


3. Duplicated Mongo ID mapping 🐞 Bug ⛯ Reliability ⭐ New
Description
MongoDB _id normalization logic is duplicated in multiple internal call sites, increasing the
chance of inconsistent behavior if ID-handling evolves. TypeORM already has a centralized helper
(convertMixedCriteria) that supports a broader set of ObjectId-compatible inputs and object-based
criteria building, but the new code re-implements a narrower variant in two places.
Code

src/query-builder/transformer/PlainObjectToDatabaseEntityTransformer.ts[R139-176]

+                    const mongoManager = this
+                        .manager as unknown as MongoEntityManager
+                    const targetMetadata = this.manager.connection.getMetadata(
+                        targetWithIds.target,
                    )
+                    const objectIdInstance =
+                        PlatformTools.load("mongodb").ObjectId
+                    const cursor =
+                        mongoManager.createEntityCursor<ObjectLiteral>(
+                            targetWithIds.target,
+                            {
+                                _id: {
+                                    $in: targetWithIds.ids.map((id: any) => {
+                                        if (typeof id === "string") {
+                                            return new objectIdInstance(id)
+                                        }
+                                        if (typeof id === "object") {
+                                            if (
+                                                id instanceof objectIdInstance
+                                            ) {
+                                                return id
+                                            }
+                                            const propertyName =
+                                                targetMetadata.objectIdColumn!
+                                                    .propertyName
+                                            if (
+                                                id[propertyName] instanceof
+                                                objectIdInstance
+                                            ) {
+                                                return id[propertyName]
+                                            }
+                                        }
+                                        return id
+                                    }),
+                                },
+                            },
+                        )
+                    entities = await cursor.toArray()
Evidence
Both SubjectDatabaseEntityLoader and PlainObjectToDatabaseEntityTransformer now inline nearly
identical _id conversion logic. Separately, MongoEntityManager maintains convertMixedCriteria,
which uses ObjectId.isValid and can build queries from metadata columns for object
criteria—demonstrating there is already a single place intended for Mongo ID/criteria normalization.

src/query-builder/transformer/PlainObjectToDatabaseEntityTransformer.ts[133-176]
src/persistence/SubjectDatabaseEntityLoader.ts[120-151]
src/entity-manager/MongoEntityManager.ts[1050-1081]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
Two internal call sites now duplicate Mongo `_id` normalization and wrapper-object extraction logic. Duplicated logic is prone to drifting over time and can lead to inconsistent handling of ObjectId-compatible inputs.

### Issue Context
`MongoEntityManager` already contains centralized criteria normalization logic (`convertMixedCriteria`) that supports additional ObjectId-compatible forms and object-based criteria building.

### Fix Focus Areas
- src/persistence/SubjectDatabaseEntityLoader.ts[120-151]
- src/query-builder/transformer/PlainObjectToDatabaseEntityTransformer.ts[133-176]
- src/entity-manager/MongoEntityManager.ts[1050-1081]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


4. Mongo migration doc mismatch 🐞 Bug ✓ Correctness
Description
The migration guide recommends replacing findByIds with findBy + In, including for MongoDB,
but MongoDB find/findBy passes the where object directly to the Mongo driver without translating
FindOperator (e.g., In()) into $in. This makes the documented replacement misleading for Mongo
users and can cause queries to return no results.
Code

docs/docs/guides/8-migration-v1.md[R232-244]

+### `findByIds`
+
+The deprecated `findByIds` method has been removed from `EntityManager`, `Repository`, `BaseEntity`, `MongoEntityManager`, and `MongoRepository`. Use `findBy` with the `In` operator instead:
+
+```typescript
+// Before
+const users = await repository.findByIds([1, 2, 3])
+
+// After
+import { In } from "typeorm"
+
+const users = await repository.findBy({ id: In([1, 2, 3]) })
+```
Evidence
The guide explicitly claims the replacement applies to MongoEntityManager/MongoRepository and
shows In(...). However, MongoEntityManager’s executeFind builds a query by returning
options.where verbatim (or the conditions object itself) and then hands that object directly to
createEntityCursor, which ultimately calls collection.find(filter) without any conversion layer.
Since In() returns a TypeORM FindOperator("in", ...) object, it will be sent as-is to MongoDB
rather than as a $in expression. The PR’s own internal refactors for Mongo use _id: { $in: ... }
with ObjectId conversion, underscoring that $in is the correct Mongo form.

docs/docs/guides/8-migration-v1.md[232-244]
src/find-options/operator/In.ts[8-12]
src/entity-manager/MongoEntityManager.ts[965-983]
src/entity-manager/MongoEntityManager.ts[1198-1210]
src/driver/mongodb/MongoQueryRunner.ts[151-153]
src/persistence/SubjectDatabaseEntityLoader.ts[120-151]
src/query-builder/transformer/PlainObjectToDatabaseEntityTransformer.ts[144-176]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The v1 migration guide states that `findByIds` removal applies to MongoDB APIs too and recommends replacing it with `findBy` + `In()`. In the current MongoDB implementation, `In()` produces a TypeORM `FindOperator` object and Mongo query execution passes the `where` object directly to `collection.find(...)` without translating `FindOperator` into MongoDB operators like `$in`.
### Issue Context
This becomes user-impacting now that `MongoRepository.findByIds`/`MongoEntityManager.findByIds` are removed and the guide is the primary migration path.
### Fix Focus Areas
- docs/docs/guides/8-migration-v1.md[232-244]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

ⓘ The new review experience is currently in Beta. Learn more

Grey Divider

Qodo Logo

alumni
alumni previously requested changes Mar 6, 2026
Copy link
Copy Markdown
Collaborator

@alumni alumni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comment. SubjectDatabaseEntityLoader and PlainObjectToDatabaseEntityTransformer should not implement driver-specific logic.

@coveralls
Copy link
Copy Markdown

coveralls commented Mar 6, 2026

Coverage Status

coverage: 74.787% (-0.009%) from 74.796%
when pulling 69ff7a8 on refactor/remove-find-by-ids
into cd4c47b on master.

@qodo-free-for-open-source-projects
Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (5) 📘 Rule violations (3) 📎 Requirement gaps (0)

Grey Divider


Action required

1. findByIds still public 📘 Rule violation ✓ Correctness ⭐ New
Description
The migration guide states findByIds was removed from MongoEntityManager, but the PR
reintroduces a public MongoEntityManager.findByIds() method. This makes the docs inaccurate for
users relying on the stated public API changes.
Code

src/entity-manager/MongoEntityManager.ts[R961-993]

+    /**
+     * Finds entities by an array of ids, resolving ObjectId types as needed.
+     * @param entityClassOrName
+     * @param ids
+     */
+    async findByIds<Entity extends ObjectLiteral>(
+        entityClassOrName: EntityTarget<Entity>,
+        ids: any[],
+    ): Promise<Entity[]> {
+        const metadata = this.connection.getMetadata(entityClassOrName)
+        const objectIdInstance = PlatformTools.load("mongodb").ObjectId
+        const cursor = this.createEntityCursor<Entity>(entityClassOrName, {
+            _id: {
+                $in: ids.map((id) => {
+                    if (typeof id === "string") {
+                        return new objectIdInstance(id)
+                    }
+                    if (typeof id === "object") {
+                        if (id instanceof objectIdInstance) {
+                            return id
+                        }
+                        const propertyName =
+                            metadata.objectIdColumn!.propertyName
+                        if (id[propertyName] instanceof objectIdInstance) {
+                            return id[propertyName]
+                        }
+                    }
+                    return id
+                }),
+            },
+        } as Filter<Entity>)
+        return cursor.toArray()
+    }
Evidence
Compliance requires docs to accurately reflect user-facing API changes; the migration guide claims
findByIds was removed from MongoEntityManager, but the PR adds async findByIds(...) without
protected/private, meaning it remains publicly accessible.

Rule 2: Docs updated for user-facing changes
docs/docs/guides/8-migration-v1.md[232-235]
src/entity-manager/MongoEntityManager.ts[961-993]

Agent prompt
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 says `findByIds` was removed from `MongoEntityManager`, but the PR adds `MongoEntityManager.findByIds()` as a public method (no `protected`/`private`). This makes the docs inaccurate and keeps a deprecated-looking API surface.

## Issue Context
The migration guide explicitly lists `MongoEntityManager` among the APIs where `findByIds` was removed. Internal code paths in this PR call `mongoManager.findByIds(...)`, which also implies the API still exists.

## Fix Focus Areas
- src/entity-manager/MongoEntityManager.ts[961-993]
- src/persistence/SubjectDatabaseEntityLoader.ts[114-119]
- src/query-builder/transformer/PlainObjectToDatabaseEntityTransformer.ts[132-153]
- docs/docs/guides/8-migration-v1.md[232-235]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


2. Mongo docs suggest In() 🐞 Bug ✓ Correctness
Description
The migration guide says findByIds removal applies to MongoDB APIs and recommends `findBy({ id:
In([...]) })`, but Mongo find paths pass the filter directly to MongoDB with no translation of
TypeORM FindOperator (like In) and Mongo id filtering uses _id (not id). Mongo users
following the guide will likely get empty results or incorrect queries.
Code

docs/docs/guides/8-migration-v1.md[R232-244]

+### `findByIds`
+
+The deprecated `findByIds` method has been removed from `EntityManager`, `Repository`, `BaseEntity`, `MongoEntityManager`, and `MongoRepository`. Use `findBy` with the `In` operator instead:
+
+```typescript
+// Before
+const users = await repository.findByIds([1, 2, 3])
+
+// After
+import { In } from "typeorm"
+
+const users = await repository.findBy({ id: In([1, 2, 3]) })
+```
Evidence
The guide explicitly includes MongoDB managers/repositories yet shows the SQL-style In()
replacement. In MongoDB, findBy/find ultimately call collection.find(filter) with the provided
where/filter object; there is no code in the Mongo path that recognizes/rewrites TypeORM
FindOperator (produced by In()) into Mongo $in. Existing Mongo tests also demonstrate querying
ObjectId columns via _id, not id.

docs/docs/guides/8-migration-v1.md[232-244]
src/entity-manager/MongoEntityManager.ts[965-983]
src/entity-manager/MongoEntityManager.ts[1198-1235]
src/driver/mongodb/MongoQueryRunner.ts[151-153]
src/find-options/operator/In.ts[8-12]
src/find-options/FindOperator.ts[12-67]
test/functional/mongodb/basic/object-id/mongodb-object-id.test.ts[69-71]

Agent prompt
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 currently states that `findByIds` was removed from MongoDB APIs too, but it recommends the relational replacement (`findBy` + `In`) which is not translated in the MongoDB codepath.
### Issue Context
MongoDB find methods pass the filter object directly into `collection.find(...)` without converting TypeORM `FindOperator` instances (like `In`) into Mongo operators (like `$in`). Mongo tests also show querying ObjectId columns via `_id`.
### Fix Focus Areas
- docs/docs/guides/8-migration-v1.md[232-244]
### Suggested change
Adjust the section to:
1) Clearly label the existing snippet as **SQL/relational**.
2) Add a **MongoDB** snippet, e.g.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


3. as unknown as type bypass 📘 Rule violation ✓ Correctness
Description
New code uses as unknown as MongoEntityManager and (id: any) which bypasses type safety and
matches the checklist's prohibited any-casts. This can hide real typing issues and make MongoDB-id
normalization logic easier to break during refactors.
Code

src/query-builder/transformer/PlainObjectToDatabaseEntityTransformer.ts[R139-152]

+                    const mongoManager = this
+                        .manager as unknown as MongoEntityManager
+                    const targetMetadata = this.manager.connection.getMetadata(
+                        targetWithIds.target,
                   )
+                    const objectIdInstance =
+                        PlatformTools.load("mongodb").ObjectId
+                    const cursor =
+                        mongoManager.createEntityCursor<ObjectLiteral>(
+                            targetWithIds.target,
+                            {
+                                _id: {
+                                    $in: targetWithIds.ids.map((id: any) => {
+                                        if (typeof id === "string") {
Evidence
PR Compliance ID 4 forbids introducing any casts or similar type-bypass patterns. The new
implementation explicitly adds as unknown as MongoEntityManager and a callback parameter typed as
any.

Rule 4: Remove AI-generated noise
src/query-builder/transformer/PlainObjectToDatabaseEntityTransformer.ts[139-152]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The refactor introduces type-bypass casts (`as unknown as MongoEntityManager` and `(id: any)`), which violates the project requirement to avoid `any`-casts/type-safety bypasses.
## Issue Context
The code already branches on `isMongoDb`, so it should be possible to narrow types without `unknown`/`any` and keep id-normalization type-safe.
## Fix Focus Areas
- src/query-builder/transformer/PlainObjectToDatabaseEntityTransformer.ts[139-152]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


View more (1)
4. as unknown as type bypass 📘 Rule violation ✓ Correctness
Description
New code uses as unknown as MongoEntityManager and (id: any) which bypasses type safety and
matches the checklist's prohibited any-casts. This can hide real typing issues and make MongoDB-id
normalization logic easier to break during refactors.
Code

src/query-builder/transformer/PlainObjectToDatabaseEntityTransformer.ts[R139-152]

+                    const mongoManager = this
+                        .manager as unknown as MongoEntityManager
+                    const targetMetadata = this.manager.connection.getMetadata(
+                        targetWithIds.target,
                  )
+                    const objectIdInstance =
+                        PlatformTools.load("mongodb").ObjectId
+                    const cursor =
+                        mongoManager.createEntityCursor<ObjectLiteral>(
+                            targetWithIds.target,
+                            {
+                                _id: {
+                                    $in: targetWithIds.ids.map((id: any) => {
+                                        if (typeof id === "string") {
Evidence
PR Compliance ID 4 forbids introducing any casts or similar type-bypass patterns. The new
implementation explicitly adds as unknown as MongoEntityManager and a callback parameter typed as
any.

Rule 4: Remove AI-generated noise
src/query-builder/transformer/PlainObjectToDatabaseEntityTransformer.ts[139-152]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The refactor introduces type-bypass casts (`as unknown as MongoEntityManager` and `(id: any)`), which violates the project requirement to avoid `any`-casts/type-safety bypasses.
## Issue Context
The code already branches on `isMongoDb`, so it should be possible to narrow types without `unknown`/`any` and keep id-normalization type-safe.
## Fix Focus Areas
- src/query-builder/transformer/PlainObjectToDatabaseEntityTransformer.ts[139-152]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Remediation recommended

5. Mongo migration doc mismatch 🐞 Bug ✓ Correctness
Description
The migration guide recommends replacing findByIds with findBy + In, including for MongoDB,
but MongoDB find/findBy passes the where object directly to the Mongo driver without translating
FindOperator (e.g., In()) into $in. This makes the documented replacement misleading for Mongo
users and can cause queries to return no results.
Code

docs/docs/guides/8-migration-v1.md[R232-244]

+### `findByIds`
+
+The deprecated `findByIds` method has been removed from `EntityManager`, `Repository`, `BaseEntity`, `MongoEntityManager`, and `MongoRepository`. Use `findBy` with the `In` operator instead:
+
+```typescript
+// Before
+const users = await repository.findByIds([1, 2, 3])
+
+// After
+import { In } from "typeorm"
+
+const users = await repository.findBy({ id: In([1, 2, 3]) })
+```
Evidence
The guide explicitly claims the replacement applies to MongoEntityManager/MongoRepository and
shows In(...). However, MongoEntityManager’s executeFind builds a query by returning
options.where verbatim (or the conditions object itself) and then hands that object directly to
createEntityCursor, which ultimately calls collection.find(filter) without any conversion layer.
Since In() returns a TypeORM FindOperator("in", ...) object, it will be sent as-is to MongoDB
rather than as a $in expression. The PR’s own internal refactors for Mongo use _id: { $in: ... }
with ObjectId conversion, underscoring that $in is the correct Mongo form.

docs/docs/guides/8-migration-v1.md[232-244]
src/find-options/operator/In.ts[8-12]
src/entity-manager/MongoEntityManager.ts[965-983]
src/entity-manager/MongoEntityManager.ts[1198-1210]
src/driver/mongodb/MongoQueryRunner.ts[151-153]
src/persistence/SubjectDatabaseEntityLoader.ts[120-151]
src/query-builder/transformer/PlainObjectToDatabaseEntityTransformer.ts[144-176]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The v1 migration guide states that `findByIds` removal applies to MongoDB APIs too and recommends replacing it with `findBy` + `In()`. In the current MongoDB implementation, `In()` produces a TypeORM `FindOperator` object and Mongo query execution passes the `where` object directly to `collection.find(...)` without translating `FindOperator` into MongoDB operators like `$in`.
### Issue Context
This becomes user-impacting now that `MongoRepository.findByIds`/`MongoEntityManager.findByIds` are removed and the guide is the primary migration path.
### Fix Focus Areas
- docs/docs/guides/8-migration-v1.md[232-244]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


6. Mongo options bypassed 🐞 Bug ✓ Correctness
Description
The MongoDB branch in SubjectDatabaseEntityLoader now calls createEntityCursor(...).toArray()
directly, so any FindManyOptions behavior (projection/skip/take/order and soft-delete filtering)
provided by MongoEntityManager.find() will be ignored. This creates cross-driver inconsistency
(SQL uses setFindOptions(findOptions)), and makes future option changes in this code path silently
ineffective on MongoDB.
Code

src/persistence/SubjectDatabaseEntityLoader.ts[R115-153]

+                    const mongoManager = this.queryRunner
+                        .manager as MongoEntityManager
+                    const metadata = this.queryRunner.connection.getMetadata(
+                        subjectGroup.target,
+                    )
+                    const objectIdInstance =
+                        PlatformTools.load("mongodb").ObjectId
+                    const cursor =
+                        mongoManager.createEntityCursor<ObjectLiteral>(
                           subjectGroup.target,
-                        ) as MongoRepository<ObjectLiteral>
-                    entities = await mongoRepo.findByIds(allIds, findOptions)
+                            {
+                                _id: {
+                                    $in: allIds.map((id) => {
+                                        if (typeof id === "string") {
+                                            return new objectIdInstance(id)
+                                        }
+                                        if (typeof id === "object") {
+                                            if (
+                                                id instanceof objectIdInstance
+                                            ) {
+                                                return id
+                                            }
+                                            const propertyName =
+                                                metadata.objectIdColumn!
+                                                    .propertyName
+                                            if (
+                                                id[propertyName] instanceof
+                                                objectIdInstance
+                                            ) {
+                                                return id[propertyName]
+                                            }
+                                        }
+                                        return id
+                                    }),
+                                },
+                            },
+                        )
+                    entities = await cursor.toArray()
               } else {
Evidence
SubjectDatabaseEntityLoader constructs findOptions and applies it only for SQL via
setFindOptions(findOptions), but the MongoDB branch bypasses options entirely by using a raw
cursor and toArray(). Meanwhile, MongoEntityManager.find() shows the standard Mongo path where
FindManyOptions (select/skip/take/order/withDeleted) are applied and soft-deletes are filtered
unless withDeleted is set.

src/persistence/SubjectDatabaseEntityLoader.ts[99-160]
src/entity-manager/MongoEntityManager.ts[103-140]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`SubjectDatabaseEntityLoader` builds a `findOptions` object (used on SQL via `setFindOptions`) but the MongoDB branch bypasses TypeORM’s standard `find` option handling by using `createEntityCursor(...).toArray()` directly.
### Issue Context
MongoEntityManager’s `find()` applies `FindManyOptions` fields like `select/skip/take/order` and soft-delete filtering (`withDeleted`). The loader’s Mongo path should ideally align with that behavior (and at minimum not silently ignore options).
### Fix Focus Areas
- src/persistence/SubjectDatabaseEntityLoader.ts[99-160]
- src/entity-manager/MongoEntityManager.ts[103-140]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


7. Duplicated Mongo ID mapping 🐞 Bug ⛯ Reliability
Description
MongoDB _id normalization logic is duplicated in multiple internal call sites, increasing the
chance of inconsistent behavior if ID-handling evolves. TypeORM already has a centralized helper
(convertMixedCriteria) that supports a broader set of ObjectId-compatible inputs and object-based
criteria building, but the new code re-implements a narrower variant in two places.
Code

src/query-builder/transformer/PlainObjectToDatabaseEntityTransformer.ts[R139-176]

+                    const mongoManager = this
+                        .manager as unknown as MongoEntityManager
+                    const targetMetadata = this.manager.connection.getMetadata(
+                        targetWithIds.target,
                   )
+                    const objectIdInstance =
+                        PlatformTools.load("mongodb").ObjectId
+                    const cursor =
+                        mongoManager.createEntityCursor<ObjectLiteral>(
+                            targetWithIds.target,
+                            {
+                                _id: {
+                                    $in: targetWithIds.ids.map((id: any) => {
+                                        if (typeof id === "string") {
+                                            return new objectIdInstance(id)
+                                        }
+                                        if (typeof id === "object") {
+                                            if (
+                                                id instanceof objectIdInstance
+                                            ) {
+                                                return id
+                                            }
+                                            const propertyName =
+                                                targetMetadata.objectIdColumn!
+                                                    .propertyName
+                                            if (
+                                                id[propertyName] instanceof
+                                                objectIdInstance
+                                            ) {
+                                                return id[propertyName]
+                                            }
+                                        }
+                                        return id
+                                    }),
+                                },
+                            },
+                        )
+                    entities = await cursor.toArray()
Evidence
Both SubjectDatabaseEntityLoader and PlainObjectToDatabaseEntityTransformer now inline nearly
identical _id conversion logic. Separately, MongoEntityManager maintains convertMixedCriteria,
which uses ObjectId.isValid and can build queries from metadata columns for object
criteria—demonstrating there is already a single place intended for Mongo ID/criteria normalization.

src/query-builder/transformer/PlainObjectToDatabaseEntityTransformer.ts[133-176]
src/persistence/SubjectDatabaseEntityLoader.ts[120-151]
src/entity-manager/MongoEntityManager.ts[1050-1081]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Two internal call sites now duplicate Mongo `_id` normalization and wrapper-object extraction logic. Duplicated logic is prone to drifting over time and can lead to inconsistent handling of ObjectId-compatible inputs.
### Issue Context
`MongoEntityManager` already contains centralized criteria normalization logic (`convertMixedCriteria`) that supports additional ObjectId-compatible forms and object-based criteria building.
### Fix Focus Areas
- src/persistence/SubjectDatabaseEntityLoader.ts[120-151]
- src/query-builder/transformer/PlainObjectToDatabaseEntityTransformer.ts[133-176]
- src/entity-manager/MongoEntityManager.ts[1050-1081]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


View more (1)
8. Mongo migration doc mismatch 🐞 Bug ✓ Correctness
Description
The migration guide recommends replacing findByIds with findBy + In, including for MongoDB,
but MongoDB find/findBy passes the where object directly to the Mongo driver without translating
FindOperator (e.g., In()) into $in. This makes the documented replacement misleading for Mongo
users and can cause queries to return no results.
Code

docs/docs/guides/8-migration-v1.md[R232-244]

+### `findByIds`
+
+The deprecated `findByIds` method has been removed from `EntityManager`, `Repository`, `BaseEntity`, `MongoEntityManager`, and `MongoRepository`. Use `findBy` with the `In` operator instead:
+
+```typescript
+// Before
+const users = await repository.findByIds([1, 2, 3])
+
+// After
+import { In } from "typeorm"
+
+const users = await repository.findBy({ id: In([1, 2, 3]) })
+```
Evidence
The guide explicitly claims the replacement applies to MongoEntityManager/MongoRepository and
shows In(...). However, MongoEntityManager’s executeFind builds a query by returning
options.where verbatim (or the conditions object itself) and then hands that object directly to
createEntityCursor, which ultimately calls collection.find(filter) without any conversion layer.
Since In() returns a TypeORM FindOperator("in", ...) object, it will be sent as-is to MongoDB
rather than as a $in expression. The PR’s own internal refactors for Mongo use _id: { $in: ... }
with ObjectId conversion, underscoring that $in is the correct Mongo form.

docs/docs/guides/8-migration-v1.md[232-244]
src/find-options/operator/In.ts[8-12]
src/entity-manager/MongoEntityManager.ts[965-983]
src/entity-manager/MongoEntityManager.ts[1198-1210]
src/driver/mongodb/MongoQueryRunner.ts[151-153]
src/persistence/SubjectDatabaseEntityLoader.ts[120-151]
src/query-builder/transformer/PlainObjectToDatabaseEntityTransformer.ts[144-176]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The v1 migration guide states that `findByIds` removal applies to MongoDB APIs too and recommends replacing it with `findBy` + `In()`. In the current MongoDB implementation, `In()` produces a TypeORM `FindOperator` object and Mongo query execution passes the `where` object directly to `collection.find(...)` without translating `FindOperator` into MongoDB operators like `$in`.
### Issue Context
This becomes user-impacting now that `MongoRepository.findByIds`/`MongoEntityManager.findByIds` are removed and the guide is the primary migration path.
### Fix Focus Areas
- docs/docs/guides/8-migration-v1.md[232-244]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

ⓘ The new review experience is currently in Beta. Learn more

Grey Divider

Qodo Logo

@qodo-free-for-open-source-projects
Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Grey Divider

ⓘ The new review experience is currently in Beta. Learn more

Grey Divider

Qodo Logo

@pkuczynski pkuczynski requested a review from alumni March 6, 2026 17:47
@qodo-free-for-open-source-projects
Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (20) 📘 Rule violations (10) 📎 Requirement gaps (0)

Grey Divider


Action required

1. Mongo docs suggest In() 🐞 Bug ✓ Correctness
Description
The migration guide says findByIds removal applies to MongoDB APIs and recommends `findBy({ id:
In([...]) })`, but Mongo find paths pass the filter directly to MongoDB with no translation of
TypeORM FindOperator (like In) and Mongo id filtering uses _id (not id). Mongo users
following the guide will likely get empty results or incorrect queries.
Code

docs/docs/guides/8-migration-v1.md[R232-244]

+### `findByIds`
+
+The deprecated `findByIds` method has been removed from `EntityManager`, `Repository`, `BaseEntity`, `MongoEntityManager`, and `MongoRepository`. Use `findBy` with the `In` operator instead:
+
+```typescript
+// Before
+const users = await repository.findByIds([1, 2, 3])
+
+// After
+import { In } from "typeorm"
+
+const users = await repository.findBy({ id: In([1, 2, 3]) })
+```
Evidence
The guide explicitly includes MongoDB managers/repositories yet shows the SQL-style In()
replacement. In MongoDB, findBy/find ultimately call collection.find(filter) with the provided
where/filter object; there is no code in the Mongo path that recognizes/rewrites TypeORM
FindOperator (produced by In()) into Mongo $in. Existing Mongo tests also demonstrate querying
ObjectId columns via _id, not id.

docs/docs/guides/8-migration-v1.md[232-244]
src/entity-manager/MongoEntityManager.ts[965-983]
src/entity-manager/MongoEntityManager.ts[1198-1235]
src/driver/mongodb/MongoQueryRunner.ts[151-153]
src/find-options/operator/In.ts[8-12]
src/find-options/FindOperator.ts[12-67]
test/functional/mongodb/basic/object-id/mongodb-object-id.test.ts[69-71]

Agent prompt
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 currently states that `findByIds` was removed from MongoDB APIs too, but it recommends the relational replacement (`findBy` + `In`) which is not translated in the MongoDB codepath.
### Issue Context
MongoDB find methods pass the filter object directly into `collection.find(...)` without converting TypeORM `FindOperator` instances (like `In`) into Mongo operators (like `$in`). Mongo tests also show querying ObjectId columns via `_id`.
### Fix Focus Areas
- docs/docs/guides/8-migration-v1.md[232-244]
### Suggested change
Adjust the section to:
1) Clearly label the existing snippet as **SQL/relational**.
2) Add a **MongoDB** snippet, e.g.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


2. as unknown as type bypass📘 Rule violation ✓ Correctness
Description
New code uses as unknown as MongoEntityManager and (id: any) which bypasses type safety and
matches the checklist's prohibited any-casts. This can hide real typing issues and make MongoDB-id
normalization logic easier to break during refactors.
Code

src/query-builder/transformer/PlainObjectToDatabaseEntityTransformer.ts[R139-152]

+                    const mongoManager = this
+                        .manager as unknown as MongoEntityManager
+                    const targetMetadata = this.manager.connection.getMetadata(
+                        targetWithIds.target,
                  )
+                    const objectIdInstance =
+                        PlatformTools.load("mongodb").ObjectId
+                    const cursor =
+                        mongoManager.createEntityCursor<ObjectLiteral>(
+                            targetWithIds.target,
+                            {
+                                _id: {
+                                    $in: targetWithIds.ids.map((id: any) => {
+                                        if (typeof id === "string") {
Evidence
PR Compliance ID 4 forbids introducing any casts or similar type-bypass patterns. The new
implementation explicitly adds as unknown as MongoEntityManager and a callback parameter typed as
any.

Rule 4: Remove AI-generated noise
src/query-builder/transformer/PlainObjectToDatabaseEntityTransformer.ts[139-152]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The refactor introduces type-bypass casts (`as unknown as MongoEntityManager` and `(id: any)`), which violates the project requirement to avoid `any`-casts/type-safety bypasses.
## Issue Context
The code already branches on `isMongoDb`, so it should be possible to narrow types without `unknown`/`any` and keep id-normalization type-safe.
## Fix Focus Areas
- src/query-builder/transformer/PlainObjectToDatabaseEntityTransformer.ts[139-152]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


3. as unknown as type bypass📘 Rule violation ✓ Correctness
Description
New code uses as unknown as MongoEntityManager and (id: any) which bypasses type safety and
matches the checklist's prohibited any-casts. This can hide real typing issues and make MongoDB-id
normalization logic easier to break during refactors.
Code

src/query-builder/transformer/PlainObjectToDatabaseEntityTransformer.ts[R139-152]

+                    const mongoManager = this
+                        .manager as unknown as MongoEntityManager
+                    const targetMetadata = this.manager.connection.getMetadata(
+                        targetWithIds.target,
                 )
+                    const objectIdInstance =
+                        PlatformTools.load("mongodb").ObjectId
+                    const cursor =
+                        mongoManager.createEntityCursor<ObjectLiteral>(
+                            targetWithIds.target,
+                            {
+                                _id: {
+                                    $in: targetWithIds.ids.map((id: any) => {
+                                        if (typeof id === "string") {
Evidence
PR Compliance ID 4 forbids introducing any casts or similar type-bypass patterns. The new
implementation explicitly adds as unknown as MongoEntityManager and a callback parameter typed as
any.

Rule 4: Remove AI-generated noise
src/query-builder/transformer/PlainObjectToDatabaseEntityTransformer.ts[139-152]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The refactor introduces type-bypass casts (`as unknown as MongoEntityManager` and `(id: any)`), which violates the project requirement to avoid `any`-casts/type-safety bypasses.
## Issue Context
The code already branches on `isMongoDb`, so it should be possible to narrow types without `unknown`/`any` and keep id-normalization type-safe.
## Fix Focus Areas
- src/query-builder/transformer/PlainObjectToDatabaseEntityTransformer.ts[139-152]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


View more (10)
4. findByIds still public 📘 Rule violation ✓ Correctness
Description
The migration guide states findByIds was removed from MongoEntityManager, but the PR
reintroduces a public MongoEntityManager.findByIds() method. This makes the docs inaccurate for
users relying on the stated public API changes.
Code

src/entity-manager/MongoEntityManager.ts[R961-993]

+    /**
+     * Finds entities by an array of ids, resolving ObjectId types as needed.
+     * @param entityClassOrName
+     * @param ids
+     */
+    async findByIds<Entity extends ObjectLiteral>(
+        entityClassOrName: EntityTarget<Entity>,
+        ids: any[],
+    ): Promise<Entity[]> {
+        const metadata = this.connection.getMetadata(entityClassOrName)
+        const objectIdInstance = PlatformTools.load("mongodb").ObjectId
+        const cursor = this.createEntityCursor<Entity>(entityClassOrName, {
+            _id: {
+                $in: ids.map((id) => {
+                    if (typeof id === "string") {
+                        return new objectIdInstance(id)
+                    }
+                    if (typeof id === "object") {
+                        if (id instanceof objectIdInstance) {
+                            return id
+                        }
+                        const propertyName =
+                            metadata.objectIdColumn!.propertyName
+                        if (id[propertyName] instanceof objectIdInstance) {
+                            return id[propertyName]
+                        }
+                    }
+                    return id
+                }),
+            },
+        } as Filter<Entity>)
+        return cursor.toArray()
+    }
Evidence
Compliance requires docs to accurately reflect user-facing API changes; the migration guide claims
findByIds was removed from MongoEntityManager, but the PR adds async findByIds(...) without
protected/private, meaning it remains publicly accessible.

Rule 2: Docs updated for user-facing changes
docs/docs/guides/8-migration-v1.md[232-235]
src/entity-manager/MongoEntityManager.ts[961-993]

Agent prompt
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 says `findByIds` was removed from `MongoEntityManager`, but the PR adds `MongoEntityManager.findByIds()` as a public method (no `protected`/`private`). This makes the docs inaccurate and keeps a deprecated-looking API surface.
## Issue Context
The migration guide explicitly lists `MongoEntityManager` among the APIs where `findByIds` was removed. Internal code paths in this PR call `mongoManager.findByIds(...)`, which also implies the API still exists.
## Fix Focus Areas
- src/entity-manager/MongoEntityManager.ts[961-993]
- src/persistence/SubjectDatabaseEntityLoader.ts[114-119]
- src/query-builder/transformer/PlainObjectToDatabaseEntityTransformer.ts[132-153]
- docs/docs/guides/8-migration-v1.md[232-235]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


5. Mongo docs suggest In() 🐞 Bug ✓ Correctness
Description
The migration guide says findByIds removal applies to MongoDB APIs and recommends `findBy({ id:
In([...]) })`, but Mongo find paths pass the filter directly to MongoDB with no translation of
TypeORM FindOperator (like In) and Mongo id filtering uses _id (not id). Mongo users
following the guide will likely get empty results or incorrect queries.
Code

docs/docs/guides/8-migration-v1.md[R232-244]

+### `findByIds`
+
+The deprecated `findByIds` method has been removed from `EntityManager`, `Repository`, `BaseEntity`, `MongoEntityManager`, and `MongoRepository`. Use `findBy` with the `In` operator instead:
+
+```typescript
+// Before
+const users = await repository.findByIds([1, 2, 3])
+
+// After
+import { In } from "typeorm"
+
+const users = await repository.findBy({ id: In([1, 2, 3]) })
+```
Evidence
The guide explicitly includes MongoDB managers/repositories yet shows the SQL-style In()
replacement. In MongoDB, findBy/find ultimately call collection.find(filter) with the provided
where/filter object; there is no code in the Mongo path that recognizes/rewrites TypeORM
FindOperator (produced by In()) into Mongo $in. Existing Mongo tests also demonstrate querying
ObjectId columns via _id, not id.

docs/docs/guides/8-migration-v1.md[232-244]
src/entity-manager/MongoEntityManager.ts[965-983]
src/entity-manager/MongoEntityManager.ts[1198-1235]
src/driver/mongodb/MongoQueryRunner.ts[151-153]
src/find-options/operator/In.ts[8-12]
src/find-options/FindOperator.ts[12-67]
test/functional/mongodb/basic/object-id/mongodb-object-id.test.ts[69-71]

Agent prompt
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 currently states that `findByIds` was removed from MongoDB APIs too, but it recommends the relational replacement (`findBy` + `In`) which is not translated in the MongoDB codepath.
### Issue Context
MongoDB find methods pass the filter object directly into `collection.find(...)` without converting TypeORM `FindOperator` instances (like `In`) into Mongo operators (like `$in`). Mongo tests also show querying ObjectId columns via `_id`.
### Fix Focus Areas
- docs/docs/guides/8-migration-v1.md[232-244]
### Suggested change
Adjust the section to:
1) Clearly label the existing snippet as **SQL/relational**.
2) Add a **MongoDB** snippet, e.g.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


6. as unknown as type bypass📘 Rule violation ✓ Correctness
Description
New code uses as unknown as MongoEntityManager and (id: any) which bypasses type safety and
matches the checklist's prohibited any-casts. This can hide real typing issues and make MongoDB-id
normalization logic easier to break during refactors.
Code

src/query-builder/transformer/PlainObjectToDatabaseEntityTransformer.ts[R139-152]

+                    const mongoManager = this
+                        .manager as unknown as MongoEntityManager
+                    const targetMetadata = this.manager.connection.getMetadata(
+                        targetWithIds.target,
                 )
+                    const objectIdInstance =
+                        PlatformTools.load("mongodb").ObjectId
+                    const cursor =
+                        mongoManager.createEntityCursor<ObjectLiteral>(
+                            targetWithIds.target,
+                            {
+                                _id: {
+                                    $in: targetWithIds.ids.map((id: any) => {
+                                        if (typeof id === "string") {
Evidence
PR Compliance ID 4 forbids introducing any casts or similar type-bypass patterns. The new
implementation explicitly adds as unknown as MongoEntityManager and a callback parameter typed as
any.

Rule 4: Remove AI-generated noise
src/query-builder/transformer/PlainObjectToDatabaseEntityTransformer.ts[139-152]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The refactor introduces type-bypass casts (`as unknown as MongoEntityManager` and `(id: any)`), which violates the project requirement to avoid `any`-casts/type-safety bypasses.
## Issue Context
The code already branches on `isMongoDb`, so it should be possible to narrow types without `unknown`/`any` and keep id-normalization type-safe.
## Fix Focus Areas
- src/query-builder/transformer/PlainObjectToDatabaseEntityTransformer.ts[139-152]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


7. as unknown as type bypass📘 Rule violation ✓ Correctness
Description
New code uses as unknown as MongoEntityManager and (id: any) which bypasses type safety and
matches the checklist's prohibited any-casts. This can hide real typing issues and make MongoDB-id
normalization logic easier to break during refactors.
Code

src/query-builder/transformer/PlainObjectToDatabaseEntityTransformer.ts[R139-152]

+                    const mongoManager = this
+                        .manager as unknown as MongoEntityManager
+                    const targetMetadata = this.manager.connection.getMetadata(
+                        targetWithIds.target,
                )
+                    const objectIdInstance =
+                        PlatformTools.load("mongodb").ObjectId
+                    const cursor =
+                        mongoManager.createEntityCursor<ObjectLiteral>(
+                            targetWithIds.target,
+                            {
+                                _id: {
+                                    $in: targetWithIds.ids.map((id: any) => {
+                                        if (typeof id === "string") {
Evidence
PR Compliance ID 4 forbids introducing any casts or similar type-bypass patterns. The new
implementation explicitly adds as unknown as MongoEntityManager and a callback parameter typed as
any.

Rule 4: Remove AI-generated noise
src/query-builder/transformer/PlainObjectToDatabaseEntityTransformer.ts[139-152]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The refactor introduces type-bypass casts (`as unknown as MongoEntityManager` and `(id: any)`), which violates the project requirement to avoid `any`-casts/type-safety bypasses.
## Issue Context
The code already branches on `isMongoDb`, so it should be possible to narrow types without `unknown`/`any` and keep id-normalization type-safe.
## Fix Focus Areas
- src/query-builder/transformer/PlainObjectToDatabaseEntityTransformer.ts[139-152]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


8. as unknown as type bypass 📘 Rule violation ✓ Correctness
Description
New code uses as unknown as MongoEntityManager and (id: any) which bypasses type safety and
matches the checklist's prohibited any-casts. This can hide real typing issues and make MongoDB-id
normalization logic easier to break during refactors.
Code

src/query-builder/transformer/PlainObjectToDatabaseEntityTransformer.ts[R139-152]

+                    const mongoManager = this
+                        .manager as unknown as MongoEntityManager
+                    const targetMetadata = this.manager.connection.getMetadata(
+                        targetWithIds.target,
                   )
+                    const objectIdInstance =
+                        PlatformTools.load("mongodb").ObjectId
+                    const cursor =
+                        mongoManager.createEntityCursor<ObjectLiteral>(
+                            targetWithIds.target,
+                            {
+                                _id: {
+                                    $in: targetWithIds.ids.map((id: any) => {
+                                        if (typeof id === "string") {
Evidence
PR Compliance ID 4 forbids introducing any casts or similar type-bypass patterns. The new
implementation explicitly adds as unknown as MongoEntityManager and a callback parameter typed as
any.

Rule 4: Remove AI-generated noise
src/query-builder/transformer/PlainObjectToDatabaseEntityTransformer.ts[139-152]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The refactor introduces type-bypass casts (`as unknown as MongoEntityManager` and `(id: any)`), which violates the project requirement to avoid `any`-casts/type-safety bypasses.
## Issue Context
The code already branches on `isMongoDb`, so it should be possible to narrow types without `unknown`/`any` and keep id-normalization type-safe.
## Fix Focus Areas
- src/query-builder/transformer/PlainObjectToDatabaseEntityTransformer.ts[139-152]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


9. as unknown as type bypass 📘 Rule violation ✓ Correctness
Description
New code uses as unknown as MongoEntityManager and (id: any) which bypasses type safety and
matches the checklist's prohibited any-casts. This can hide real typing issues and make MongoDB-id
normalization logic easier to break during refactors.
Code

src/query-builder/transformer/PlainObjectToDatabaseEntityTransformer.ts[R139-152]

+                    const mongoManager = this
+                        .manager as unknown as MongoEntityManager
+                    const targetMetadata = this.manager.connection.getMetadata(
+                        targetWithIds.target,
                  )
+                    const objectIdInstance =
+                        PlatformTools.load("mongodb").ObjectId
+                    const cursor =
+                        mongoManager.createEntityCursor<ObjectLiteral>(
+                            targetWithIds.target,
+                            {
+                                _id: {
+                                    $in: targetWithIds.ids.map((id: any) => {
+                                        if (typeof id === "string") {
Evidence
PR Compliance ID 4 forbids introducing any casts or similar type-bypass patterns. The new
implementation explicitly adds as unknown as MongoEntityManager and a callback parameter typed as
any.

Rule 4: Remove AI-generated noise
src/query-builder/transformer/PlainObjectToDatabaseEntityTransformer.ts[139-152]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The refactor introduces type-bypass casts (`as unknown as MongoEntityManager` and `(id: any)`), which violates the project requirement to avoid `any`-casts/type-safety bypasses.
## Issue Context
The code already branches on `isMongoDb`, so it should be possible to narrow types without `unknown`/`any` and keep id-normalization type-safe.
## Fix Focus Areas
- src/query-builder/transformer/PlainObjectToDatabaseEntityTransformer.ts[139-152]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


10. findByIds still public 📘 Rule violation ✓ Correctness
Description
The migration guide states findByIds was removed from MongoEntityManager, but the PR
reintroduces a public MongoEntityManager.findByIds() method. This makes the docs inaccurate for
users relying on the stated public API changes.
Code

src/entity-manager/MongoEntityManager.ts[R961-993]

+    /**
+     * Finds entities by an array of ids, resolving ObjectId types as needed.
+     * @param entityClassOrName
+     * @param ids
+     */
+    async findByIds<Entity extends ObjectLiteral>(
+        entityClassOrName: EntityTarget<Entity>,
+        ids: any[],
+    ): Promise<Entity[]> {
+        const metadata = this.connection.getMetadata(entityClassOrName)
+        const objectIdInstance = PlatformTools.load("mongodb").ObjectId
+        const cursor = this.createEntityCursor<Entity>(entityClassOrName, {
+            _id: {
+                $in: ids.map((id) => {
+                    if (typeof id === "string") {
+                        return new objectIdInstance(id)
+                    }
+                    if (typeof id === "object") {
+                        if (id instanceof objectIdInstance) {
+                            return id
+                        }
+                        const propertyName =
+                            metadata.objectIdColumn!.propertyName
+                        if (id[propertyName] instanceof objectIdInstance) {
+                            return id[propertyName]
+                        }
+                    }
+                    return id
+                }),
+            },
+        } as Filter<Entity>)
+        return cursor.toArray()
+    }
Evidence
Compliance requires docs to accurately reflect user-facing API changes; the migration guide claims
findByIds was removed from MongoEntityManager, but the PR adds async findByIds(...) without
protected/private, meaning it remains publicly accessible.

Rule 2: Docs updated for user-facing changes
docs/docs/guides/8-migration-v1.md[232-235]
src/entity-manager/MongoEntityManager.ts[961-993]

Agent prompt
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 says `findByIds` was removed from `MongoEntityManager`, but the PR adds `MongoEntityManager.findByIds()` as a public method (no `protected`/`private`). This makes the docs inaccurate and keeps a deprecated-looking API surface.
## Issue Context
The migration guide explicitly lists `MongoEntityManager` among the APIs where `findByIds` was removed. Internal code paths in this PR call `mongoManager.findByIds(...)`, which also implies the API still exists.
## Fix Focus Areas
- src/entity-manager/MongoEntityManager.ts[961-993]
- src/persistence/SubjectDatabaseEntityLoader.ts[114-119]
- src/query-builder/transformer/PlainObjectToDatabaseEntityTransformer.ts[132-153]
- docs/docs/guides/8-migration-v1.md[232-235]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


11. Mongo docs suggest In() 🐞 Bug ✓ Correctness
Description
The migration guide says findByIds removal applies to MongoDB APIs and recommends `findBy({ id:
In([...]) })`, but Mongo find paths pass the filter directly to MongoDB with no translation of
TypeORM FindOperator (like In) and Mongo id filtering uses _id (not id). Mongo users
following the guide will likely get empty results or incorrect queries.
Code

docs/docs/guides/8-migration-v1.md[R232-244]

+### `findByIds`
+
+The deprecated `findByIds` method has been removed from `EntityManager`, `Repository`, `BaseEntity`, `MongoEntityManager`, and `MongoRepository`. Use `findBy` with the `In` operator instead:
+
+```typescript
+// Before
+const users = await repository.findByIds([1, 2, 3])
+
+// After
+import { In } from "typeorm"
+
+const users = await repository.findBy({ id: In([1, 2, 3]) })
+```
Evidence
The guide explicitly includes MongoDB managers/repositories yet shows the SQL-style In()
replacement. In MongoDB, findBy/find ultimately call collection.find(filter) with the provided
where/filter object; there is no code in the Mongo path that recognizes/rewrites TypeORM
FindOperator (produced by In()) into Mongo $in. Existing Mongo tests also demonstrate querying
ObjectId columns via _id, not id.

docs/docs/guides/8-migration-v1.md[232-244]
src/entity-manager/MongoEntityManager.ts[965-983]
src/entity-manager/MongoEntityManager.ts[1198-1235]
src/driver/mongodb/MongoQueryRunner.ts[151-153]
src/find-options/operator/In.ts[8-12]
src/find-options/FindOperator.ts[12-67]
test/functional/mongodb/basic/object-id/mongodb-object-id.test.ts[69-71]

Agent prompt
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 currently states that `findByIds` was removed from MongoDB APIs too, but it recommends the relational replacement (`findBy` + `In`) which is not translated in the MongoDB codepath.
### Issue Context
MongoDB find methods pass the filter object directly into `collection.find(...)` without converting TypeORM `FindOperator` instances (like `In`) into Mongo operators (like `$in`). Mongo tests also show querying ObjectId columns via `_id`.
### Fix Focus Areas
- docs/docs/guides/8-migration-v1.md[232-244]
### Suggested change
Adjust the section to:
1) Clearly label the existing snippet as **SQL/relational**.
2) Add a **MongoDB** snippet, e.g.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


12. as unknown as type bypass 📘 Rule violation ✓ Correctness
Description
New code uses as unknown as MongoEntityManager and (id: any) which bypasses type safety and
matches the checklist's prohibited any-casts. This can hide real typing issues and make MongoDB-id
normalization logic easier to break during refactors.
Code

src/query-builder/transformer/PlainObjectToDatabaseEntityTransformer.ts[R139-152]

+                    const mongoManager = this
+                        .manager as unknown as MongoEntityManager
+                    const targetMetadata = this.manager.connection.getMetadata(
+                        targetWithIds.target,
                  )
+                    const objectIdInstance =
+                        PlatformTools.load("mongodb").ObjectId
+                    const cursor =
+                        mongoManager.createEntityCursor<ObjectLiteral>(
+                            targetWithIds.target,
+                            {
+                                _id: {
+                                    $in: targetWithIds.ids.map((id: any) => {
+                                        if (typeof id === "string") {
Evidence
PR Compliance ID 4 forbids introducing any casts or similar type-bypass patterns. The new
implementation explicitly adds as unknown as MongoEntityManager and a callback parameter typed as
any.

Rule 4: Remove AI-generated noise
src/query-builder/transformer/PlainObjectToDatabaseEntityTransformer.ts[139-152]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The refactor introduces type-bypass casts (`as unknown as MongoEntityManager` and `(id: any)`), which violates the project requirement to avoid `any`-casts/type-safety bypasses.
## Issue Context
The code already branches on `isMongoDb`, so it should be possible to narrow types without `unknown`/`any` and keep id-normalization type-safe.
## Fix Focus Areas
- src/query-builder/transformer/PlainObjectToDatabaseEntityTransformer.ts[139-152]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


13. as unknown as type bypass 📘 Rule violation ✓ Correctness
Description
New code uses as unknown as MongoEntityManager and (id: any) which bypasses type safety and
matches the checklist's prohibited any-casts. This can hide real typing issues and make MongoDB-id
normalization logic easier to break during refactors.
Code

src/query-builder/transformer/PlainObjectToDatabaseEntityTransformer.ts[R139-152]

+                    const mongoManager = this
+                        .manager as unknown as MongoEntityManager
+                    const targetMetadata = this.manager.connection.getMetadata(
+                        targetWithIds.target,
                 )
+                    const objectIdInstance =
+                        PlatformTools.load("mongodb").ObjectId
+                    const cursor =
+                        mongoManager.createEntityCursor<ObjectLiteral>(
+                            targetWithIds.target,
+                            {
+                                _id: {
+                                    $in: targetWithIds.ids.map((id: any) => {
+                                        if (typeof id === "string") {
Evidence
PR Compliance ID 4 forbids introducing any casts or similar type-bypass patterns. The new
implementation explicitly adds as unknown as MongoEntityManager and a callback parameter typed as
any.

Rule 4: Remove AI-generated noise
src/query-builder/transformer/PlainObjectToDatabaseEntityTransformer.ts[139-152]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The refactor introduces type-bypass casts (`as unknown as MongoEntityManager` and `(id: any)`), which violates the project requirement to avoid `any`-casts/type-safety bypasses.
## Issue Context
The code already branches on `isMongoDb`, so it should be possible to narrow types without `unknown`/`any` and keep id-normalization type-safe.
## Fix Focus Areas
- src/query-builder/transformer/PlainObjectToDatabaseEntityTransformer.ts[139-152]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Remediation recommended

14. Mongo findByIds still exposed 🐞 Bug ✓ Correctness ⭐ New
Description
MongoDB still exposes findByIds on MongoEntityManager and MongoRepository (and the PR removes
the deprecation tag), creating inconsistent cross-driver behavior vs the relational APIs and making
the migration guidance incomplete/ambiguous for Mongo users.
Code

src/entity-manager/MongoEntityManager.ts[R185-190]

     * @param entityClassOrName
     * @param ids
     * @param optionsOrConditions
-     * @deprecated use `findBy` method instead.
     */
    async findByIds<Entity>(
        entityClassOrName: EntityTarget<Entity>,
Evidence
The migration guide states findByIds was removed from the core APIs, but Mongo-specific public
APIs still define findByIds methods. Additionally, the PR change in Mongo files removes the
@deprecated annotation without removing the method, effectively “un-deprecating” it and increasing
inconsistency.

docs/docs/guides/8-migration-v1.md[232-244]
src/entity-manager/MongoEntityManager.ts[182-241]
src/repository/MongoRepository.ts[135-143]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
MongoDB still publicly exposes `findByIds` (and the PR removes its `@deprecated` tag), which is inconsistent with the removal from `EntityManager`/`Repository`/`BaseEntity` and makes migration guidance ambiguous for MongoDB users.

### Issue Context
The migration guide claims removal from core APIs, but Mongo-specific APIs still include `findByIds`.

### Fix Focus Areas
- src/entity-manager/MongoEntityManager.ts[182-241]
- src/repository/MongoRepository.ts[135-143]
- docs/docs/guides/8-migration-v1.md[232-244]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


15. Transformer depends on Mongo findByIds 🐞 Bug ⛯ Reliability ⭐ New
Description
PlainObjectToDatabaseEntityTransformer now has a MongoDB branch that directly calls
MongoEntityManager.findByIds. If the intent is to fully remove findByIds (including MongoDB
variants), this internal dependency will immediately block that refactor and risks regressions when
Mongo’s API is aligned later.
Code

src/query-builder/transformer/PlainObjectToDatabaseEntityTransformer.ts[R132-143]

+        const isMongoDb =
+            this.manager.connection.driver.options.type === "mongodb"
        await Promise.all(
-            loadMap.groupByTargetIds().map((targetWithIds) => {
-                // todo: fix type hinting
-                return this.manager
-                    .findByIds<ObjectLiteral>(
-                        targetWithIds.target as any,
+            loadMap.groupByTargetIds().map(async (targetWithIds) => {
+                let entities: ObjectLiteral[]
+                if (isMongoDb) {
+                    const mongoManager = this
+                        .manager as unknown as MongoEntityManager
+                    entities = await mongoManager.findByIds(
+                        targetWithIds.target,
                        targetWithIds.ids,
                    )
-                    .then((entities) =>
-                        loadMap.fillEntities(targetWithIds.target, entities),
-                    )
Evidence
The updated transformer explicitly casts to MongoEntityManager and calls findByIds, meaning the
codebase still relies on the deprecated API shape (for MongoDB). This creates a maintenance trap
if/when Mongo’s findByIds is removed to match the relational API removals.

src/query-builder/transformer/PlainObjectToDatabaseEntityTransformer.ts[132-152]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
`PlainObjectToDatabaseEntityTransformer` still depends on MongoDB `findByIds`, which undermines the effort to remove `findByIds` and will break if MongoDB `findByIds` is removed/aligned in a follow-up.

### Issue Context
The relational branch was refactored to `whereInIds`, but the MongoDB branch calls `MongoEntityManager.findByIds` directly.

### Fix Focus Areas
- src/query-builder/transformer/PlainObjectToDatabaseEntityTransformer.ts[132-152]
- src/entity-manager/MongoEntityManager.ts[182-241]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


16. Mongo migration doc mismatch 🐞 Bug ✓ Correctness
Description
The migration guide recommends replacing findByIds with findBy + In, including for MongoDB,
but MongoDB find/findBy passes the where object directly to the Mongo driver without translating
FindOperator (e.g., In()) into $in. This makes the documented replacement misleading for Mongo
users and can cause queries to return no results.
Code

docs/docs/guides/8-migration-v1.md[R232-244]

+### `findByIds`
+
+The deprecated `findByIds` method has been removed from `EntityManager`, `Repository`, `BaseEntity`, `MongoEntityManager`, and `MongoRepository`. Use `findBy` with the `In` operator instead:
+
+```typescript
+// Before
+const users = await repository.findByIds([1, 2, 3])
+
+// After
+import { In } from "typeorm"
+
+const users = await repository.findBy({ id: In([1, 2, 3]) })
+```
Evidence
The guide explicitly claims the replacement applies to MongoEntityManager/MongoRepository and
shows In(...). However, MongoEntityManager’s executeFind builds a query by returning
options.where verbatim (or the conditions object itself) and then hands that object directly to
createEntityCursor, which ultimately calls collection.find(filter) without any conversion layer.
Since In() returns a TypeORM FindOperator("in", ...) object, it will be sent as-is to MongoDB
rather than as a $in expression. The PR’s own internal refactors for Mongo use _id: { $in: ... }
with ObjectId conversion, underscoring that $in is the correct Mongo form.

docs/docs/guides/8-migration-v1.md[232-244]
src/find-options/operator/In.ts[8-12]
src/entity-manager/MongoEntityManager.ts[965-983]
src/entity-manager/MongoEntityManager.ts[1198-1210]
src/driver/mongodb/MongoQueryRunner.ts[151-153]
src/persistence/SubjectDatabaseEntityLoader.ts[120-151]
src/query-builder/transformer/PlainObjectToDatabaseEntityTransformer.ts[144-176]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The v1 migration guide states that `findByIds` removal applies to MongoDB APIs too and recommends replacing it with `findBy` + `In()`. In the current MongoDB implementation, `In()` produces a TypeORM `FindOperator` object and Mongo query execution passes the `where` object directly to `collection.find(...)` without translating `FindOperator` into MongoDB operators like `$in`.
### Issue Context
This becomes user-impacting now that `MongoRepository.findByIds`/`MongoEntityManager.findByIds` are removed and the guide is the primary migration path.
### Fix Focus Areas
- docs/docs/guides/8-migration-v1.md[232-244]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


View more (14)
17. Mongo options bypassed🐞 Bug ✓ Correctness
Description
The MongoDB branch in SubjectDatabaseEntityLoader now calls createEntityCursor(...).toArray()
directly, so any FindManyOptions behavior (projection/skip/take/order and soft-delete filtering)
provided by MongoEntityManager.find() will be ignored. This creates cross-driver inconsistency
(SQL uses setFindOptions(findOptions)), and makes future option changes in this code path silently
ineffective on MongoDB.
Code

src/persistence/SubjectDatabaseEntityLoader.ts[R115-153]

+                    const mongoManager = this.queryRunner
+                        .manager as MongoEntityManager
+                    const metadata = this.queryRunner.connection.getMetadata(
+                        subjectGroup.target,
+                    )
+                    const objectIdInstance =
+                        PlatformTools.load("mongodb").ObjectId
+                    const cursor =
+                        mongoManager.createEntityCursor<ObjectLiteral>(
                          subjectGroup.target,
-                        ) as MongoRepository<ObjectLiteral>
-                    entities = await mongoRepo.findByIds(allIds, findOptions)
+                            {
+                                _id: {
+                                    $in: allIds.map((id) => {
+                                        if (typeof id === "string") {
+                                            return new objectIdInstance(id)
+                                        }
+                                        if (typeof id === "object") {
+                                            if (
+                                                id instanceof objectIdInstance
+                                            ) {
+                                                return id
+                                            }
+                                            const propertyName =
+                                                metadata.objectIdColumn!
+                                                    .propertyName
+                                            if (
+                                                id[propertyName] instanceof
+                                                objectIdInstance
+                                            ) {
+                                                return id[propertyName]
+                                            }
+                                        }
+                                        return id
+                                    }),
+                                },
+                            },
+                        )
+                    entities = await cursor.toArray()
              } else {
Evidence
SubjectDatabaseEntityLoader constructs findOptions and applies it only for SQL via
setFindOptions(findOptions), but the MongoDB branch bypasses options entirely by using a raw
cursor and toArray(). Meanwhile, MongoEntityManager.find() shows the standard Mongo path where
FindManyOptions (select/skip/take/order/withDeleted) are applied and soft-deletes are filtered
unless withDeleted is set.

src/persistence/SubjectDatabaseEntityLoader.ts[99-160]
src/entity-manager/MongoEntityManager.ts[103-140]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`SubjectDatabaseEntityLoader` builds a `findOptions` object (used on SQL via `setFindOptions`) but the MongoDB branch bypasses TypeORM’s standard `find` option handling by using `createEntityCursor(...).toArray()` directly.
### Issue Context
MongoEntityManager’s `find()` applies `FindManyOptions` fields like `select/skip/take/order` and soft-delete filtering (`withDeleted`). The loader’s Mongo path should ideally align with that behavior (and at minimum not silently ignore options).
### Fix Focus Areas
- src/persistence/SubjectDatabaseEntityLoader.ts[99-160]
- src/entity-manager/MongoEntityManager.ts[103-140]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


18. Duplicated Mongo ID mapping🐞 Bug ⛯ Reliability
Description
MongoDB _id normalization logic is duplicated in multiple internal call sites, increasing the
chance of inconsistent behavior if ID-handling evolves. TypeORM already has a centralized helper
(convertMixedCriteria) that supports a broader set of ObjectId-compatible inputs and object-based
criteria building, but the new code re-implements a narrower variant in two places.
Code

src/query-builder/transformer/PlainObjectToDatabaseEntityTransformer.ts[R139-176]

+                    const mongoManager = this
+                        .manager as unknown as MongoEntityManager
+                    const targetMetadata = this.manager.connection.getMetadata(
+                        targetWithIds.target,
                  )
+                    const objectIdInstance =
+                        PlatformTools.load("mongodb").ObjectId
+                    const cursor =
+                        mongoManager.createEntityCursor<ObjectLiteral>(
+                            targetWithIds.target,
+                            {
+                                _id: {
+                                    $in: targetWithIds.ids.map((id: any) => {
+                                        if (typeof id === "string") {
+                                            return new objectIdInstance(id)
+                                        }
+                                        if (typeof id === "object") {
+                                            if (
+                                                id instanceof objectIdInstance
+                                            ) {
+                                                return id
+                                            }
+                                            const propertyName =
+                                                targetMetadata.objectIdColumn!
+                                                    .propertyName
+                                            if (
+                                                id[propertyName] instanceof
+                                                objectIdInstance
+                                            ) {
+                                                return id[propertyName]
+                                            }
+                                        }
+                                        return id
+          ...

@qodo-free-for-open-source-projects
Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Grey Divider

ⓘ The new review experience is currently in Beta. Learn more

Grey Divider

Qodo Logo

@pkuczynski pkuczynski requested review from gioboa and naorpeled March 6, 2026 22:23
@pkuczynski pkuczynski dismissed alumni’s stale review March 6, 2026 22:29

Changes applied

@qodo-free-for-open-source-projects
Copy link
Copy Markdown

Persistent review updated to latest commit c78dff7

1 similar comment
@qodo-free-for-open-source-projects
Copy link
Copy Markdown

Persistent review updated to latest commit c78dff7

@pkuczynski pkuczynski added this to the 1.0 milestone Mar 6, 2026
@pkuczynski pkuczynski enabled auto-merge (squash) March 11, 2026 16:56
…d-by-ids

# Conflicts:
#	docs/docs/guides/8-migration-v1.md
@sonarqubecloud
Copy link
Copy Markdown

@qodo-free-for-open-source-projects
Copy link
Copy Markdown

Persistent review updated to latest commit 69ff7a8

@pkuczynski pkuczynski merged commit aa4c2f2 into master Mar 11, 2026
39 checks passed
@pkuczynski pkuczynski deleted the refactor/remove-find-by-ids branch March 11, 2026 19:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

From Repository / EntityManager APIs remove findByIds (could be easily replaced with QueryBuilder.whereInIds?). (S)

6 participants