Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add ability to specify count for scan match #1201

Closed
alekspickle opened this issue May 31, 2024 · 2 comments
Closed

add ability to specify count for scan match #1201

alekspickle opened this issue May 31, 2024 · 2 comments

Comments

@alekspickle
Copy link
Contributor

alekspickle commented May 31, 2024

Right now the only thing scan match accepts is a pattern, and while for simplicity it's great, it would be nice to be able to add count to force scan to return more results.


127.0.0.1:6379> set kek1 nope
OK
127.0.0.1:6379> set kek2 nope
OK
127.0.0.1:6379> set kek3 nope
OK
127.0.0.1:6379> set kek4 nope
OK
127.0.0.1:6379> scan 0 match kek*
1) "42"
2) 1) "kek3"
127.0.0.1:6379> scan 0 match kek* count 100
1) "0"
2) 1) "kek3"
   2) "kek4"
   3) "kek1"
   4) "kek2"
127.0.0.1:6379>

I can sketch a PR but would be glad to hear an opinion on what can it look like
I guess the most obvious path is to add new scan_match_n

@nihohit
Copy link
Contributor

nihohit commented Jun 10, 2024

Thanks for the initiative, a PR will be very much appreciated!

if we add a function for each option, we'll get 7 different functions - scan, scan_match, scan_match_count, scan_match_count_type, scan_match_type, scan_count_type, scan_type.
IMO it's better to just use scan_options, like set_options, and use an options struct that defines the requested behavior.

@nihohit
Copy link
Contributor

nihohit commented Jun 27, 2024

closed, since PR was merged.

@nihohit nihohit closed this as completed Jun 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants