Skip to content

Add ifChanged option to put method #1

@Rulexec

Description

@Rulexec

Without ifNotPresent key-value record will be updated even if it has the same value. For example if you have {"key":"a", "value":"42", "generationId":"001"} stored in the database and next generationId is 002, if you'll /put {"key":"a", "value":"42"}, new record {"key":"a", "value":"42", "generationId":"002"} will be created.

We need to add ifChanged option to read previous stored value and update it only if it was changed.

This option should read value from current generation, not from the next one. Else if we have value A and two requests one of which wants to write A, second one wants to write B, B is faster, writes B, responds with wasPut: true, then first one checks that there is B, writes A back and responds with wasPut: true too. Later we'll add CAS that will check value in the next generation.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions