Cloudant / CouchDB has supported using Query selectors as an alternative to JavaScript filter functions for over a year. Query selectors have a significant performance advantage over using JavaScript filters - they can be roughly an order of magnitude more efficient - and do not require users to inject a design document prior to reading changes.
The OpenWhisk package should strongly push users towards using Query selectors in favour of JS functions. Essentially the changes would be:
- use
filter=_selector instead of asking users to specify a design doc/filter
- make a
POST request to _changes instead of GET
- in the request body, include a
"selector" field containing the Query selector to match documents against.