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

Function createDocIdsToChangesAndEmits

lib/index.js:8742–8763  ·  view source on GitHub ↗
(results)

Source from the content-addressed store, hash-verified

8740 }
8741
8742 function createDocIdsToChangesAndEmits(results) {
8743 const docIdsToChangesAndEmits = new Map();
8744 for (const change of results) {
8745 if (change.doc._id[0] !== '_') {
8746 mapResults = [];
8747 doc = change.doc;
8748
8749 if (!doc._deleted) {
8750 tryMap(view.sourceDB, mapFun, doc);
8751 }
8752 mapResults.sort(sortByKeyThenValue);
8753
8754 const indexableKeysToKeyValues = createIndexableKeysToKeyValues(mapResults);
8755 docIdsToChangesAndEmits.set(change.doc._id, [
8756 indexableKeysToKeyValues,
8757 change.changes
8758 ]);
8759 }
8760 currentSeq = change.seq;
8761 }
8762 return docIdsToChangesAndEmits;
8763 }
8764
8765 function createIndexableKeysToKeyValues(mapResults) {
8766 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…