Closed badfd closed 4 years ago
Saving a script that looks like it does the same thing as yours:
$ redis-cli script load "local keys = redis.call('KEYS',ARGV[1]..'*'); local values = redis.call('MGET', unpack(redis.call('KEYS',ARGV[1]..'*'))); local results = {}; for i,key in ipairs(keys) do results[i] = {keys[i],values[i]} end; return results"
"0d76aafa1f7ffcc886e0e205cc22c1fb8fe86315"
$ redis-cli set foo1 bar1
OK
$ redis-cli set foo2 bar2
OK
$ redis-cli evalsha 0d76aafa1f7ffcc886e0e205cc22c1fb8fe86315 0 foo
1) 1) "foo1"
2) "bar1"
2) 1) "foo2"
2) "bar2"
And querying with Webdis:
$ curl -s 'http://localhost:7379/evalsha/0d76aafa1f7ffcc886e0e205cc22c1fb8fe86315/0/foo' | jq
{
"evalsha": [
[
"foo1",
"bar1"
],
[
"foo2",
"bar2"
]
]
}
Webdis version: 0.1.3-dev
The following redis-cli commands are successful:
Or, within an interactive session:
however, when I attempt the EVALSHA command via Webdis, no in/sane URI seems to work:
Oddly enough, if I specify RAW output, I get a correct count of the number of matching key-value pairs:
Is it the output of my Lua script that's at fault? Can I change the script's output format to make it work?