1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-07 13:22:56 +03:00

a little bit docs

This commit is contained in:
Leibale
2023-11-09 21:01:26 -05:00
parent 37c39b71c9
commit 7247777a6f
8 changed files with 97 additions and 115 deletions

View File

@@ -4,7 +4,7 @@
[`SCAN`](https://redis.io/commands/scan) results can be looped over using [async iterators](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/asyncIterator):
```typescript
```javascript
for await (const keys of client.scanIterator()) {
const values = await client.mGet(keys);
}
@@ -12,7 +12,7 @@ for await (const keys of client.scanIterator()) {
This works with `HSCAN`, `SSCAN`, and `ZSCAN` too:
```typescript
```javascript
for await (const entries of client.hScanIterator('hash')) {}
for await (const members of client.sScanIterator('set')) {}
for await (const membersWithScores of client.zScanIterator('sorted-set')) {}
@@ -20,7 +20,7 @@ for await (const membersWithScores of client.zScanIterator('sorted-set')) {}
You can override the default options by providing a configuration object:
```typescript
```javascript
client.scanIterator({
cursor: '0', // optional, defaults to '0'
TYPE: 'string', // `SCAN` only