[JAVA-1681] Allow GroupCommand to accept MongoCollection Created: 12/Mar/15  Updated: 12/Mar/15  Resolved: 12/Mar/15

Status: Closed
Project: Java Driver
Component/s: Command Operations
Affects Version/s: 3.0.0
Fix Version/s: None

Type: New Feature Priority: Major - P3
Reporter: Ahmed ElRefaey Assignee: Ross Lawley
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

The GroupCommand constructor constructor requires only a DBCollection object, and the MongoDatabase.getCollection returns a MongoCollection not a DBCollection.



 Comments   
Comment by Ahmed ElRefaey [ 12/Mar/15 ]

Hi @Ross,

Thanks for the clarification, I will go for the Aggregation framework, kindly close the ticket.

Ahmed,

Comment by Ross Lawley [ 12/Mar/15 ]

Hi montaro,

Thats correct the group command class is used as part of the legacy api and is only used by the deprecated DBCollection. As the GroupCommand uses JavaScript, it is subject to a number of performance limitations and for that reason we don't currently support group in the new API. For most cases the $group operator in the aggregation pipeline provides a suitable alternative with fewer restrictions.

Do you have a use case that's not covered by the aggregation framework or the map reduce command?

Ross

Generated at Thu Feb 08 08:55:14 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.