Skip to content

Commit 57a9d46

Browse files
committed
add hscanNoValuesIterator
1 parent acd18f2 commit 57a9d46

File tree

4 files changed

+16
-77
lines changed

4 files changed

+16
-77
lines changed

packages/client/lib/client/index.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -901,6 +901,19 @@ export default class RedisClient<
901901
} while (cursor !== '0');
902902
}
903903

904+
async* hScanValuesIterator(
905+
this: RedisClientType<M, F, S, RESP, TYPE_MAPPING>,
906+
key: RedisArgument,
907+
options?: ScanCommonOptions & ScanIteratorOptions
908+
) {
909+
let cursor = options?.cursor ?? '0';
910+
do {
911+
const reply = await this.hScanNoValues(key, cursor, options);
912+
cursor = reply.cursor;
913+
yield reply.fields;
914+
} while (cursor !== '0');
915+
}
916+
904917
async* sScanIterator(
905918
this: RedisClientType<M, F, S, RESP, TYPE_MAPPING>,
906919
key: RedisArgument,

packages/client/lib/commands/HSCAN_VALUES.spec.ts

Lines changed: 0 additions & 56 deletions
This file was deleted.

packages/client/lib/commands/HSCAN_VALUES.ts

Lines changed: 0 additions & 18 deletions
This file was deleted.

packages/client/lib/commands/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ import HRANDFIELD_COUNT_WITHVALUES from './HRANDFIELD_COUNT_WITHVALUES';
144144
import HRANDFIELD_COUNT from './HRANDFIELD_COUNT';
145145
import HRANDFIELD from './HRANDFIELD';
146146
import HSCAN from './HSCAN';
147-
import HSCAN_VALUES from './HSCAN_VALUES';
147+
import HSCAN_NOVALUES from './HSCAN_NOVALUES';
148148
import HSET from './HSET';
149149
import HSETNX from './HSETNX';
150150
import HSTRLEN from './HSTRLEN';
@@ -624,8 +624,8 @@ export default {
624624
hRandField: HRANDFIELD,
625625
HSCAN,
626626
hScan: HSCAN,
627-
HSCAN_VALUES,
628-
hScanValues: HSCAN_VALUES,
627+
HSCAN_NOVALUES,
628+
hScanNoValues: HSCAN_NOVALUES,
629629
HSET,
630630
hSet: HSET,
631631
HSETNX,

0 commit comments

Comments
 (0)