You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Mysql: what would be the code for updating an row:
I see one example;
people[0].save(function (err) {
// err.msg = "under-age";
});
DML: Driver.prototype.update
DML: Driver.prototype.remove
Instead of creating another method in every instance (which could conflict with properties names and we want to avoid it), I changed .save() to support the following different options.
item.save();// just save, no callback givenitem.save(cb);// save with callbackitem.save({name: "Jacque"});// update 'name', save, no callback givenitem.save({name: "Jacque"},cb);// update 'name', save with callback
Activity
dxg commentedon Apr 10, 2013
For changing many attributes at once I used:
_.extend(item, attributes);There is no publicly exposed
item.update(attrs, cb)method.Definitely on the todo list..
dresende commentedon Apr 10, 2013
It's an easy function to do. About the "delete single row" issue, you can just do:
Changes instance.save() to support an hash of changes before saving (#…
dresende commentedon Apr 10, 2013
Instead of creating another method in every instance (which could conflict with properties names and we want to avoid it), I changed
.save()to support the following different options.dxg commentedon Apr 10, 2013
Makes sense. Nice.