我有一个名为Track的DynamoDb表,分区键为'id'(String),排序键为'timestamp'(Number),以毫秒为单位。每5秒插入一次数据。在
现在我想获取数据,这样结果将从每小时中获得一个项目,而不是全部。在
如何查询数据库?在
我正在使用python和boto3库。在
我的桌子是这样的:
table = dynamodb.create_table(
TableName='Track',
KeySchema=[
{
'AttributeName': 'gpsid',
'KeyType': 'HASH' # Partition key
},
{
'AttributeName': 'timestamp',
'KeyType': 'RANGE' # Sort key
}
],
AttributeDefinitions=[
{
'AttributeName': 'gpsid',
'AttributeType': 'S'
},
{
'AttributeName': 'timestamp',
'AttributeType': 'N'
}
],
ProvisionedThroughput={
'ReadCapacityUnits': 10,
'WriteCapacityUnits': 10
}
)
数据如下:
目前没有回答
相关问题 更多 >
编程相关推荐