{"record":{"id":"10668d49145207d1","repo":"mongodb/mongoid","slug":"mongoid-errors-messages-invalid-field-operator-mes","errorCode":null,"errorMessage":"mongoid.errors.messages.invalid_field_operator.message","messagePattern":"mongoid\\.errors\\.messages\\.invalid_field_operator\\.message","errorType":"exception","errorClass":"Mongoid::Errors::InvalidFieldOperator","httpStatus":null,"severity":"error","filePath":"lib/mongoid/matcher/field_operator.rb","lineNumber":44,"sourceCode":"        '$regex' => Regex,\n        '$size' => Size,\n        '$type' => Type\n      }.freeze\n\n      # Returns the matcher module for a given operator.\n      #\n      # @param [ String ] op The operator name.\n      #\n      # @return [ Module ] The matcher module.\n      #\n      # @raises [ Mongoid::Errors::InvalidFieldOperator ]\n      #   Raised if the given operator is unknown.\n      #\n      # @api private\n      module_function def get(op)\n        MAP.fetch(op)\n      rescue KeyError\n        raise Errors::InvalidFieldOperator.new(op)\n      end\n\n      # Used for evaluating $lt, $lte, $gt, $gte comparison operators.\n      #\n      # @todo Refactor this as it is only relevant to $lt, $lte, $gt, $gte.\n      #\n      # @api private\n      module_function def apply_array_field_operator(_exists, value, _condition, &block)\n        if value.is_a?(Array)\n          value.any?(&block)\n        else\n          yield value\n        end\n      end\n\n      # Used for evaluating $lt, $lte, $gt, $gte comparison operators.\n      #\n      # @todo Refactor this as it is only relevant to $lt, $lte, $gt, $gte.","sourceCodeStart":26,"sourceCodeEnd":62,"githubUrl":"https://github.com/mongodb/mongoid/blob/0da0e23d71adfbad31128c18e5e2c8c301c6f7c4/lib/mongoid/matcher/field_operator.rb#L26-L62","documentation":"Error \"mongoid.errors.messages.invalid_field_operator.message\" thrown in mongodb/mongoid.","triggerScenarios":"Thrown at lib/mongoid/matcher/field_operator.rb:44 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"}