Class: Parse::Constraint::ContainedByConstraint
- Inherits:
-
Constraint
- Object
- Constraint
- Parse::Constraint::ContainedByConstraint
- Defined in:
- lib/parse/query/constraints.rb
Overview
Equivalent to the $containedBy Parse query operation. Matches documents where the array field's values are all within the supplied set (the inverse of ContainsAllConstraint: the field must be a subset of the provided array). The field column should be of type Array in your Parse class.
q.where :field.contained_by => [1, 2, 3] q.where :tags.contained_by => ["ruby", "rails", "parse"]
Instance Method Summary collapse
-
#build ⇒ Hash
The compiled constraint.
-
#contained_by ⇒ ContainedByConstraint
A registered method on a symbol to create the constraint.
Instance Method Details
#build ⇒ Hash
Returns the compiled constraint.
1261 1262 1263 1264 |
# File 'lib/parse/query/constraints.rb', line 1261 def build val = list_value { @operation.operand => { key => val } } end |
#contained_by ⇒ ContainedByConstraint
A registered method on a symbol to create the constraint. Maps to Parse operator "$containedBy".
1257 |
# File 'lib/parse/query/constraints.rb', line 1257 constraint_keyword :$containedBy |