-
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
update/delete single row #111
Comments
dm.models.person.get(1, function(err, item) {
item.name = 'Jacque';
item.save( ...
}); For changing many attributes at once I used: There is no publicly exposed Definitely on the todo list.. |
It's an easy function to do. About the "delete single row" issue, you can just do: item.remove(function (err) { // callback optional
if (!err) console.log("removed!");
}); |
Instead of creating another method in every instance (which could conflict with properties names and we want to avoid it), I changed item.save(); // just save, no callback given
item.save(cb); // save with callback
item.save({ name: "Jacque" }); // update 'name', save, no callback given
item.save({ name: "Jacque" }, cb); // update 'name', save with callback |
Makes sense. Nice. |
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
not sure wich way to go?
The text was updated successfully, but these errors were encountered: