scard

1. 基本語法

scard(key , callback)

回傳集合中的成員數量,key不存在則回傳0。

2. 範例

client.del('food');

const arr = ['apple', 'potato', 'apple', 'onion', 'potato', 'onion']
client.sadd('food', arr);
client.scard('food', redis.print);
Reply: 3

Last updated

Was this helpful?