Skip to content

Running into 16MB BSON limit with Mongoose Populate #5890

Open
@mayeaux

Description

@mayeaux

I am doing a really large Mongoose call with nested population, and then doing some processing on the data.

However, because of the nested populate call I am hitting the 16MB limit for a BSON document in Mongoose.

What's a solid way around this?

let allDocuments = await exampleModel.find({
    condition: true
  }).populate({path: 'tvShows', populate: {path: 'views'}});

enter image description here

Maybe I can break into into multiple calls? But I'm not sure a logical way to do that. Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions