Skip to content

Check why primary/secondary GSIs are using if_not_exists #300

@kr1p70n1c

Description

@kr1p70n1c

Is this still a thing with the latest version, i.e. by default you get generated UpdateExpression like this:

SET #gsi1pk = if_not_exists(#gsi1pk,:gsi1pk), #gsi1sk = if_not_exists(#gsi1sk,:gsi1sk)

I am having this issue with v0.3.5, and am wondering if this has been addressed in the latest version, where it is straight forward to not have it generated like that, and where you do not have to provide the whole UpdateExpression yourself either.

Sidenote: I have seen in an issue where they say this is not an issue and the array for composite keys fixes this, but this won't work for me (besides, I've read in latest documentation that the array for composite keys is going to be dropped in the future).

For now I am bypassing this issue by providing the UpdateExpression in the params object to the query method, i.e. instead of having this in the expression (which was generated):

... #gsi1sk = if_not_exists(#gsi1sk,:gsi1sk) ...

I replace it with:

... #gsi1sk = :gsi1sk ...

Regards

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions