[SERVER-5378] Position of parameters within out {} object shouldn't matter Created: 23/Mar/12 Updated: 11/Nov/14 Resolved: 01/Jul/14 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | MapReduce |
| Affects Version/s: | 2.1.0 |
| Fix Version/s: | 2.7.3 |
| Type: | Bug | Priority: | Minor - P4 |
| Reporter: | Ben Osheroff | Assignee: | Benety Goh |
| Resolution: | Done | Votes: | 0 |
| Labels: | polish | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Attachments: |
|
||||||||||||||||||||
| Issue Links: |
|
||||||||||||||||||||
| Operating System: | ALL | ||||||||||||||||||||
| Participants: | |||||||||||||||||||||
| Description |
should work the same as
but the latter throws an error instead. |
| Comments |
| Comment by Benety Goh [ 01/Jul/14 ] | ||||||||||||
|
Attached JS test script from pull request. This JS test has been replaced by a C++ unit test. | ||||||||||||
| Comment by Githook User [ 01/Jul/14 ] | ||||||||||||
|
Author: {u'username': u'benety', u'name': u'Benety Goh', u'email': u'benety@mongodb.com'}Message: | ||||||||||||
| Comment by Githook User [ 01/Jul/14 ] | ||||||||||||
|
Author: {u'username': u'osheroff', u'name': u'osheroff', u'email': u'ben@zendesk.com'}Message: Where we put replace, db, inline, etc within the map-reduce "out" Signed-off-by: Benety Goh <benety@mongodb.com> | ||||||||||||
| Comment by Githook User [ 01/Jul/14 ] | ||||||||||||
|
Author: {u'username': u'benety', u'name': u'Benety Goh', u'email': u'benety@mongodb.com'}Message: | ||||||||||||
| Comment by Benety Goh [ 28/Jun/14 ] | ||||||||||||
|
rebased original pull request on commit ecfc44d7bce08660804fa4475b45f9a09d203f09 | ||||||||||||
| Comment by Ian Whalen (Inactive) [ 25/May/12 ] | ||||||||||||
|
@ben - in order to be able to integrate your pull request we'll need you to sign the contributor agreement at http://www.10gen.com/contributor - as soon as you've got that signed we'll be able to push forward on your pull request. | ||||||||||||
| Comment by Antoine Girbal [ 11/Apr/12 ] | ||||||||||||
|
Ben, | ||||||||||||
| Comment by Ben Osheroff [ 04/Apr/12 ] | ||||||||||||
|
It's pretty unexpected behavior. A colleague and I beat our heads over a "WTF" moment for 15 minutes – we missed the one line "Note: ..." in the docs. For another example, the ruby driver's map_reduce method:
Due to the fact that hashes have no guaranteed ordering within ruby, I can't simply write:
but must instead write:
Worse, if I use the first form, it may actually succeed in some cases due to the hash function dropping the parameters magically in the right order, but then start to fail randomly. I guess the driver could handle all of that for me, but clearly the driver writers don't know about this behavior either. Anyway, I still don't see the benefit of the ordered-parameter behavior. What if my pull-request enforced that one and only one of [replace|merge|reduce|inline] appeared in the input? | ||||||||||||
| Comment by Ben Osheroff [ 23/Mar/12 ] | ||||||||||||