Skip to content

Instantly share code, notes, and snippets.

@cadasmeq
Forked from LeCoupa/redis_cheatsheet.bash
Created August 2, 2021 14:19
Show Gist options
  • Select an option

  • Save cadasmeq/bc261b979e69e4fac84f95f15dfc8a6b to your computer and use it in GitHub Desktop.

Select an option

Save cadasmeq/bc261b979e69e4fac84f95f15dfc8a6b to your computer and use it in GitHub Desktop.
Redis Cheatsheet - Basic Commands You Must Know --> UPDATED VERSION --> https://github.com/LeCoupa/awesome-cheatsheets
# Redis Cheatsheet
# All the commands you need to know
SET key value # set value in key
SETNX key value # set if not exist value in key
GET key # get value in key
INCR key # increment value in key
DEL key # delete key
EXPIRE key 120 # key will be deleted in 120 seconds
TTL key # returns the number of seconds until a key is deleted
RPUSH list value # puts the new value at the end of the list
LPUSH list value # puts the new value at the start of the list
LRANGE list 0 1 # gives a subset of the list
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment