namsu55
asked on
How can I find keys in Redis
Using Redis I store a KEY and VAlUE in this example structure :
KEY=2012-01:DAY:01 VALUE=BYTES_IN
What I am trying to do is find what keys belong in the DAY tree (01, 02, 03). These represent dates but suppose one day does not exist I don't want to increment the counter in a loop and assume it exists.
By the way in PHP I have tried to return the contents in an array without specifying the full key and it returns nothing. I thought Redis might allow for a partial key and return the remaining structure but this is not the case.
KEY=2012-01:DAY:01 VALUE=BYTES_IN
What I am trying to do is find what keys belong in the DAY tree (01, 02, 03). These represent dates but suppose one day does not exist I don't want to increment the counter in a loop and assume it exists.
By the way in PHP I have tried to return the contents in an array without specifying the full key and it returns nothing. I thought Redis might allow for a partial key and return the remaining structure but this is not the case.
$check = $redis->smembers("$currentUserVnoId:$exampleSelection");
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.