code: 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
    }
docs: 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.