Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,8 @@ Account.update({email: '[email protected]', name: 'Bar Tester'}, function (err, ac

`Model.update` accepts options to pass to DynamoDB when making the updateItem request

See [AWS SDK - update][7] for list of valid params for options

```js
Account.update({email: '[email protected]', name: 'Bar Tester'}, {ReturnValues: 'ALL_OLD'}, function (err, acc) {
console.log('update account', acc.get('name')); // prints the old account name
Expand Down Expand Up @@ -427,8 +429,10 @@ BlogPost.destroy({email: '[email protected]', title: 'Another Post'}, function (er

`Model.destroy` accepts options to pass to DynamoDB when making the deleteItem request

See [AWS SDK - delete][9] for list of valid params for options

```js
Account.destroy('[email protected]', {ReturnValues: true}, function (err, acc) {
Account.destroy('[email protected]', {ReturnValues: ALL_OLD}, function (err, acc) {
console.log('account deleted');
console.log('deleted account name', acc.get('name'));
});
Expand Down Expand Up @@ -469,6 +473,8 @@ Account.get('[email protected]', {ConsistentRead: true}, function (err, acc) {
`Model.get` accepts any options that DynamoDB getItem request supports. For
example:

See [AWS SDK - get][6] for list of valid params for options

```js
Account.get('[email protected]', {ConsistentRead: true, AttributesToGet : ['name','age']}, function (err, acc) {
console.log('got account', acc.get('email'))
Expand Down Expand Up @@ -960,6 +966,8 @@ BlogPost.getItems([postKey1, postKey2], function (err, posts) {

`Model.getItems` accepts options which will be passed to DynamoDB when making the batchGetItem request

See [AWS SDK - batchGet][8] for list of valid params for options

```js
// Get both accounts, using a consistent read
Account.getItems(['[email protected]','[email protected]'], {ConsistentRead: true}, function (err, accounts) {
Expand Down Expand Up @@ -1107,3 +1115,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
[3]: http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LSI.html
[4]: http://aws.typepad.com/aws/2013/05/amazon-dynamodb-parallel-scans-and-other-good-news.html
[5]: http://aws.amazon.com/dynamodb
[6]: https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/DynamoDB/DocumentClient.html#get-property
[7]: https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/DynamoDB/DocumentClient.html#update-property
[8]: https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/DynamoDB/DocumentClient.html#batchGet-property
[9]: https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/DynamoDB/DocumentClient.html#delete-property