utilities/query-helper.js
function(query, mongooseQuery, logger) {
    if (query.$sort) {
      if (Array.isArray(query.$sort)) {
        query.$sort = query.$sort.join(' ')
      }
      mongooseQuery.sort(query.$sort)
      delete query.$sort
    }
    return mongooseQuery
  }
function(query, mongooseQuery, logger) {
    if (query.$sort) {
      if (Array.isArray(query.$sort)) {
        query.$sort = query.$sort.join(' ')
      }
      mongooseQuery.sort(query.$sort)
      delete query.$sort
    }
    return mongooseQuery
  }
function ( query , mongooseQuery , logger ) { if ( query . $sort ) { if ( Array . isArray ( query . $sort ) ) { query . $sort = query . $sort . join ( ' ' ) } mongooseQuery . sort ( query . $sort ) delete query . $sort } return mongooseQuery }
Set the sort priority for the mongoose query.
@param query: The incoming request query.
@param mongooseQuery: A mongoose query.
@param logger: A logging object.
@returns {*}: The updated mongoose query.
Set the sort priority for the mongoose query .