redis icon indicating copy to clipboard operation
redis copied to clipboard

Bug: xrange failed to parse empty string

Open biluohc opened this issue 2 years ago • 0 comments

redis-cli

127.0.0.1:6379> xadd x  * '' 1
"1676359882053-0"
127.0.0.1:6379> xrange x - + 
1) 1) "1676359882053-0"
   2) 1) ""
      2) "1"

xrange got an empty fieldValues

// import { connect, parseURL } from "https://deno.land/x/[email protected]/mod.ts";

{ xid: { unixMs: 1676359882053, seqNo: 0 }, fieldValues: {} }
error: Uncaught (in promise) SyntaxError: "undefined" is not valid JSON
    const js = JSON.parse(x[i].fieldValues[""])

biluohc avatar Feb 14 '23 07:02 biluohc