newszine

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

5 years 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

5 years 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

5 years 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

5 years 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

5 years 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

5 years 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

5 years 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

5 years 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

Redis DEL – How to delete a key from redis datastore

5 years ago Lalit Bhagtani 0
In this tutorial, we will learn about how to delete a key in redis datastore by using a COMMAND – DEL in redis-cli. The syntax of redis DEL command is as follows :- Syntax :- redis host:post> DEL <key name> Output :-  (integer) 1 if key is deleted (integer) 0 if key does not exists Read More

Redis PERSIST – How to remove expiration time of key in redis

5 years ago Lalit Bhagtani 0
In this tutorial, we will learn about how to remove expiration time ( timeout ) of a key stored in redis datastore, by using a COMMAND – PERSIST in redis-cli. When we set an expiration time on a key using EXPIRE/PEXPIRE or EXPIREAT/PEXPIREAT, its state becomes Volatile ( a key with an expiration time set ). Read More