We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 3cb0559 + bea845d commit 67d0b87Copy full SHA for 67d0b87
lib/Drivers/DML/mongodb.js
@@ -316,7 +316,13 @@ Driver.prototype.hasMany = function (Model, association) {
316
pull[association.name] = [];
317
318
for (var i = 0; i < Associations.length; i++) {
319
- pull[association.name].push({ _id: Associations[i][association.model.id] });
+ var props = {_id: Associations[i][association.model.id]};
320
+
321
+ if (Associations[i].extra !== undefined) {
322
+ props = _.merge(props, _.pick(Associations[i].extra, _.keys(association.props)));
323
+ }
324
325
+ pull[association.name].push(props);
326
}
327
328
return db.update({
0 commit comments