[JAVA-1979] GroupCommand should support key functions Created: 22/Sep/15 Updated: 15/Oct/15 Resolved: 28/Sep/15 |
|
| Status: | Closed |
| Project: | Java Driver |
| Component/s: | Query Operations |
| Affects Version/s: | 3.0.4 |
| Fix Version/s: | 3.1.0, 2.14.0 |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Gordon Syme | Assignee: | Ross Lawley |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Description |
|
com.mongodb.DBCollection#group(DBObject) is deprecated in 2.13 in favour of com.mongodb.GroupCommand and has been removed in 3.0 GroupCommand does not allow key functions to be specified and with the DBObject method removed there's no way to specify a key function to group any more. GroupOperation does allow key functions, but because the GroupCommand#toOperation method is package protected it's not possible to create a subclass of GroupCommand that can accept key functions. The net effect is that key functions in group operations are unavailable to JVM clients. |
| Comments |
| Comment by Jeffrey Yemin [ 07/Oct/15 ] | ||||||||||||||||||||||||||||||
|
Released in 3.1.0 | ||||||||||||||||||||||||||||||
| Comment by Githook User [ 05/Oct/15 ] | ||||||||||||||||||||||||||||||
|
Author: {u'username': u'rozza', u'name': u'Ross Lawley', u'email': u'ross.lawley@gmail.com'}Message: Add KeyFunction support to group in DBCollection
| ||||||||||||||||||||||||||||||
| Comment by Githook User [ 28/Sep/15 ] | ||||||||||||||||||||||||||||||
|
Author: {u'username': u'rozza', u'name': u'Ross Lawley', u'email': u'ross.lawley@gmail.com'}Message: Add KeyFunction support to group in DBCollection
| ||||||||||||||||||||||||||||||
| Comment by Githook User [ 28/Sep/15 ] | ||||||||||||||||||||||||||||||
|
Author: {u'username': u'rozza', u'name': u'Ross Lawley', u'email': u'ross.lawley@gmail.com'}Message: Add KeyFunction support to group in DBCollection
| ||||||||||||||||||||||||||||||
| Comment by Gordon Syme [ 22/Sep/15 ] | ||||||||||||||||||||||||||||||
|
Ah, I wasn't aware of that escape-hatch, that's awesome, thanks Ross. | ||||||||||||||||||||||||||||||
| Comment by Ross Lawley [ 22/Sep/15 ] | ||||||||||||||||||||||||||||||
|
Thanks gordonsyme for reporting this oversight. Until there is a fix to GroupCommand, the only way would be to execute the command manually via db.command. See the group command documentation for details of how the group command is structured. An example of manually executing it is below:
|