Skip to content

Document populate type is returning an ObjectId & PopulatedType #11955

@JeromeDeLeon

Description

@JeromeDeLeon

Prerequisites

  • I have written a descriptive issue title
  • I have searched existing issues to ensure the bug has not already been reported

Mongoose version

6.3.4

Node.js version

14.18

MongoDB server version

4.5.0

Description

I have an issue with document.populate where it always returns an intersection of objectId & the populated types itself and find it weird that it is not an issue for query.populate but maybe because you use UnpackIntersection.

Steps to Reproduce

TS playground

Expected Behavior

I'm expecting it to return just the populated document type and not to have ObjectId

Metadata

Metadata

Assignees

No one assigned

    Labels

    typescriptTypes or Types-test related issue / Pull Request

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions