{"record":{"id":"b6d8151e9a6c8fc2","repo":"mongodb/mongoid","slug":"invalid-elemmatch-operator-operator-b6d815","errorCode":null,"errorMessage":"Invalid $elemMatch operator '%{operator}'.","messagePattern":"Invalid \\$elemMatch operator '%(.+?)'\\.","errorType":"exception","errorClass":"Mongoid::Errors::InvalidElemMatchOperator","httpStatus":null,"severity":"error","filePath":"lib/mongoid/matcher/elem_match_expression.rb","lineNumber":24,"sourceCode":"    # also have a regular expression predicate.\n    #\n    # @api private\n    module ElemMatchExpression\n      # Returns whether a document satisfies an $elemMatch expression.\n      #\n      # @param [ Mongoid::Document ] document The document.\n      # @param [ Hash ] expr The $elemMatch condition predicate.\n      #\n      # @return [ true | false ] Whether the document matches.\n      #\n      # @api private\n      module_function def matches?(document, expr)\n        Expression.matches?(document, expr)\n      rescue Mongoid::Errors::InvalidExpressionOperator\n        begin\n          FieldExpression.matches?(true, document, expr)\n        rescue Mongoid::Errors::InvalidFieldOperator => exc\n          raise Mongoid::Errors::InvalidElemMatchOperator.new(exc.operator)\n        end\n      end\n    end\n  end\nend\n","sourceCodeStart":6,"sourceCodeEnd":30,"githubUrl":"https://github.com/mongodb/mongoid/blob/0da0e23d71adfbad31128c18e5e2c8c301c6f7c4/lib/mongoid/matcher/elem_match_expression.rb#L6-L30","documentation":"Error \"Invalid $elemMatch operator '%{operator}'.\" thrown in mongodb/mongoid.","triggerScenarios":"Thrown at lib/mongoid/matcher/elem_match_expression.rb:24 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"}