[JAVA-99] adding optional finalyze,keyf parameters to group funtion Created: 02/Apr/10  Updated: 18/Aug/13  Resolved: 18/Aug/13

Status: Closed
Project: Java Driver
Component/s: API
Affects Version/s: None
Fix Version/s: None

Type: New Feature Priority: Major - P3
Reporter: kiran k Assignee: Unassigned
Resolution: Done Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

software



 Description   

>db.collection.group —

supports many arguments namely key,reduce,initial,keyf,cond,finalyze.
But java driver for this function accepts only four of them ->
key,reduce,initial,cond. How could we use finalyze with java driver.



 Comments   
Comment by Jeffrey Yemin [ 18/Aug/13 ]

This was fixed a long time ago, but never resolved.

Comment by Remon van Vliet [ 27/Oct/11 ]

Are there actually real-world use cases for group that aren't covered by m/r? Might be worth considering deprecating group in favor of either m/r or the new aggregation framework.

Comment by Eliot Horowitz (Inactive) [ 12/Nov/10 ]

whole api might change for group

Comment by Eliot Horowitz (Inactive) [ 29/Sep/10 ]

Still don't like any syntax.
Maybe a Group class?
Also ugly

Comment by Eliot Horowitz (Inactive) [ 18/Aug/10 ]

Want to make the api a bit nicer before doing anything.
You can use direct command syntax till then.

Comment by Eliot Horowitz (Inactive) [ 18/Aug/10 ]

You can always do a commend directly.
If you look at how group is implemented, very easy to do whatever you want.

public DBObject group( DBObject key , DBObject cond , DBObject initial , String reduce )
throws MongoException

{ CommandResult res = _db.command( new BasicDBObject( "group" , BasicDBObjectBuilder.start() .add( "ns" , getName() ) .add( "key" , key ) .add( "cond" , cond ) .add( "$reduce" , reduce ) .add( "initial" , initial ) .get() ) ); res.throwOnError(); return (DBObject)res.get( "retval" ); }
Generated at Thu Feb 08 08:51:30 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.