dynamodbhelper

1.15.0 • Public • Published

This package is for aws dynamodb user. It helps developer to CRUD the dynamodb easily

Any bugs reported are welcomed

To import this package using "npm install dynamodbhelper" or "yarn add dynamodbhelper"

Before you use it, please add "const dbHelper = require('dynamodbhelper');"

  • InsertItem: create or update one item in table Examples: dbHelper.InsertItem({id,name},'tablename',callback);
  • InsertItems: create or update multiple items Examples: dbHelper.InsertItems([{id,name1},{id,name2}],'tablename',callback);
  • DeleteItems: delete items (only pass an array of keys) Examples: dbHelper.DeleteItems([{id},{id}],'tablename',callback);
  • GetItemById: retrieve one item by the key Examples: dbHelper.GetItemById({id},'tablename').then(item=>{...}).catch(error=>...);
  • GetAllItems: retrieve all items which satisfy the conditions, conditions should be strictly follow the format: {operator:"OR",conditions:["Feild1 > :para1","Feild2 < :para2","Feild3 != :para3"],parameters:{":para1":1,":para2":2,":para3":3}} Examples: dbHelper.GetAllItems('tablename',condition).then(items=>{...}).catch(error=>...);
  • UpdateItem: update existing item (add or update attribute) Examples: dbHelper.UpdateItem({id},{Feild1:value1,Feild2:value2},'tablename').then(item=>{...}).catch(error=>...);

Readme

Keywords

none

Package Sidebar

Install

npm i dynamodbhelper

Weekly Downloads

5

Version

1.15.0

License

ISC

Unpacked Size

26.5 kB

Total Files

5

Last publish

Collaborators

  • harry-developer
  • kpatel1989