redis操作之一
redis 127.0.0.1:6379> ping
PONG
redis 127.0.0.1:6379> SET name "linfy"
OK
redis 127.0.0.1:6379> GET name
"linfy"
redis 127.0.0.1:6379> HMSET user:1 username linfy password linfy points 200
OK
redis 127.0.0.1:6379> HGETALL user:1
1) "username"
2) "linfy"
3) "password"
4) "linfy"
5) "points"
6) "200"
redis 127.0.0.1:6379> lpush tutoriallist redis
(integer) 1
redis 127.0.0.1:6379> lpush tutoriallist mongodb
(integer) 2
redis 127.0.0.1:6379> lpush tutoriallist rabitmq
(integer) 3
redis 127.0.0.1:6379> lrange tutoriallist 0 10
1) "rabitmq"
2) "mongodb"
3) "redis"
redis 127.0.0.1:6379> sadd tutoriallist redis
(error) ERR Operation against a key holding the wrong kind of value
redis 127.0.0.1:6379> sadd tutoriallist mongodb
(error) ERR Operation against a key holding the wrong kind of value
redis 127.0.0.1:6379> sadd linfylist redis
(integer) 1
redis 127.0.0.1:6379> sadd linfylist mongodb
(integer) 1
redis 127.0.0.1:6379> sadd linfylist rabitmq
(integer) 1
redis 127.0.0.1:6379> sadd linfylist rabitmq
(integer) 0
redis 127.0.0.1:6379> smembers linfylist
1) "mongodb"
2) "rabitmq"
3) "redis"
redis 127.0.0.1:6379> zadd tianlist 0 redis
(integer) 1
redis 127.0.0.1:6379> zadd tianlist 0 mongodb
(integer) 1
redis 127.0.0.1:6379> zadd tianlist 0 memcached
(integer) 1
redis 127.0.0.1:6379> zadd tianlist 0 memcached
(integer) 0
redis 127.0.0.1:6379> zrangebyscore tianlist 0 1000
1) "memcached"
2) "mongodb"
3) "redis"
redis 127.0.0.1:6379> command key_name
(error) ERR unknown command 'command'
redis 127.0.0.1:6379> COMMAND KEY_NAME
(error) ERR unknown command 'COMMAND'
redis 127.0.0.1:6379> SET linfy redis
OK
redis 127.0.0.1:6379> DEL linfy
(integer) 1
redis 127.0.0.1:6379> SET dou redis
OK
redis 127.0.0.1:6379> get dou
"redis"
redis 127.0.0.1:6379> edis basic commands for caching" likes 20 visitors 23000
(error) ERR Operation against a key holding the wrong kind of value
redis 127.0.0.1:6379> HMSET doudou name "redis tutorial" description "redis bas
OK
redis 127.0.0.1:6379> HGETALL doudou
1) "name"
2) "redis tutorial"
3) "description"
4) "redis basic commands for caching"
5) "likes"
6) "20"
7) "visitors"
8) "23000"
redis 127.0.0.1:6379>quit
PONG
redis 127.0.0.1:6379> SET name "linfy"
OK
redis 127.0.0.1:6379> GET name
"linfy"
redis 127.0.0.1:6379> HMSET user:1 username linfy password linfy points 200
OK
redis 127.0.0.1:6379> HGETALL user:1
1) "username"
2) "linfy"
3) "password"
4) "linfy"
5) "points"
6) "200"
redis 127.0.0.1:6379> lpush tutoriallist redis
(integer) 1
redis 127.0.0.1:6379> lpush tutoriallist mongodb
(integer) 2
redis 127.0.0.1:6379> lpush tutoriallist rabitmq
(integer) 3
redis 127.0.0.1:6379> lrange tutoriallist 0 10
1) "rabitmq"
2) "mongodb"
3) "redis"
redis 127.0.0.1:6379> sadd tutoriallist redis
(error) ERR Operation against a key holding the wrong kind of value
redis 127.0.0.1:6379> sadd tutoriallist mongodb
(error) ERR Operation against a key holding the wrong kind of value
redis 127.0.0.1:6379> sadd linfylist redis
(integer) 1
redis 127.0.0.1:6379> sadd linfylist mongodb
(integer) 1
redis 127.0.0.1:6379> sadd linfylist rabitmq
(integer) 1
redis 127.0.0.1:6379> sadd linfylist rabitmq
(integer) 0
redis 127.0.0.1:6379> smembers linfylist
1) "mongodb"
2) "rabitmq"
3) "redis"
redis 127.0.0.1:6379> zadd tianlist 0 redis
(integer) 1
redis 127.0.0.1:6379> zadd tianlist 0 mongodb
(integer) 1
redis 127.0.0.1:6379> zadd tianlist 0 memcached
(integer) 1
redis 127.0.0.1:6379> zadd tianlist 0 memcached
(integer) 0
redis 127.0.0.1:6379> zrangebyscore tianlist 0 1000
1) "memcached"
2) "mongodb"
3) "redis"
redis 127.0.0.1:6379> command key_name
(error) ERR unknown command 'command'
redis 127.0.0.1:6379> COMMAND KEY_NAME
(error) ERR unknown command 'COMMAND'
redis 127.0.0.1:6379> SET linfy redis
OK
redis 127.0.0.1:6379> DEL linfy
(integer) 1
redis 127.0.0.1:6379> SET dou redis
OK
redis 127.0.0.1:6379> get dou
"redis"
redis 127.0.0.1:6379> edis basic commands for caching" likes 20 visitors 23000
(error) ERR Operation against a key holding the wrong kind of value
redis 127.0.0.1:6379> HMSET doudou name "redis tutorial" description "redis bas
OK
redis 127.0.0.1:6379> HGETALL doudou
1) "name"
2) "redis tutorial"
3) "description"
4) "redis basic commands for caching"
5) "likes"
6) "20"
7) "visitors"
8) "23000"
redis 127.0.0.1:6379>quit
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/543979/viewspace-1734665/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 【Redis】Redis 主從複製之一Redis
- Redis Functions 介紹之一RedisFunction
- 操作Redis之go-redisRedisGo
- Go操作RedisGoRedis
- Golang操作RedisGolangRedis
- Redis基本操作Redis
- jedis操作 redisRedis
- redis操作類Redis
- Go 操作 Redis 的基本操作GoRedis
- 【Redis】Redis的操作命令(一)——Redis Key命令Redis
- Python操作RedisPythonRedis
- Redis事務操作Redis
- python 操作redisPythonRedis
- Redis管理基本操作Redis
- redis 常用api操作RedisAPI
- Laravel Redis操作大全LaravelRedis
- redis+java操作RedisJava
- Redis基礎操作Redis
- Redis有序集合操作Redis
- Redis常用操作命令Redis
- show engine innodb status操作解析之一
- Elasticsearch聚合學習之一:基本操作Elasticsearch
- 【Redis】用python操作redis叢集RedisPython
- Redis工作系列之一 與 Memcached對比理解Redis
- Redis介紹 && Java客戶端操作RedisRedisJava客戶端
- python操作redis(二)PythonRedis
- Redis資料基本操作Redis
- Go操作Redis實戰GoRedis
- redis-3.基本操作Redis
- redis簡單的操作Redis
- redis基本操作概覽Redis
- 操作Redis之redigoRedisGo
- JUnit5學習之一:基本操作
- Jedis操作單節點redis,叢集及redisTemplate操作redis叢集(一)Redis
- Redis 運維實際經驗紀錄之一Redis運維
- php安裝redis擴充套件及操作redisPHPRedis套件
- Redis 相關運維操作Redis運維
- python操作Redis詳解PythonRedis