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

Function createDocIdsToChangesAndEmits

lib/index-browser.js:8704–8725  ·  view source on GitHub ↗
(results)

Source from the content-addressed store, hash-verified

8702 }
8703
8704 function createDocIdsToChangesAndEmits(results) {
8705 const docIdsToChangesAndEmits = new Map();
8706 for (const change of results) {
8707 if (change.doc._id[0] !== '_') {
8708 mapResults = [];
8709 doc = change.doc;
8710
8711 if (!doc._deleted) {
8712 tryMap(view.sourceDB, mapFun, doc);
8713 }
8714 mapResults.sort(sortByKeyThenValue);
8715
8716 const indexableKeysToKeyValues = createIndexableKeysToKeyValues(mapResults);
8717 docIdsToChangesAndEmits.set(change.doc._id, [
8718 indexableKeysToKeyValues,
8719 change.changes
8720 ]);
8721 }
8722 currentSeq = change.seq;
8723 }
8724 return docIdsToChangesAndEmits;
8725 }
8726
8727 function createIndexableKeysToKeyValues(mapResults) {
8728 const indexableKeysToKeyValues = new Map();

Callers 1

processBatchFunction · 0.70

Calls 2

tryMapFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…