{"record":{"id":"203216b389800445","repo":"redis/redis-rb","slug":"only-one-of-nx-xx-gt-lt-can-be-specified","errorCode":null,"errorMessage":"only one of :nx, :xx, :gt, :lt can be specified","messagePattern":"only one of :nx, :xx, :gt, :lt can be specified","errorType":"exception","errorClass":"ArgumentError","httpStatus":null,"severity":"error","filePath":"lib/redis/commands/hashes.rb","lineNumber":558,"sourceCode":"      #   future minor release without a major version bump.\n      #\n      # @return [Integer] number of fieldsets removed\n      # @api experimental\n      def himport_discard_all\n        send_command([:himport, \"DISCARDALL\"])\n      end\n\n      private\n\n      # The HEXPIRE command family accepts a single optional condition token\n      # (`[NX | XX | GT | LT]`); the server rejects combinations, so fail fast in Ruby.\n      def hash_field_expiration_condition(nx, xx, gt, lt)\n        condition = []\n        condition << \"NX\" if nx\n        condition << \"XX\" if xx\n        condition << \"GT\" if gt\n        condition << \"LT\" if lt\n        raise ArgumentError, \"only one of :nx, :xx, :gt, :lt can be specified\" if condition.size > 1\n\n        condition\n      end\n    end\n  end\nend\n","sourceCodeStart":540,"sourceCodeEnd":565,"githubUrl":"https://github.com/redis/redis-rb/blob/2ba9010b91dab9e0fde1fbae3a9aae003f8bc307/lib/redis/commands/hashes.rb#L540-L565","documentation":"Error \"only one of :nx, :xx, :gt, :lt can be specified\" thrown in redis/redis-rb.","triggerScenarios":"Thrown at lib/redis/commands/hashes.rb:558 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass only one of the mutually exclusive options :nx, :xx, :gt or :lt.","Remove the extra option(s) from the keyword arguments so exactly one condition flag remains."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2ba9010b91dab9e0fde1fbae3a9aae003f8bc307","analyzedAt":"2026-08-23T03:54:57.017Z","schemaVersion":2},"datasetVersion":"2026-08-23T08:06:27.607Z"}