garbados opened a new pull request #1898: [wip] feat: add mango-based VDU endpoints URL: https://github.com/apache/couchdb/pull/1898 <!-- Thank you for your contribution! Please file this form by replacing the Markdown comments with your text. If a section needs no action - remove it. Also remember, that CouchDB uses the Review-Then-Commit (RTC) model of code collaboration. Positive feedback is represented +1 from committers and negative is a -1. The -1 also means veto, and needs to be addressed to proceed. Once there are no objections, the PR can be merged by a CouchDB committer. See: http://couchdb.apache.org/bylaws.html#decisions for more info. --> ## Overview This work-in-progress PR tracks my efforts to implement features described in https://github.com/apache/couchdb/issues/1554 namely Mango-based update handlers under the `/{db}/_update` endpoint. As of this writing, I have scaffolded only a few functions and have written no tests. I'm mainly fumbling around, copying code from where it seems to make sense, in anticipation of further guidance. As described in the issue thread, this PR attempts to implement the following endpoints: - `GET /{db/_update`: Retrieve a database's update handlers, similar to `GET /{db}/_index`. - `POST /{db}/_update`: Submit a document for validation. If it passes validation, the update is accepted. Otherwise, it is rejected. - `PUT /{db}/_update`: Create a new update handler. - `DELETE /{db}/_update`: Delete an update handler. Although not yet in the code, I expect update handlers to have at least two attributes: a `guard` selector, which indicates which documents this handler applies to; and a `condition` selector, which validates the document. If a document passes the `guard` selector but not the `condition` selector, it is rejected. If a document submitted for validation matches no known guard selectors, it should be rejected too. <!-- Please give a short brief for the pull request, what problem it solves or how it makes things better. --> ## Testing recommendations As of this writing, there are no tests in this PR. <!-- Describe how we can test your changes. Does it provides any behaviour that the end users could notice? --> ## Related Issues or Pull Requests - https://github.com/apache/couchdb/issues/1554 <!-- If your changes affects multiple components in different repositories please put links to those issues or pull requests here. --> ## Checklist - [ ] Code is written and works correctly; - [ ] Changes are covered by tests; - [ ] Documentation reflects the changes;
---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services
