On this page:
redis-hash-get
redis-hash-has-key?
redis-hash-incr!
redis-hash-keys
redis-hash-length
redis-hash-ref
redis-hash-remove!
redis-hash-scan
redis-hash-set!
redis-hash-string-length
redis-hash-values
in-redis-hash

8 Hash Commands🔗ℹ

procedure

(redis-hash-get client key)  hash?

  client : redis?
  key : redis-key/c
(redis-hash-get client key fld ...+)  hash?
  client : redis?
  key : redis-key/c
  fld : redis-string/c
The first form grabs the entire hash at key.

The second form grabs the given subflds from the hash at key.
Commands used by this function: HGETALL, HMGET

procedure

(redis-hash-has-key? client key fld)  boolean?

  client : redis?
  key : redis-key/c
  fld : redis-string/c
Returns #t when the hash at key has a key named fld.
Commands used by this function: HEXISTS

procedure

(redis-hash-incr! client key fld amt)  real?

  client : redis?
  key : redis-key/c
  fld : redis-string/c
  amt : real?
Increments the field fld belonging to the hash at key by amt and returns the result.
Commands used by this function: HINCRBY, HINCRBYFLOAT

procedure

(redis-hash-keys client key)  (listof bytes?)

  client : redis?
  key : redis-key/c
Returns all the keys belonging to the hash at key.
Commands used by this function: HKEYS

procedure

(redis-hash-length client key)  exact-nonnegative-integer?

  client : redis?
  key : redis-key/c
Returns the length of the hash at key.
Commands used by this function: HLEN

procedure

(redis-hash-ref client key fld)  redis-value/c

  client : redis?
  key : redis-key/c
  fld : redis-string/c
Grabs a single field value from the hash at key.
Commands used by this function: HGET

procedure

(redis-hash-remove! client key fld ...+)

  exact-nonnegative-integer?
  client : redis?
  key : redis-key/c
  fld : redis-string/c
Removes one or more flds from the hash at key and returns the total number of fields that were removed.
Commands used by this function: HDEL

procedure

(redis-hash-scan client 
  key 
  [#:cursor cursor 
  #:pattern pattern 
  #:limit limit]) 
  
exact-nonnegative-integer?
(listof redis-key/c)
  client : redis?
  key : redis-key/c
  cursor : exact-nonnegative-integer? = 0
  pattern : (or/c #f redis-string/c) = #f
  limit : (or/c #f exact-positive-integer?) = #f
Efficiently iterates through the set of keys in the hash at key.

The limit parameter serves as a hint for the implementation, but the server may return more items than limit per iteration.
Commands used by this function: HSCAN

procedure

(redis-hash-set! client key fld value)  boolean?

  client : redis?
  key : redis-key/c
  fld : redis-string/c
  value : redis-string/c
(redis-hash-set! client    
  key    
  fld    
  value ...+    
  ...+)  boolean?
  client : redis?
  key : redis-key/c
  fld : redis-string/c
  value : redis-string/c
(redis-hash-set! client key d)  boolean?
  client : redis?
  key : redis-key/c
  d : dict?
The first form sets fld to value within the hash at key.

The second form sets each pair of fld and values within the hash at key.

The third form stores d at key.
Commands used by this function: HSET, HMSET

procedure

(redis-hash-string-length client key fld)

  exact-nonnegative-integer?
  client : redis?
  key : redis-key/c
  fld : redis-string/c
Returns the length of the byte string value of fld belonging to the hash at key.
Commands used by this function: HSTRLEN

procedure

(redis-hash-values client key)  (listof bytes?)

  client : redis?
  key : redis-key/c
Returns all the values of the hash at key.
Commands used by this function: HVALS

procedure

(in-redis-hash client key)  (sequence/c (cons/c bytes? bytes?))

  client : redis?
  key : redis-key/c
Returns a sequence that can be used to efficiently iterate through the hash at key.

Any keyword arguments that are passed to this function will be forwarded to redis-hash-scan.