---
title: "decrement · RUAL Documentation"
description: "Decrements the number stored at key by one. If the key does not exist, it is set to 0 before performing the operation."
canonical: https://docs.rual.nl/block-types/redis/function_redis_cache_decr_key
language: en
---

# decrement

This block is part of the [`redis`](https://docs.rual.nl/block-types/redis) group and was last modified in core [`v13.0.6`](https://docs.rual.nl/core-versions/130006).

### Redis Key Selection Required

This block relies on a Redis key to perform its redis releated actions. You must manually select the Redis key you want to use in the flow in the blueprint using the Redis key selector modal. To access the modal, click the white button on the block.

Decrements the number stored at key by one. If the key does not exist, it is set to `0` before performing the operation.

- flow `flow`

- number required `number` Number to decrement given the key with.

- flow `flow`

- number `number` New number.

- error `value`

- key `v13.0.6` `value` current redis key, this outpin be handy when using dynamic redis keys

| `redis decr` |
| --- |
| `decr` |

A typical wiring for [decrement](https://docs.rual.nl/block-types/redis/function_redis_cache_decr_key): a [function trigger](https://docs.rual.nl/block-types/globals/trigger_custom_function) starts the flow; the `flow` out pin feeds [debug](https://docs.rual.nl/block-types/state%20ui/state_debug).

![Studio canvas example for the decrement block: typical wiring for decrement.](https://docs.rual.nl/canvas-examples/function_redis_cache_decr_key.png)

### Version history

Introduced in [`v11.0.0`](https://docs.rual.nl/core-versions/110000).

Last modified in [`v13.0.6`](https://docs.rual.nl/core-versions/130006).
