我正在使用DocumentClient(http://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/DynamoDB/DocumentClient.html)來更輕鬆地使用DynamoDB。但是,它好像在使用Date對象時遇到問題。我知道DynamoDB需要格式化爲特定日期的日期Date (as ISO8601 millisecond-precision string, shifted to UTC)
。AWS DynamoDB DocumentClient可以處理本機JavaScript Date對象嗎?
是否DocumentClient不處理這個問題,或者是否有需要在Date對象上設置的東西?
現在,我剛剛通過toString()
將該值轉換爲字符串。 expires_at
的值具體爲:
這個不包含expires_at
在DyanmoDB Item中。
{
Item:
{
id: 'session',
credentials:
{
access_token: '',
refresh_token: '',
token_type: 'Bearer',
expires_in: 3599,
expires_at: 2017-04-17T18:48:03.608Z
}
},
TableName: 'table'
}
而這其中將包括它:
{
Item:
{
id: 'session',
credentials:
{
access_token: '',
refresh_token: '',
token_type: 'Bearer',
expires_in: 3599,
expires_at: 'Mon Apr 17 2017 18:50:24 GMT+0000 (UTC)'
}
},
TableName: 'table'
}