Why is there no **not equal** comparison in DynamoDB queries?

前端 未结 1 1821
盖世英雄少女心
盖世英雄少女心 2021-01-02 00:18

I try to query my table Tinpon with a secondary index yielding a partition-key category and sort-key tinponId. My goal is

相关标签:
1条回答
  • 2021-01-02 01:03

    The KeyConditionExpression doesn't allow not equals for the sort key. However, you can use the "Not Equals i.e. <>" in FilterExpression.

    KeyConditionExpression : 'category = :category',    
    FilterExpression : 'tinponId  <> :tinponIdVal',
    ExpressionAttributeValues : {
        ':category' : 'somevalue',
        ':tinponIdVal' :  'somevalue'
    }
    
    0 讨论(0)
提交回复
热议问题