Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Marshaller

A class that will convert arbitrary JavaScript data types to their most logical in the DynamoDB schema.

Hierarchy

  • Marshaller

Index

Constructors

constructor

  • new Marshaller(__namedParameters?: object): Marshaller

Methods

marshallItem

  • marshallItem(item: object): AttributeMap
  • Convert a JavaScript object with string keys and arbitrary values into an object with string keys and DynamoDB AttributeValue objects as values.

    Parameters

    • item: object
      • [key: string]: any

    Returns AttributeMap

marshallValue

  • marshallValue(value: any): AttributeValue | undefined
  • Convert a JavaScript value into a DynamoDB AttributeValue or undefined.

    throws

    Error if the value cannot be converted to a DynamoDB type and the marshaller has been configured to throw on invalid input.

    Parameters

    • value: any

    Returns AttributeValue | undefined

unmarshallItem

  • Convert a DynamoDB operation result (an object with string keys and AttributeValue values) to an object with string keys and native JavaScript values.

    Parameters

    • item: AttributeMap

    Returns UnmarshalledMapAttributeValue

unmarshallValue