Updated on 2024-04-25 GMT+08:00

Middleware: RedisSet

This system keyword is used for Redis character string operations. You can configure the expiration time and value based on a specified key.

Parameter

Mandatory

Type

Description

Ip

Yes

String

IP address of the Redis database

Port

Yes

Integer

Redis database port

Password

Yes

String

Password (The login password is personal information and must be defined as sensitive in the environment parameters.)

Key

Yes

String

Specified key name

Value

Yes

String

Specified value

Expire

No

Long

Expiration time, in seconds. If the default value -1 is used, the password never expires. If a negative integer of the Long type is used, the password never expires.

RedisSet Response

Status: success

Parameter

Type

Description

result

String

Result returned by the configured value corresponding to the key. If the setting is successful, OK is returned. If the setting fails, an error message is returned.

RedisSet Response Example

{
  "result" : "OK"
}

RedisSet Usage Example

  • Set the value based on the entered key value. The default value is used, indicating that the password never expires.

    Check whether the setting is successful.

  • Set the corresponding value based on the entered key value. Set the expiration time to 600 seconds.

    Check whether the setting is successful.