I want to make an update but the conditional check I want to add is not based on the Hash/Range of the primary table but of a GSI.
Effectively, I want to fail the save if a given attribute (i.e. GSI's hash) already exists.
As an example, in an imaginary employees table, “SSN” is the hash key and there is a GSI on “EmployeeId”. Both of these attributes need to be unique all around. While saving an employee, I want to make sure that neither of “SSN” or “EmployeeId” is already in use in the table. I can do it for Hash of the table i.e. SSN but not for Hash of the GSI.
Is it supported? I did not see that in the documentation.
Thanks!