Method: Contentstack::Query#less_than_or_equal

Defined in:
lib/contentstack/query.rb

#less_than_or_equal(field_uid, value) ⇒ Contentstack::Query

Add a constraint to the query that requires a particular key entry to be less than or equal to the provided value.

Example

@query = @stack.content_type('product').query
@query.less_than_or_equal('price', '100')

Parameters:

  • field_uid (String)

    UID of the field for which query should be executed

  • value (String/Number)

    Value that provides an upper bound

Returns:


195
196
197
198
# File 'lib/contentstack/query.rb', line 195

def less_than_or_equal(field_uid, value)
  add_query_hash({:"#{field_uid}" => {"$lte" => value}})
  self
end