Paste ZRANGEBYSCORE result into set

I am trying to figure out how I can take the result of the ZRANGEBYSCORE command in a sorted set and save the result as a new set in redis, I do not want the data returned to the client. I know that I could read the result in the client, and then click the result as a new set, but I do not want the data to be transferred between the client and server.

Basically I have a sorted set of "A" and a regular set of "B". I want to filter the values ​​in a sorted set by running ZRANGEBYSCORE on β€œA” and then cross the result with β€œB”. Hope this makes sense. I wonder how I can do this

+6
source share
1 answer

Unfortunately, you cannot do this. You can try using an unstable version that allows you to use Lua scripts (which are pretty stable at the time), and you can do this with a simple Lua script.

+2
source

Source: https://habr.com/ru/post/902714/


All Articles