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

Redis EXISTS – How to check existence of key in redis datastore

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

How to get expiration time of key in redis – Redis TTL | PTTL

5 years ago Lalit Bhagtani 0
In this tutorial, we will learn about how to get an expiration time ( timeout ) of key by using redis TTL and PTTL command.. Expiration Time in Seconds :- To get an expiration time of key in seconds, we will use a COMMAND – TTL in redis-cli. This number of seconds represents the remaining time Read More

Redis TYPE – How to get datatype of value store in key

5 years ago Lalit Bhagtani 0
In this tutorial, we will learn about how to get the datatype of a value store in the key. Values in redis datastore can be of different datatype like String, List, Set, Sorted Set etc. To get the data type of a value, we will use the COMMAND – TYPE in redis-cli. The syntax of redis TYPE Read More

Redis DUMP – How to get serialized value of key in redis

5 years ago Lalit Bhagtani 0
In this tutorial, we will learn about how to get serialized version of value stored at the key in redis datastore by using a COMMAND – DUMP in redis-cli. The syntax of redis DUMP command is as follows :- Syntax :- redis host:post> DUMP <key name> Output :- - string representing serialized version of value Example :- Read More

Python Set Functions & Methods – Python Tutorial

6 years ago Lalit Bhagtani 0
In Python, Objects have built-in methods inside it, which can be used to perform actions on the object itself. We can call methods of any object by putting period after object variable and then the method name. Syntax:    objectVariable.methodName( parameters.. )                   objectVariable :  variable containing object.  Read More

Python Set Symmetric Difference with Example – Python Tutorial

6 years ago Lalit Bhagtani 0
In this tutorial, we will learn about different ways of performing symmetric difference operation on a given pair of sets in python. Symmetric Difference of Sets: In set theory, the symmetric difference of two sets A and B, written as A Δ B is a set which contains all elements of set A and B that Read More