Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LRANGE command #56

Open
lliendo opened this issue May 5, 2022 · 2 comments
Open

LRANGE command #56

lliendo opened this issue May 5, 2022 · 2 comments

Comments

@lliendo
Copy link

lliendo commented May 5, 2022

I'm trying to issue an LRANGE command (syntax is LRANGE "KEY" START STOP, where START and STOP are integer values).

These are the things that I have tried:

1 - Create the node. I set the "Topic/Key" input to the desired key (in this case "collectedImages"). Then I set the START and STOP arguments as: [0, 9] in the "Params" box. I get an error reporting: "ReplyError: ERR wrong number of arguments for 'lrange' command".

Screenshot from 2022-05-05 17-54-04

2 - Create the node. I set the "Topic/Key" input to the desired key (in this case "collectedImages"). Then I set the KEY, START and STOP arguments as: ["collectedImages", 0, 9] in the "Params" box. I get an error reporting: "ReplyError: ERR wrong number of arguments for 'lrange' command".

Screenshot from 2022-05-05 17-54-33

It is super confusing how to correctly pass arguments for each command. Wouldn't it be much better and easier to let the user to completely construct the command from a function or set a string with the full command to run?

Thanks for your help!

@innoagg
Copy link

innoagg commented Jul 12, 2022

What are you injecting into the redis cmd node? Check your payload.

@pauldeng
Copy link
Contributor

pauldeng commented Sep 1, 2022

I agree, it is confusing.

But there is workaround: do NOT use the Topic/Key and Params fields in the redis cmd node.

Try this, hope it will be helpful to you:

[{"id":"a920473f2fb295af","type":"redis-command","z":"2c71e369871e1bf1","server":"a0efbb89.5e42d8","command":"LRANGE","name":"","topic":"","params":"[]","paramsType":"json","payloadType":"json","block":false,"x":420,"y":1280,"wires":[["4c9bf2a5755c6dfe"]]},{"id":"57d9021027774fc6","type":"inject","z":"2c71e369871e1bf1","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"[\"lkey\",\"0\", \"9\"]","payloadType":"json","x":190,"y":1280,"wires":[["a920473f2fb295af"]]},{"id":"4c9bf2a5755c6dfe","type":"debug","z":"2c71e369871e1bf1","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":650,"y":1280,"wires":[]},{"id":"a0efbb89.5e42d8","type":"redis-config","name":"local","options":"{}","cluster":false,"optionsType":"json"}]

This is opensource software, you are welcome to fork to fix it and PR back.

Cheers mate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants