Skip to content

Support for increment #58

Description

@fwal

There is no increment sentinel in the library — ArrayUnion, ArrayRemove, and Delete exist as sentinel classes, but atomic counter updates require dropping to the raw SDK's FieldValue.increment().

Motivation

Atomic increments are a common Firestore pattern (counters, balances, usage tracking), and today every use forces a raw getFirestore().update(...) escape hatch outside the typed repository layer.

Suggested shape

Following the existing sentinel pattern:

  • An Increment sentinel class + increment(n) constructor alongside the existing field sentinels
  • Converter support in the admin and client layers mapping it to FieldValue.increment(n)
  • A Firestore.WithIncrementField (or similar) model helper in the style of WithArrayFields, so the sentinel is accepted on number fields in the update variant and flows through Repository.update with full typing

Metadata

Metadata

Assignees

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions