Skip to content

Remove redis key api

  • To remove redis keys we can use the remove-redis-key system API.

Request Method: POST

URL

/api/system-api/user-path/remove-redis-key

Request payload

1
2
3
4
5
6
{
    "keys": [
        "Key_Name_1",
        "Key_Name_2"
    ]
}

Remove redis keys

Remove redis key and its value using global object 'g'.

await g.sys.cache.removeKey("REDIS_KEY_NAME");

Remove multiple redis keys.

await g.sys.cache.removeKey(["REDIS_KEY_NAME", "ANOTHER_REDIS_KEY_NAME"]);

API Response

1
2
3
4
5
{
    "success": true,
    "statusCode": 200,
    "data": true
}