Skip to content

DynamoDbContext.SaveAsync Should Support Conditional Update Expressions #1605

Open
@jopincar

Description

@jopincar

Expected Behavior

Change the QueryFilter element of DynamoDBOperationConfig to just Filter or add a SaveFilter and allow specification of conditional update expressions. The fact that QueryFilter works with ConditionalOperator (why no Query in front of that?) is odd and I had the expectation of being able to supply an update expression.

Current Behavior

Poorly named members promote confusion about the ability to perform conditional updates.

Possible Solution

Context

I am unable to implement conditional update logic using DynamoDbContext.SaveAsync which is a great inconvenience. It prevents me from implementing this check without doing an extra read and introducing a hole in the check due to latency and timing. My alternative is to introduce the lower level APIs but then, what's the point of the higher level. It's also inconsistent that query supports expressions but save does not.

I was wanting to use an existing date field as the "version" to implement optimistic locking.

.NET Core Info

  • .NET Core version used for development: 2.1
  • .NET Core version installed in the environment where application runs: 2.1

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions