Options
All
  • Public
  • Public/Protected
  • All
Menu

@aws/dynamodb-data-mapper

Index

Type aliases

OnMissingStrategy

OnMissingStrategy: "remove" | "skip"

ParallelScanParameters

ParallelScanParameters: BaseScanOptions & CtorBearer<T> & object
deprecated

ParallelScanState

ParallelScanState: Array<ScanState>

ParallelScanState is represented as an array whose length is equal to the number of segments being scanned independently, with each segment's state being stored at the array index corresponding to its segment number.

Segment state is represented with a tagged union with the following keys:

  • initialized -- whether the first page of results has been retrieved
  • lastEvaluatedKey -- the key to provide (if any) when requesting the next page of results.

If lastEvaluatedKey is undefined and initialized is true, then all pages for the given segment have been returned.

ParallelScanWorkerParameters

ParallelScanWorkerParameters: ParallelScanWorkerOptions & CtorBearer<T>
deprecated

ReadConsistency

ReadConsistency: "eventual" | "strong"

ScanParameters

ScanParameters: ScanOptions & CtorBearer<T>
deprecated

ScanState

SecondaryIndexOptions

SecondaryIndexProjection

SecondaryIndexProjection: "all" | "keys" | Array<string>

SequentialScanOptions

SequentialScanOptions: ScanOptions | ParallelScanWorkerOptions & object
internal

StreamViewType

StreamViewType: "NEW_IMAGE" | "OLD_IMAGE" | "NEW_AND_OLD_IMAGES" | "KEYS_ONLY" | "NONE"

SyncOrAsyncIterable

SyncOrAsyncIterable: Iterable<T> | AsyncIterable<T>

WriteType

WriteType: "put" | "delete"

Variables

Const DynamoDbDirtyFields

DynamoDbDirtyFields: unique symbol = Symbol('DynamoDbDirtyFields')

Used to designate which fields on an object have been changed. The method identified by this symbol should return a iterable that enumerates the fields that have been altered.

example
 class FooDocument {
     constructor() {
         this._dirtyFields = new Set();
         this._foo = '';
     }

     get foo() {
         return this._foo;
     }

     set foo(value) {
         this._foo = value;
         this._dirtyFields.add('foo');
     }

     [DynamoDbDirtyFields]() {
         return this._dirtyFields.values();
     }
 }

Const DynamoDbSchema

DynamoDbSchema: unique symbol = Symbol('DynamoDbSchema')

Used to designate the mapping of an object from its JavaScript form to its representation in a DynamoDB Table or nested map.

example
 class FooDocument {
     [DynamoDbSchema]() {
         return {
             bar: {type: 'String'},
             baz: {type: 'Number'},
         };
     }
 }

Const DynamoDbTable

DynamoDbTable: unique symbol = Symbol('DynamoDbTableName')

Used to designate that an object represents a row of the named DynamoDB table. Meant to be used in conjunction with {DynamoDbSchema}.

example
 class FooDocument {
     [DynamoDbTable]() {
         return 'FooTable';
     }

     [DynamoDbSchema]() {
         return {
             bar: {type: 'String'},
             baz: {type: 'Number'},
         };
     }
 }

Const MAX_READ_BATCH_SIZE

MAX_READ_BATCH_SIZE: 100 = 100

Const MAX_WRITE_BATCH_SIZE

MAX_WRITE_BATCH_SIZE: 25 = 25

Const VERSION

VERSION: "0.4.0" = "0.4.0"

Functions

buildScanInput

  • buildScanInput<T>(valueConstructor: ZeroArgumentsConstructor<T>, options?: SequentialScanOptions): ScanInput

embed

  • embed<T>(documentConstructor: ZeroArgumentsConstructor<T>, __namedParameters?: object): DocumentType
  • Type parameters

    • T

    Parameters

    • documentConstructor: ZeroArgumentsConstructor<T>
    • Default value __namedParameters: object = {}

    Returns DocumentType

getSchema

  • getSchema(item: any): Schema

getTableName

  • getTableName(item: any, tableNamePrefix?: string): string
  • Parameters

    • item: any
    • Default value tableNamePrefix: string = ""

    Returns string

marshallStartKey

  • marshallStartKey(schema: Schema, startKey: object): Key
  • internal

    Parameters

    • schema: Schema
    • startKey: object
      • [key: string]: any

    Returns Key