What are some common commands used in Redis?

Commonly used commands in Redis include:

  1. SET: Set the value of the specified key.
  2. GET: Retrieve the value of a specified key.
  3. DEL: Remove the specified key.
  4. Check if the specified key exists.
  5. KEYS: Retrieve all key names.
  6. TTL: Get the remaining time to live for a key.
  7. EXPIRE: Set a key’s expiration time.
  8. INCR: Increase the value of the key by 1.
  9. DECR: Decrease the value of the key by 1.
  10. HSET: Sets a field in a hash table.
  11. HGET: Retrieve the value of a field in a hash table.
  12. HMSET: Set multiple fields in a hash map at once.
  13. HMGET: Retrieve multiple hash field values at once.
  14. LPUSH: Insert one or more values at the head of a list.
  15. RPUSH: Insert one or more values at the end of a list.
  16. LPOP: Remove and return the first element of the list.
  17. RPOP: Remove and return the last element of the list.
  18. SADD: Add one or more members to a set.
  19. SREM: Remove one or more members from the set.
  20. SMEMBERS: Retrieve all members from a set.
  21. ZADD: Add one or more members to a sorted set.
  22. ZRANGE: Retrieve members within a specified range in a sorted set.
  23. ZSCORE: Get the score of a specific member in a sorted set.
  24. ZREM: Remove one or more members from a sorted set.
  25. PUBLISH: Send the message to the specified channel.
  26. SUBSCRIBE: Receive messages from one or more channels by subscribing.
  27. UNSUBSCRIBE: Cancel your subscription to one or more channels.
  28. EVAL: Execute Lua scripts on the server side.
  29. SCAN: Iterate over the keys in the database.
  30. FLUSHDB command clears all keys in the current database.
bannerAds