KEYS
Synopsis
KEYS pattern
Returns all keys matching pattern. An error is thrown if over 10,000 keys are in the db to protectagainst an out of memory state, although this limit can be changed.
Supported patterns:
- ?oo matches foo, boo, zoo, …
- *oo matches oo, foo, fllllloo, …
- [fb]oo matches foo and boo.
- [^f]oo matches boo, zoo, … but not foo.
- [f-g]oo matches foo and goo.
Use \ to escape special characters if you want to match them verbatim.
Return Value
String array with the list of matching keys, error if there are over 10,000 keys. There is noordering invariant on the returned keys.
Examples
$ ZADD z_key 1.0 v1
(integer) 1
$ SADD key val
(integer) 1
Get all keys in the db.
$ KEYS *
1) "key"
2) "z_key"
Get keys matching a specific pattern.
$ KEYS ?ey
1) "key"
当前内容版权归 YugabyteDB 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 YugabyteDB .