- 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
Redis - Hash Hincrby Command
Redis HINCRBY command is used to increment the number stored at the field in the hash, stored at the key by increment. If the key does not exist, a new key holding a hash is created. If the field does not exist, the value is set to 0 before the operation is performed.
Return Value
Integer reply, the value at the field after the increment operation.
Syntax
Following is the basic syntax of Redis HINCRBY command.
redis 127.0.0.1:6379> HINCRBY KEY_NAME FIELD_NAME INCR_BY_NUMBER
Example
redis 127.0.0.1:6379> HSET myhash field1 20 (integer) 1 redis 127.0.0.1:6379> HINCRBY myhash field 1 (integer) 21 redis 127.0.0.1:6379> HINCRBY myhash field -1 (integer) 20
redis_hashes.htm
Advertisements