Redis Tutorials

Redis is an in-memory data structure storage system. The term REDIS represents Remote Dictionary Server.

All the command names in Redis are case-insensitive. So “GET <key>” and “get <key>” and “Get <key>” means the same thing in Redis.

Here is the list of Redis tutorials-

Installation & Management

Security

Generic/Management Commands

Here are the commands used to manage Redis-

Generic Key Commands

Here are generic commands for Redis key management-

CommandUsageDetails
KEYS
SCAN
EXISTS
TYPE
COPY
RENAME
RENAMENX
DEL
TOUCE
RANDOMKEY
SORT
SORT_RO

Expire Commands

The following commands are for expiring and persisting key-

CommandUsageDetails
EXPIRE
EXPIREAT
EXPIRETIME
PEXPIRE
PEXPIREAT
PEXPIRETIME
PERSIST
TTL
PTTL

Object Commands

These are commands for managing Redis objects-

CommandUsageDetails
OBJECT ENCODING
OBJECT FREQ
OBJECT IDLETIME
OBJECT REFCOUNT

Migration/Backup Commands

Here are the commands for migration and/or backup-

CommandUsageDetails
DUMPGet serialized value of a key DUMP Command Details
RESTORERestore/recreate key from serialized data RESTORE Command Details
MIGRATE
MOVE
WAIT
WAITAOF

String Commands

Here are the commands we can use for different operations on String data type in Redis-

Get Commands

CommandUsageDetails
GETRetrieve string value GET Command Details
MGETRetrieve multiple string value MGET Command Details
GETEXGet string value and set expire GETEX Command Details
GETDELGet string value and delete key GETDEL Command Details
STRLENGet length of string STRLEN Command Details

String Set Commands

CommandUsageDetails
SETSet string value SET Command Details
MSETSet string values for multiple keys MSET Command Details
MSETNXSet string values for multiple keys if not exist MSETNX Command Details
APPENDAppend string at the end APPEND Command Details

Increment Commands

CommandUsageDetails
INCRIncrement integer value INCR Command Details
INCRBY
INCRBYFLOAT

Decrement Commands

CommandUsageDetails
DECRDecrement integer value DECR Command Details
DECRBY
DECRBYFLOAT

Substring Commands

CommandUsageDetails
GETRANGEGet a substring by range GETRANGE Command Details
LCS

List Commands

Here are the commands used to manipulate a list in Redis-

General Operation Commands

CommandUsageDetails
LINDEXGet list item by index LINDEX Command Details
LINSERTInsert a list element LINSERT Command Details
LLENGet list length LLEN Command Details
LMOVEPOP from source, PUSH to destination list LMOVE Command Details
LMPOPPop items from one of multiple list LMPOP Command Details
LPOPPop item from Left/HEAD of list LPOP Command Details
LPOSGet list item index LPOS Command Details
LPUSHPrepend item(s) to list LPUSH Command Details
LPUSHX
LRANGEGet items from list LRANGE Command Details
LREMRemove item(s) from list LREM Command Details
LSETChange list value at specific index LSET Command Details
LTRIMTrim list to start and stop indexes LTRIM Command Details
RPOP
RPUSHAppend item(s) to list RPUSH Command Details
RPUSHX

Blocking Operation Commands

CommandUsageDetails
BLMOVE
MLMPOP
BLPOPBlock until popping from HEAD of first non-empty list BLPOP Command Details
BRPOP
BRPOPLPUSH

Hash Commands

Here are the commands for performing operations on Redis Hash-

CommandUsageDetails
HSETSet hash field(s) HSET Command Details
HSETNX
HGETGet single hash field value HGET Command Details
HMGET
HGETALLGet all fields and value of a hash HGETALL Command Details
HSCAN
HKEYSGet all field names of a hash HKEYS Command Details
HVALSGet all values of a hash HVALS Command Details
HLEN
HSTRLEN
HEXISTS
HINCRBYIncrement hash field integer value HINCRBY Command Details
HINCRBYFLOAT
HDEL
HRANDFIELD

