1
0
Fork 0
mirror of https://github.com/KingDuckZ/incredis synced 2024-11-27 00:43:50 +00:00

Add INCR command

This commit is contained in:
King_DuckZ 2017-04-06 21:48:15 +01:00
parent ee0767e52c
commit 89da7b33fe
2 changed files with 6 additions and 0 deletions

View file

@ -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 );

View file

@ -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