Skip to content

populate() on Arrays broken #2421

@schw4rzlicht

Description

@schw4rzlicht

Is there an existing issue for this?

  • I have searched the existing issues

Current behavior

Using populate() on an array of ObjectIDs stopped working and does not populate the array.

Minimum reproduction code

https://github.com/schw4rzlicht/nestjs-mongoose-populate-bug

Steps to reproduce

Instructions in the linked repo.

Expected behavior

Populated child array should contain sub documents.

Package version

>=10.0.2

mongoose version

7/8 (doesn't matter)

NestJS version

10/11 (doesn't matter)

Node.js version

>=20

In which operating systems have you tested?

  • macOS
  • Windows
  • Linux

Other

I can pinpoint the issue to the change made in this PR. When I revert that change, everything works as expected.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions