I\'ve been for some help on getting the highest value on a column for a mongo document. I can sort it and get the top/bottom, but I\'m pretty sure there is a better way to d
Sorting might be overkill. You can just do a group by
db.messages.group( {key: { created_at:true }, cond: { active:1 }, reduce: function(obj,prev) { if(prev.cmax