Sha256: 6f0282000da1a002ca4f8139c89e9a28d479808a83e2e3298c852c0132abf266

Contents?: true

Size: 377 Bytes

Versions: 39

Compression:

Stored size: 377 Bytes

Contents

module Mongoid
  module Matcher

    # @api private
    module Exists
      module_function def matches?(exists, value, condition)
        case condition
        when Range
          raise Errors::InvalidQuery, "$exists argument cannot be a Range: #{Errors::InvalidQuery.truncate_expr(condition)}"
        end
        exists == (condition || false)
      end
    end
  end
end

Version data entries

39 entries across 39 versions & 1 rubygems

Version Path
mongoid-8.1.8 lib/mongoid/matcher/exists.rb
mongoid-8.1.7 lib/mongoid/matcher/exists.rb
mongoid-8.1.6 lib/mongoid/matcher/exists.rb
mongoid-8.0.8 lib/mongoid/matcher/exists.rb
mongoid-8.1.5 lib/mongoid/matcher/exists.rb
mongoid-8.1.4 lib/mongoid/matcher/exists.rb
mongoid-8.0.7 lib/mongoid/matcher/exists.rb
mongoid-8.1.3 lib/mongoid/matcher/exists.rb
mongoid-8.1.2 lib/mongoid/matcher/exists.rb
mongoid-8.0.6 lib/mongoid/matcher/exists.rb
mongoid-7.5.4 lib/mongoid/matcher/exists.rb
mongoid-8.1.1 lib/mongoid/matcher/exists.rb
mongoid-8.0.5 lib/mongoid/matcher/exists.rb
mongoid-8.1.0 lib/mongoid/matcher/exists.rb
mongoid-7.5.3 lib/mongoid/matcher/exists.rb
mongoid-8.0.4 lib/mongoid/matcher/exists.rb
mongoid-8.0.3 lib/mongoid/matcher/exists.rb
mongoid-7.5.2 lib/mongoid/matcher/exists.rb
mongoid-8.0.2 lib/mongoid/matcher/exists.rb
mongoid-7.5.1 lib/mongoid/matcher/exists.rb