I believe that in the newest release of Waterline, .save()
will re-populate any associations in its callback. But regardless, you can always hang on to them by saving them in a local variable. Assuming you meant find
and not create
above (since populate
doesn't do anything on create
):
ModelA.find({...}).populate('modelBs').exec(function(err, instanceA) {
// Do some nested things here, for example:
instanceA.prop1 = someNewValue;
var modelBs = instanceA.modelBs;
instanceA.save(function(err, instanceAModified) {
// modelBs will still be available here.
});
});