| 8 | } |
| 9 | |
| 10 | bool SSDBHashModel::GetData( const std::string& key, RedisResult& results ) |
| 11 | { |
| 12 | std::vector<std::string> hmkeys ; |
| 13 | if (GetClient()->hkeys(key, "", "", 200000, &hmkeys).error()) |
| 14 | { |
| 15 | return false; |
| 16 | } |
| 17 | results.NewColumn("Field "); |
| 18 | results.NewColumn("Value"); |
| 19 | std::string val; |
| 20 | for (std::size_t idx=0; idx<hmkeys.size(); ++idx) |
| 21 | { |
| 22 | if (GetClient()->hget(key, hmkeys[idx], &val).error()) |
| 23 | { |
| 24 | return false; |
| 25 | } |
| 26 | results.NewRow(); |
| 27 | std::string& field = results.Value(results.RowSize()-1, 0); |
| 28 | std::string& value = results.Value(results.RowSize()-1, 1); |
| 29 | field = hmkeys[idx]; |
| 30 | value = val; |
| 31 | } |
| 32 | return true; |
| 33 | } |
| 34 | |
| 35 | bool SSDBHashModel::UpdateData( const std::string& key, |
| 36 | const std::string& oldValue, |