spolu/node-dynamodb — pull request #16 by garo (2012-02-01 13:44:47+00:00)
Title: Implemented updateItem method

I've implemented the missing UpdateItem method into the api.

There's just one inconsistency with the rest of the api: Most other calls accept data as object with {key : value} -pairs as the data and convert that into {key : {"S" : "value"}} structure with the toDDB() method. Because the UpdateItem also accepts the Action attribute, the toDDB() method can't be used. Instead I've just resulted to accept directly an Amazon DynamoDB AttributeUpdates structure. If you have an idea how to done it instead of this, please respond. Instead you can just pull and merge this.

Here's an example:

```JavaScript
var updates = {
counter : {Value : {"N" : "1"}, Action : "ADD"},
foo : {Value : {"S" : "Bar"}}
};

ddb.updateItem('tablename', '3d2d69633ffa5368c7971cf15c91d2eb', null, updates, {}, function(err) {
console.dir(err);
});
```