{"record":{"id":"a117d8cf74d8f5c9","repo":"mongodb/mongoid","slug":"nor-argument-must-be-a-non-empty-array-errors","errorCode":null,"errorMessage":"$nor argument must be a non-empty array: #{Errors::InvalidQuery.truncate_expr(expr)}","messagePattern":"\\$nor argument must be a non-empty array: #(.+?)","errorType":"exception","errorClass":"Mongoid::Errors::InvalidQuery","httpStatus":null,"severity":"error","filePath":"lib/mongoid/matcher/nor.rb","lineNumber":23,"sourceCode":"    # @see https://www.mongodb.com/docs/manual/reference/operator/query/nor/\n    #\n    # @api private\n    module Nor\n      # Returns whether a document satisfies a $nor expression.\n      #\n      # @param [ Mongoid::Document ] document The document.\n      # @param [ Array<Hash> ] expr The $nor conditions.\n      #\n      # @return [ true | false ] Whether the document matches.\n      #\n      # @api private\n      module_function def matches?(document, expr)\n        unless expr.is_a?(Array)\n          raise Errors::InvalidQuery, \"$nor argument must be an array: #{Errors::InvalidQuery.truncate_expr(expr)}\"\n        end\n\n        if expr.empty?\n          raise Errors::InvalidQuery, \"$nor argument must be a non-empty array: #{Errors::InvalidQuery.truncate_expr(expr)}\"\n        end\n\n        expr.each do |sub_expr|\n          return false if Expression.matches?(document, sub_expr)\n        end\n\n        expr.any?\n      end\n    end\n  end\nend\n","sourceCodeStart":5,"sourceCodeEnd":35,"githubUrl":"https://github.com/mongodb/mongoid/blob/0da0e23d71adfbad31128c18e5e2c8c301c6f7c4/lib/mongoid/matcher/nor.rb#L5-L35","documentation":"Error \"$nor argument must be a non-empty array: #{Errors::InvalidQuery.truncate_expr(expr)}\" thrown in mongodb/mongoid.","triggerScenarios":"Thrown at lib/mongoid/matcher/nor.rb:23 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"0da0e23d71adfbad31128c18e5e2c8c301c6f7c4","analyzedAt":"2026-08-23T06:25:47.656Z","schemaVersion":2},"datasetVersion":"2026-08-23T08:06:27.607Z"}