DynamoDBDocument client instance. Must be declared before configuring the model.
Regular expression to use when checking if the hash
key has the tenant
prefixed.
The name of the hash
key.
The type of the hash
key.
The name of the index to use when running an index
operation. By default
if will be called byGSIK
. If the index is not created before hand, and
the model is configured with a tenant
, then the method will fail.
The maximum GSIK values to use to index the models. This is necessary when
configuring a tenant
, since you can't configure an IAM policy to restrict
access to an item with a prefix on its hash ID. So, a GSIK will be
configured on every item by the library, using the tenant
value plus a
number between 0
and maxGSIK
. Then you can create an IAM policy that
restrict access on the index (called by defaylt byGSIK
) with access only
on the items with the appropiate GSIK value.
The name of the range
key.
The type of the range
key.
Struct instance created from the struct
data passed through the model
configuration.
The table name. If not provided it will try to use the table
name
globally configured.
The tenant
unique identifier.
Value used to track the dates where modifications were done to the item.
Does the stored DynamoDB DocumentClient call and wraps the result in a
callback. It handles error produced on the call, and passes the onto the
callback on the err
argument.
Callback function to invoke with the data or the error generated on the DynamoDB DocumentClient call.
Sets up a call to DynamoDB to create a new item.
Body of the item to be created.
Sets a call to DynamoDB to delete an item.
Item key.
Sets a call to get an item from DynamoDB.
Item key.
Sets a call to DynamoDB to get a list of items.
Index options used to set what items to return.
Does the stored DynamoDB DocumentClient call and wraps the result in promise. It handles error produced on the call.
Sets a call to DynamoDB to update an item.
Body of the item to be updated.
Generated using TypeDoc
Default Model
This basic model has some basic methods to interact with DynamoDB. It has implemented all the typical
CRUD
operations, and translates them into DynamoDB DocumentClient calls. By using a model, you can avoid having to learn how to work with DynamoDB.If you want to add more methods to your model, you can create your own class extended from this one.