[
https://issues.apache.org/jira/browse/COUCHDB-735?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12862245#action_12862245
]
Jarrod Roberson commented on COUCHDB-735:
-----------------------------------------
here is what I did
http://github.com/fuzzylollipop/couchdb/commit/71e5d2c60c5b3313cac5203922a477106ab8c7e1
my debug.js filter that just logged the contents of the request is working.
but anything that actually tries to return true/false just hangs with a
partially serialzied results
function(doc, req)
{
var ids = JSON.parse(req.body);
log(toJSON(ids));
var result = false;
for (var i = 0; i < ids.length; i++)
{
log(ids[i]);
if (ids[i] == doc._id) { result = true; break; }
}
return result;
}
curl -X POST http://localhost:5984/mydb/_changes?filter=transfer/by_ids -d '
["123","job_id:1234567890"]'
{"results":[
> Support HTTP POST for the change notification filter API
> --------------------------------------------------------
>
> Key: COUCHDB-735
> URL: https://issues.apache.org/jira/browse/COUCHDB-735
> Project: CouchDB
> Issue Type: Improvement
> Components: HTTP Interface
> Affects Versions: 0.11
> Reporter: Ning Tan
> Attachments: changes_filter_with_post.patch
>
>
> Currently the change notification filters only support HTTP GET. This limits
> their usefulness for cases where the filter criteria passed in exceed URL
> query length limitations. If the API supports HTTP POST, the filter function
> can then inspect the BODY of the request for filtering criteria.
> I started a discussion on the mailing list here:
> http://mail-archives.apache.org/mod_mbox/couchdb-user/201004.mbox/browser.
> Chris suggested that I modify the change API to support POST (in the Erlang
> code) myself as an experiment. I was able to verify that the filter function
> was able to see the BODY of the request. However, the changes feed (with the
> filtering function) hangs whenever there is a BODY in the request (for both
> GET and POST verbs).
> I'm attaching a patch that contains the change Chris proposed as well as the
> updated Futon JavaScript test file for the changes API. The test currently
> times out (and fails). It should work once the feature is implemented.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.