Skip to content

DocumentClient: inconsistant requirement of conditional expressions vs Dynamodb, for transact writes #439

@seba-i

Description

@seba-i

Hi, it is frustrating that DocumentClient transactWrite forces you to use a 'conditional expression', whereas the underlying Dynamodb transactWriteItem does not.

DocumentClient TransactWrite uses class Operation, where the field expression is a required field, even though it then gets translated into a Dynamodb TransactWriteItem, whose conditionExpression is not required.

Its inconvenient to always have to use a conditional expression, eg just PUT an object into db.

Happy to submit a PR if there's agreement (to change Option.expression type to nullable String)

// workaround...
TransactWrite(
      put: Operation(
          value: {'pk': '123', 'sk': '456'},
          tableName: 'my-table',
          expression: 'attribute_not_exists(arrrgghhhh)')), // :-(

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions