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

Function complete

lib/index.js:5668–5701  ·  view source on GitHub ↗
(err)

Source from the content-addressed store, hash-verified

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