【问题标题】:AWS boto3 attribute_not_existsAWS boto3 attribute_not_exists
【发布时间】:2022-11-15 12:21:47
【问题描述】:
currDBraw = table.scan(
  FilterExpression=Attr('purebetId').gt(0) & "attribute_not_exists(ouline)",
  ProjectionExpression="event,homeTeam,awayTeam,startDate,purebetId" 
)

我是aws和boto3的新手,有了这个,我明白了

AND 操作不能直接应用于 <class 'str'> 类型的 value attribute_not_exists(ouline)

我不确定这意味着什么或我能做什么

【问题讨论】:

    标签: python amazon-web-services amazon-dynamodb boto3


    【解决方案1】:

    attribute_not_exists 是仅在更新/插入操作中使用的条件表达式

    ConditionExpression='attribute_not_exists(something)
    

    您需要做的只是与 null 比较

    currDBraw = table.scan(
      FilterExpression=Attr('purebetId').gt(0) & "outline = null",
      ProjectionExpression="event,homeTeam,awayTeam,startDate,purebetId" 
    )
    

    【讨论】:

      猜你喜欢
      • 2020-01-11
      • 2016-10-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-08-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多