Skip to content

Conversation

@dfahlander
Copy link
Collaborator

@dfahlander dfahlander commented Mar 29, 2024

  • number or bigint properties (add/subtract)
  • array properties (treating array as a set)

Mathematical addition Example

import { add } from "dexie";
db.friends.update(1, {
  age: add(1)
});
// Equivalent to:
db.friends.update(1, friend => ++friend.age);
// ...but works consistently in sync

Set addition Example

import { add } from "dexie";
db.friends.update(1, {
  interests: add(["football"])
});
// Equivalent to:
db.friends.update(1, friend => friend.interests = [...friend.interests, "football"].sort());
// ...but works consistently in sync

Checklist

  • Unit tests
  • Implementation
  • Support in Dexie Cloud Server (version 1.6.0)
  • Update documentation of Consistency in Dexie Cloud
  • Add documentation of replacePrefix()
  • Add documentation of add()
  • Add documentation of remove()
  • Update documentation of Collection.modify()
  • Update documentation of Table.update()

* number or bigint properties (add/subtract)
* array properties (treating array as a set)
@dfahlander dfahlander marked this pull request as ready for review May 24, 2024 14:51
@dfahlander dfahlander merged commit 1430bd1 into master May 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done
Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants