Methods
flynamo(client, configopt)
- Description:
Wraps an AWS DynamoDB
clientand returns Flynamo's API to access its methods. Optionally, aconfigobject fordynamodb-wrappermay be provided.
- Source:
- See:
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
client |
Object | A DynamoDB client |
||
config |
Object |
<optional> |
{}
|
|
forTable(tableName) → {Object}
- Description:
Returns a Flynamo API that automatically adds a
TableNameprop to all its requests. This serves as a shorthand for manually addingTableNameto DynamoDBrequestarguments or using regular*forfunctions in the API (such ascountFor,getFor, etc.). This is how you would typically use those*forfunctions.
- Source:
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