《Redis使用手册》(试读版)127.0.0.1:6379> PING PONG 但是, 如果⽤户给定了可选的消息, 那么服务器将原封不动地向客户端返回该消息: 127.0.0.1:6379> PING "hello world" "hello world" 另⼀⽅⾯, 如果服务器与客户端的连接不正常, 那么客户端将返回⼀个错误: -- 客户端未能连接服务器,返回⼀个连接错误 127.0.0.1:6379> PING 被关联的键和值既可以是普通的⽂字数据, 也可以是图⽚、视频、⾳频、压缩⽂件等更为复杂的⼆进制数 据。 作为例⼦, 图 2-1 展示了数据库视⻆下的四个字符串键, 其中: 与键 "message" 相关联的值是 "hello world" ; 与键 "number" 相关联的值是 "10086" ; 与键 "homepage" 相关联的值是 "redis.io" ; 与键 "redis-logo.jpg" 相关联的值是⼆进制数据 命令接受⼀个字符串键作为参数, 然后返回与该键相关联的值。 ⽐如对于图 2-4 所示的数据库来说, 我们可以通过执⾏以下 GET 命令来取得各个字符串键相关联的值: redis> GET message "hello world" redis> GET number "10086" redis> GET homepage "redis.io" 图 2-4 使⽤ GET 命令获取数据库键的值 另⼀⽅⾯,0 码力 | 352 页 | 6.57 MB | 1 年前3
陈宗志:大容量redis存储方案--Pikamessage_.ParseFromArray(rbuf_ + cur_pos_ - header_len_, header_len_); message_.set_name("hello " + message_.name()); uint32_t u =htonl( message_.ByteSize()); memcpy(static_cast(wbuf_) com/Qihoo360/nemo SACC2017 存储引擎--Nemo SACC2017 • HSET myhash field1 "Hello" – DB->Put(wop, h6myhashfield1,Hello01477671118) – DB->Put(wop, Hmyhash11477671118, 6) 存储引擎--Nemo SACC2017 存储引擎--Nemo 0 码力 | 47 页 | 2.18 MB | 1 年前3
阿里云云数据库 Redis 版 快速入门%s %s", "foo", "hello world"); printf("SET: %s\n", reply->str); freeReplyObject(reply); /* Set a key using binary safe API */ reply = redisCommand(c,"SET %b %b", "bar", (size_t) 3, "hello", (size_t) 5); 快速入门 22 SortedSet 开头代表5种数据结构。 string: hash list //set get string strKey = "hello"; string strValue = "world"; bool setResult = db.StringSet(strKey, strValue); Console.WriteLine("set0 码力 | 29 页 | 1.07 MB | 1 年前3
共 3 条
- 1













