English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

Comando Redis Psetex

String (String) do Redis

O comando Redis Psetex define o tempo de vida do key em milissegundos.

Sintaxe

A sintaxe básica do comando redis Psetex é a seguinte:

redis 127.0.0.1:6379> PSETEX key1 EXPIRY_IN_MILLISECONDS valor1

Versão Disponível

>= 2.6.0

Valor de Retorno

Retorna OK ao configurar com sucesso .

Exemplo Online

redis 127.0.0.1:6379> PSETEX mykey 1000 "Hello"
OK
redis 127.0.0.1:6379> PTTL mykey
999
redis 127.0.0.1:6379> GET mykey
1) "Hello"

String (String) do Redis