Skip to content

lean getters does not work on generative functions #44

Open
@Marius-Romanus

Description

@Marius-Romanus

Hi!

I'm not sure if it's a bug or a new feature, in cases where generative functions function* are used in mongoose with a cursor provideRouter, and at the same time the implementation of mongoose-lean-getters, it's not working well for me.

It's curious because if instead of doing it natively with for example a for await (const data of cursor), I do it with the "co" library, the .lean({ getters: true }) works correctly.

Same thing happens with map()
https://mongoosejs.com/docs/api/querycursor.html#QueryCursor.prototype.map()

Right now I can't put an example because the one I have is very complex, but if you need it, let me know :)

Regards!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions