Class: Parse::Constraint::CompoundQueryConstraint

Inherits:
Constraint
  • Object
show all
Defined in:
lib/parse/query/constraints.rb

Overview

Equivalent to the $or Parse query operation. This is useful if you want to find objects that match several queries. We overload the | operator in order to have a clean syntax for joining these or operations. or_query = query1 | query2 | query3 query = Player.where(:wins.gt => 150) | Player.where(:wins.lt => 5)

query.or_where :field => value

Instance Method Summary collapse

Instance Method Details

#buildHash

Returns the compiled constraint.

Returns:

  • (Hash)

    the compiled constraint.



150
151
152
153
# File 'lib/parse/query/constraints.rb', line 150

def build
  or_clauses = formatted_value
  return { :$or => Array.wrap(or_clauses) }
end