Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface CustomType<JsType>

A node whose type is not managed by the marshaller, but rather by the marshall and unmarshall functions defined in this SchemaType. Useful for objects not easily classified using the standard schema taxonomy.

Type parameters

  • JsType

Hierarchy

Index

Properties

Optional attributeName

attributeName: undefined | string

The key in which this value will be persisted in DynamoDB. If not provided, the key will be assumed to be the same in the input and in the persisted record.

Optional attributeType

attributeType: ScalarAttributeType

The attribute type to be used for this field when creating or updating the DynamoDB table definition for this record.

Required if the custom field is being used as a key and the schema is used to create or update a table or index.

Optional defaultProvider

defaultProvider: undefined | function

An optional default value factory. If a type has a defined defaultProvider and its value is undefined in the provided input, the defaultProvider will be called and its return value serialized.

Optional indexKeyConfigurations

indexKeyConfigurations: undefined | object

An array of key configurations as they apply to global and local secondary indices.

Optional keyType

keyType: KeyType

Key configuration as it pertains to the DynamoDB table.

marshall

marshall: function

A function that converts an input value into a DynamoDB attribute value. This function will not be invoked if the input value is undefined.

param

The value to be converted.

Type declaration

    • (input: JsType): AttributeValue
    • Parameters

      • input: JsType

      Returns AttributeValue

type

type: "Custom"

unmarshall

unmarshall: function

A function that converts a DynamoDB AttributeValue into a JavaScript value.

param

The value to be converted.

Type declaration

    • (persistedValue: AttributeValue): JsType
    • Parameters

      • persistedValue: AttributeValue

      Returns JsType