Class: Parse::Constraint::ContainsAllConstraint
- Inherits:
-
Constraint
- Object
- Constraint
- Parse::Constraint::ContainsAllConstraint
- Defined in:
- lib/parse/query/constraints.rb
Overview
Equivalent to the $all Parse query operation. Checks whether the value in the column field contains all of the given values provided in the array. Note that the field column should be of type Array in your Parse class.
q.where :field.all => array q.where :array_key.all => [2,3,4]
Instance Method Summary collapse
-
#all ⇒ ContainsAllConstraint
A registered method on a symbol to create the constraint.
-
#build ⇒ Hash
The compiled constraint.
-
#contains_all ⇒ ContainsAllConstraint
Alias for #all.
-
#superset_of ⇒ ContainsAllConstraint
Alias for #all - semantically clearer when checking if array is a superset.
Instance Method Details
#all ⇒ ContainsAllConstraint
A registered method on a symbol to create the constraint. Maps to Parse operator "$all".
|
|
# File 'lib/parse/query/constraints.rb', line 1212
|
#build ⇒ Hash
Returns the compiled constraint.
1233 1234 1235 1236 |
# File 'lib/parse/query/constraints.rb', line 1233 def build val = list_value { @operation.operand => { key => val } } end |
#contains_all ⇒ ContainsAllConstraint
Alias for #all
|
|
# File 'lib/parse/query/constraints.rb', line 1218
|
#superset_of ⇒ ContainsAllConstraint
Alias for #all - semantically clearer when checking if array is a superset
1227 |
# File 'lib/parse/query/constraints.rb', line 1227 constraint_keyword :$all |