-
Notifications
You must be signed in to change notification settings - Fork 376
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Questions: update hasMany extra_fields? AS command? #197
Comments
I think that this line: node-orm2/lib/Associations/Many.js Line 292 in 5d04813
should be changed to data[association.mergeAssocId] = Association[association.mergeAssocId]; If your ids are not called "id", you have problems :-/. Could you verify and merge? |
You're probably right, I'm a little tired but I'm going to change it and check the unit tests. |
I think what you probably want is this: data[association.mergeAssocId] = Association[association.model.id]; |
About your questions:
Model.get(123, function (err, Instance) {
Instance.getAssoc(function (err, Assoc) {
Assoc.extra.whatever = newvalue;
Assoc.prop = Assoc.prop;
Assoc.save();
});
});
|
|
Doing those kind of changes would require maybe to use |
Is there any way to change only the value of a hasMany table (extra_fields) of a set of values? I think that delete and re-add the rows each time kills the performance.
Is there any way to change the name of the results with the ORM? (like the AS command in mysql)
Thankss!
The text was updated successfully, but these errors were encountered: