windows 下安装redis 及命令练习
2022/6/26 2:23:22
本文主要是介绍windows 下安装redis 及命令练习,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
第一步:下载
Github下载地址:
https://github.com/MicrosoftArchive/redis/releases
网盘下载地址:链接: https://pan.baidu.com/s/1jHbHv43J37Tv6LVxopwR0A?pwd=bjmq 提取码: bjmq
redis 官网没有关于windows下的安装包,所以从github下载即可
第二步:运行
方式1:
方式2:
第三步:连接redis
重新打开一个cmd命令行,
第四步:练习
string类型:
list类型:
语法:LREM key count VALUE
Lrem 根据参数 COUNT 的值,移除列表中与参数 VALUE 相等的元素
COUNT 的值可以是以下几种:
count > 0 : 从表头开始向表尾搜索,移除与 VALUE 相等的元素,数量为 COUNT 。
count < 0 : 从表尾开始向表头搜索,移除与 VALUE 相等的元素,数量为 COUNT 的绝对值。
count = 0 : 移除表中所有与 VALUE 相等的值。
hash类型:
127.0.0.1:6379[1]> hmset students name "clo" age "18" career "tester" description "none" OK 127.0.0.1:6379[1]> hgetall students 1) "name" 2) "clo" 3) "age" 4) "18" 5) "career" 6) "tester" 7) "description" 8) "none" 127.0.0.1:6379[1]> type students hash 127.0.0.1:6379[1]> hgetall students 1) "name" 2) "clo" 3) "age" 4) "18" 5) "career" 6) "tester" 7) "description" 8) "none" 127.0.0.1:6379[1]> hget students name "clo" 127.0.0.1:6379[1]> hget students age "18" 127.0.0.1:6379[1]> hget students description "none" 127.0.0.1:6379[1]> hexists students name (integer) 1 127.0.0.1:6379[1]> hgetall students 1) "name" 2) "clo" 3) "age" 4) "18" 5) "career" 6) "tester" 7) "description" 8) "none" 127.0.0.1:6379[1]> hdel students description (integer) 1 127.0.0.1:6379[1]> hgetall students 1) "name" 2) "clo" 3) "age" 4) "18" 5) "career" 6) "tester" 127.0.0.1:6379[1]> hkeys students 1) "name" 2) "age" 3) "career" 127.0.0.1:6379[1]> hlen students (integer) 3 127.0.0.1:6379[1]> hmget students name 1) "clo" 127.0.0.1:6379[1]> hgetall students 1) "name" 2) "clo" 3) "age" 4) "18" 5) "career" 6) "tester" 127.0.0.1:6379[1]> hmset students name eosclover OK 127.0.0.1:6379[1]> hgetall students 1) "name" 2) "eosclover" 3) "age" 4) "18" 5) "career" 6) "tester" 127.0.0.1:6379[1]> hkeys students 1) "name" 2) "age" 3) "career" 127.0.0.1:6379[1]> hvals students 1) "eosclover" 2) "18" 3) "tester" 127.0.0.1:6379[1]>
set集合:
sorted set有序集合:
以上就是window下 安装redis 及一些命令的练习。
参考链接:https://www.runoob.com/redis/redis-sorted-sets.html
这篇关于windows 下安装redis 及命令练习的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!
- 2024-03-21redisinsight-v2
- 2024-02-26Typed property App\Api\Mapper\GamePropsConfigMapper::$apiRedis must not be accessed before initia-icode9专业技术文章分享
- 2024-02-21redisson getlock
- 2024-02-20redis config
- 2024-02-20redis leaderboard
- 2024-01-23缓存选型:Redis or MemCache
- 2024-01-22面试官:Redis持久化能关吗?怎么关?
- 2024-01-21Redis压测工具redis-benchmark-icode9专业技术文章分享
- 2024-01-19这才是你应该了解的Redis数据结构!
- 2024-01-18Redis系列:使用 Redis Module 扩展功能