Java DynamoDB映射器,用于具有多个条件的条件保存
我一直在尝试使用dynamodbmapper创建保存表达式。我想保存一个记录Java DynamoDB映射器,用于具有多个条件的条件保存,java,amazon-dynamodb,amazon-dynamodb-data-modeling,dynamodb-mapper,Java,Amazon Dynamodb,Amazon Dynamodb Data Modeling,Dynamodb Mapper,我一直在尝试使用dynamodbmapper创建保存表达式。我想保存一个记录 特定属性值不存在。 或 该属性值应大于特定值 所以我为它创建了一个表达式,但它抛出了IllegalArgumentException expected.put("date", new ExpectedAttributeValue(new AttributeValue() .withN(Long.toString(date
IllegalArgumentException
expected.put("date",
new ExpectedAttributeValue(new AttributeValue()
.withN(Long.toString(date.toEpochMilli())))
.withComparisonOperator(ComparisonOperator.LT));
expected.put("date", new ExpectedAttributeValue(false));
saveExpression.withConditionalOperator(ConditionalOperator.OR);
saveExpression.setExpected(expected);
这是我得到的一种例外
java.lang.IllegalArgumentException: Unable to assert the value of the fields [version], since the expected value conditions cannot be combined with user-specified conditions joined by "OR"
我想知道我是否遗漏了什么或者是有什么不对劲
编辑
看起来我无法在两个内部条件之间使用OR操作。是否有可能以某种方式执行或取消操作??
提前感谢。检查这是否与所描述的错误相关。您可以使用SaveBehavior.CLOBBER跳过这些字段上的断言。@sham。。。看起来我不能在两个内部条件之间使用OR。有没有办法使用或??