Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: built-in operations IncrementFrom and IncrementSet #592

Closed
nunomaduro opened this issue Jun 30, 2020 · 0 comments · Fixed by #600
Closed

feat: built-in operations IncrementFrom and IncrementSet #592

nunomaduro opened this issue Jun 30, 2020 · 0 comments · Fixed by #600

Comments

@nunomaduro
Copy link

nunomaduro commented Jun 30, 2020

TL DR: Update API Client types so both IncrementFrom and IncrementSet can be used for built-in operations.

The built-in operations IncrementFrom and IncrementSet guarantee that the update will be idempotent, as those operations will force the update to be rejected if applied more than once.

    index.partialUpdateObject({
      version: {
        _operation: 'IncrementFrom',
        value: 2,
      },
      objectID: 'myID',
    })
    .then(({ objectIDs }) => {
      console.log(objectIDs);
    });

Internal specs issue: #127

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant