Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue #344: Add basic Set support (ADD and DELETE operations) #363

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from

Conversation

andygonzalez2010
Copy link

Copy link
Member

@whimzyLive whimzyLive left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@andygonzalez2010
Please add tests

);
}
});
// THIS CHECK IS NOT NEEDED
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@andygonzalez2010

From memory the reason this check was here was due to DynamoDB itself didn't support declaring multiple condition on same attribute within a expression..

With your below example... it would have created an incorrect query expression that would fail when executing against DynamoDB.

Not sure if this has changed since the time it was implemented. Would love to see some references proving this is now supported.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

im currently running this raw :

TransactWriteItems{
  "TransactItems": [
    {
      "Update": {
        "TableName": "test",
        "Key": {
          "PK": {
            "S": "UserId#111"
          },
          "SK": {
            "S": "RUNNING_TASKS"
          }
        },
        "ExpressionAttributeNames": {
          "#runningTaskIds": "runningTaskIds"
        },
        "ExpressionAttributeValues": {
          ":runningTaskIds": {
            "SS": ["12", "34"]
          },
          ":zero": {
            "N": "0"
          }
        },
        "ConditionExpression":
                "attribute_not_exists(#runningTaskIds) OR size(#runningTaskIds) = :zero",
        "UpdateExpression": "ADD #runningTaskIds :runningTaskIds"
      }
    }
  ]
}

@andygonzalez2010
Copy link
Author

@whimzyLive anything else needed here? can we rerun the automated checks?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants