"Redis Object command "
1. OBJECT subcommand [arguments [arguments]]
The Object command allows you to view key a given Redis object from within.
It is usually used in debugging (debugging) or understanding in order to save space and to
keyThe use of special coding cases. When using Redis as a caching program, you can also use the information in the OBJECT command to determine
keyExpulsion strategy (eviction policies).
The OBJECT command has multiple subcommands:
OBJECT REFCOUNT <key>Returns the key number of times the value is stored for a given reference. This command is primarily used for debugging.
OBJECT ENCODING <key>Returns the key internal representation (representation) used for the value stored by the given lock.
OBJECT IDLETIME <key>Returns key the idle time (idle, not read, or written) for a given self-storage, in seconds.
2.KEYS pattern
Finds all that match the given pattern pattern key .
KEYS *Match all in the database
key。
KEYS h?lloThe
hello,
halloAnd
hxllosuch as
KEYS h*lloThe
hlloAnd
heeeeellosuch as
KEYS h[ae]lloThe
helloAnd
hallo, but does not match
hillo。
Special symbols \ separated by
KEYS is very fast, but using it in a large database can still cause performance problems, and if you need to find a specific one from a data set key , you'd better use the Redis collection structure (set) instead.
3,Randomkey
Returns a random (not deleted) one from the current database key .
4.TYPE Key
Returns the type of the key stored value.
return value:
none(key does not exist)
stringString
listList
setCollection
zset(ordered set)
hashHash table
Reference: http://redisdoc.com/
Redis Object command