dynamodb-toolbox
dynamodb-toolbox copied to clipboard
[update] setting input param of type 'map' to undefined results in error
const MyEntity = new Entity({
...,
attributes: {
...,
someAttr: 'string',
myMap: 'map'
}
await MyEntity.update({ someAttr: 'foo'}) // works fine
await MyEntity.update({ someAttr: 'foo', myMap: undefined}) // TypeError: Cannot read property '$set' of undefined
Error stack trace is pointing here
Is it expected behaviour? In my opinion, non-required property set to 'undefined' should be treated same as missing property and not result in error.