You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
by: lex appears to be taking the input as-is and prepending a [ to start/end unless the value is one of the special values - or +.
I should be able to work around this behaviour by deliberately manipulating the strings I put in.
Additional info
Discord message: _I don't think that zRange by lex is working quite like the official Redis documentation says it should. Imagine a sorted set with members a, b, c, d and e.
const res = await context.redis.zRange("myKey", "[b", "[d", { by: "lex" }); should return ["b", "c", "d"] because the [ indicates an inclusive range, and const res = await context.redis.zRange("myKey", "(b", "(e", { by: "lex" }); should return just ["c"] because ( indicates exclusive. However in both cases I just get an empty array.
If I omit the ( or [, I get b, c and d however. This implies to me some processing is happening on the server rather than the inputs being taken as-is._
I made a few updates that allow devs to prepend the start/stop input with ( or [. If the input doesn't have ( or [ in front of it, then the server will prepend an inclusive bracket [ by default.
additionally, you can pass in - or + as input to indicate negative or positive infinity strings.
Developer docs have been updated to reflect the changes.
Details
Example gist: https://gist.github.com/fsvreddit/382476dcf4f1efe470dfb146a93a7e4d
by: lex appears to be taking the input as-is and prepending a [ to start/end unless the value is one of the special values - or +.
I should be able to work around this behaviour by deliberately manipulating the strings I put in.
Additional info
Discord message: _I don't think that zRange by lex is working quite like the official Redis documentation says it should. Imagine a sorted set with members a, b, c, d and e.
const res = await context.redis.zRange("myKey", "[b", "[d", { by: "lex" });
should return ["b", "c", "d"] because the [ indicates an inclusive range, andconst res = await context.redis.zRange("myKey", "(b", "(e", { by: "lex" });
should return just ["c"] because ( indicates exclusive. However in both cases I just get an empty array.If I omit the ( or [, I get b, c and d however. This implies to me some processing is happening on the server rather than the inputs being taken as-is._
Message author: big.wheel
Discord link: https://discord.com/channels/1050224141732687912/1242689538447507458/1287404638345367612
The text was updated successfully, but these errors were encountered: