Mark Hansen
unread,Oct 4, 2012, 1:20:24 PM10/4/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to mongod...@googlegroups.com
I have an aggregation that uses limit at the end to keep the results under the 16MB limit. However, when I run it in a sharded environment, it fails. The $limit comes after a $sort - and I guess that mongos has to get the entire sorted shard results back and interleave with the other shards in order to produce the full sorted list that gets limited.
Is there anyway around this? Can I output the results of aggregation to a temporary collection?
Here is the error message:
mongos> db.ga_page_path.aggregate(match, group, sort, limit);
{
"errmsg" : "exception: sharded pipeline failed on shard megaset3: { errmsg: \"exception: aggregation result exceeds maximum document size (16MB)\", code: 16389, ok: 0.0 }",
"code" : 16390,
"ok" : 0
}