Skip to content
田传武 edited this page Jun 27, 2014 · 4 revisions
redis-cli -h localhost -p 6379

# Delete all the documents
localhost:6379> flushall

# Find all keys matching the given pattern
localhost:6379> keys realtime/store/*
1) "realtime/store/users/larry/_ops"
2) "realtime/store/users/larry/_v"

# Get the version of a document
localhost:6379> get realtime/store/users/larry/_v
"1"

# Get a latest range of operations from a document
localhost:6379> lrange realtime/store/users/larry/_ops -5 -1
1) "{\"uid\":\"fakeUserId\",\"sid\":\"fakeSessionId\",\"op\":[[7.0,\"gdeRJwk3k7DyrP1Kx\",2.0],[5.0,\"gdeRJwk3k7DyrP1Kx\",0.0,[1.0,\"Larry Tin\"]],[8.0,\"root\",\"name\",[2.0,\"gdeRJwk3k7DyrP1Kx\"]]],\"v\":0}"

# Get the time to live for a document
localhost:6379> ttl realtime/store/users/larry/_ops
(integer) 86165
Clone this wiki locally