Redis String: PSETEX key milliseconds value
Description
Redis PSETEX command is used to set the value of key, with the expiration of time in milliseconds instead of seconds.
Syntax:
Basic syntax of redis PSETEX command is shown below:
redis 127.0.0.1:6379> PSETEX key1 EXPIRY_IN_MILLISECONDS value1
Available since
2.6.0.
Return Value
Simple string reply OK
Return Value Type
String
Example:
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"
- New Content published on w3resource:
- HTML-CSS Practical: Exercises, Practice, Solution
- Java Regular Expression: Exercises, Practice, Solution
- Scala Programming Exercises, Practice, Solution
- Python Itertools exercises
- Python Numpy exercises
- Python GeoPy Package exercises
- Python Pandas exercises
- Python nltk exercises
- Python BeautifulSoup exercises
- Form Template
- Composer - PHP Package Manager
- PHPUnit - PHP Testing
- Laravel - PHP Framework
- Angular - JavaScript Framework
- Vue - JavaScript Framework
- Jest - JavaScript Testing Framework