DynamoDB ProjectionExpression排除属性(除一个字段外的所有字段) [英] DynamoDB ProjectionExpression exclude attribute (all fields except one)
问题描述
我有一个要求,其中我的dynamodb表具有许多属性,并且我需要在投影表达式中使用所有属性,但不需要一两个列作为响应.(我正在扫描桌子).有没有一种方法可以在ProjectionExpression中定义此方法(除此一列以外的所有方法).我已经看到了一些示例,其中ProjectionExpression仅采用所有必需",而没有采用其他方式.
I have a requirement where my dynamodb table has many attributes, and i need all of them in the projection expression except one or two columns which i dont need in response. (I am scanning the table). Is there a way how can i define this in ProjectionExpression (all except this one column). I have seen examples where ProjectionExpression only takes what all "is required" and not the other way.
推荐答案
根据文档,这是不可能的:
As per the documentation, this is not possible:
ProjectionExpression-标识一个或多个属性的字符串从表中检索.这些属性可以包括标量,集或JSON文档的元素.表达式中的属性必须以逗号分隔.如果未指定属性名称,则所有属性都将返回.
ProjectionExpression - A string that identifies one or more attributes to retrieve from the table. These attributes can include scalars, sets, or elements of a JSON document. The attributes in the expression must be separated by commas. If no attribute names are specified, then all attributes will be returned.
以下链接可帮助您更好地理解ProjectionExpression的内容:
Here is a link to help you better undestand what goes underneath the ProjectionExpression: https://medium.com/pageup-tech/dynamodb-and-projection-expressions-why-c08c40243195
这篇关于DynamoDB ProjectionExpression排除属性(除一个字段外的所有字段)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!