How do I pass options to a command when using the Redis function?

I want to use the SET command with the GET and EX option, but I’m not sure how to pass in options. https://redis.io/commands/set/
For example, I want to see if a message has already been seen, and then set a timeout after which the values will clean themselves up.

Figured it out with some help from @bdalpe. From the docs:

Args: A JavaScript expression to compute arguments to the operation. Can return an array. Click the icon at right to open a validation modal.

This would be why you want to use an array.

So if we’re using _raw as key (probably not good to do in real life; use a hash), and getting the value to “value” with TTL of 5 seconds, you’d do something like this.
Effectively, this results in the command: SET _raw value GET EX 5

image