[JAVA-2196] use mapReduce to get some document Created: 26/May/16 Updated: 11/Sep/19 Resolved: 26/May/16 |
|
| Status: | Closed |
| Project: | Java Driver |
| Component/s: | API |
| Affects Version/s: | 3.2.2 |
| Fix Version/s: | None |
| Type: | Task | Priority: | Major - P3 |
| Reporter: | km1218 | Assignee: | Unassigned |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
window7、eclipse(Mars Release (4.5.0))、jdk1.6.0_45 |
||
| Description |
|
I need to get a fixed number of doc by per group,when i use the method of mapReduce (class MongoCollection),it is so strange that the first doc have so many repeat keys.hope to get your answer,thank you very much. the example code:
the output:
Edit: Sanitised the domain names in the example. |
| Comments |
| Comment by Ross Lawley [ 26/May/16 ] |
|
Hi, Just to let you know this project is for Java driver bugs or feature requests. The best place for questions regarding MongoDB usage or the Java driver specifics is the mongodb-user mailing list or stackoverflow as you will reach a boarder audience there. If your business requires an answer from MongoDB within a set time frame then we do offer production support. I'm closing this as "Works as designed" because it is possible to invoke the reduce function more than once for the same key. You need to update your reduce function so that the following properties are true:
Please see the mapReduce documentation for more information. |