Fix mongoose query

This caused an "Invalid sort() argument." error when accessing groups.