Skip to content

MongoDB aggregation cursor return type cannot be modified #10702

@pringon

Description

@pringon

Issue description

MongoDB aggregation cursor return type cannot be modified

Expected Behavior

Aggregate method's generic parameter allows modifying the expected return type of the call.

Actual Behavior

The generic is redundant and the cursor will always hold the entity type instead of allow parameterization.
This is clear from the type signature.

Steps to reproduce

Attempt to perform an aggregation that returns anything other than the entities and observe the type mismatch.

My Environment

Dependency Version
Operating System MacOS
Node.js version 18.19.0
Typescript version 5.3.3
TypeORM version 0.3.19

Additional Context

Happy to change the return type in the signature, but I need guidance on what the process is and whether I need to modify anything else.

Relevant Database Driver(s)

  • aurora-mysql
  • aurora-postgres
  • better-sqlite3
  • cockroachdb
  • cordova
  • expo
  • mongodb
  • mysql
  • nativescript
  • oracle
  • postgres
  • react-native
  • sap
  • spanner
  • sqlite
  • sqlite-abstract
  • sqljs
  • sqlserver

Are you willing to resolve this issue by submitting a Pull Request?

Yes, I have the time, but I don't know how to start. I would need guidance.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions