{"record":{"id":"5d24797029e2d1cb","repo":"mongodb/mongoid","slug":"invalid-option-option-provided-for-field-na","errorCode":null,"errorMessage":"Invalid option :%{option} provided for field :%{name}.","messagePattern":"Invalid option :%(.+?) provided for field :%(.+?)\\.","errorType":"exception","errorClass":"Mongoid::Errors::InvalidFieldOption","httpStatus":null,"severity":"error","filePath":"lib/mongoid/fields/validators/macro.rb","lineNumber":106,"sourceCode":"          Mongoid.logger.warn(\"Overwriting existing field #{name} in class #{klass.name}.\") if Mongoid.logger\n        end\n\n        # Validate that the field options are allowed.\n        #\n        # @api private\n        #\n        # @example Validate the field options.\n        #   Macro.validate_options(Model, :name, { localized: true })\n        #\n        # @param [ Class ] klass The model class.\n        # @param [ Symbol ] name The field name.\n        # @param [ Hash ] options The provided options.\n        #\n        # @raise [ Errors::InvalidFieldOption ] If an option is invalid.\n        def validate_options(klass, name, options)\n          options.keys.each do |option|\n            if !OPTIONS.include?(option) && !Fields.options.include?(option)\n              raise Errors::InvalidFieldOption.new(klass, name, option, OPTIONS)\n            end\n\n            Mongoid::Warnings.warn_symbol_type_deprecated if option == :type && options[option] == Symbol\n          end\n        end\n      end\n    end\n  end\nend\n","sourceCodeStart":88,"sourceCodeEnd":116,"githubUrl":"https://github.com/mongodb/mongoid/blob/0da0e23d71adfbad31128c18e5e2c8c301c6f7c4/lib/mongoid/fields/validators/macro.rb#L88-L116","documentation":"Error \"Invalid option :%{option} provided for field :%{name}.\" thrown in mongodb/mongoid.","triggerScenarios":"Thrown at lib/mongoid/fields/validators/macro.rb:106 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"}