dynamodb-expr

0.0.1 • Public • Published

dynamodb-expr

DynamoDB expression utility.

Installation

npm i dynamodb-expr -S

API

buildProjectionExpression(attributes, ExpressionAttributeNames)

Build a projection expression.

  • attributes
    • An array of names of attributes to be projected.
  • ExpressionAttributeNames
    • An object that adds mappings of attributes that are replaced with placeholders during expression construction.

The return value is a string of the projection expression that reserved words in it are replaced with placeholders.

Example:

const { buildProjectionExpression } = require('dynamodb-expr');
 
const ExpressionAttributeNames = {};
 
const ProjectionExpression = buildProjectionExpression(['index', `foo'], ExpressionAttributeNames);
 
// Result:
//   ProjectionExpression: '#index,foo'
//   ExpressionAttributeNames: { '#index': 'index' }

isReserved(word)

Return a boolean value that indicates whether the word is reserved.

Constant

RESERVED_KEYWORDS

An array of reserved keywords.

License

MIT

Dependencies (0)

    Dev Dependencies (1)

    Package Sidebar

    Install

    npm i dynamodb-expr

    Weekly Downloads

    2

    Version

    0.0.1

    License

    MIT

    Unpacked Size

    10.4 kB

    Total Files

    4

    Last publish

    Collaborators

    • nak2k