
- 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 Zincrby Command
Redis ZINCRBY command increments the score of member in the sorted set stored at the key by increment. If the member does not exist in the sorted set, it is added with increment as its score (as if its previous score was 0.0). If the key does not exist, a new sorted set with the specified member as its sole member is created. An error is returned when the key exists but does not hold a sorted set.
Return Value
String reply, the new score of the member (a double precision floating point number), represented as string.
Syntax
Following is the basic syntax of Redis ZINCRBY command.
redis 127.0.0.1:6379> ZINCRBY KEY INCREMENT MEMBER
Example
redis 127.0.0.1:6379> ZADD myset 1 "hello" (integer) 1 redis 127.0.0.1:6379> ZADD myset 1 "foo" (integer) 1 redis 127.0.0.1:6379> ZINCRBY myzset 2 "hello" (integer) 3 redis 127.0.0.1:6379> ZRANGE myzset 0 -1 WITHSCORES 1) "foo" 2) "2" 3) "hello" 4) "3"
redis_sorted_sets.htm
Advertisements