Returns all the keys matching the glob-style pattern. For example if
you have in the database the keys "foo" and "foobar" the command "KEYS foo*" will return
"foo foobar".<br>
<strong>Warning:</strong> consider this as a command that should be used in production environments with <strong>extreme care</strong>.
It may ruin performance when it is executed against large databases.
This command is intended for debugging and special operations, such as changing your keyspace layout.
<strong>Don't use it in your regular application code.</strong>
If you're looking for a way to find keys in a subset of your keyspace, consider using {@link #scan(string, ScanParams)} or sets.
<p>
While the time complexity for this operation is O(N), the constant times are fairly low.
For example, Redis running on an entry level laptop can scan a 1 million key database in 40 milliseconds.
<p>
Glob style patterns examples:
<ul>
<li>h?llo will match hello hallo hhllo
<li>h*llo will match hllo heeeello
<li>haello will match hello and hallo, but not hillo
</ul>
<p>
Use \ to escape special chars if you want to match them verbatim.
<p>
Time complexity: O(n) (with n being the number of keys in the DB, and assuming keys and pattern
of limited length)
@param pattern
@return Multi bulk reply
@see <a href="https://redis.io/commands/keys">Redis KEYS documentation</a>
Returns all the keys matching the glob-style pattern. For example if you have in the database the keys "foo" and "foobar" the command "KEYS foo*" will return "foo foobar".<br> <strong>Warning:</strong> consider this as a command that should be used in production environments with <strong>extreme care</strong>. It may ruin performance when it is executed against large databases. This command is intended for debugging and special operations, such as changing your keyspace layout. <strong>Don't use it in your regular application code.</strong> If you're looking for a way to find keys in a subset of your keyspace, consider using {@link #scan(string, ScanParams)} or sets. <p> While the time complexity for this operation is O(N), the constant times are fairly low. For example, Redis running on an entry level laptop can scan a 1 million key database in 40 milliseconds. <p> Glob style patterns examples: <ul> <li>h?llo will match hello hallo hhllo <li>h*llo will match hllo heeeello <li>haello will match hello and hallo, but not hillo </ul> <p> Use \ to escape special chars if you want to match them verbatim. <p> Time complexity: O(n) (with n being the number of keys in the DB, and assuming keys and pattern of limited length) @param pattern @return Multi bulk reply @see <a href="https://redis.io/commands/keys">Redis KEYS documentation</a>