Class: Parse::Constraint::NotContainedInConstraint
- Inherits:
- Parse::Constraint
- Object
- Parse::Constraint
- Parse::Constraint::NotContainedInConstraint
- Defined in:
- lib/parse/query/constraints.rb
Overview
Equivalent to the `$nin` Parse query operation. Checks whether the value in the column field is not contained in the set of values in the target array. If the field is an array data type, it checks whether at least one value in the field array is not contained in the set of values in the target array.
q.where :field.not_in => array
q.where :player_name.not_in => ["Jonathan", "Dario", "Shawn"]
Instance Attribute Summary
Attributes inherited from Parse::Constraint
#operand, #operation, #operator, #value
Instance Method Summary collapse
- #build ⇒ Hash
The compiled constraint.
- #nin ⇒ NotContainedInConstraint
Alias for #not_in.
- #not_contained_in ⇒ NotContainedInConstraint
Alias for #not_in.
- #not_in ⇒ NotContainedInConstraint
A registered method on a symbol to create the constraint.
Methods inherited from Parse::Constraint
#as_json, contraint_keyword, create, #formatted_value, formatted_value, #initialize, #key, #precedence, register, #to_s
Constructor Details
This class inherits a constructor from Parse::Constraint
Instance Method Details
#build ⇒ Hash
Returns the compiled constraint.
352 353 354 355 356 | # File 'lib/parse/query/constraints.rb', line 352 def build val = formatted_value val = [val].compact unless val.is_a?(Array) { @operation.operand => { key => val } } end |
#not_contained_in ⇒ NotContainedInConstraint
Alias for #not_in
346 | # File 'lib/parse/query/constraints.rb', line 346 contraint_keyword :$nin |
#not_in ⇒ NotContainedInConstraint
A registered method on a symbol to create the constraint. Maps to Parse operator “$nin”.
# File 'lib/parse/query/constraints.rb', line 333
|