StringRedisTemplate與RedisTemplate

StringRedisTemplate

它存得是字符串類型得數據到redis中

操作如下

//生成一個空鍵和空值
ValueOperations<String, String> stringStringValueOperations = stringRedisTemplate.opsForValue();
//往redis裏面存值
stringStringValueOperations .set("鍵","值");
//其它方法
opsForHash();   //操作hash
opsForList();   //操作list
opsForSet();    //操作set
opsForZSet();   //操作有序set

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章