2017-11-29 4 views
0

Ich versuche, ein Datum Attribut eines Elements in DynamoDB durch Stück Code folgenden zu aktualisieren:UnsupportedOperationException für updateItem Datum Attribut in DynamoDB

 AttributeUpdate attributeUpdates = new AttributeUpdate("workDate"); 
    Date workDate = finalMap.get(tID); 
    attributeUpdates.put(workDate); 
    PrimaryKey primaryKey = new PrimaryKey("tID", tID); 
    UpdateItemOutcome outcome = table.updateItem(primaryKey, attributeUpdates); 

Letzte Zeile, wo ich table.updateItem nenne, schenkt UnsupportedOperationException wie folgt.

Exception in thread "main" java.lang.UnsupportedOperationException: value type: class java.util.Date 

Hat jemand Ahnung, wie man das macht. Vielen Dank.

Antwort

1

DynamoDB akzeptiert keine Daten als data type. Sie müssen dieses Datum in eine Zeichenfolge konvertieren und dann das Update durchführen.

Verwandte Themen