dynamodb 쿼리 또는 스캔 결과에 어떤 필드를 포함 시킬지 선택할 수있는 방법이 있는지 궁금합니다. 나는 AttributesToGet에게DynamoDB에서 반환 할 필드를 선택할 수 있습니까?
def filter_ga_account_by_email(self, email):
response = Table.scan(
FilterExpression=Attr('client_email').eq(email),
AttributesToGet=['id'],
)
return response['Items']
를 사용하려고하고 지금은이 오류가 : ClientError: An error occurred (ValidationException) when calling the Scan operation: Can not use both expression and non-expression parameters in the same request: Non-expression parameters: {AttributesToGet} Expression parameters: {FilterExpression}
ClientError : 스캔 작업을 호출 할 때 오류가 발생했습니다 (ValidationException). 동일한 요청에서 표현식과 비 표현식 매개 변수를 모두 사용할 수 없습니다. 표현식이 아닌 매개 변수 : {AttributesToGet} 표현식 매개 변수 : {FilterExpression} 'btw 나는 스캔을 고소하고있다. 나는 내 코드도 업데이트 할 것이다. – Alex
내 대답을 편집했습니다. (단일 호출에서 레거시 매개 변수와 표현 매개 변수를 결합하지 마십시오. 그렇지 않으면 DynamoDB가 ValidationException 예외를 반환합니다.) –
오류 'TypeError : object .__ new __ (thread.lock) .lock .__ new __()'나는 파이썬에서도 새내기입니다. – Alex