📜  redis INCRBYFLOAT mykey 0.1 (1)

📅  最后修改于: 2023-12-03 15:34:41.775000             🧑  作者: Mango

Redis INCRBYFLOAT Command

The Redis INCRBYFLOAT command is used to increment the value of a key in Redis by a floating-point increment. If the key does not exist, a new key holding a value of "increment" will be created.

The INCRBYFLOAT command returns the new value of the key after incrementing it.

Syntax:

INCRBYFLOAT mykey increment

Example:

INCRBYFLOAT mykey 0.1

In this example, the value of the "mykey" key in Redis will be incremented by 0.1. If the value of "mykey" was previously 2.0, it will now be 2.1.

Return Value:

The INCRBYFLOAT command returns the new value of the key after incrementing it.

Example Output:

2.1

Markdown Code Block:

# Redis INCRBYFLOAT Command

The Redis INCRBYFLOAT command is used to increment the value of a key in Redis by a floating-point increment. If the key does not exist, a new key holding a value of "increment" will be created.

The INCRBYFLOAT command returns the new value of the key after incrementing it.

## Syntax:

```redis
INCRBYFLOAT mykey increment
Example:
INCRBYFLOAT mykey 0.1

In this example, the value of the "mykey" key in Redis will be incremented by 0.1. If the value of "mykey" was previously 2.0, it will now be 2.1.

Return Value:

The INCRBYFLOAT command returns the new value of the key after incrementing it.

Example Output:
2.1