nim-lang / redis

Official redis wrapper for Nim.
Other
128 stars 35 forks source link

RedisList should allow any redis objects including Arrays #11

Open xmonader opened 6 years ago

xmonader commented 6 years ago

RedisList should be a sequence of any redis objects including Arrays the same behavior as in redis-cli

In redis package: the defined types assumes RedisList can just be a seq[RedisString]


  RedisString* = string
    ## Bulk reply
  RedisList* = seq[RedisString]
    ## Multi-bulk reply

redis-cli parses nested arrays just fine

~ > redis-cli -h playground.hub.grid.tf  -p 9910                           
playground.hub.grid.tf:9910> SCAN
1) "\x10\x00\x00\xf04\x00\x00\r+\x00\x00\xaf\x97\xab\xff"
2)   1) 1) "\xe5\t\"\x1b\xc7\x88=.\xa8\x0e\x1a\xf2\x96\x84\xcb\xd5"
        2) (integer) 896
        3) (integer) 1534759473
     2) 1) "r\xac,^\xdc\x1cH\xe3\x06\x80\xe2\xf3k\xae:h"
        2) (integer) 364216
        3) (integer) 1534759473
     3) 1) "\xa3\xba\\\x04\xadU~To\x92\x10\xbdO\xfb\x8f\xfa"
        2) (integer) 402684
        3) (integer) 1534759473
     4) 1) "\x03Z\xc3\xedmf\xf64\x83\xbbg\x84Z\x17^\x8e"
        2) (integer) 75420
        3) (integer) 1534759473
     5) 1) "\x9cA\xbf\xba\xfa\xa2\n\xc7vz\xb0\xf0\x97\x89sc"
        2) (integer) 344
        3) (integer) 1534759473
....
....