@novo-x/aws-dynamo
v1.0.8
Published
AWS DynamoDB core
Downloads
3
Readme
AWS DynamoDB Service
Available methods
- getDocumentsByIndex: retrieves a list of documents by index
- getDocumentById: retrieves a document by id
- saveDocument: saves document
- updateAwsConfig: updates the aws config
Usage examples
yarn add @novo-x/aws-dynamo
import {DynamoDB} from "@novo-x/aws-dynamo"
const MyService = new DynamoDB(/* optional config object */);
MyService.updateAwsConfig({
// ... AWS config
})
const documentsByIndex = MyService.getDocumentsByIndex(
'my_index', // indexName
'my_key', // indexKey
'index_value', // indexValue,
'my_table' // tableName
);
const documentById = MyService.getDocumentById(
'my_key', // keyName
'123456789', // id
'my_table' // tableName
)
const saved = MyService.saveDocument(
{
name: 'John Doe',
age: 59
}, // itemData,
tableName // tableName
)