@getanthill/datastore
Version:
Event-Sourced Datastore
31 lines (27 loc) • 465 B
YAML
- type: fetch
model: accounts
query:
_fields:
account_id: 1
version: 1
destination: account
as_entity: true
- type: fetch
model: accounts
source: events
destination: events
map:
- from: account.account_id
to: account_id
- type: op
path: events
func: length
destination: events_count
- type: op
func: max
path: events
destination: events_max
args:
- path: version
default: 0
args_as_array: true