Multi-Model Requests
There are different requests you can use to read from or write to different tables.
General
Creation
Multi-model requests are created with the new
keyword.
You can provide a DynamoDB client instance when creating a new multi model request:new BatchGetRequest(Person, myDynamoDBClient)
Params
Every request instance contains the public params
property where all params for the request are written to. You might want to use it for debugging purpose but are also able to write on it (eg. non-covered features).
Consumed Capacity
You might want to receive the consumed capacity which can be achieved by applying the returnConsumedCapacity('INDEXES' | 'TOTAL')
method and the usage of execFullResponse()
instead of exec()
.
Execution
All requests provide at least two execution methods:
exec()
returns a promise which will resolve to the requested items or void if no items were requestedexecFullResponse()
returns a promise which will resolve to the full response DynamoDB returns, butresponse.Items
are still mapped for you.
BatchGet
BatchWrite
TransactGet
Execute transactional read operations by providing one or multiple models + keys.
TransactWrite
Execute transactional write operations by providing one or multiple transact items (TransactConditionCheck, TransactDelete, TransactPut, TransactUpdate).
Last updated