TylerBrock / mongo-hacker

MongoDB Shell Enhancements for Hackers
tylerbrock.github.io/mongo-hacker
MIT License
1.79k stars 235 forks source link

Error 16389: "aggregation result exceeds maximum document size (16MB)" #189

Closed gpakosz closed 5 years ago

gpakosz commented 6 years ago

Hello,

I just started using mongo-hacker and I'm hitting the following: when an aggregation pipeline returns a lot of data, I'm hitting error 16389.

Launching mongo shell with --norc removes the error. My guess is that mongo-hacker is trying to convert the cursor returned by aggregate() into a document to pretty print it.

Is there a way around this?

Thank you

stennie commented 5 years ago

@gpakosz It has been a while since you reported this error, but I suspect is was fixed in 0.0.16 by way of changes for #182.

Note: the error code 16389 ("aggregation result exceeds maximum document size") only appears in MongoDB 3.0 and earlier. In modern versions of MongoDB aggregation results are always returned using a cursor.

If you are still seeing this issue with a non-EOL version of MongoDB (currently MongoDB 3.4 or newer) please open a new issue with further details of your environment (specific versions of Mongo Hacker, mongo shell, and MongoDB server) and ideally include an example document & query to reproduce the issue.

Thanks, Stennie