简体   繁体   中英

Use the output “SMEMBERS” command as input to “MGET” in redis?

I am using redis-py (python redis library) in my code and would like to use the strings output by an SMEMBERS command directly in an MGET command. I would like to do this without pulling all of the members into my python program, and then sending the MGET command using that data. I'm not sure if redis (the actual database application itself) has any provisions for using output as input to another within itself, but I also a novice with it.

Is this something redis is capable of, a sort of internal piping?

Is this something redis is capable of, a sort of internal piping?

Capable - yes, but not in a scalable manner. You can do that in a server-side Lua script but that would go against best practices and would yield unknown results in a clustered deployment.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM