shiftcode / dynamo-easy

DynamoDB client for NodeJS and browser with a fluent api to build requests. We take care of the type mapping between JS and DynamoDB, customizable trough typescript decorators.
https://shiftcode.github.io/dynamo-easy/
MIT License
206 stars 27 forks source link

appendToList without initial array #299

Open hookercookerman opened 4 years ago

hookercookerman commented 4 years ago

when using appendToList there is no construction to allow the initial field to be null

FEATURE

Handle updates for appendToList that allow if not exists for setting a value

'SET my_list2 = list_append(if_not_exists(my_list2, :empty_list), :my_value)'

Ideal API

update2(AccommodationType, 'images').appendToList([image]).ifNotExists([image])

or

update2(AccommodationType, 'images').appendToList([image]).ifNotExists().set([images])

or

update2(AccommodationType, 'images').appendToList([image], true)