Method: Mongoid::Criteria::Queryable::Selectable#or
- Defined in:
- lib/mongoid/criteria/queryable/selectable.rb
#or(*criteria) ⇒ Selectable
Creates a disjunction using $or from the existing criteria in the receiver and the provided arguments.
This behavior (receiver becoming one of the disjunction operands) matches ActiveRecord’s or behavior.
Use any_of to add a disjunction of the arguments as an additional constraint to the criteria already existing in the receiver.
Each argument can be a Hash, a Criteria object, an array of Hash or Criteria objects, or a nested array. Nested arrays will be flattened and can be of any depth. Passing arrays is deprecated.
644 645 646 |
# File 'lib/mongoid/criteria/queryable/selectable.rb', line 644 def or(*criteria) _mongoid_add_top_level_operation('$or', criteria) end |