mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-24 09:12:28 +02:00
Add hmset
This commit is contained in:
@@ -188,6 +188,19 @@ Command Command::hmget(const std::string& hash, const StringVec& fields)
|
||||
return cmd;
|
||||
}
|
||||
|
||||
Command Command::hmset(const std::string& hash, std::map<std::string, std::string>& fields)
|
||||
{
|
||||
Command cmd("HMSET");
|
||||
|
||||
cmd << hash;
|
||||
for(std::map<std::string, std::string>::const_iterator it = fields.begin(); it != fields.end(); ++it)
|
||||
{
|
||||
cmd << it->first << it->second;
|
||||
}
|
||||
|
||||
return cmd;
|
||||
}
|
||||
|
||||
Command Command::hset(const std::string& hash, const std::string& field, const std::string& value, bool create)
|
||||
{
|
||||
Command cmd(create ? "HSET" : "HSETNX");
|
||||
|
||||
Reference in New Issue
Block a user