MCPcopy
hub / github.com/apache/pouchdb / allDocsKeys

Function allDocsKeys

lib/index-browser.js:5411–5428  ·  view source on GitHub ↗
(keys, docStore, onBatch)

Source from the content-addressed store, hash-verified

5409}
5410
5411function allDocsKeys(keys, docStore, onBatch) {
5412 // It's not guaranteed to be returned in right order
5413 var valuesBatch = new Array(keys.length);
5414 var count = 0;
5415 keys.forEach(function (key, index) {
5416 docStore.get(key).onsuccess = function (event) {
5417 if (event.target.result) {
5418 valuesBatch[index] = event.target.result;
5419 } else {
5420 valuesBatch[index] = {key, error: 'not_found'};
5421 }
5422 count++;
5423 if (count === keys.length) {
5424 onBatch(keys, valuesBatch, {});
5425 }
5426 };
5427 });
5428}
5429
5430function createKeyRange(start, end, inclusiveEnd, key, descending) {
5431 try {

Callers 1

idbAllDocsFunction · 0.70

Calls 2

onBatchFunction · 0.70
getMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…