Net
Net

Reputation: 47

Can I use a redis set as an argument in MGET?

If I have a set containing a list of keys, can I then use that set as an argument in MGET to get all the keys named in the set? I'm more interested in a method that doesn't involve EVAL.

Upvotes: 1

Views: 251

Answers (1)

Itamar Haber
Itamar Haber

Reputation: 49962

No, MGET isn't an option here but SORT is.

Assuming a list called foo whose members are key names in the database, you can use the following to return the keys' values rather than the list's contents:

SORT foo BY nosort GET *

Upvotes: 2

Related Questions