apache / apache/openwhisk-package-cloudant
Package should prefer _selector filters over JavaScript filter functions
- Dominant language
- Scala
- Stars
- 17
- Forks
- 31
- PR merge metrics
- No merged PRs in 30d
Description
Cloudant / CouchDB has supported using Query selectors as an [alternative to JavaScript filter functions](http://docs.couchdb.org/en/2.0.0/api/database/changes.html#selector) 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.
Contributor guide
Research direction
The issue names the `_changes` entry point and the `filter=_selector` request option; locate the package action that currently reads changes and inspect its filter and HTTP-method handling. Verify completion by sending a POST request with a selector in the request body and confirming that a design document and JavaScript filter are no longer required.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- databases
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100