in common/dbconnector.h [252:342]
def _del(self, *args, **kwargs):
return self.delete(*args, **kwargs)
%}
#endif
bool exists(const std::string &key);
int64_t hdel(const std::string &key, const std::string &field);
int64_t hdel(const std::string &key, const std::vector<std::string> &fields);
void del(const std::vector<std::string>& keys);
template <typename ReturnType=std::unordered_map<std::string, std::string>>
ReturnType hgetall(const std::string &key);
#ifndef SWIG
template <typename OutputIterator>
void hgetall(const std::string &key, OutputIterator result);
#endif
std::vector<std::string> keys(const std::string &key);
std::pair<int, std::vector<std::string>> scan(int cursor = 0, const char *match = "", uint32_t count = 10);
bool set(const std::string &key, const std::string &value);
bool set(const std::string &key, int value);
void hset(const std::string &key, const std::string &field, const std::string &value);
template<typename InputIterator>
void hmset(const std::string &key, InputIterator start, InputIterator stop);
void hmset(const std::unordered_map<std::string, std::vector<std::pair<std::string, std::string>>>& multiHash);
std::shared_ptr<std::string> get(const std::string &key);
std::shared_ptr<std::string> hget(const std::string &key, const std::string &field);
bool hexists(const std::string &key, const std::string &field);
int64_t incr(const std::string &key);
int64_t decr(const std::string &key);
int64_t rpush(const std::string &list, const std::string &item);
std::shared_ptr<std::string> blpop(const std::string &list, int timeout);
void subscribe(const std::string &pattern);
void psubscribe(const std::string &pattern);
void punsubscribe(const std::string &pattern);
int64_t publish(const std::string &channel, const std::string &message);
void config_set(const std::string &key, const std::string &value);
bool flushdb();
std::map<std::string, std::map<std::string, std::map<std::string, std::string>>> getall();
private:
void setNamespace(const std::string &netns);
void setDBKey(const SonicDBKey &key);
int m_dbId;
std::string m_dbName;
SonicDBKey m_key;
};
template <typename ReturnType>
ReturnType DBConnector::hgetall(const std::string &key)
{
ReturnType map;
hgetall(key, std::inserter(map, map.end()));
return map;
}
#ifndef SWIG
template<typename OutputIterator>
void DBConnector::hgetall(const std::string &key, OutputIterator result)
{
RedisCommand shgetall;
shgetall.format("HGETALL %s", key.c_str());
RedisReply r(this, shgetall, REDIS_REPLY_ARRAY);
auto ctx = r.getContext();
for (unsigned int i = 0; i < ctx->elements; i += 2)
{