Skip to content

Instantly share code, notes, and snippets.

@baudehlo
Created October 17, 2014 15:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save baudehlo/0ecc526a7dc528b77581 to your computer and use it in GitHub Desktop.
Save baudehlo/0ecc526a7dc528b77581 to your computer and use it in GitHub Desktop.
async.parallel([
function (cb) {
async.each(vrcholy, function (vrcholy_entry, cb) {
db.collection('vrcholy').insert(vrcholy_entry, {w:1}, cb);
}, cb);
},
function (cb) {
async.each(cesty, function (cesty_entry, cb) {
db.collection('cesty').insert(cesty_entry, {w:1}, cb);
}, cb);
},
function (cb) {
async.each(relacie, function (relacie_entry, cb) {
db.collection('relacie').insert(relacie_entry, {w:1}, cb);
}, cb);
},
], function (err) {
if (err) {
console.error("Error happened: ", err);
}
db.close();
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment