Skip to content

Commit

Permalink
add docs
Browse files Browse the repository at this point in the history
  • Loading branch information
frankleng committed May 2, 2021
1 parent 5c7e710 commit 87c3263
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 2 deletions.
51 changes: 50 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,50 @@
# dynamocsv
# dynadash

### Helpers

+ `getTableRow` - get single row
```javascript
getTableRow(
tableName, // string
keys, // { hash: "key", range: "key" },
projection?, // string[], (optional)
consistent? // boolean, (optional)
)
```
+ `queryTableIndex` - query table index
```javascript
queryTableIndex(
tableName, // string
indexName, // string

// Simplified mappings to generate `KeyConditionExpression` and `FilterExpression`.
// key/val pair generates a simple equality condition, use an object to specify operator and value if needed.
keyCondExpressionMap, // { hash: 'test', range: { op: '>=', value: 1234 }}
filterExpressionMap // same as ^, with addition of "<>" operator
)
```
+ `batchPutTable`, `batchDelTable` - generate bulk write requests, chunks of 25 each, auto retry (10x max) w/ exponential backoff. (2s - 4min)
```javascript
batchPutTable(
tableName, // string
unmarshalledList, // any[],
predicate?, // (item) => any // called for every element of `unmarshalledList` (optional)
)
```
* `putTableRow`, `delTableRow` - update or delete single item
```javascript
putTableRow(tableName, item)
delTableRow(tableName, key)
```
+ `shallowUpdateTableRow` - shallow update 1st level elements
```javascript
shallowUpdateTableRow(
tableName, // string
keys, // { hash: "key", range: "key" }
row, // { attr: "newValue", attr2: "newVal" }
)
```
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dynadash",
"version": "1.0.5",
"version": "1.0.6",
"description": "DynamoDb helpers",
"main": "dist/index.js",
"scripts": {
Expand Down

0 comments on commit 87c3263

Please sign in to comment.