Describe the bug
If I have a property with a custom mapper like
@Model()classMyModel{
@Property({mapper: stringArrayOrEmptyMapper})myList: string[]}exportconststringArrayOrEmptyMapper: MapperForType<string[],ListAttribute<StringAttribute>>={fromDb: attributeValue=>attributeValue?.L?.map((item: {S: string})=>item.S)??[],toDb: propertyValue=>propertyValue?.length
? {L: propertyValue.map(item=>({S: item}))}
: {L: []},};and I try to do a conditional transact update like:
newTransactUpdate(MyModel,PK,SK).onlyIfAttribute('myList').eq([]).updateAttribute('myList).set(['liststuff'])I get Error: expected 1 value(s) for operator =, this is not the right amount of method parameters for this operator
This works fine if the list is populated but fails when the list is empty
Expected behavior
I expect the operation to succeed if the list is empty and fail if the list is not empty. I do not expect an error
Describe the bug
If I have a property with a custom mapper like
and I try to do a conditional transact update like:
I get
Error: expected 1 value(s) for operator =, this is not the right amount of method parameters for this operatorThis works fine if the list is populated but fails when the list is empty
Expected behavior
I expect the operation to succeed if the list is empty and fail if the list is not empty. I do not expect an error