MCPcopy Index your code
hub / github.com/apache/pouchdb / fetchExistingDocs

Function fetchExistingDocs

lib/index.es.js:5387–5413  ·  view source on GitHub ↗
(finish)

Source from the content-addressed store, hash-verified

5385 }
5386
5387 function fetchExistingDocs(finish) {
5388 var numDone = 0;
5389 var overallErr;
5390 function checkDone() {
5391 if (++numDone === userDocs.length) {
5392 return finish(overallErr);
5393 }
5394 }
5395
5396 userDocs.forEach(function (doc) {
5397 if (doc._id && isLocalId(doc._id)) {
5398 // skip local docs
5399 return checkDone();
5400 }
5401 txn.get(stores.docStore, doc._id, function (err, info) {
5402 if (err) {
5403 /* istanbul ignore if */
5404 if (err.name !== 'NotFoundError') {
5405 overallErr = err;
5406 }
5407 } else {
5408 fetchedDocs.set(doc._id, info);
5409 }
5410 checkDone();
5411 });
5412 });
5413 }
5414
5415 function compact(revsMap, callback) {
5416 var promise = Promise.resolve();

Callers 1

LevelPouchFunction · 0.70

Calls 3

isLocalIdFunction · 0.70
checkDoneFunction · 0.70
getMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…