diff options
-rw-r--r-- | db/dbcommands.cpp | 3 | ||||
-rw-r--r-- | shell/db.js | 4 |
2 files changed, 4 insertions, 3 deletions
diff --git a/db/dbcommands.cpp b/db/dbcommands.cpp index 18a01d18e68..683d848ef15 100644 --- a/db/dbcommands.cpp +++ b/db/dbcommands.cpp @@ -1217,8 +1217,7 @@ namespace mongo { keyf = p["$keyf"].ascode(); } else { - errmsg = "parameter 'key' is missing or not an object"; - return false; + // no key specified, will use entire object as key } return group( realdbname , cursor , key , keyf , p["$reduce"].ascode() , p["initial"].embeddedObjectUserCheck() , errmsg , result ); diff --git a/shell/db.js b/shell/db.js index 0aa80cdaf34..43d53cf96f5 100644 --- a/shell/db.js +++ b/shell/db.js @@ -367,7 +367,7 @@ DB.prototype.dbEval = DB.prototype.eval; keyf is a function which takes an object and returns the desired key. set either key or keyf (not both). * </p> */ -DB.prototype.group = function(parmsObj) { +DB.prototype.groupeval = function(parmsObj) { var groupFunction = function() { var parms = args[0]; @@ -412,6 +412,8 @@ DB.prototype.groupcmd = function( parmsObj ){ return ret.retval; } +DB.prototype.group = DB.prototype.groupcmd; + DB.prototype._groupFixParms = function( parmsObj ){ var parms = Object.extend({}, parmsObj); |