Skip to content

Commit

Permalink
docs: add #next docs
Browse files Browse the repository at this point in the history
  • Loading branch information
walkersumida committed Feb 24, 2019
1 parent 0012fcd commit 902fe2a
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,22 @@ items = scan.all.items
|3 |3 |Model S |0.20120601e8 |0 |
|4 |1 |S2000 |0.19980101e8 |1 |


#### Next(Paging)

```ruby
scan = Dynamodb::Api.scan
scan.from('cars').
limit(1)
_items = scan.all.items
items = scan.next.items
```

| id | maker_id(Partition key) | model | release_date(Sort key) | status |
|:---|:---|:---|:---|:---|
|2 |2 |CROWN |0.19550101e8 |0 |


### Query
https://docs.aws.amazon.com/sdkforruby/api/Aws/DynamoDB/Client.html#query-instance_method

Expand Down Expand Up @@ -148,6 +164,22 @@ items = query.all.items
|:---|:---|:---|:---|:---|
|1 |1 |Accord |0.19760508e8 |0 |

#### Next(Paging)

```ruby
query = Dynamodb::Api.query
query.from('cars').index('index_maker_id_release_date').
where(['maker_id', '=', 1]).
order('asc'). # default: 'desc'
limit(1)
_items = query.all.items
items = query.next.items
```

| id | maker_id(Partition key) | model | release_date(Sort key) | status |
|:---|:---|:---|:---|:---|
|4 |1 |S2000 |0.19980101e8 |1 |

#### Expression Attribute Names

Words reserved in DynamoDB can not be used without special processing.
Expand Down

0 comments on commit 902fe2a

Please sign in to comment.