MongoDB.live, free & fully virtual. June 9th - 10th. Register Now

How could I write aggregation without exceeds maximum document size?

Hi Team,

How could I write aggregation without exceeds maximum document size?

Use $match early, make it the most restrictive. Use $project early to remove unnecessary fields. Try to use index for the first $match. Add intermediate $match as soon as you know you can reduce the working set.

1 Like