@@ -23,6 +23,7 @@ This package provides QueryBuilder for DynamoDB.
23
23
- [ Filter Expressions for Query] ( #filter-expressions-for-query )
24
24
- [ Working with Scans in DynamoDB] ( #working-with-scans-in-dynamodb )
25
25
- [ Filter Expressions for Scan] ( #filter-expressions-for-scan )
26
+ - [ Paginating the Results] ( #paginating-the-results )
26
27
- [ Using Global Secondary Indexes in DynamoDB] ( #using-global-secondary-indexes-in-dynamodb )
27
28
- [ Querying a Global Secondary Index] ( #querying-a-global-secondary-index )
28
29
- [ Models] ( #models )
@@ -40,8 +41,9 @@ This package provides QueryBuilder for DynamoDB.
40
41
I started trying to make simple QueryBuilder because:
41
42
42
43
- I want to use DynamoDB with Laravel. (e.g., authenticate with custom user provider)
43
- - I don't want to extend Eloquent Query Builder because DynamoDB looks quite different from relational databases.
44
44
- I want to use a simple API which doesn't need to worry about cumbersome things like manually handling Expression Attributes.
45
+ - I don't want to make it fully compatible with Eloquent because DynamoDB looks quite different from relational databases.
46
+ - However, I want to extend Laravel's code as much as I can to keep additional implementation simple.
45
47
- I'm longing for [ jessengers/laravel-mongodb] ( https://github.com/jenssegers/laravel-mongodb ) . What if we have that for DynamoDB?
46
48
47
49
## Installation
@@ -274,6 +276,27 @@ $response = DB::table('Thread')
274
276
->scan();
275
277
```
276
278
279
+ #### Paginating the Results
280
+
281
+ If there are more results, the result contains ` LastEvaluatedKey ` .
282
+
283
+ ``` php
284
+ $response = DB::table('ProductCatalog')
285
+ ->limit(5)
286
+ ->scan();
287
+
288
+ $response['LastEvaluatedKey']; // array
289
+ ```
290
+
291
+ Pass ` LastEvaluatedKey ` to the ` exclusiveStartKey ` clause to retrieve the next results.
292
+
293
+ ``` php
294
+ $response = DB::table('ProductCatalog')
295
+ ->exclusiveStartKey($response['LastEvaluatedKey'])
296
+ ->limit(5)
297
+ ->scan();
298
+ ```
299
+
277
300
### Using Global Secondary Indexes in DynamoDB
278
301
279
302
[ corresponding document] ( https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/GSI.html )
0 commit comments