Skip to content

Commit

Permalink
added Command::keys()
Browse files Browse the repository at this point in the history
  • Loading branch information
obiltschnig committed Dec 8, 2022
1 parent 6628c17 commit 3e14d40
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Redis/include/Poco/Redis/Command.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,9 @@ class Redis_API Command: public Array
static Command incr(const std::string& key, Int64 by = 0);
/// Creates and returns an INCR or INCRBY command. Calls INCR when by is omitted or zero.

static Command keys(const std::string& pattern);
/// Creates and returns a KEYS command.

static Command lindex(const std::string& list, Int64 index = 0);
/// Creates and returns a LINDEX command.

Expand Down
10 changes: 10 additions & 0 deletions Redis/src/Command.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,16 @@ Command Command::hvals(const std::string& hash)
}


Command Command::keys(const std::string& pattern)
{
Command cmd("KEYS");

cmd << pattern;

return cmd;
}


Command Command::incr(const std::string& key, Int64 by)
{
Command cmd(by == 0 ? "INCR" : "INCRBY");
Expand Down

0 comments on commit 3e14d40

Please sign in to comment.