rosedb icon indicating copy to clipboard operation
rosedb copied to clipboard

Proposal: get or delete keys by pattern

Open victor-gapeev opened this issue 1 year ago • 1 comments

In my standalone Golang application, I utilize RoseDB and distribute it to the client as an .exe. This application acts as a server that supports multiple sessions for a single account. The keys I use to store session refresh tokens are formatted as session_<user_id>_<device_id>. When a user is deleted from the server, I also need to remove all their sessions. This requires me to map through every existing key and see if it begins with session_<user_id>. I cannot save a refresh token in JSON with session_<user_id> keys because it would cause performance issues, as checking tokens happens with each request, unlike user deletion. Therefore, I really need something similar to the KEYS or SCAN methods in Redis.

victor-gapeev avatar Aug 20 '24 04:08 victor-gapeev

method Ascend or AscendKeys will be useful for you.

roseduan avatar Aug 20 '24 13:08 roseduan

I will close the issue if you don`t have any other questions.

roseduan avatar Oct 06 '24 01:10 roseduan