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

Function fetchAttachments

lib/index.es.js:4999–5017  ·  view source on GitHub ↗
(results, stores, opts)

Source from the content-addressed store, hash-verified

4997}
4998
4999function fetchAttachments(results, stores, opts) {
5000 var atts = [];
5001 results.forEach(function (row) {
5002 if (!(row.doc && row.doc._attachments)) {
5003 return;
5004 }
5005 var attNames = Object.keys(row.doc._attachments);
5006 attNames.forEach(function (attName) {
5007 var att = row.doc._attachments[attName];
5008 if (!('data' in att)) {
5009 atts.push(att);
5010 }
5011 });
5012 });
5013
5014 return Promise.all(atts.map(function (att) {
5015 return fetchAttachment(att, stores, opts);
5016 }));
5017}
5018
5019function LevelPouch(opts, callback) {
5020 opts = clone(opts);

Callers 4

LevelPouchFunction · 0.70
completeFunction · 0.70
onGetWinningDocFunction · 0.70
fetchAllAttachmentsFunction · 0.70

Calls 3

fetchAttachmentFunction · 0.70
fetchDataFunction · 0.70
poolFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…