[SERVER-18381] inconsistent return values when using jsmode: true on inline map reduce Created: 08/May/15 Updated: 06/Dec/22 Resolved: 09/Mar/20 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | MapReduce |
| Affects Version/s: | 2.6.8, 3.0.2 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | David Martin-Borregon | Assignee: | Backlog - Query Team (Inactive) |
| Resolution: | Done | Votes: | 1 |
| Labels: | Bug, jsMode, query-44-grooming | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
mongo 3.0.1 / ubuntu 14.04 |
||
| Attachments: |
|
||||
| Issue Links: |
|
||||
| Assigned Teams: |
Query
|
||||
| Operating System: | ALL | ||||
| Participants: | |||||
| Description |
|
When using inline map reduce with jsMode=True, in some cases the structure of the value is wrapped with a list. The return is incosistent with the results when using jsMode=False. |
| Comments |
| Comment by Charlie Swanson [ 09/Mar/20 ] | ||||||||||||||||||||||||||||||||||||||||||||
|
As part of a recent project to reimplement mapReduce on top of the aggregation framework, the 'jsMode' option no longer has any effect. It is still accepted for compatibility, but this issue has gone away. | ||||||||||||||||||||||||||||||||||||||||||||
| Comment by David Martin-Borregon [ 12/May/15 ] | ||||||||||||||||||||||||||||||||||||||||||||
|
Actually I'm using both 3.0.1 either pymongo and MongoDB | ||||||||||||||||||||||||||||||||||||||||||||
| Comment by Bernie Hackett [ 08/May/15 ] | ||||||||||||||||||||||||||||||||||||||||||||
|
I reproduced this using MongoDB 3.0.3-pre-. mabodo, what version of MongoDB are you using? I can't tell from the environment field if you are using MongoDB 3.0.1 or PyMongo 3.0.1. | ||||||||||||||||||||||||||||||||||||||||||||
| Comment by Bernie Hackett [ 08/May/15 ] | ||||||||||||||||||||||||||||||||||||||||||||
|
I've moved this to the core server project. I can reproduce the same problem in the mongo shell. No python required.
| ||||||||||||||||||||||||||||||||||||||||||||
| Comment by David Martin-Borregon [ 08/May/15 ] | ||||||||||||||||||||||||||||||||||||||||||||
|
As far as i can see i think this behaivor only happens when the reducer should reduce just one element. (so not reducer needed) insted of returning the first element of the one-item-array returns the full array. It can be passby cheking the type of the value but it is clearlly an unexpected behaivor. I labeled the isueue on pymongo, as I recentelly updated the driver, and I haven't seen this behaivor before. | ||||||||||||||||||||||||||||||||||||||||||||
| Comment by David Martin-Borregon [ 08/May/15 ] | ||||||||||||||||||||||||||||||||||||||||||||
|
Instructions to reproduce the bug: The collection can be as dummer as a 200 records of the type: {_id:1}, {_id:2}, {_id:3}, ....
Given this is you perform:
you get a result similar to:
if you exactue the same with jsMode=True
the result is:
note the value wrapped with an array |