Skip to content

How can I retrieve a list of subkeys, branch of master key #51

Answered by ra1u
ironmask2004 asked this question in Q&A
Discussion options

You must be logged in to vote

Oh. I see! Do you have trouble using scan?

Something like - without compiler

var iter = "0"

do{
    r = await _cache.send_object(['scan',iter, 'MATCH','userId:$userId:*');
    iter = r[0]; // update new iterator
    var keys = r[1]; 
    // delete keys for received range
    for (var i = 0; i < keys.length; i++) {
        await _cache.send_object(['EXPIRE', '${keys[i]}', '-1']);
    }
} while(iter != "0");

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@ironmask2004
Comment options

Comment options

You must be logged in to vote
1 reply
@ironmask2004
Comment options

Answer selected by ironmask2004
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants