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
标签:0.1,127.0,name,windows,age,练习,redis,6379,students 来源: https://www.cnblogs.com/eosclover/p/16408139.html