Skip to content

Commit 0a4884e

Browse files
authored
Update set.js
1 parent 59d2e9c commit 0a4884e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

examples/set.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,18 @@ const SET_NAME = 'user1:favorites';
1010
// add an item to the set
1111
// set members can only be `string | Buffer` so make sure to convert values if needed,
1212
// https://redis.io/commands/sadd/
13-
await client.SADD(SET_NAME, '1');
13+
await client.sAdd(SET_NAME, '1');
1414

1515
// retrieve all the members of the set in one batch (be careful using it with "large" sets)
1616
// https://redis.io/commands/smembers/
17-
const favorites = await client.SMEMBERS(SET_NAME);
17+
const favorites = await client.sMembers(SET_NAME);
1818
for (const favorite of favorites) {
1919
console.log(favorite);
2020
}
2121

2222
// retrieve all the members of the set in batches using SSCAN (useful with large sets)
2323
// https://redis.io/commands/sscan/
24-
for await (const member of client.sScanIterator(setName)) {
24+
for await (const member of client.sScanIterator(SET_NAME)) {
2525
console.log(member);
2626
}
2727

0 commit comments

Comments
 (0)