{"record":{"id":"84f524fb090212b7","repo":"mongodb/mongoid","slug":"unknown-mod-argument-condition","errorCode":null,"errorMessage":"Unknown $mod argument #{condition}","messagePattern":"Unknown \\$mod argument #(.+?)","errorType":"exception","errorClass":"Mongoid::Errors::InvalidQuery","httpStatus":null,"severity":"error","filePath":"lib/mongoid/matcher/mod.rb","lineNumber":20,"sourceCode":"  module Matcher\n    # In-memory matcher for $mod expression.\n    #\n    # @see https://www.mongodb.com/docs/manual/reference/operator/query/mod/\n    #\n    # @api private\n    module Mod\n      # Returns whether a value satisfies a $mod expression.\n      #\n      # @param [ true | false ] exists Not used.\n      # @param [ Numeric ] value The value to check.\n      # @param [ Array<Numeric> ] condition The $mod condition predicate,\n      #   which is a 2-tuple containing the divisor and remainder.\n      #\n      # @return [ true | false ] Whether the value matches.\n      #\n      # @api private\n      module_function def matches?(_exists, value, condition)\n        raise Errors::InvalidQuery, \"Unknown $mod argument #{condition}\" unless condition.is_a?(Array)\n        if condition.length != 2\n          raise Errors::InvalidQuery, \"Malformed $mod argument #{condition}, should have 2 elements\"\n        end\n\n        condition[1] == value % condition[0]\n      end\n    end\n  end\nend\n","sourceCodeStart":2,"sourceCodeEnd":30,"githubUrl":"https://github.com/mongodb/mongoid/blob/0da0e23d71adfbad31128c18e5e2c8c301c6f7c4/lib/mongoid/matcher/mod.rb#L2-L30","documentation":"Error \"Unknown $mod argument #{condition}\" thrown in mongodb/mongoid.","triggerScenarios":"Thrown at lib/mongoid/matcher/mod.rb:20 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"}