@@ -822,10 +822,13 @@ namespace mongo {
822822 BSONObj mapreduce (const std::string &ns, const std::string &jsmapf, const std::string &jsreducef, BSONObj query = BSONObj(), MROutput output = MRInline);
823823
824824 /* *
825- * Groups documents in a collection by the specified keys and performs simple aggregation
825+ * Groups documents in a collection by the specified key and performs simple aggregation
826826 * functions such as computing counts and sums.
827827 *
828- * See: http://docs.mongodb.org/manual/reference/method/db.collection.group
828+ * @note WARNING: Use of the group command is strongly discouraged, it is much better to use
829+ * the aggregation framework to acheive similar functionality.
830+ *
831+ * @see http://docs.mongodb.org/manual/reference/method/db.collection.group
829832 *
830833 * @param ns The namespace to group
831834 * @param key The field or fields to group specified as a projection document: { field: 1 }
@@ -839,30 +842,30 @@ namespace mongo {
839842 * returning the final values in the output vector.
840843 */
841844 void group (
842- const std::string & ns,
843- const std::string & jsreduce,
845+ const StringData & ns,
846+ const StringData & jsreduce,
844847 std::vector<BSONObj>* output,
845848 const BSONObj& initial = BSONObj(),
846849 const BSONObj& cond = BSONObj(),
847850 const BSONObj& key = BSONObj(),
848- const std::string & finalize = ""
851+ const StringData & finalize = ""
849852 );
850853
851854 /* *
852- * Does the same thing as group but accepts a key function that can be used to create the
853- * object representing the key. This allows for grouping on calculated fields rather than
854- * existing fields alone.
855+ * Does the same thing as ' group' but accepts a key function, 'jskey', that is used to
856+ * create an object representing the key. This allows for grouping on calculated fields
857+ * rather on existing fields alone.
855858 *
856859 * @see DBClientWithCommands::group
857860 */
858861 void groupWithKeyFunction (
859- const std::string & ns,
860- const std::string & jsreduce,
862+ const StringData & ns,
863+ const StringData & jsreduce,
861864 std::vector<BSONObj>* output,
862865 const BSONObj& initial = BSONObj(),
863866 const BSONObj& cond = BSONObj(),
864- const std::string & jskey = "",
865- const std::string & finalize = ""
867+ const StringData & jskey = "",
868+ const StringData & finalize = ""
866869 );
867870
868871 /* * Run javascript code on the database server.
@@ -1058,15 +1061,15 @@ namespace mongo {
10581061 bool _haveCachedAvailableOptions;
10591062
10601063 void _buildGroupObj (
1061- const std::string & ns,
1062- const std::string & jsreduce,
1064+ const StringData & ns,
1065+ const StringData & jsreduce,
10631066 const BSONObj& initial,
10641067 const BSONObj& cond,
1065- const std::string & finalize,
1068+ const StringData & finalize,
10661069 BSONObjBuilder* groupObj
10671070 );
10681071
1069- void _runGroup (const std::string ns, const BSONObj& group, std::vector<BSONObj>* output);
1072+ void _runGroup (const StringData& ns, const BSONObj& group, std::vector<BSONObj>* output);
10701073 };
10711074
10721075 class DBClientWriter ;
0 commit comments