On Apr 21, 2015, at 11:57 PM, Alex Lai <alex...@gmail.com> wrote:I try to use view parameter in _changes rest api. I have set view in database and I have used query to confirm that view works well, but when I use view parameter in _changes rest api, it does not work, it will return all changes, what I want is just return me document which is defined in view. Could some help me?
On Apr 21, 2015, at 11:57 PM, Alex Lai <alex...@gmail.com> wrote:I try to use view parameter in _changes rest api. I have set view in database and I have used query to confirm that view works well, but when I use view parameter in _changes rest api, it does not work, it will return all changes, what I want is just return me document which is defined in view. Could some help me?Sorry, that parameter isn’t implemented. :(
(Some of the REST API docs were adapted from CouchDB’s, since our API is based on its. There are a couple of spots where we missed deleting some features that CouchDB supports that we don’t.)
If you want to filter the changes, use the “filter” parameter and define a filter function.
—Jens
On Jul 20, 2015, at 11:43 AM, atom992 <yangzi...@gmail.com> wrote:Hi, I am using couchbaselite-phonegap-plugin 1.1 for android, and when I using REST api to get _changes with filter function and view function,it does't work. does this mean that parameter isn’t implemented.?
If I use filter=XXX in the _changes request, it return 404,but when I use filters=XXX It return all docs.
On Jul 20, 2015, at 11:43 AM, atom992 <yangzi...@gmail.com> wrote:Hi, I am using couchbaselite-phonegap-plugin 1.1 for android, and when I using REST api to get _changes with filter function and view function,it does't work. does this mean that parameter isn’t implemented.?Yes, that’s what I said above: the “view=” query parameter isn’t supported.
If I use filter=XXX in the _changes request, it return 404,but when I use filters=XXX It return all docs.“filters=XXX” will just be ignored because that’s not a known query parameter.In the REST API you put filter functions in design documents as JS code — specifying “filter=ddoc/foo” will look for a design document named “_design/ddoc”, find a dictionary property named “filters" in it, and look for a string property named “foo” in that.
{
"filters": {
"ff": "function (doc, req) {\\\\\\\n if(doc.type == \"TYPE1\"){\\\\\\\n return true;\\\\\\\n }\\\\\\\n return false;\\\\\\\n }"
},
"_rev": "1-36cfb89647b0162d1b8e4b504675ce46",
"_id": "_design/app"
}
—Jens
On Jul 20, 2015, at 11:03 PM, atom992 <yangzi...@gmail.com> wrote:Is there a roadmap to supported view query parameter?
On Jul 21, 2015, at 11:43 AM, Hideki Itakura <hideki....@gmail.com> wrote:I wonder to many back-slash (\\\\\\\n) might caused problem.