MCPcopy Index your code
hub / github.com/dresende/node-orm2 / iterator

Function iterator

lib/Model.js:607–631  ·  view source on GitHub ↗
(params, index, cb)

Source from the content-addressed store, hash-verified

605 }
606
607 var iterator = function (params, index, cb) {
608 createInstance(params, {
609 is_new : true,
610 autoSave : opts.autoSave,
611 autoFetch : false
612 }, function (err, item) {
613 if (err) {
614 err.index = index;
615 err.instance = item;
616
617 return cb(err);
618 }
619 item.save({}, options, function (err) {
620 if (err) {
621 err.index = index;
622 err.instance = item;
623
624 return cb(err);
625 }
626
627 items[index] = item;
628 cb();
629 });
630 });
631 };
632
633 async.eachOfSeries(itemsParams, iterator, function (err) {
634 if (err) return done(err);

Callers

nothing calls this directly

Calls 3

createInstanceFunction · 0.85
cbFunction · 0.85
saveMethod · 0.65

Tested by

no test coverage detected