@@ -822,10 +822,13 @@ namespace mongo {
822
822
BSONObj mapreduce (const std::string &ns, const std::string &jsmapf, const std::string &jsreducef, BSONObj query = BSONObj(), MROutput output = MRInline);
823
823
824
824
/* *
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
826
826
* functions such as computing counts and sums.
827
827
*
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
829
832
*
830
833
* @param ns The namespace to group
831
834
* @param key The field or fields to group specified as a projection document: { field: 1 }
@@ -839,30 +842,30 @@ namespace mongo {
839
842
* returning the final values in the output vector.
840
843
*/
841
844
void group (
842
- const std::string & ns,
843
- const std::string & jsreduce,
845
+ const StringData & ns,
846
+ const StringData & jsreduce,
844
847
std::vector<BSONObj>* output,
845
848
const BSONObj& initial = BSONObj(),
846
849
const BSONObj& cond = BSONObj(),
847
850
const BSONObj& key = BSONObj(),
848
- const std::string & finalize = ""
851
+ const StringData & finalize = ""
849
852
);
850
853
851
854
/* *
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.
855
858
*
856
859
* @see DBClientWithCommands::group
857
860
*/
858
861
void groupWithKeyFunction (
859
- const std::string & ns,
860
- const std::string & jsreduce,
862
+ const StringData & ns,
863
+ const StringData & jsreduce,
861
864
std::vector<BSONObj>* output,
862
865
const BSONObj& initial = BSONObj(),
863
866
const BSONObj& cond = BSONObj(),
864
- const std::string & jskey = "",
865
- const std::string & finalize = ""
867
+ const StringData & jskey = "",
868
+ const StringData & finalize = ""
866
869
);
867
870
868
871
/* * Run javascript code on the database server.
@@ -1058,15 +1061,15 @@ namespace mongo {
1058
1061
bool _haveCachedAvailableOptions;
1059
1062
1060
1063
void _buildGroupObj (
1061
- const std::string & ns,
1062
- const std::string & jsreduce,
1064
+ const StringData & ns,
1065
+ const StringData & jsreduce,
1063
1066
const BSONObj& initial,
1064
1067
const BSONObj& cond,
1065
- const std::string & finalize,
1068
+ const StringData & finalize,
1066
1069
BSONObjBuilder* groupObj
1067
1070
);
1068
1071
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);
1070
1073
};
1071
1074
1072
1075
class DBClientWriter ;
0 commit comments