Skip to content

System generated get redis key api

  • To get the value of redis key, use get-redis-key system API.

Request Method: POST

URL

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

Request payload, single key

1
2
3
{
    "keys": "redis_key_name"
}

Request payload, multiple keys

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

Get redis keys

Get redis key using global object 'g'.

  • Get single redis key value.
await g.sys.cache.getKey("REDIS_KEY_NAME");
  • Get multiple redis keys values.
await g.sys.cache.getKey(["REDIS_KEY_NAME", "ANOTHER_REDIS_KEY_NAME"]);

API Response, single key

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

API Response, multiple keys

1
2
3
4
5
6
7
8
{
    "success": true,
    "statusCode": 200,
    "data": [
        "redis_key_value",
        "redis_key_value"
    ]
}