Basic CRUD operations for Dynamo DB
npm install @commonthread/dynamodb-crudSource available here
getItem
| Param | Type | Description |
| ------ | ------------------- | ------------ |
| docClient | DocumentClient | AWS Dynamodb DocumentClient |
| tableName | string | table name string |
| field | string | search field name |
| value | string | search field value |
getItems
| Param | Type | Description |
| ------ | ------------------- | ------------ |
| docClient | DocumentClient | AWS Dynamodb DocumentClient |
| tableName | string | table name string |
getItemById
| Param | Type | Description |
| ------ | ------------------- | ------------ |
| docClient | DocumentClient | AWS Dynamodb DocumentClient |
| tableName | string | table name string |
| id | string | id field value |
| idField | string | id field name |
| rangeId | string | rangeId field value |
| rangeIdField | string | rangeIdField field name |
insertItem
| Param | Type | Description |
| ------ | ------------------- | ------------ |
| docClient | DocumentClient | AWS Dynamodb DocumentClient |
| tableName | string | table name string |
| item | object | object to insert |
updateItem
| Param | Type | Description |
| ------ | ------------------- | ------------ |
| docClient | DocumentClient | AWS Dynamodb DocumentClient |
| tableName | string | table name string |
| data | object | data to update with |
| id | string | id field value |
| idField | string | id field name |
deleteItem
| Param | Type | Description |
| ------ | ------------------- | ------------ |
| docClient | DocumentClient | AWS Dynamodb DocumentClient |
| tableName | string | table name string |
| keys | string array | field names to update |
| keyValues | string array | field value to update |