1

I'm new to Dynamo Db. And my Application says I need to write a program in which two attributes must be compared by their date values. I used GSI for this but what I found was, using GSI I can query all the attributes but separately. But I have to compare two different attributes by their date values so that I can move forward in my application for further. Thank you :)

Kishore Kumar Korada
  • 1,204
  • 6
  • 22
  • 47
  • Cant you use the normal Condition operators offered by DynamoDB? – Abhiroop Sarkar Sep 23 '14 at 11:16
  • Thank you for your help but operators offered by Dynamo Db is limited. And I'm using operators but How can compare two attributes in a table because using hash key I'm able to partition items and with range key I'm to query only on that particular range key attribute. I'm new to this so if I'm wrong please let me know :) – Kishore Kumar Korada Sep 23 '14 at 11:44

1 Answers1

4

You can not compare two attributes. DynamoDB conditions are bound to an attribute. You will have to write this condition in application level

Chen Harel
  • 9,684
  • 5
  • 44
  • 58
  • I feel your pain. As a precursor to "making the work lighter", you can exclude an item if either or both of the attributes with a FilterExpression='attribute_not_exists(firstcomparison_date)'. Another suggestion would be to reserve a third attribute and have a precursory run at the data with strictly comparison logic to flag which items need attention. – Patrick Scott Best Mar 02 '22 at 21:13