is there anyway to return the object and not the value from Method:
Mongoid::Contexts::Enumerable#max
An easy example is if you have collection of Users and they all have field :age => can i get the users that are oldest with max or should i use something else
That’ll get you a one of users with the greatest age (in case there are several). If you want to get them all, the easiest way is to use a two-pass.
To make these queries efficient, you’ll need an index on
:age, of course.