java - Using NOT_CONTAINS in conditional write via DynamoDBMapper -
i want update record in dynamodb table based on below condition states "update record when attribute value belongs none of values specified in list".
code snippet:
attributevalue inprogressstatus = new attributevalue("in_progress"); attributevalue successstatus = new attributevalue("success"); expectedattributevalue expectedattributevalue = new expectedattributevalue(); expectedattributevalue.setattributevaluelist(arrays.aslist(inprogressstatus, successstatus)); expectedattributevalue.setcomparisonoperator(comparisonoperator.not_contains);
while executing conditional update receiving following exception:
com.amazonaws.amazonserviceexception: 1 or more parameter values invalid: invalid number of argument(s) not_contains comparisonoperator (service: null; status code: 400; error code: validationexception; request id: null).
please let me know how can achieve functionality using not_contains
operator.
not_contains
can have single attributevalue
, have two. refer documentation dynamodb conditions including not_contains
@ http://docs.aws.amazon.com/amazondynamodb/latest/apireference/api_condition.html.
Comments
Post a Comment