
- Redis Basics
- Redis - Home
- Redis - Overview
- Redis - Environment
- Redis - Configuration
- Redis - Data types
- Redis Commands
- Redis - Commands
- Redis - Keys
- Redis - Strings
- Redis - Hashes
- Redis - Lists
- Redis - Sets
- Redis - Sorted Sets
- Redis - HyperLogLog
- Redis - Publish Subscribe
- Redis - Transactions
- Redis - Scripting
- Redis - Connections
- Redis - Server
- Redis Advanced
- Redis - Backup
- Redis - Security
- Redis - Benchmarks
- Redis - Client Connection
- Redis - Pipelining
- Redis - Partitioning
- Redis - Java
- Redis - Php
- Redis Useful Resources
- Redis - Quick Guide
- Redis - Useful Resources
- Redis - Discussion
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Redis - Sorted Set Zinterstore Command
Redis ZINTERSTORE command computes the intersection of numkeys sorted sets given by the specified keys, and stores the result in the destination. It is mandatory to provide the number of input keys (numkeys) before passing the input keys and the other (optional) arguments.
Return Value
Integer reply, the number of elements in the resulting sorted set at the destination.
Syntax
Following is the basic syntax of Redis ZINTERSTORE command.
redis 127.0.0.1:6379> ZINTERSTORE KEY INCREMENT MEMBER
Example
redis 127.0.0.1:6379> ZADD myset 1 "hello" (integer) 1 redis 127.0.0.1:6379> ZADD myset 2 "world" (integer) 1 redis 127.0.0.1:6379> ZADD myset2 1 "hello" (integer) 1 redis 127.0.0.1:6379> ZADD myset2 2 "world" (integer) 1 redis 127.0.0.1:6379> ZADD myset2 3 "foo" (integer) 1 redis 127.0.0.1:6379> ZINTERSTORE out 2 myset1 myset2 WEIGHTS 2 3" (integer) 3 redis 127.0.0.1:6379> ZRANGE out 0 -1 WITHSCORES 1) "hello" 2) "5" 3) "world" 4) "10"
redis_sorted_sets.htm
Advertisements