Available since v1.0.0

This command implements both INCRBY and DECRBY by a flag passed during instantiation. DECRBY key decrement

Decrements the number stored at key by decrement. If the key does not exist, it is set to 0 before performing the operation. An error is returned if the key contains a value of the wrong type or contains a string that can not be represented as integer. This operation is limited to 53 bit signed integers.

See INCR for extra information on increment/decrement operations.

Return value Integer reply: the value of key after the decrement

Hierarchy

Constructors

Properties

blocking?: boolean
dataType?: DataType

Used for "database" commands to enforce type checking.

dbDataType: DataType = DataType.STRING
logger: Logger = ...
maxParams: number = 2

Maximum number of parameters allowed. -1 for no maximum.

minParams: number = 2

Minimum number of parameters require.

name: string = "incrby"
pubSubAllowed?: boolean

Used when PUB/SUB is in effect.

sign: number

Sign is used in commands with a compliment command. The only current example is INCR/DECR. Sign is 1 for INCR and -1 for DECR

txIgnore?: boolean

Used in transactions to enqueue a command.

Methods