title: Error doing update_item in DynamoDB python boto3
body: <p>I have a table in DynamoDB that holds a bunch of documents for me. The documents have the following fields: computedID (Primary partition key), publication_timestamp, displayTitle, displayText, displayUrl, producer and tags.</p>
  
  <p>I'd like to do update_item on the table, so that a record gets updated only if any of the fields publication_timestamp, displayTitle, displayText, displayUrl, producer and tags has changed. If the record is totally new it will be simply inserted in the table.</p>
  
  <p>The problem is that not all the existing documents in the table or the incoming documents have displayTitle, displayText, displayUrl and tags. They may miss any number of these fields.</p>
  
  <p>I have tried the following:</p>
  
  <pre><code>dynamodb = boto3.resource('dynamodb')
  table = dynamodb.Table('project_Incoming_Data')
  print("Sending documents to DynamoDB...")
  
  for item in Docs:
      try:
          response=table.update_item(
              Key={"computedID":item["computedID"]},
              UpdateExpression="SET publication_timestamp = :time, displayTitle= :title, displayText= :text, producer = :p, tags= :tags, displayUrl= :url, time_to_live= :ttl",
              ConditionExpression= "publication_timestamp &lt;&gt; :time OR (attribute_exists(displayTitle) AND displayTitle &lt;&gt; :title) OR (attribute_exists(displayText) AND displayText &lt;&gt; :text) OR producer &lt;&gt; :p OR (attribute_exists(tags) AND tags &lt;&gt; :tags) OR (attribute_exists(displayUrl) AND displayUrl &lt;&gt; :url)",
              ExpressionAttributeValues={
                      ":time":item["publication_timestamp"],
                      ":ttl":item["time_to_live"],
                      ":title":item["displayTitle"],
                      ":text":item["displayText"],
                      ":p":item["producer"],
                      ":tags":item["tags"],
                      ":url":item["displayUrl"]
              },
              ReturnValues="UPDATED_NEW"
              )
          print("response is: "+str(response))
      except Exception as e:
          print (e)
  print("Done with sending documents to DynamoDB")
  </code></pre>
  
  <p>I still am unable to get some of my documents into DynamoDB. The error I get is 'displayText'! I am guessing that the mechanism I have in place for making sure that the field exists on the record doesn't work for documents that don't have that field.</p>
  
  <p>Any idea how to fix this?</p>