我尝试在创建一些帖子时自动添加时间戳。但它不适用于 appsync resolver-context-reference 的示例。
{
"version" : "2017-02-28",
"operation" : "PutItem",
"key": {
"id" : $util.dynamodb.toDynamoDBJson($util.autoId())
},
#set( $myfoo = $util.dynamodb.toMapValues($ctx.args) )
#set( $myFoo.version = $util.dynamodb.toNumber(1) )
#set( $myFoo.timestamp = $util.time.nowISO8601() )
"attributeValues" : $util.toJson($myFoo)
}