Skip to content

lean transform doesn't work #12093

@Hagriel

Description

@Hagriel

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.4.4

Node.js version

18.5

MongoDB server version

5.0.9

Description

lean transform doesn't work

Steps to Reproduce

this.favoriteList
      .find({ })
      .lean({
        transform: (doc) => {
          delete doc._id;
          return doc;
        }
      });

Expected Behavior

No response

Metadata

Metadata

Assignees

Labels

confirmed-bugWe've confirmed this is a bug in Mongoose and will fix it.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions