Created
January 23, 2014 02:36
-
-
Save nick-thompson/8571849 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// New version | |
async.parallel([ | |
stores[BY_SEQ_STORE].put.bind(null, formatSeq(doc.metadata.seq, doc.data), | |
stores[DOC_STORE].put.bind(null, doc.metadata.id, doc.metadata) | |
], function(err) { | |
results.push(doc); | |
return saveUpdateSeq(callback2); | |
}); | |
// Old version | |
stores[BY_SEQ_STORE].put(formatSeq(doc.metadata.seq), doc.data, function (err) { | |
stores[DOC_STORE].put(doc.metadata.id, doc.metadata, function (err) { | |
results.push(doc); | |
return saveUpdateSeq(callback2); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment