Methods
flynamo(client, configopt)
- Source:
- See:
Wraps an AWS DynamoDB client
and returns Flynamo's API to access
its methods. Optionally, a config
object for dynamodb-wrapper
may be provided.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
client |
Object | A DynamoDB client |
||
config |
Object |
<optional> |
{}
|
|
forTable(tableName) → {Object}
Returns a Flynamo API that automatically adds a TableName
prop
to all its requests. This serves as a shorthand for manually adding
TableName
to DynamoDB request
arguments or using regular *for
functions in the API
(such as countFor
, getFor
, etc.). This is how you would typically use those *for
functions.
Example
const { get, count } = forTable('SomeTable');
await get(42); // Fetch item of primary key `{id: 42}` from `SomeTable`
await count(); // Count total number of elements in `SomeTable`
Parameters:
Name | Type | Description |
---|---|---|
tableName |
String | The value of |
Returns:
The entire Flynamo's API scoped to a single table. The exported
members contain get
, getAll
, insert
, query
, update
, remove
, count
, batchWrite
,
batchInsert
, batchRemove
, batchGetFor
.
- Type
- Object