dynamodb-toolbox icon indicating copy to clipboard operation
dynamodb-toolbox copied to clipboard

[update] setting input param of type 'map' to undefined results in error

Open vsnig opened this issue 3 years ago • 0 comments

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.

vsnig avatar May 07 '21 11:05 vsnig