add sort functionality for mongo data