File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -10,18 +10,18 @@ const SET_NAME = 'user1:favorites';
10
10
// add an item to the set
11
11
// set members can only be `string | Buffer` so make sure to convert values if needed,
12
12
// https://redis.io/commands/sadd/
13
- await client . SADD ( SET_NAME , '1' ) ;
13
+ await client . sAdd ( SET_NAME , '1' ) ;
14
14
15
15
// retrieve all the members of the set in one batch (be careful using it with "large" sets)
16
16
// https://redis.io/commands/smembers/
17
- const favorites = await client . SMEMBERS ( SET_NAME ) ;
17
+ const favorites = await client . sMembers ( SET_NAME ) ;
18
18
for ( const favorite of favorites ) {
19
19
console . log ( favorite ) ;
20
20
}
21
21
22
22
// retrieve all the members of the set in batches using SSCAN (useful with large sets)
23
23
// https://redis.io/commands/sscan/
24
- for await ( const member of client . sScanIterator ( setName ) ) {
24
+ for await ( const member of client . sScanIterator ( SET_NAME ) ) {
25
25
console . log ( member ) ;
26
26
}
27
27
You can’t perform that action at this time.
0 commit comments