T
T
Terion2012-05-30 12:43:19
NoSQL
Terion, 2012-05-30 12:43:19

Redis: using intermediate query results within a single transaction - how?

Hello.
A long search did not lead me to anything, so I'm asking here.
Task: to make a "complex" selection from Redis in one transaction (to save on connections and transport time).
Example:
There are entries containing hashes:
objects:1 = [], objects:2 = []
There are indexes to search for objects by their properties
index:objects:prop:value1 = 1, index:objects:prop:value2 = 2
( not SET/LIST, because you need to search with a wildcard (propname *), and this can only be done using the KEYS command. Numbers are stored without keyspace, because data can be stored in different keyspaces)
How, within one request (one transaction), first select the necessary record IDs from the index using KEYS, take the received multi bulk reply, substitute the required keyspace (objects:) for them and select the necessary objects with MGET?
If this cannot be done with a transaction, but you need to execute a LUA script, I would be very grateful for a hint on it.
Thanks

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question