Redis LLEN – How to get a length of the list in redis datastore

5 days ago Lalit Bhagtani 0
In this tutorial, we will learn about how to get the length ( number of elements ) of a list value stored at the key, by using a COMMAND – LLEN in redis-cli. If key doesn’t exist in redis datastore, it is interpreted as an empty list and 0 is returned. The syntax of redis LLEN Read More

Redis SADD – How to create and add elements in the set

6 days ago Lalit Bhagtani 0
In this tutorial, we will learn about how to create and add elements in a set value stored at the key, by using a COMMAND – SADD in redis-cli. If a key exists in the datastore, all the specified elements will be added (ignoring the elements that are already present ) to the set otherwise Read More

Redis SISMEMBER – How to check existence of an element in the set

6 days ago Lalit Bhagtani 0
In this tutorial, we will learn about how to check, if a specified element is a member of the set or not. For this we will use a COMMAND – SISMEMBER in redis-cli. The syntax of redis SISMEMBER command is as follows :- Syntax :- redis host:post> SISMEMBER <key name> Output :-  (integer) 1 if Read More

Redis SCARD – How to get a size of the set in redis datastore

6 days ago Lalit Bhagtani 0
In this tutorial, we will learn about how to get the size ( number of elements ) of a set value stored at the key, by using a COMMAND – SCARD in redis-cli. The syntax of redis SCARD command is as follows :- Syntax :- redis host:post> SCARD <key name> Output :-  (integer) value, representing Read More

Redis SMEMBERS – How to get all elements of a set in redis

6 days ago Lalit Bhagtani 0
In this tutorial, we will learn about how to get all the elements of a set value stored at the key, by using a COMMAND – SMEMBERS in redis-cli. The syntax of redis SMEMBERS command is as follows :- Syntax :- redis host:post> SMEMBERS <key name> Output :-  - array value, containing all elements of Read More

How to rename a key in redis datastore – Redis RENAME | RENAMENX

6 days ago Lalit Bhagtani 0
In this tutorial, we will learn about how to rename a key in redis datastore, by using redis RENAME and RENAMENX command. RENAME Command :- The RENAME command, rename the key from old name to new name. if a key with new name already exists, it will be overwritten and key with old name will Read More

Redis Keys – Commands to manage keys in redis datastore

1 week ago Lalit Bhagtani 0
In Redis, Keys are used as a unique identifier to store, manage and retrieved a value stored in the database. Keys can be manage by using Redis Commands in redis-cli. The syntax for using redis Key commands is as follows :- Syntax :- redis host:post> <Command Name> <key name> Example :- Redis Key Commands :-  Read More

How to set expiration time on key in redis – Redis EXPIRE | EXPIREAT

1 week ago Lalit Bhagtani 0
In this tutorial, we will learn about how to set an expiration time ( timeout ) on a key, using redis EXPIRE, PEXPIRE, EXPIREAT and PEXPIREAT command. Expiration Time in Seconds :- To set an expiration time on key in seconds, we will use a redis EXPIRE command in redis-cli. This number of seconds represents the time Read More

Redis RANDOMKEY – How to get random key stored in redis

1 week ago Lalit Bhagtani 0
In this tutorial, we will learn about how to get a random key currently stored in redis datastore by using a COMMAND – RANDOMKEY in redis-cli. The syntax of redis RANDOMKEY command is as follows :- Syntax :- redis host:post> RANDOMKEY Output :- - random key from datastore. - nil, if datastore is empty. Example :- Read More