return a hash grouping by an object field