user
user

Reputation: 179

Multiple Expected values dynamoDB

I am trying to update an item conditionally in Dynamo DB. Right now I am able to work with one expected value through this

expectedValues.put("Status",
        new ExpectedAttributeValue()
        .withComparisonOperator("EQ")
        .withAttributeValueList(new AttributeValue().withS(StatusCond1))); 

Now I want to check if Status is equal to one of two expected values. I tried to replace the last line with

.withAttributeValueList(new AttributeValue().withSS(StatusCond1, StatusCond2)));

but to no avail. I don't understand how to use conditional operators here.

Upvotes: 2

Views: 1598

Answers (1)

Erben Mo
Erben Mo

Reputation: 3634

use the IN operator. http://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_PutItem.html

"IN : checks for matching elements within two sets"

Upvotes: 2

Related Questions