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

Method execute

lib/index.es.js:4908–4924  ·  view source on GitHub ↗
(db, callback)

Source from the content-addressed store, hash-verified

4906 }
4907
4908 execute(db, callback) {
4909 var keys = new Set();
4910 var uniqBatches = [];
4911
4912 // remove duplicates; last one wins
4913 for (var i = this._batch.length - 1; i >= 0; i--) {
4914 var operation = this._batch[i];
4915 var lookupKey = operation.prefix.prefix()[0] + '\xff' + operation.key;
4916 if (keys.has(lookupKey)) {
4917 continue;
4918 }
4919 keys.add(lookupKey);
4920 uniqBatches.push(operation);
4921 }
4922
4923 db.batch(uniqBatches, callback);
4924 }
4925}
4926
4927var DOC_STORE = 'document-store';

Callers 1

LevelPouchFunction · 0.95

Calls 2

addMethod · 0.45
batchMethod · 0.45

Tested by

no test coverage detected