allDocs returns ALL docs
pouch-react-native Version: 6.4.0
RN Version: 0.51.0
React Version: 16.0.0
Adaptor: asyncstorage
DB: Couchbase Sync Gateway v1.2.0
Description:
Despite providing the keys option as an array of document id strings, all docs are returned when calling allDocs. This seems to include _design docs and any replicated docs, but possibly not _local docs. The issue was introduced in 6.4.0 as it does not replicate on 6.3.4.
Replication:
The following will return all docs in the local database on version 6.4.0.
createLocalDatabase() {
// connect to the local database
this.local = new PouchDB('local_db', {
auto_compaction: true,
adapter: 'asyncstorage',
revs_limit: 3,
});
}
async bulkGet(docIds) {
let getResults;
const options = { include_docs: true, conflicts: true, keys: docIds };
try {
getResults = await this.local.allDocs(options);
} catch (ex) {
console.log(ex);
}
return getResults;
}
Expected Behavior:
As described in the PouchDB docs for allDocs, when using the keys option.
I am seeing the same bug too, also 6.4.0
There is another one identical issue but on Cordova https://github.com/pouchdb/pouchdb/issues/7007. The issue seems to be introduced in some of 6.4.0 pouchdb libs. 6.3.4 works fine for me.