我正在使用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'
}