def order fields
      by_num = { 1 => 'asc', -1 => 'desc' }
      ordering = []
      fields.each_pair do |key, value|
        ordering << [key.to_s, by_num[value] || value]
      end
      @ordering = ordering
      self
    end
def order fields
      by_num = { 1 => 'asc', -1 => 'desc' }
      ordering = []
      fields.each_pair do |key, value|
        ordering << [key.to_s, by_num[value] || value]
      end
      @ordering = ordering
      self
    end
Add order clause to the query.

 @param fields [String] ...
 @return [Collection] self