mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-29 12:18:01 +01:00
Add hgetall / hincrby
This commit is contained in:
@@ -158,6 +158,24 @@ Command Command::hget(const std::string& hash, const std::string& field)
|
||||
return cmd;
|
||||
}
|
||||
|
||||
Command Command::hgetall(const std::string& hash)
|
||||
{
|
||||
Command cmd("HGETALL");
|
||||
|
||||
cmd << hash;
|
||||
|
||||
return cmd;
|
||||
}
|
||||
|
||||
Command Command::hincrby(const std::string& hash, const std::string& field, Int64 by)
|
||||
{
|
||||
Command cmd("HINCRBY");
|
||||
|
||||
cmd << hash << field << NumberFormatter::format(by);
|
||||
|
||||
return cmd;
|
||||
}
|
||||
|
||||
Command Command::hset(const std::string& hash, const std::string& field, const std::string& value, bool create)
|
||||
{
|
||||
Command cmd(create ? "HSET" : "HSETNX");
|
||||
@@ -167,6 +185,11 @@ Command Command::hset(const std::string& hash, const std::string& field, const s
|
||||
return cmd;
|
||||
}
|
||||
|
||||
Command Command::hset(const std::string& hash, const std::string& field, Int64 value, bool create)
|
||||
{
|
||||
return hset(hash, field, NumberFormatter::format(value), create);
|
||||
}
|
||||
|
||||
Command Command::incr(const std::string& key, Int64 by)
|
||||
{
|
||||
Command cmd(by == 0 ? "INCR" : "INCRBY");
|
||||
|
||||
Reference in New Issue
Block a user