title: How to add item to dynamodb if a field does not exist or matches a condition?
body: <p>I want to save an item if a field, is either non-existent or less than a given value.</p>
  
  <p>So the first time the item is written, the field would be non-existent. and on subsequent writes, it needs to be less than a given value.</p>
  
  <p>However it seems <code>DynamoDBSaveExpression</code> does not allow multiple conditions on a column. My current code looks like this:</p>
  
  <pre><code>Map&lt;String, ExpectedAttributeValue&gt; expected = new HashMap&lt;&gt;();
  expected.put("lastProcessTime", new ExpectedAttributeValue().withComparisonOperator(ComparisonOperator.LT).withValue(
                  new AttributeValue().withN(String.valueOf(processTime))
          ));
  DynamoDBSaveExpression saveExpression = new DynamoDBSaveExpression()
                  .withExpected(expected);
  dynamoDBMapper.save(item, saveExpression);
  </code></pre>
  
  <p>However, this does not work if there isnt an existing item in the table with the same primary key since in that case the value of <code>lastProcessTime</code> is <code>null</code>. </p>
  
  <p>How do i achieve what i need here?</p>