Exception: Mongoid::Errors::InvalidElemMatchOperator
- Inherits:
-
InvalidQuery
- Object
- StandardError
- MongoidError
- InvalidQuery
- Mongoid::Errors::InvalidElemMatchOperator
- Defined in:
- lib/mongoid/errors/invalid_elem_match_operator.rb
Overview
Raised when invalid field-level operator is passed to the $elemMatch embedded matcher.
Constant Summary collapse
- VALID_OPERATORS =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
%w[ and all eq exists gt gte in lt lte ne nin nor not or regex size ].freeze
Constants inherited from MongoidError
Instance Attribute Summary collapse
-
#operator ⇒ String
readonly
The operator that was used.
Attributes inherited from MongoidError
#problem, #resolution, #summary
Instance Method Summary collapse
-
#initialize(operator) ⇒ InvalidElemMatchOperator
constructor
private
Creates the exception.
Methods inherited from InvalidQuery
Methods inherited from MongoidError
Constructor Details
#initialize(operator) ⇒ InvalidElemMatchOperator
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Creates the exception.
18 19 20 21 22 23 |
# File 'lib/mongoid/errors/invalid_elem_match_operator.rb', line 18 def initialize(operator) @operator = operator super(('invalid_elem_match_operator', operator: operator, valid_operators: VALID_OPERATORS.map { |op| "'$#{op}'" }.join(', '))) end |
Instance Attribute Details
#operator ⇒ String (readonly)
Returns The operator that was used.
26 27 28 |
# File 'lib/mongoid/errors/invalid_elem_match_operator.rb', line 26 def operator @operator end |