dynamodb-path

1.0.1 • Public • Published

dynamodb-path

Convert an array path like ['x', '291', '2', 'beep', 283] to a string path like #x[291][2].#beep[283] suitable for DynamoDB UpdateExpressions.

npm status Dependency status

example

var ddbPath = require('dynamodb-path')
var escape = (s) => '#' + s
 
var arr = ['x', '291', '2', 'beep', 283]
var str = ddbPath(arr, escape)
 
console.log(str) // #x[291][2].#beep[283]

api

ddbPath(path[, map])

Takes an array, returns a string. Will throw if path is invalid. If a map function is provided, it will be called for every string segment. You can use this mapper to escape segments and collect names for ExpressionAttributeNames.

install

With npm do:

npm install dynamodb-path

license

MIT © ironSource

/dynamodb-path/

    Package Sidebar

    Install

    npm i dynamodb-path

    Weekly Downloads

    2

    Version

    1.0.1

    License

    MIT

    Last publish

    Collaborators

    • it-ironsrc
    • kessler
    • vweevers