Overall
SDKs
- Typescript
- @upstash/redis
- Overview
- Get Started
- Commands
- Overview
- Auth
- Bitmap
- Generic
- Hash
- Json
- List
- PubSub
- Scripts
- Server
- Set
- Sorted Set
- Stream
- String
- Transactions
- Deployment
- Pipeline
- Advanced
- Retries
- Troubleshooting
- Developing or Testing
- @upstash/query
- @upstash/vector
- @upstash/edge-flags
- @upstash/ratelimit
- @upstash/kafka
- @upstash/qstash
- Python
DevOps
- Terraform
- Pulumi
- CLI
Set
SUNION
Return the union between sets
await redis.sadd("set1", "a", "b", "c");
await redis.sadd("set2", "c", "d", "e");
const union = await redis.sunion("set1", "set2");
console.log(union); // ["a", "b", "c", "d", "e"]
Arguments
The keys of the sets to perform the union operation on.
Response
The members of the resulting set.
await redis.sadd("set1", "a", "b", "c");
await redis.sadd("set2", "c", "d", "e");
const union = await redis.sunion("set1", "set2");
console.log(union); // ["a", "b", "c", "d", "e"]
Was this page helpful?
await redis.sadd("set1", "a", "b", "c");
await redis.sadd("set2", "c", "d", "e");
const union = await redis.sunion("set1", "set2");
console.log(union); // ["a", "b", "c", "d", "e"]