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

Method execute

lib/index.js:4913–4929  ·  view source on GitHub ↗
(db, callback)

Source from the content-addressed store, hash-verified

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

Callers 1

LevelPouchFunction · 0.95

Calls 2

addMethod · 0.45
batchMethod · 0.45

Tested by

no test coverage detected