Set Commands

The following commands are used to manage and perform operations on Redis Set data type-

CommandUsageDetails
SADDAdd member(s) to set SADD Command Details
SCARD
SDIFF
SDIFFSTORE
SINTER
SINTERCARD
SINTERSTORE
SISMEMBER
SMISMEMBER
SMEMBERSGet all members of set SMEMBERS Command Details
SMOVE
SPOP
SRANDMEMBER
SREMRemove item(s) from set SREM Command Details
SSCAN
SUNION
SUNIONSTORE

Sorted Set Commands

Here are the commands Sorted Set data structure-

CommandUsageDetails
BZMPOP
BZPOPMAX
BZPOPMIN
ZADD
ZCARD
ZCOUNT
ZDIFF
ZDIFFSTORE
ZINCRBY
ZINTER
ZINTERCARD
ZINTERSTORE
ZLEXCOUNT
ZMPOP
ZMSCORE
ZPOPMAX
ZPOPMIN
ZRANDMEMBER
ZRANGE
ZRANGEBYLEX
ZRANGEBYSCORE
ZRANGESTORE
ZRANK
ZREM
ZREMRANGEBYLEX
ZREMRANGEBYRANK
ZREMRANGEBYSCORE
ZREVRANGE
ZREVRANGEBYLEX
ZREVRANGEBYSCORE
ZREVRANK
ZSCAN
ZSCORE
ZUNION
ZUNIONSTORE

Geospatial Commands

Here are some locations of cities, just as an example, so we can use those for the following Goespatial commands-

LongitudeLatitudeCity
2.35222248.856613Paris
100.50176213.756331Bangkok
114.10949722.396427Hong Kong
139.69171135.689487Tokyo
12.49636541.902782Rome
-87.62979941.878113Chicago
13.40495452.520008Berlin
-79.38318643.653225Toronto
37.61729855.755825Moscow
-0.12775851.507351London
-74.00597440.712776New York
72.87765519.075983Mumbai
135.50216734.693737Osaka

Here are the commands for handling Geospatial data-

CommandUsageDetails
GEOADDAdd geospatial item(s) GEOADD Command Details
GEODISTDistance between two geoindex members GEODIST Command Details
GEOHASHGet geohash of geo index member(s) GEOHASH Command Details
GEOPOSGet position(s) of geo index member(s) GEOPOS Command Details
GEOSEARCHFind geo positions inside certain area GEOSEARCH Command Details
GEOSEARCHSTORE

HyperLogLog Commands

Here are the commands for HyperLogLog data structure-

CommandUsageDetails
PFADD
PFCOUNT
PFDEBUG
PFMERGE
PFSELFTEST

Stream Commands

Here are the commands for handling Stream-

CommandUsageDetails
XACK
XADD
XAUTOCLAIM
XCLAIM
XDEL
XGROUP CREATE
XGROUP CREATECONSUMER
XGROUP DELCONSUMER
XGROUP DESTROY
XGROUP SETID
XINFO CONSUMERS
XINFO GROUPS
XINFO STREAM
XLEN
XPENDING
XRANGE
XREAD
XREADGROUP
XREVRANGE
XSETID
XTRIM

Pub/Sub Commands

Here are the commands for Pub/Sub-

CommandUsageDetails
PSUBSCRIBE
PUBLISH
PUBSUB CHANNELS
PUBSUB NUMPAT
PUBSUB NUMSUB
PUBSUB SHARDCHANNELS
PUBSUB SHARDNUMSUB
PUNSUBSCRIBE
SPUBLISH
SSUBSCRIBE
SUBSCRIBE
SUNSUBSCRIBE
UNSUBSCRIBE

Transaction Commands

Here are the commands for handling Transaction-

CommandUsageDetails
DISCARD
EXEC
MULTI
UNWATCH
WATCH

Leave a Comment


The reCAPTCHA verification period has expired. Please reload the page.