MCPcopy Create free account
hub / github.com/CloudBoost/cloudboost / _attachSchema

Function _attachSchema

services/cloudObjects.js:1207–1227  ·  view source on GitHub ↗
(docsArray, oldDocs)

Source from the content-addressed store, hash-verified

1205}
1206
1207function _attachSchema(docsArray, oldDocs) {
1208 try {
1209 for (let i = 0; i < oldDocs.length; i++) {
1210 for (let j = 0; j < docsArray.length; j++) {
1211 if (oldDocs[i]._id === docsArray[j].document._id) {
1212 const obj = {};
1213 obj.document = oldDocs[i];
1214 obj.schema = docsArray[j].schema;
1215 oldDocs[i] = obj;
1216 }
1217 }
1218 }
1219 return oldDocs;
1220 } catch (err) {
1221 winston.log('error', {
1222 error: String(err),
1223 stack: new Error().stack,
1224 });
1225 return null;
1226 }
1227}
1228
1229function _rollBack(appId, status, docsArray, oldDocs) {
1230 const deferred = q.defer();

Callers 1

_rollBackFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected