(key, field, value)
| 157 | } |
| 158 | |
| 159 | async hset(key, field, value) { |
| 160 | const hash = this.hashes.get(key) || new Map(); |
| 161 | if (value === undefined) { |
| 162 | hash.delete(field); |
| 163 | if (hash.size === 0) { |
| 164 | this.hashes.delete(key); |
| 165 | } else { |
| 166 | this.hashes.set(key, hash); |
| 167 | } |
| 168 | return 1; |
| 169 | } |
| 170 | |
| 171 | hash.set(field, value); |
| 172 | this.hashes.set(key, hash); |
| 173 | return 1; |
| 174 | } |
| 175 | |
| 176 | async hdel(key, ...fields) { |
| 177 | const hash = this.hashes.get(key); |
no test coverage detected