The read model's cache of an entity's state
attribute | type | description |
|
| ID of the entity |
|
| Version number of the projection |
|
| An arbitrary object containing the entity's state |
get(id)
Retrieve the stored projection for a given entity.
attribute | type | description |
|
| (required) the ID of the entity |
projection
set(id, { version, state })
Set the projection state for a given entity.
attribute | type | description |
|
| (required) the ID of the entity |
|
| (required) the version of the projection |
|
| (required) an arbitrary object containing the entity state |
null
batchGet([ ...ids ])
Fetch multiple projections at once
attribute | type | description |
|
| (required) the IDs of entities to fetch |
[ projections ]
(array of projections) - the projections (if they exist)
batchWrite({ id: { version, state }, id: { version, state }, ... })
Set multiple projections at once
attribute | type | description |
|
| (required) the ID of the entity |
|
| (required) the version of the projection |
|
| (required) an arbitrary object containing the entity state |
search(params)
Search for projections
attribute | type | description |
|
| (required) an arbitrary object of search params |
{ total, data }
attribute | type | description |
| integer | (required) the total number of records found |
|
| (required) an array of projection objects |