Options for DocumentClient
initialization
Private
_clientThe options used to initialize this object's DocumentClient
instance.
The DocumentClient
instance used by the methods of this object.
This property is lazily initialized.
Returns the attributes of one or more items from one or more tables by delegating to DocumentClient.batchGet()
.
You can use the batchItem helper to create the request items.
import { batchItem as bi } from 'dynamo-facade-v2';
// These two are equivalent
df.batchGet([
bi.get('movies', { actor: 'Tom Hanks', movie: 'Toy Story' }),
bi.get('movies', { actor: 'Tom Hanks', movie: 'Forrest Gump' }),
])
df.batchGet([
bi.get('movies', [
{ actor: 'Tom Hanks', movie: 'Toy Story' },
{ actor: 'Tom Hanks', movie: 'Forrest Gump' },
])
])
The same response returned by batchGet().promise()
The items to get in the format { [tableName]: { Keys: [...] } }
Optional
options: Partial<BatchGetItemInput>The options accepted by the original batchGet
method
Puts or deletes multiple items in one or more tables by delegating to DocumentClient.batchWrite()
.
You can use the batchItem helper to create the request items.
import { batchItem as bi } from 'dynamo-facade-v2';
df.batchWrite([
bi.put('movies', [
{ actor: 'Tom Hanks', movie: 'Toy Story' },
{ actor: 'Tom Hanks', movie: 'Forrest Gump' },
])
])
The same response returned by batchWrite().promise()
The items to write in the format { tableName: [ { ...request }, ...] }
Optional
options: Partial<BatchWriteItemInput>The options accepted by the original batchWrite
method
Deletes a single item in a table by primary key by delegating to DocumentClient.delete
.
The same response returned by delete().promise()
The name of the table from which to delete the item
A map of attribute names to values, representing the primary key of the item to delete
Optional
options: Partial<FacadeUpdateItemInput>The options accepted by the original delete
method, plus an optional condition
field that generates ConditionExpression
Returns a set of attributes for the item with the given primary key by delegating to DocumentClient.get
.
The same response returned by get().promise()
The name of the table containing the requested item
A map of attribute names to values, representing the primary key of the item to retrieve
Optional
options: Partial<GetItemInput>The options accepted by the original get
method
Creates a new item, or replaces an old item with a new item by delegating to DocumentClient.put
.
The same response returned by put().promise()
The name of the table to contain the item
A map of attribute name/value pairs, one for each attribute
Optional
options: Partial<FacadePutItemInput>The options accepted by the original put
method, plus an optional condition
field that generates ConditionExpression
Directly access items from a table by primary key or a secondary index by delegating to DocumentClient.query
.
df.query('movies', { actor: 'Tom Hanks', movie: 'Toy Story' })
The same response returned by query().promise()
The name of the table containing the requested items
An object describing the comparisons used to generate KeyConditionExpression
, ExpressionAttributeNames
, and ExpressionAttributeValues
Optional
options: Partial<FacadeQueryInput>The options accepted by the original query
method, plus an optional filter
field that generates FilterExpression
Returns one or more items and item attributes by accessing every item in a table or a secondary index by delegating to DocumentClient.scan
.
df.scan('movies', { actor: 'Tom Hanks' })
The same response returned by scan().promise()
The name of the table containing the requested items; or, if you provide IndexName
in the options
, the name of the table to which that index belongs
An object describing the comparisons used to generate FilterExpression
, ExpressionAttributeNames
, and ExpressionAttributeValues
Optional
options: ScanInputThe options accepted by the original scan
method
Creates a set of elements by delegating to DocumentClient.createSet
.
The created DynamoDB Set
Collection to represent your DynamoDB Set
Optional
options: Partial<CreateSetOptions>The options accepted by the original createSet
method
Atomically retrieves multiple items from one or more tables (but not from indexes) in a single account and region by delegating to DocumentClient.transactGet
.
You can use the transactItem helper to create the request items.
import { transactItem as tr } from 'dynamo-facade-v2';
df.transactGet([
tr.get('movies', { actor: 'Tom Hanks', movie: 'Toy Story' }
])
The same response returned by transactGet().promise()
The items to get in the format [{ Get: { TableName: ..., Key: ... } }, ...]
Optional
options: Partial<TransactGetItemsInput>The options accepted by the original transactGet
method
Synchronous write operation that groups up to 25 action requests by delegating to DocumentClient.transactWrite
.
You can use the transactItem helper to create the request items.
import { transactItem as tr } from 'dynamo-facade-v2';
df.transactWrite([
tr.put('movies', { actor: 'Tom Hanks', movie: 'Toy Story' }
])
The same response returned by transactWrite().promise()
The items to write in the format [ { Put: { ... } }, ...]
Optional
options: Partial<TransactWriteItemsInput>The options accepted by the original transactWrite
method
Edits an existing item's attributes, or adds a new item to the table if it does not already exist by delegating to DocumentClient.update
.
The same response returned by update().promise()
The name of the table containing the item to update
The primary key of the item to be updated
A map of attribute name/value pairs with the attributes that must be modified
Optional
options: Partial<FacadeUpdateItemInput>The options accepted by the original update
method, plus an optional condition
field that generates ConditionExpression
Generated using TypeDoc
Facade class for easy access to DynamoDB.