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 filtering to KV method returning all keys #901

Closed
Jarema opened this issue Jun 20, 2024 · 0 comments
Closed

Add filtering to KV method returning all keys #901

Jarema opened this issue Jun 20, 2024 · 0 comments
Assignees

Comments

@Jarema
Copy link
Member

Jarema commented Jun 20, 2024

Here is the revised issue description:

Description

The current method that returns all keys in the bucket does not support filtering specific keys. Adding this functionality would be beneficial, especially when working with large buckets.

Details

Extract from ADR:

	// KeysWithFilters returns a filtered list of keys in the bucket.
	// Historically this method returned a complete slice of all keys in the bucket,
	// however clients should return interable result.
	// Languages can implement the list of filters in most idiomatic way - as an iterator, variadic argument, slice, etc.
	// When multiple filters are passed, client library should check `consumer info` from `consumer create method` if the filters are matching,
	// as nats-server < 2.10 would ignore them.
	KeysWithFilters(filter []string) ([]string, error)

The new method should align with the current library API in terms of signature and behavior for retrieving all keys.

Contribution

This is a good first issue for someone new to the project, as it should be based on the same underlying Ordered Consumer
that the method for receiving all keys is based on, plus the provided subject filters (and properly kv handled prefixes).

References

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