MongoSnapshotStore
Dieser Inhalt ist noch nicht in deiner Sprache verfügbar.
Defined in: src/persistence/snapshot-stores/MongoSnapshotStore.ts:39
SnapshotStore backed by MongoDB.
One document per (persistenceId, sequenceNr) behind a unique index, so
save at an existing sequence number overwrites in place and loadLatest is
an indexed descending read. Payloads are JSON text for the same reason as in
MongoJournal — exact round-trip fidelity over queryability the framework
does not use.
PersistenceOptions (compression, encryption) are ignored, matching the SQL
and Cassandra stores; the object-storage store is the one that honours them.
Extends
Section titled “Extends”Implements
Section titled “Implements”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new MongoSnapshotStore(
options?):MongoSnapshotStore
Defined in: src/persistence/snapshot-stores/MongoSnapshotStore.ts:45
Parameters
Section titled “Parameters”options?
Section titled “options?”MongoSnapshotStoreOptions = {}
Returns
Section titled “Returns”MongoSnapshotStore
Overrides
Section titled “Overrides”MongoStore.constructor
Methods
Section titled “Methods”close()
Section titled “close()”close():
Promise<void>
Defined in: src/persistence/LazyStore.ts:66
Best-effort teardown.
Returns
Section titled “Returns”Promise<void>
Implementation of
Section titled “Implementation of”Inherited from
Section titled “Inherited from”delete()
Section titled “delete()”delete(
persistenceId,toSeq):Promise<void>
Defined in: src/persistence/snapshot-stores/MongoSnapshotStore.ts:99
Delete snapshots up to and including toSeq. Useful for pruning.
Parameters
Section titled “Parameters”persistenceId
Section titled “persistenceId”string
number
Returns
Section titled “Returns”Promise<void>
Implementation of
Section titled “Implementation of”loadBefore()
Section titled “loadBefore()”loadBefore<
S>(persistenceId,seq,_options?):Promise<Option<Snapshot<S>>>
Defined in: src/persistence/snapshot-stores/MongoSnapshotStore.ts:89
Load the newest snapshot with sequenceNr < seq, or None.
Type Parameters
Section titled “Type Parameters”S
Parameters
Section titled “Parameters”persistenceId
Section titled “persistenceId”string
number
_options?
Section titled “_options?”PersistenceOptions
Returns
Section titled “Returns”Implementation of
Section titled “Implementation of”loadLatest()
Section titled “loadLatest()”loadLatest<
S>(persistenceId,_options?):Promise<Option<Snapshot<S>>>
Defined in: src/persistence/snapshot-stores/MongoSnapshotStore.ts:79
Load the newest snapshot for persistenceId, or None if none exist.
options.encryption is required when client-side encryption was
used at write time — the store has no other way to obtain the
master key. Stores that don’t encrypt ignore the field.
Type Parameters
Section titled “Type Parameters”S
Parameters
Section titled “Parameters”persistenceId
Section titled “persistenceId”string
_options?
Section titled “_options?”PersistenceOptions
Returns
Section titled “Returns”Implementation of
Section titled “Implementation of”save()
Section titled “save()”save<
S>(persistenceId,seq,state,_options?):Promise<Snapshot<S>>
Defined in: src/persistence/snapshot-stores/MongoSnapshotStore.ts:63
Persist a snapshot at seq — typically the seq of the latest event
applied. Optional options carry per-call preferences from the
caller (e.g. compression/encryption set on the actor). Stores that
cannot honour them silently ignore the field.
Type Parameters
Section titled “Type Parameters”S
Parameters
Section titled “Parameters”persistenceId
Section titled “persistenceId”string
number
S
_options?
Section titled “_options?”PersistenceOptions
Returns
Section titled “Returns”Promise<Snapshot<S>>
