Skip to content

Commit

Permalink
adding get batch item info to docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan Fitzgerald committed Jan 27, 2012
1 parent 203ddb2 commit 8c46c24
Showing 1 changed file with 26 additions and 1 deletion.
27 changes: 26 additions & 1 deletion README.md
Expand Up @@ -244,6 +244,30 @@ The Scan operation returns one or more items and its attributes by performing a
dynode.query("ExampleTable", opts, console.log);
```

<a name="batchGetItem"></a>
## Batch Get Item
The BatchGetItem operation returns the attributes for multiple items from multiple tables using their primary keys. For more info see [here][batchGetDocs]

``` js
var query = {
"ExampleTable": {keys:[{hash: "someKey"}, {hash: "someKey2"}]},
"AnotherTable": {keys:[{hash: "anotherKey", range: 123}]}
}

dynode.batchGetItem(query, console.log);
```

`scan` accepts any option that Amazon accepts.

``` js
var filter = {
"ExampleTable": {keys:[{hash: "someKey"}], AttributesToGet :["name", "age"]},
"AnotherTable": {keys:[{hash: "anotherKey", range: 123}], AttributesToGet :["brand", "price"]}
}

dynode.query(filter, console.log);
```

## Tests
All tests are written with [mocha][0] and should be run with make:

Expand All @@ -265,4 +289,5 @@ All tests are written with [mocha][0] and should be run with make:
[getItemDocs]: http://docs.amazonwebservices.com/amazondynamodb/latest/developerguide/API_GetItem.html
[deleteItemDocs]: http://docs.amazonwebservices.com/amazondynamodb/latest/developerguide/API_DeleteItem.html
[queryDocs]: http://docs.amazonwebservices.com/amazondynamodb/latest/developerguide/API_Query.html
[scanDocs]: http://docs.amazonwebservices.com/amazondynamodb/latest/developerguide/API_Scan.html
[scanDocs]: http://docs.amazonwebservices.com/amazondynamodb/latest/developerguide/API_Scan.html
[batchGetDocs]: http://docs.amazonwebservices.com/amazondynamodb/latest/developerguide/API_BatchGetItems.html

0 comments on commit 8c46c24

Please sign in to comment.