diff --git a/include/incredis/incredis.hpp b/include/incredis/incredis.hpp index 4318071..4f1a7a9 100644 --- a/include/incredis/incredis.hpp +++ b/include/incredis/incredis.hpp @@ -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 ); diff --git a/src/incredis.cpp b/src/incredis.cpp index 60b1bed..f69eb9a 100644 --- a/src/incredis.cpp +++ b/src/incredis.cpp @@ -156,4 +156,9 @@ namespace redis { const auto ret = redis::get(batch.replies().front()); return ret.is_ok(); } + + RedisInt IncRedis::incr (boost::string_ref parKey) { + const auto ret = redis::get(m_command.run("INCR", parKey)); + return ret; + } } //namespace redis