Http adapter adds double quotes to startkey and endkey

23 views
Skip to first unread message

Rodolfo Toledo

unread,
Jun 18, 2015, 7:38:23 AM6/18/15
to pou...@googlegroups.com
Hi:

First of all, thank you for developing poutchdb!

I'm using pouchdb to connect to a sync-gateway instance. When I perform an allDocs request, the sync-gateway+couchbase combination does not like the double quotes pouchdb puts around startkey and endkey:

10:56:18.012007 2015-06-18T10:56:18.011Z WARNING: all_docs got error: error executing view req at http://127.0.0.1:8092/default/_design/sync_housekeeping/_view/all_docs?endkey=%22%22biz_z%22%22&reduce=false&stale=false&startkey=%22%22biz%22%22: 400 Bad Request - {"error":"bad_request","reason":"invalid UTF-8 JSON: {{error,garbage_after_value},\"\\\"\\\"biz_z\\\"\\\"\"}"}

If I perform the http request directly without the quotes, it works.

I narrowed down the issue to the http adapter (lines 1458 & 1465), where a call to JSON.stringify  adds the extra quotes.

I don't know whether couchdb accepts/requires these quotes, but the sync-gateway fails at handling them.

Any help would be appreciated.
Regards,

Rodolfo.

Rodolfo Toledo

unread,
Jun 18, 2015, 7:56:37 AM6/18/15
to pou...@googlegroups.com
Hi:

It seems that the correct formatting is with double quotes, so the problem is the sync-gateway.

Thanks!
Reply all
Reply to author
Forward
0 new messages