awslabs / dynamodb-data-mapper-js

A schema-based data mapper for Amazon DynamoDB.
https://awslabs.github.io/dynamodb-data-mapper-js/
Apache License 2.0
817 stars 106 forks source link

Nested Arrays with Attribute Annotations #163

Open Hoferdilo opened 5 years ago

Hoferdilo commented 5 years ago

I have the following typescript Attribute I want to marshall and unmarshall.

@attribute({memberType: {type: 'Number'}})
    private _ranges : Array<Array<number>>;
        get ranges():Array<Array<number>> {
            return this._ranges;
        }
        set ranges(theRanges:Array<Array<number>>){
            if(theRanges != undefined)
            {
                this._ranges = new Array<Array<number>>();
                theRanges.forEach(element => {
                    element.sort(function(a:number, b:number):number{
                        return a-b;
                    });
                    this._ranges.push(element);
                });
            }
        }

Sadly I cannot seem to find a way to do this. Can anyone help me with this issue.