I am trying to do a conditional updateItem call using php SDK2, but having trouble figuring out how to check for only a single value within a string set.
For Exmple: I have a string set in dynamoDB:
{"a","b","c"}
I want to do an updatedItem call, and delete one of those values, but error out if the value doesn't exist. So, if I attempted to remove "d" from the above set, I want dynamoDB to throw an error, not just silently ignore the fact that "d" doesn't exist in my string set.
I've tried:
'Expected' => array(
myAttribute => array(
'Exists' => true,
'Value' => array(Type::STRING_SET => array("d"))
)
)
This fails, however, even if the value was, for example, "a". I think the reason is that dynamoDB thinks I want it to validate the entire set, not just one value in it.
Is there a way to do a conditional put and verify just a single value within the set?
I can do a getItem call, grab the string set as an array and do my own checking, but I'd love to do it all in one call if possible.
Thanks in advance