Skip to content

COMMAND GETKEYS support #1738

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Nov 25, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions redis/commands/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -3919,6 +3919,9 @@ def command_info(self):
def command_count(self):
return self.execute_command('COMMAND COUNT')

def command_getkeys(self, *args):
return self.execute_command('COMMAND GETKEYS', *args)

def command(self):
return self.execute_command('COMMAND')

Expand Down
9 changes: 9 additions & 0 deletions tests/test_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -3671,6 +3671,15 @@ def test_command_count(self, r):
assert isinstance(res, int)
assert res >= 100

@skip_if_server_version_lt('2.8.13')
def test_command_getkeys(self, r):
res = r.command_getkeys('MSET', 'a', 'b', 'c', 'd', 'e', 'f')
assert res == [b'a', b'c', b'e']
res = r.command_getkeys('EVAL', '"not consulted"',
'3', 'key1', 'key2', 'key3',
'arg1', 'arg2', 'arg3', 'argN')
assert res == [b'key1', b'key2', b'key3']

@skip_if_server_version_lt('2.8.13')
def test_command(self, r):
res = r.command()
Expand Down