AppSync BatchPutItem error: "The number of conditions on the keys is invalid"
AppSync BatchPutItem error: "The number of conditions on the keys is invalid"
我收到错误消息:"The number of conditions on the keys is invalid" 尝试批量放置项目时。
模板
{
version: '2018-05-29',
operation: 'BatchPutItem',
tables: {
ItemTable: [
{
accountId: { S: 'f586fb14-6d80-4635-9d2e-d33a1bd49f96' },
itemId: { S: '16e89b71-271c-4ccd-81ad-55f496b15e6f' }
}
]
}
}
Table 架构
{
"AttributeDefinitions": [
{
"AttributeName": "itemId",
"AttributeType": "S"
},
{
"AttributeName": "accountId",
"AttributeType": "S"
}
],
"TableName": "ItemTable",
"KeySchema": [
{
"AttributeName": "accountId",
"KeyType": "HASH"
},
{
"AttributeName": "itemId",
"KeyType": "RANGE"
}
],
"TableStatus": "ACTIVE"
}
如果我只尝试添加其中一个密钥,我会收到缺少密钥的预期错误。如果我将 table 设置为使用单个分区键,那么它就可以工作。我还可以使用不使用 AppSync 的代码进行批量写入。
我正在本地使用无服务器 appsync/dynamodb 本地进行测试。所有其他单项查询和变异工作正常。我不确定我明白它在问什么 - 在这种情况下 "condition" 是什么?
我试过每个 table 都得到相同的结果。我在文档中没有看到任何迹象表明无法在复合键上完成批处理,但这似乎是这样。
哎呀..这是无服务器应用程序同步离线插件中的一个错误。它通过获取它正在编写的项目来模拟 return 并且有一个错误,而它不处理复合键。
我收到错误消息:"The number of conditions on the keys is invalid" 尝试批量放置项目时。
模板
{
version: '2018-05-29',
operation: 'BatchPutItem',
tables: {
ItemTable: [
{
accountId: { S: 'f586fb14-6d80-4635-9d2e-d33a1bd49f96' },
itemId: { S: '16e89b71-271c-4ccd-81ad-55f496b15e6f' }
}
]
}
}
Table 架构
{
"AttributeDefinitions": [
{
"AttributeName": "itemId",
"AttributeType": "S"
},
{
"AttributeName": "accountId",
"AttributeType": "S"
}
],
"TableName": "ItemTable",
"KeySchema": [
{
"AttributeName": "accountId",
"KeyType": "HASH"
},
{
"AttributeName": "itemId",
"KeyType": "RANGE"
}
],
"TableStatus": "ACTIVE"
}
如果我只尝试添加其中一个密钥,我会收到缺少密钥的预期错误。如果我将 table 设置为使用单个分区键,那么它就可以工作。我还可以使用不使用 AppSync 的代码进行批量写入。
我正在本地使用无服务器 appsync/dynamodb 本地进行测试。所有其他单项查询和变异工作正常。我不确定我明白它在问什么 - 在这种情况下 "condition" 是什么?
我试过每个 table 都得到相同的结果。我在文档中没有看到任何迹象表明无法在复合键上完成批处理,但这似乎是这样。
哎呀..这是无服务器应用程序同步离线插件中的一个错误。它通过获取它正在编写的项目来模拟 return 并且有一个错误,而它不处理复合键。