Observed behavior
When using the keys() method with filters on a KeyValue store containing a large number of keys (thousands or more), the method fetches all keys from the server and filters them client-side using substring matching. This creates significant performance problems and server load.
Expected behavior
The KeyValue keys() method should perform server-side filtering to minimize network traffic and server load, similar to how the Go client implements this functionality.
Server and client version
- NATS Server: 2.12.1
- nats-py: current main branch
- Python: 3.11+
Host environment
No response
Steps to reproduce
No response