Skip to content

Instantly share code, notes, and snippets.

@yssk22
Created November 19, 2011 13:17
Show Gist options
  • Save yssk22/1378832 to your computer and use it in GitHub Desktop.
Save yssk22/1378832 to your computer and use it in GitHub Desktop.
node-mongodb-native について
// insertの結果を待たずに実行
col.insert({}, function(){}); // (a)
col.insert({}, function(){}); // (b)
// async.parallel を使って a, b は非同期で実行するが、 a, b, のりょうほうが終わったら c を呼ぶ
async.parallel({
"a": function(cb){
col.insert(..., cb);
},
"b": function(cb){
col.insert(..., cb);
},
}, function(){
// c
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment