import type { Db } from 'mongodb'; import type { IContainer } from 'node-cqrs'; import type { IObjectStorage, Identifier } from '../interfaces/index.ts'; import { AbstractMongoAccessor } from './AbstractMongoAccessor.ts'; /** * MongoDB-backed implementation of IObjectStorage. * * Each record is stored as a document `{ _id, data, version }`. * The version field enables optimistic concurrency control: `update` and * `updateEnforcingNew` re-read the record after the user callback runs and * atomically commit only when the version still matches. * On mismatch the operation retries up to `maxRetries` times. */ export declare class MongoObjectStorage extends AbstractMongoAccessor implements IObjectStorage { #private; constructor(o: Partial> & { tableName: string; maxRetries?: number; }); protected initialize(db: Db): Promise; get(id: Identifier): Promise; create(id: Identifier, data: TRecord): Promise; update(id: Identifier, update: (r: TRecord) => TRecord): Promise; updateEnforcingNew(id: Identifier, update: (r?: TRecord) => TRecord): Promise; delete(id: Identifier): Promise; }