diff options
author | Eliot Horowitz <eliot@10gen.com> | 2009-09-17 22:00:58 -0400 |
---|---|---|
committer | Eliot Horowitz <eliot@10gen.com> | 2009-09-17 22:00:58 -0400 |
commit | dfdfb74a57016600b906c4d924029f5c4699de38 (patch) | |
tree | 46d8e5f2843fca474fb71cc3f1f4d667307fc948 /db/dbcommands.cpp | |
parent | 44fabaec401181bb6070648c880056a7b021d442 (diff) | |
download | mongo-dfdfb74a57016600b906c4d924029f5c4699de38.tar.gz |
don't let group() key map get too huge
Diffstat (limited to 'db/dbcommands.cpp')
-rw-r--r-- | db/dbcommands.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/db/dbcommands.cpp b/db/dbcommands.cpp index 75b6dcc79f4..4477a800497 100644 --- a/db/dbcommands.cpp +++ b/db/dbcommands.cpp @@ -1250,6 +1250,8 @@ namespace mongo { if ( n == 0 ){ n = map.size(); s->setObject( "$key" , key , true ); + + uassert( "group() can't handle more than 10000 unique keys" , n < 10000 ); } s->setObject( "obj" , obj , true ); @@ -1258,7 +1260,7 @@ namespace mongo { throw UserException( (string)"reduce invoke failed: " + s->getError() ); } } - + if (!finalize.empty()){ s->exec( "$finalize = " + finalize , "finalize define" , false , true , true , 100 ); ScriptingFunction g = s->createFunction( |