Method: Contentstack::Query#ascending

Defined in:
lib/contentstack/query.rb

#ascending(field_uid) ⇒ Contentstack::Query

Sort the results in ascending order with the given key. Sort the returned entries in ascending order of the provided key.

Example

@query = @stack.content_type('category').query
@query.ascending

Parameters:

  • field_uid (String)

    The key to order by

Returns:

[View source]

373
374
375
376
377
# File 'lib/contentstack/query.rb', line 373

def ascending(field_uid)
  @query.delete(:desc)
  @query[:asc] = field_uid
  self
end