sMembers(key: string): string[]
Parameter | Type | Description |
key | string | Key name. |
Type | Description |
string[] | On success, all elements are returned. |
import redis from "pts/redis";let client = new redis.Client("redis://:<password>@<host>:6379/0");export default function main() {let sAddResp = client.sAdd("set", "hello", "world");console.log(redis sAdd $
{
sAddResp
}
); // 2let sMembersResp = client.sMembers("set");console.log(redis sMembers $
{
sMembersResp
}
); // hello,world}