We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9a6d4a8 commit 0ad330bCopy full SHA for 0ad330b
src/cache/localcache.ts
@@ -80,8 +80,19 @@ export class LocalCache implements ICache {
80
}
81
82
83
- async hDelete() {
84
- console.log('hDelete not implemented');
85
- return 0;
+ async hDelete(key: string, field: string) {
+ try {
+ const data = LocalCache.localCache.get(this.buildKey(key)) as Object;
86
+
87
+ if (data && field in data) {
88
+ delete data[field];
89
+ LocalCache.localCache.set(key, data);
90
+ return 1;
91
+ }
92
93
+ return 0;
94
+ } catch (error) {
95
+ this.logger.error(error);
96
97
98
0 commit comments