module Mongoid::Matcher::Gt

In-memory matcher for $gt expression.

@see www.mongodb.com/docs/manual/reference/operator/query/gt/

@api private

Public Instance Methods

matches?(exists, value, condition) click to toggle source

Returns whether a value satisfies a $gt expression.

@param [ true | false ] exists Whether the value exists. @param [ Object ] value The value to check. @param [ Object ] condition The $gt condition predicate.

@return [ true | false ] Whether the value matches.

@api private

# File lib/mongoid/matcher/gt.rb, line 21
                def matches?(exists, value, condition)
  case condition
  when Range
    raise Errors::InvalidQuery, "$gt argument cannot be a Range: #{Errors::InvalidQuery.truncate_expr(condition)}"
  end
  FieldOperator.apply_array_field_operator(exists, value, condition) do |v|
    FieldOperator.apply_comparison_operator(:>, v, condition)
  end
end