Skip to content

Instantly share code, notes, and snippets.

@indyarocks
Created May 21, 2017 17:36
Show Gist options
  • Save indyarocks/2ce1317f71221ac9dbb676e9fd799f62 to your computer and use it in GitHub Desktop.
Save indyarocks/2ce1317f71221ac9dbb676e9fd799f62 to your computer and use it in GitHub Desktop.
Redis STRING data type
127.0.0.1:6379> SET foo bar # Setting foo with value bar
OK
127.0.0.1:6379> GET foo # Getting value at key foo
"bar"
127.0.0.1:6379> GET chandan # Getting a non-set value. Returns nil
(nil)
127.0.0.1:6379> DEL chandan # Deleting a non-set key. Returns nil
(integer) 0
127.0.0.1:6379> SET chandan faodail # Setting a new key-value (Note: All downcased letters in key)
OK
127.0.0.1:6379> DEL foo # Deleting an existing key. Returns 1
(integer) 1
127.0.0.1:6379> GET foo # Getting deleted key-value. Returns nil
(nil)
127.0.0.1:6379> GET chandan # Getting value at key chandan (Note: All downcased letters)
"faodail"
127.0.0.1:6379> GET Chandan # NOTE the CASE-SENSITIVE Key, fetching value for Chandan as nil
(nil)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment