Sha256: 6339d8423749e8522555b726c85630961d09b27a144fdc3df2d6ad2e0e5ab73c
Contents?: true
Size: 563 Bytes
Versions: 43
Compression:
Stored size: 563 Bytes
Contents
module Mongoid module Matcher # @api private module And module_function def matches?(document, expr) unless expr.is_a?(Array) raise Errors::InvalidQuery, "$and argument must be an array: #{Errors::InvalidQuery.truncate_expr(expr)}" end if expr.empty? raise Errors::InvalidQuery, "$and argument must be a non-empty array: #{Errors::InvalidQuery.truncate_expr(expr)}" end expr.all? do |sub_expr| Expression.matches?(document, sub_expr) end end end end end
Version data entries
43 entries across 43 versions & 1 rubygems