{"record":{"id":"8d9b4277cb2c6541","repo":"mongodb/mongoid","slug":"invalid-index-specification-on-klass-spec","errorCode":null,"errorMessage":"Invalid index specification on %{klass}: %{spec}, %{options}","messagePattern":"Invalid index specification on %(.+?): %(.+?), %(.+?)","errorType":"exception","errorClass":"Mongoid::Errors::InvalidIndex","httpStatus":null,"severity":"error","filePath":"lib/mongoid/indexable/validators/options.rb","lineNumber":75,"sourceCode":"        end\n\n        private\n\n        # Validates the options of the index spec.\n        #\n        # @api private\n        #\n        # @example Validate the options.\n        #   Options.validate_options(Band, name: 1)\n        #\n        # @param [ Class ] klass The model class.\n        # @param [ Hash ] spec The index specification.\n        # @param [ Hash ] options The index options.\n        #\n        # @raise [ Errors::InvalidIndex ] If validation failed.\n        def validate_options(klass, spec, options)\n          options.each_pair do |name, _value|\n            raise Errors::InvalidIndex.new(klass, spec, options) unless VALID_OPTIONS.include?(name)\n          end\n        end\n\n        # Validates the index spec.\n        #\n        # @api private\n        #\n        # @example Validate the spec.\n        #   Options.validate_spec(Band, name: 1)\n        #\n        # @param [ Class ] klass The model class.\n        # @param [ Hash ] spec The index specification.\n        # @param [ Hash ] options The index options.\n        #\n        # @raise [ Errors::InvalidIndex ] If validation failed.\n        def validate_spec(klass, spec, options)\n          raise Errors::InvalidIndex.new(klass, spec, options) unless spec.is_a?(::Hash)\n","sourceCodeStart":57,"sourceCodeEnd":93,"githubUrl":"https://github.com/mongodb/mongoid/blob/0da0e23d71adfbad31128c18e5e2c8c301c6f7c4/lib/mongoid/indexable/validators/options.rb#L57-L93","documentation":"Error \"Invalid index specification on %{klass}: %{spec}, %{options}\" thrown in mongodb/mongoid.","triggerScenarios":"Thrown at lib/mongoid/indexable/validators/options.rb:75 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"}