You probably doesn't need to wait until modelA is created to create modelB and so on.
If this is true, then you can do the following:
var promises = [
ModelA.create(...),
ModelB.create(...),
ModelC.create(...)
);
Q.all( promises ).spread(function( modelA, modelB, modelC ) {
// Do things with them!
}).fail(function() {
// Oh noes :(
});
What this does is:
- Create an array of promises, with one promise for each model you need;
- Execute all 3 promises in parallel;
- Execute a function passed in
spread() when all 3 promises are done. The arguments are the resolved values for each promise, in the declaration order.
I hope it helps you :)