I want to get all of the records from a Dynamo DB table and have them mapped into an array of POJOs; The POJO is simple and already annotated.
DynamoDBMapper appears to be the object that will do a fetch to acquire the records and deserialize them into my POJOs. Perhaps using PaginatedScanList() to walk through the entire table.
Mapper's Scan() and PaginatedScanList() methods both require a DynamoDBScanExpression parameter. What DynamoDBScanExpression would be used to select all of the records in the table?
The DynamoDBMapper class is the entry point to Amazon DynamoDB. It provides access to a DynamoDB endpoint and enables you to access your data in various tables. It also enables you to perform various create, read, update, and delete (CRUD) operations on items, and run queries and scans against tables.
AWS DynamoDB Mapper query by GSI returns null for all non-key attributes.
Class PaginatedQueryList<T>Implementation of the List interface that represents the results from a query in AWS DynamoDB. Paginated results are loaded on demand when the user executes an operation that requires them.
withScanIndexForward(Boolean scanIndexForward) Specifies the order for index traversal: If true (default), the traversal is performed in ascending order; if false , the traversal is performed in descending order. QueryRequest. withSelect(Select select) The attributes to be returned in the result.
You can pass a new DynamoDBScanExpression()
into the scan method.:
mapper.scan(MyObject.class, new DynamoDBScanExpression());
Or you could use the new Document API
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With