mirror of
https://github.com/KingDuckZ/incredis
synced 2024-12-27 21:35:42 +00:00
Add INCR command
This commit is contained in:
parent
ee0767e52c
commit
89da7b33fe
2 changed files with 6 additions and 0 deletions
|
@ -89,6 +89,7 @@ namespace redis {
|
|||
//String
|
||||
opt_string get ( boost::string_ref parKey );
|
||||
bool set ( boost::string_ref parKey, boost::string_ref parField );
|
||||
RedisInt incr ( boost::string_ref parKey );
|
||||
|
||||
private:
|
||||
static opt_string_list reply_to_string_list ( const Reply& parReply );
|
||||
|
|
|
@ -156,4 +156,9 @@ namespace redis {
|
|||
const auto ret = redis::get<StatusString>(batch.replies().front());
|
||||
return ret.is_ok();
|
||||
}
|
||||
|
||||
RedisInt IncRedis::incr (boost::string_ref parKey) {
|
||||
const auto ret = redis::get<RedisInt>(m_command.run("INCR", parKey));
|
||||
return ret;
|
||||
}
|
||||
} //namespace redis
|
||||
|
|
Loading…
Reference in a new issue