跳转到内容
简体中文

MongoStore

此内容尚不支持你的语言。

Defined in: src/persistence/journals/MongoStore.ts:31

The MongoDB half of the store lifecycle: LazyStore handles lazy connection, one-shot preparation and ownership-aware teardown, and this layer supplies index creation as the preparation step.

Index creation is not cosmetic here the way CREATE INDEX often is. The journal’s unique compound index on (persistenceId, sequenceNr) is the optimistic-concurrency backstop — without it a racing writer silently overwrites, exactly the failure the relational backends get for free from a primary key. autoCreateIndexes: false therefore means “I have created them myself”, not “I don’t need them”, and the docs say so.

close(): Promise<void>

Defined in: src/persistence/LazyStore.ts:66

Promise<void>

LazyStore.close