Get documents by a single key in android couchbase lite

I am trying to get documents based on a single key which can be done in couchdb e.g. /blog/_design/docs/_view/by_date?key="2009/01/30 18:04:11" http://guide.couchdb.org/draft/views.html#one .

The iOS version seems to be able to do it using "keys" (If non-nil, the query will fetch only the rows with the given keys." http://couchbase.github.io/couchbase-lite-ios/docs/html/interfaceCBLQuer...) but the android version
seems to operate differently ("An optional array of document IDs. If given, only keys emitted by the documents with these IDs will be returned" - http://developer.couchbase.com/mobile/develop/guides/couchbase-lite/nati...)

The net being I've not been able to successfully query specific documents based on keys

3 Answers

« Back to question.

It was my error. I was trying to get a key "1" when the key was true. Though the difference in wording is a bit confusing, the android version makes it seem like you're specifying document ids

« Back to question.

The iOS and Android docs are describing the same feature, just using different words.

What exactly is the problem you're running into?

« Back to question.

I filed a ticket to see if we have existing test coverage for this here:

https://github.com/couchbaselabs/cblite-tests/issues/17

Can you update the issue and add exact steps to reproduce your problem?

Including:

* Design doc you are using
* Curl request(s) that reproduce the issue.

we have such tests in our functional tests:
https://github.com/couchbaselabs/cblite-tests/blob/master/tests/cbl-view...

they have the same result for both Android and ios:

{ offset: 0,
total_rows: 1,
rows: [ { id: 'cbl_views_5', value: 'bar', key: 'cbl_views_5' } ] }
{ offset: 0,
total_rows: 3,
rows:
[ { id: 'cbl_views_3', value: 'bar', key: 'cbl_views_3' },
{ id: 'cbl_views_4', value: 'bar', key: 'cbl_views_4' },
{ id: 'cbl_views_5', value: 'bar', key: 'cbl_views_5' } ] }