Eric Deloak
0
Q:

group by in ruby mongoid

Lead.where(client_id: client.id.to_s).collection.aggregate([{"$group"=>{ :_id=> "$sales_id" , :count=>{"$sum"=>1} } }, {"$match": { count: { "$gte": 3 } }} ]).to_a
0

New to Communities?

Join the community