1
1
mirror of https://github.com/namibia/awesome-cheatsheets.git synced 2024-11-10 15:20:59 +00:00

Update cheatsheets

This commit is contained in:
Julien Le Coupanec 2017-11-18 17:22:37 +00:00
parent 5c488dab02
commit a6c52438bd
2 changed files with 18 additions and 18 deletions

View File

@ -1,15 +1,15 @@
############################################################################## # *****************************************************************************
# BASICS # BASICS
############################################################################## # *****************************************************************************
redis-server /path/redis.conf # start redis with the related configuration file redis-server /path/redis.conf # start redis with the related configuration file
redis-cli # opens a redis prompt redis-cli # opens a redis prompt
############################################################################## # *****************************************************************************
# STRINGS # STRINGS
############################################################################## # *****************************************************************************
APPEND key value # append a value to a key APPEND key value # append a value to a key
@ -34,10 +34,10 @@ EXPIRE key 120 # key will be deleted in 120 seconds
TTL key # returns the number of seconds until a key is deleted TTL key # returns the number of seconds until a key is deleted
############################################################################## # *****************************************************************************
# LISTS # LISTS
# A list is a series of ordered values # A list is a series of ordered values
############################################################################## # *****************************************************************************
RPUSH key value [value ...] # put the new value at the end of the list RPUSH key value [value ...] # put the new value at the end of the list
@ -56,11 +56,11 @@ BLPOP key [key ...] timeout # remove and get the first element in a li
BRPOP key [key ...] timeout # remove and get the last element in a list, or block until one is available BRPOP key [key ...] timeout # remove and get the last element in a list, or block until one is available
############################################################################## # *****************************************************************************
# SETS # SETS
# A set is similar to a list, except it does not have a specific order # A set is similar to a list, except it does not have a specific order
# and each element may only appear once. # and each element may only appear once.
############################################################################## # *****************************************************************************
SADD key member [member ...] # add the given value to the set SADD key member [member ...] # add the given value to the set
@ -74,11 +74,11 @@ SMOVE source destination member # move a member from one set to another
SPOP key [count] # remove and return one or multiple random members from a set SPOP key [count] # remove and return one or multiple random members from a set
############################################################################## # *****************************************************************************
# SORTED SETS # SORTED SETS
# A sorted set is similar to a regular set, but now each value has an associated score. # A sorted set is similar to a regular set, but now each value has an associated score.
# This score is used to sort the elements in the set. # This score is used to sort the elements in the set.
############################################################################## # *****************************************************************************
ZADD key [NX|XX] [CH] [INCR] score member [score member ...] # add one or more members to a sorted set, or update its score if it already exists ZADD key [NX|XX] [CH] [INCR] score member [score member ...] # add one or more members to a sorted set, or update its score if it already exists
@ -96,11 +96,11 @@ ZSCORE key member # get the score associated with the given mm
ZRANGEBYSCORE key min max [WITHSCORES] [LIMIT offset count] # return a range of members in a sorted set, by score ZRANGEBYSCORE key min max [WITHSCORES] [LIMIT offset count] # return a range of members in a sorted set, by score
############################################################################## # *****************************************************************************
# HASHES # HASHES
# Hashes are maps between string fields and string values, # Hashes are maps between string fields and string values,
# so they are the perfect data type to represent objects. # so they are the perfect data type to represent objects.
############################################################################## # *****************************************************************************
HGET key field # get the value of a hash field HGET key field # get the value of a hash field
@ -119,11 +119,11 @@ HSTRLEN key field # get the length of the value of a hash field
HVALS key # get all the values in a hash HVALS key # get all the values in a hash
############################################################################## # *****************************************************************************
# HYPERLOGLOG # HYPERLOGLOG
# HyperLogLog uses randomization in order to provide an approximation of the number # HyperLogLog uses randomization in order to provide an approximation of the number
# of unique elements in a set using just a constant, and small, amount of memory # of unique elements in a set using just a constant, and small, amount of memory
############################################################################## # *****************************************************************************
PFADD key element [element ...] # add the specified elements to the specified HyperLogLog PFADD key element [element ...] # add the specified elements to the specified HyperLogLog
@ -132,9 +132,9 @@ PFCOUNT key [key ...] # return the approximated cardinality of the se
PFMERGE destkey sourcekey [sourcekey ...] # merge N HyperLogLogs into a single one PFMERGE destkey sourcekey [sourcekey ...] # merge N HyperLogLogs into a single one
############################################################################## # *****************************************************************************
# PUBLICATION & SUBSCRIPTION # PUBLICATION & SUBSCRIPTION
############################################################################## # *****************************************************************************
PSUBSCRIBE pattern [pattern ...] # listen for messages published to channels matching the given patterns PSUBSCRIBE pattern [pattern ...] # listen for messages published to channels matching the given patterns
@ -145,9 +145,9 @@ SUBSCRIBE channel [channel ...]  # listen for messages published to
UNSUBSCRIBE [channel [channel ...]] # stop listening for messages posted to the given channels UNSUBSCRIBE [channel [channel ...]] # stop listening for messages posted to the given channels
############################################################################## # *****************************************************************************
# OTHER COMMANDS # OTHER COMMANDS
############################################################################## # *****************************************************************************
KEYS pattern # find all keys matching the given pattern KEYS pattern # find all keys matching the given pattern