{"record":{"id":"5997e2721d010988","repo":"mongodb/mongoid","slug":"unknown-type-argument-condition","errorCode":null,"errorMessage":"Unknown $type argument: #{condition}","messagePattern":"Unknown \\$type argument: #(.+?)","errorType":"exception","errorClass":"Mongoid::Errors::InvalidQuery","httpStatus":null,"severity":"error","filePath":"lib/mongoid/matcher/type.rb","lineNumber":26,"sourceCode":"    module Type\n      # Returns whether a value satisfies a $type expression.\n      #\n      # @param [ true | false ] exists Whether the value exists.\n      # @param [ Object ] value The value to check.\n      # @param [ Integer | Array<Integer> ] condition The $type condition\n      #   predicate which corresponds to the BSON type enumeration.\n      #\n      # @return [ true | false ] Whether the value matches.\n      #\n      # @api private\n      module_function def matches?(exists, value, condition)\n        conditions = case condition\n                     when Array\n                       condition\n                     when Integer\n                       [ condition ]\n                     else\n                       raise Errors::InvalidQuery, \"Unknown $type argument: #{condition}\"\n                     end\n        conditions.each do |condition|\n          return true if one_matches?(exists, value, condition)\n        end\n        false\n      end\n\n      # Returns whether a value satisfies a single $type expression\n      # value.\n      #\n      # @param [ true | false ] exists Whether the value exists.\n      # @param [ Object ] value The value to check.\n      # @param [ Integer ] condition The $type condition predicate\n      #   which corresponds to the BSON type enumeration.\n      #\n      # @return [ true | false ] Whether the value matches.\n      #\n      # @api private","sourceCodeStart":8,"sourceCodeEnd":44,"githubUrl":"https://github.com/mongodb/mongoid/blob/0da0e23d71adfbad31128c18e5e2c8c301c6f7c4/lib/mongoid/matcher/type.rb#L8-L44","documentation":"Error \"Unknown $type argument: #{condition}\" thrown in mongodb/mongoid.","triggerScenarios":"Thrown at lib/mongoid/matcher/type.rb:26 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"}