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

Function complete

lib/index.es.js:5663–5696  ·  view source on GitHub ↗
(err)

Source from the content-addressed store, hash-verified

5661 }
5662
5663 function complete(err) {
5664 /* istanbul ignore if */
5665 if (err) {
5666 return nextTick(function () {
5667 callback(err);
5668 });
5669 }
5670 txn.batch([
5671 {
5672 prefix: stores.metaStore,
5673 type: 'put',
5674 key: UPDATE_SEQ_KEY,
5675 value: newUpdateSeq
5676 },
5677 {
5678 prefix: stores.metaStore,
5679 type: 'put',
5680 key: DOC_COUNT_KEY,
5681 value: db._docCount + docCountDelta
5682 }
5683 ]);
5684 txn.execute(db, function (err) {
5685 /* istanbul ignore if */
5686 if (err) {
5687 return callback(err);
5688 }
5689 db._docCount += docCountDelta;
5690 db._updateSeq = newUpdateSeq;
5691 levelChanges.notify(name);
5692 nextTick(function () {
5693 callback(null, results);
5694 });
5695 });
5696 }
5697
5698 if (!docInfos.length) {
5699 return callback(null, []);

Callers 4

constructorMethod · 0.70
finishFunction · 0.70
LevelPouchFunction · 0.70
onChangesCompleteFunction · 0.70

Calls 7

fetchAttachmentsFunction · 0.70
getChangesFunction · 0.70
processPendingBatchFunction · 0.70
batchMethod · 0.45
executeMethod · 0.45
notifyMethod · 0.45
destroyMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…