ReadonlynameThe name of the store (e.g. 'mongodb', 'redis', 'dynamodb')
ReadonlylibraryThe client library being used
Returns the DynamoDBDocumentClient (plain-object marshalling), not the raw DynamoDBClient.
Access to the low-level DynamoDBClient (raw AttributeValue shapes), for anything the document client doesn't cover.
options.returnValues defaults to 'NONE' (matching real PutItem
default behavior). Pass 'ALL_OLD' to get the item's previous value
back (undefined if there wasn't one).
Convenience update: SETs each key in updates to its value. Builds a
simple UpdateExpression/ExpressionAttributeValues internally, using
#k0, #k1, ... as attribute name placeholders (so reserved words like
status are always safe) merged with any options.expressionAttributeNames.
For REMOVE/ADD/DELETE or nested-path updates, use updateItemRaw().
Escape hatch for update expressions beyond the flat-SET convenience wrapper above (REMOVE/ADD/DELETE, nested paths, etc).
options.returnValues defaults to 'ALL_OLD' (returns the deleted item); pass 'NONE' to skip returning it.
Query by partition key equality (plus an optional sort-key condition) against the base table or a named GSI/LSI. This is the primary way to read more than one item efficiently from DynamoDB — unlike Scan, it only reads the partition(s) that match, not the whole table.
Full table (or index) scan. This reads every item in the table — cost
and latency scale with table size, not with how many items you actually
want, and filterExpression is applied after the read (it does not
reduce RCU consumption or the amount of data scanned). Prefer query()
with a well-designed partition/sort key or GSI. Only reach for scan()
for admin/maintenance/export tasks, small tables, or as a last resort
when no query-friendly access pattern exists.
Auto-paginating query(): DynamoDB caps each Query response at 1MB of
data, so a query over more items than that fits in a single page and
returns a lastEvaluatedKey that the caller must pass back in as
exclusiveStartKey to fetch the next page. Forgetting to loop on that
silently truncates results. queryAll() follows lastEvaluatedKey
automatically and returns every matching item across all pages.
params.limit, if set, still applies per-page (as DynamoDB defines
it) — it does not cap the total number of items returned here. To
consume pages one at a time instead of buffering everything in memory,
use queryPages().
Async-generator form of queryAll(): yields each page of items as it
arrives instead of buffering the entire result set in memory, while
still following lastEvaluatedKey automatically.
Auto-paginating scan() — see queryAll() above for why this matters
(the same 1MB-per-page cap applies to Scan). Reminder: scan() is
already O(table size) per the warning on scan() itself; scanAll()
makes that even more explicit by reading literally the whole table (or
index) into memory across as many pages as it takes.
Async-generator form of scanAll(); yields each page as it arrives.
BatchGetItem across one or more tables. DynamoDB caps a single
BatchGetItem call at 100 items total; this method chunks keys
internally (25-at-a-time chunks well under the limit, sent
sequentially) so callers can pass an arbitrarily large key list without
worrying about the limit themselves. Also retries any
UnprocessedKeys DynamoDB returns for a chunk (throttling) with
exponential backoff and jitter between attempts, up to
options.maxAttempts (default 5) attempts per chunk, before giving up
and returning whatever's still unprocessed to the caller.
BatchWriteItem (put and/or delete) against a single table. DynamoDB
caps a single BatchWriteItem call at 25 write requests; this method
chunks requests internally so callers can pass an arbitrarily large
batch. Also retries UnprocessedItems with exponential backoff and
jitter, up to options.maxAttempts (default 5) attempts per chunk,
before returning whatever's left to the caller.
Passthrough to DynamoDB's TransactWriteItems — up to 100 Put/Update/ Delete/ConditionCheck actions, atomically, potentially across multiple tables. Not chunked: DynamoDB rejects the whole transaction if it exceeds the limit, so it's on the caller to stay under it (unlike the batch methods above, there's no safe way to silently split a transaction into several without breaking its atomicity guarantee).
Passthrough to DynamoDB's TransactGetItems — up to 100 Get actions, read as a single consistent snapshot.
Enables DynamoDB Streams on a table via UpdateTableCommand's
StreamSpecification, choosing what a stream record captures:
KEYS_ONLY (just the key attributes of the modified item), NEW_IMAGE
(the entire item as it appears after modification), OLD_IMAGE (as it
appeared before), or NEW_AND_OLD_IMAGES (both). This only flips the
table-level setting and returns the ARN DynamoDB assigns the new
stream — it does not read from the stream itself; see "Known
limitations" in the README for why a stream consumer is out of scope
for this store.
Disables DynamoDB Streams on a table via UpdateTableCommand.
Reads back the table's current stream ARN (undefined if streams
aren't enabled) via DescribeTableCommand. Consuming the stream itself
(shard iterators / record polling) requires the separate
@aws-sdk/client-dynamodb-streams package or a Lambda event source
mapping — out of scope here, see the README.
Enables TTL on a table via UpdateTimeToLiveCommand: DynamoDB
periodically (usually within 48 hours, not immediately) deletes items
whose attributeName holds a Unix epoch-seconds number in the past.
A table may only have one TTL attribute at a time.
Disables TTL on a table. DynamoDB requires the currently-enabled
AttributeName to be repeated on the disabling call, so this first
reads it back via describeTTL() and is a no-op if TTL isn't
currently enabled on the table.
Reads back a table's TTL configuration via DescribeTimeToLiveCommand.
Creates a table via CreateTableCommand. Thin passthrough to the raw
SDK input shape: params.TableName, params.KeySchema, and
params.AttributeDefinitions are required (as real CreateTable
requires), plus either params.BillingMode: 'PAY_PER_REQUEST' or
params.ProvisionedThroughput (real CreateTable requires one or the
other), and optionally params.GlobalSecondaryIndexes/
params.LocalSecondaryIndexes. Table creation is asynchronous on AWS's
side (the table starts in CREATING status) — this call returns as
soon as DynamoDB accepts the request, it does not wait for the table to
become ACTIVE; poll describeTable() if you need to wait.
Deletes a table via DeleteTableCommand. Like createTable(), this is
asynchronous on AWS's side (the table moves to DELETING status); this
call returns as soon as DynamoDB accepts the request.
Lists table names in the current account/region via ListTablesCommand.
A single call returns at most 100 table names (or params.limit if
lower); pass params.exclusiveStartTableName (from a previous call's
lastEvaluatedTableName) to page through the rest.
Reads back a table's full description (status, key schema, billing
mode, indexes, stream ARN, item count, etc.) via DescribeTableCommand.
getStreamArn() above is a narrow convenience wrapper around this same
command for just the stream ARN.
Adds or removes a Global Secondary Index on an existing table via
UpdateTableCommand's GlobalSecondaryIndexUpdates. DynamoDB only
allows one GSI create/delete/update action per UpdateTable call, so
gsiUpdates must contain exactly one GlobalSecondaryIndexUpdate
entry ({ Create: {...} }, { Update: {...} }, or { Delete: {...} }).
When creating a new GSI, attributeDefinitions must include the key
attribute(s) of the new index (DynamoDB validates this).
OptionalattributeDefinitions: AttributeDefinition[]Switches a table between on-demand (PAY_PER_REQUEST) and provisioned
(PROVISIONED) capacity via UpdateTableCommand. When switching to
PROVISIONED, throughput (ReadCapacityUnits/WriteCapacityUnits)
is required (real DynamoDB rejects the call without it); it's ignored
when switching to PAY_PER_REQUEST.
Optionalthroughput: ProvisionedThroughputEnables Point-in-Time Recovery on a table via
UpdateContinuousBackupsCommand, allowing restore to any second within
the retention window (35 days by default; DynamoDB currently ignores
a custom recoveryPeriodInDays on enable and defaults to 35).
Disables Point-in-Time Recovery on a table via UpdateContinuousBackupsCommand.
Reads back a table's PITR configuration via DescribeContinuousBackupsCommand.
Creates an on-demand backup of a table via CreateBackupCommand.
Reads back a backup's full description via DescribeBackupCommand.
Lists backups via ListBackupsCommand, optionally scoped to a single
table. Does not auto-paginate — pass the last item's BackupArn back
in as exclusiveStartBackupArn to fetch the next page, same pattern as
listTables().
OptionaltableName: stringRestores a backup into a new table via RestoreTableFromBackupCommand.
DynamoDB always restores into a new table (newTableName must not
already exist) — it does not overwrite the original table the backup
was taken from. Like createTable(), this is asynchronous: the new
table starts in CREATING status.
Adds (or updates, if the key already exists) tags on a table/backup resource via TagResourceCommand.
Removes tags (by key) from a table/backup resource via UntagResourceCommand.
Lists tags on a table/backup resource via ListTagsOfResourceCommand.
Does not auto-paginate — pass a returned nextToken back in as
options.nextToken to fetch the next page.
Fetch items matching the ORM where clause. When options.key pins the
partition key by equality this issues an efficient Query; otherwise it
falls back to a Scan (see the warning on scan). Returns a single
page plus the lastEvaluatedKey cursor (pass it back as
exclusiveStartKey for the next page, or use findAll to
auto-paginate).
Auto-paginating findAllPaged: follows lastEvaluatedKey and
returns every matching item. options.limit still applies per page (as
DynamoDB defines it); to cap total results, slice the return value.
Fetch the first item matching where (page-limited to 1), or undefined.
Count items matching where using Select: 'COUNT' (server-side count;
items are not returned). Follows pagination automatically and sums each
page's count.
Insert an item (PutItem). By default overwrites any existing item with
the same key (native Put semantics); pass options.key with
options.insertOnly to add an attribute_not_exists(<pk>) condition so a
duplicate primary key fails instead (SQL INSERT semantics).
Insert many items via chunked/retried BatchWriteItem puts.
Update every item matching where, SETting each key in values. When
where pins the full primary key (and nothing else), this is a single
UpdateItem; otherwise it finds matching items (Query/Scan via key),
then issues one UpdateItem per item. Requires options.key. Returns the
number of items updated.
Delete every item matching where. When where pins the full primary key
this is a single DeleteItem; otherwise it finds matching items and
deletes them via chunked BatchWriteItem. Requires options.key. Returns
the number of items deleted.
Amazon DynamoDB store, implementing the minimal
NoSqlStoremarker interface. Unlike the SQL dialects, there is noquery(sql)— DynamoDB's operations are item/key-shaped (Get/Put/Update/Delete/Query/Scan/Batch/Transact), and that shape is preserved here rather than forced into a SQL string.