![](/img/trans.png)
[英]Getting Error While Inserting JSON data to DynamoDB using Python
[英]dynamodb getting issue on getting attributes
我想在我的 dynamo 查詢中獲取特定屬性(列)並出現錯誤。
table = get_dynamodb_table()
response = table.query(
AttributesToGet=["USER_ID","NODE_TYPE"],
IndexName='GSI3',
KeyConditionExpression="GSI3_ACCOUNT_PK = 2 AND GSI3_UPDATED_ON BETWEEN 1231231 AND123")
但是當我嘗試運行它時,我收到了這個錯誤
botocore.exceptions.ClientError: An error occurred (ValidationException) when calling the Query operation: Can not use both expression and non-expression parameters in the same request: Non-expression parameters: {AttributesToGet} Expression parameters: {KeyConditionExpression}
嘗試改用ProjectionExpression
。 正如https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.AttributesToGet.html中的文檔所解釋的那樣, AttributesToGet
是一種較舊的樣式,無法與較新的表達式功能結合使用。 這就是錯誤的意思。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.