Hi @atom932,

As @jens wrote in previous comment, it seems your codes are correct. 
CBL Android supports _changes with filter parameter. However, Android's 
 test case does cover _changes with filter parameter. So, our code could 
have a bug in _changes REST api with filter parameter.

As you received 404 error, some reason CBL Android codes can not find 
filter function. It could be filter function is not stored in db properly 
or javascript code is not compiled. 
I wonder to many back-slash (\\\\\\\n) might caused problem. 

I submitted issue ticket for writing unit test case for this scenario. 
https://github.com/couchbase/couchbase-lite-java-core/issues/684

Thanks,
Hideki

On Monday, July 20, 2015 at 11:03:40 PM UTC-7, atom992 wrote:
>
>
>
> On Tuesday, July 21, 2015 at 3:07:43 AM UTC+8, Jens Alfke wrote:
>>
>>
>> On Jul 20, 2015, at 11:43 AM, atom992 <[email protected]> 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.
>>
>>
> Is there a roadmap to supported view query parameter?
>  
>
>>
>> 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.
>>
>>
> yes I have a filter like this:
>
> {
>   "filters": {
>     "ff": "function (doc, req) {\\\\\\\n                       
>  if(doc.type == \"TYPE1\"){\\\\\\\n                            return 
> true;\\\\\\\n                        }\\\\\\\n                       
>  return false;\\\\\\\n                    }"
>   },
>   "_rev": "1-36cfb89647b0162d1b8e4b504675ce46",
>   "_id": "_design/app"
> }
>
>
> and when I get _changes with filter=app/ff , I got 404. My request is like 
> this:
>
> GET /cbldb/_changes?filter=app/ff HTTP/1.1
>
> and response is like this :
>
> {"status":404}
>
>
>
>
>
>  
>
>>
>> —Jens
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Couchbase Mobile" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mobile-couchbase/73c757fd-04cd-48e6-9a36-82f42c9280f5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to