[SERVER-2893] C++ client 1.8 driver has unusable mapreduce method (with wrong signature) Created: 04/Apr/11  Updated: 12/Jul/16  Resolved: 04/Apr/11

Status: Closed
Project: Core Server
Component/s: Internal Client
Affects Version/s: 1.8.0
Fix Version/s: 1.8.2, 1.9.0

Type: Bug Priority: Major - P3
Reporter: Piotr Beling Assignee: Mathias Stearn
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Minor Change
Operating System: ALL
Participants:

 Description   

In dbclient.h line 554 is method:
BSONObj mapreduce(const string &ns, const string &jsmapf, const string &jsreducef, BSONObj query = BSONObj(), const string& output = "");
note that output (last) parameter is string and has "" default value.
If try to call this method with default ("") value I have error: 'out' has to be a string or an object

I have no idea how I could use this method. Due to documentation:
http://www.mongodb.org/display/DOCS/MapReduce#MapReduce-Outputoptions
output should be an object.

I download driver from page:
http://dl.mongodb.org/dl/cxx-driver
cxx-driver/mongodb-linux-x86_64-v1.8-latest.tgz 2011-04-04 09:22:58 6374730



 Comments   
Comment by auto [ 03/May/11 ]

Author:

{u'login': u'RedBeard0531', u'name': u'Mathias Stearn', u'email': u'mathias@10gen.com'}

Message: C++ driver now supports 1.8 M/R options SERVER-2893
Branch: v1.8
https://github.com/mongodb/mongo/commit/8a9f531efe371b8e79a82b0014d81f23927ff6fa

Comment by Mathias Stearn [ 04/Apr/11 ]

Only backwards breaking if you depended on using a temp collection if you didn't specify an output (which was broken anyway in 1.8). Now defaults to using inline-style output.

Not sure what the policy is for C++ driver-only backports, but this only touches the driver (and not a part used by any server) and is needed for driver compatability with a 1.8 server

Comment by auto [ 04/Apr/11 ]

Author:

{u'login': u'RedBeard0531', u'name': u'Mathias Stearn', u'email': u'mathias@10gen.com'}

Message: C++ driver now supports 1.8 M/R options SERVER-2893
Branch: master
https://github.com/mongodb/mongo/commit/ec093cc5accdc0ef6f5272e84b2930044cbf4d01

Comment by Eliot Horowitz (Inactive) [ 04/Apr/11 ]

We should change this soon, but in the meantime you can simply use the raw command interface.

Comment by Piotr Beling [ 04/Apr/11 ]

Sorry, I just read that I can pass collection name here.
But still default "" value for output is bad, and many interesting options are unavailable because there are not mapreduce version with BSONObject output.

Generated at Thu Feb 08 03:01:29 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.