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

Function doBulkGet

lib/index.js:6995–7022  ·  view source on GitHub ↗
(cb)

Source from the content-addressed store, hash-verified

6993 const self = this;
6994
6995 async function doBulkGet(cb) {
6996 const params = {};
6997 if (opts.revs) {
6998 params.revs = true;
6999 }
7000 if (opts.attachments) {
7001 /* istanbul ignore next */
7002 params.attachments = true;
7003 }
7004 if (opts.latest) {
7005 params.latest = true;
7006 }
7007 try {
7008 const result = await fetchJSON(genDBUrl(host, '_bulk_get' + paramsToStr(params)), {
7009 method: 'POST',
7010 body: JSON.stringify({ docs: opts.docs})
7011 });
7012
7013 if (opts.attachments && opts.binary) {
7014 result.data.results.forEach(function (res$$1) {
7015 res$$1.docs.forEach(readAttachmentsAsBlobOrBuffer);
7016 });
7017 }
7018 cb(null, result.data);
7019 } catch (error) {
7020 cb(error);
7021 }
7022 }
7023
7024 /* istanbul ignore next */
7025 function doBulkGetShim() {

Callers 1

HttpPouchFunction · 0.70

Calls 3

fetchJSONFunction · 0.70
genDBUrlFunction · 0.70
paramsToStrFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…