Created
August 23, 2019 22:16
-
-
Save kevinhooke/b13a64407b5a22da1163f99f42f32679 to your computer and use it in GitHub Desktop.
redis hashes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#cli set/get entry in hash | |
hmset hash-name key value | |
hmget hash-name key | |
#keys in hash | |
hkeys hash-name | |
#values in hash | |
hvals hash-name | |
#spring data redis | |
redisTemplate.opsForHash().put("hash-name", "key", "value"); | |
String value = redisTemplate.opsForHash().get("hash-name", "key"); | |
#get typed HashOperations: hashname, hey, value | |
HashOperations<String, String, SomeClass> hashOps = redisTemplate.opsForHash(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment