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
816 stars 106 forks source link

BatchGet always returns Cannot read property 'B' of undefined #208

Closed wakeupmh closed 2 years ago

wakeupmh commented 2 years ago

I'm using exact the documentation example, but I always have the error bellow: Cannot read property 'B' of undefined

WTF AM I DOING WRONG? Here is my code:

// employeeIds example: ['7b49423f-f1ce-4527-bfa4-e9ef22aaed6c', '4b188a1d-58b5-4889-a86a-2046ba3dd531']
const employeesToGet = employeeIds.map(employeeId => Object.assign(new Employee(), { id: employeeId }))
for await (const employee of this.mapper.batchGet(employeesToGet)) {
   employees.push(employee)
}

Can someone help me?