4 ms·
It's not dependent on SQL. @pixel.hits is returning an Array, and there is no method group for Array in Ruby. You could try group_by if you really want to grou
by akane 13y ago
It's not dependent on SQL. @pixel.hits is returning an Array, and there is no method group for Array in Ruby. You could try group_by if you really want to group an Array, or use the Mongoid syntax for grouping.
- hayksaakian 13y agoIs this: http://stackoverflow.com/questions/4732393/ordering-and-grouping-in-mongoid http://stackoverflow.com/questions/4732393/ordering-and-grou... What you're referring to?
- akane 13y agoYou may have to use counts from map reduce. I'm not super familiar with the current state of MongoDB. http://mongoid.org/en/mongoid/docs/querying.html#aggregations http://mongoid.org/en/mongoid/docs/querying.html#aggregation... Hopefully someone else can speak to this.