nearinfinity/node-persist — Issue #15: Add ability to pass save method an object of parameters to be updated
Author: kunklejr
Created: 2011-12-22 18:51:07+00:00
State: open

Currently, you have to manually change the properties of an object you want to update such as:

```javascript
Model.where({id: 1}).first(err, model) {
model.name = 'Jenny';
model.phone = '867-5309';
model.save(connection, function(err) {
if (!err) { // saved }
});
});
```

What I'd like to do in addition is:

```javascript
Model.where({id: 1}).first(err, model) {
model.save(connection, { name: 'Jenny', phone: '867-5309' }, function(err) {
if (!err) { // saved }
});
});
```

Or perhaps that should be a call to update, such as:

```javascript
Model.where({id: 1}).first(err, model) {
model.update(connection, { name: 'Jenny', phone: '867-5309' }, function(err) {
if (!err) { // saved }
});
});
```