[SERVER-1031] Allow user to choose whether to wrap MapReduce results inside "value"-attribute of result Created: 20/Apr/10 Updated: 29/May/12 Resolved: 31/Aug/11 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Querying |
| Affects Version/s: | 1.3.0, 1.3.1, 1.3.2, 1.3.3, 1.3.4, 1.3.5, 1.4.0, 1.4.1, 1.5.0 |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Tommy V | Assignee: | Unassigned |
| Resolution: | Duplicate | Votes: | 3 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
n/a |
||
| Issue Links: |
|
||||||||
| Participants: | |||||||||
| Description |
|
MapReduce queries in the current version always returns a result that contains documents that look like {"_id":something, "value":{...}}. In this format, the documents that result from the reduce (and finalize) function are wrapped inside the "value" attribute. This is nice if you want to output documents (which contain their own "_id" that would otherwise clash with the _id in the result set). Sometimes, however, I am returning plain objects or objects of which the _id has been stripped, and it would be nice to not have the extra "value" wrapper. Although querying result sets that contain the 'value' wrapper is possible, it becomes a bit clumsy (especially since the column names differ from the collection I ran the MapReduce on). So my feature request is to add an option that disables the wrapping of results inside the 'value' attribute. If the wrapping is disabled, the _id could also be automatically removed to prevent mistakes. |
| Comments |
| Comment by Kyle Banker [ 31/Aug/11 ] |
|
See newer, related issue. |
| Comment by Gerhard Balthasar [ 05/Jan/11 ] |
|
An additional output option to the mapreduce command result: "value" would allow for the following options result: "value" (=default) wraps the result as it does now inside a value subdocument doesn't wrap at all, instead inlines the result into the same level as the _id This would be syntacticaly conform to the 'out' option since 1.7.4 |
| Comment by Tommy V [ 20/Apr/10 ] |
|
If this feature is implemented, MapReduce can also be used to store the results of ordinary queries to another collection (i.e. by specifying the query as "query:"-option to the mapReduce command). |