Add rename

This commit is contained in:
fbraem
2015-11-14 20:12:33 +01:00
parent 4e5fe3f874
commit 36108e2378
4 changed files with 113 additions and 1 deletions

View File

@@ -262,6 +262,16 @@ Command Command::set(const std::string& key, Int64 value, bool overwrite, const
return set(key, NumberFormatter::format(value), overwrite, expireTime, create);
}
Command Command::rename(const std::string& key, const std::string& newName, bool overwrite)
{
Command cmd(overwrite ? "RENAME" : "RENAMENX");
cmd << key << newName;
return cmd;
}
Command Command::rpop(const std::string& list)
{
Command cmd("RPOP");