最近,我开始与Dynamo合作。遇到了一种情况,我只想在尚不存在或属性值相同时才在其中添加条目。 例如
insert {'h': 1, 'r': 2, 'attr': {'attr': 'value1'}} should succeed, as record not present already
insert {'h': 1, 'r': 2, 'attr': {'attr': 'value1'}} should succeed, as same record exist with same information
insert {'h': 1, 'r': 2, 'attr': {'attr': 'value2'}} should fail, as attribute value is different
我想在单个指令中执行以保持原子性,那么如何在Dynamo中使用Expected_value条件实现这一目标?
任何有用的帮助