A MongoDB persistence plugin for NAct.
import { MongoClient } from "mongodb";
import { MongoDBPersistenceEngine } from "nact-persistence-mongodb";
const mongoClient = new MongoClient("...");
const system = start(
configurePersistence(
new MongoDBPersistenceEngine(mongoClient, {
dbName: "...", // optional
dbOptions: { ... }, // optional
eventsCollectionName: "nact_events", // optional
eventsCollectionOptions: { ... }, // optional
snapshotsCollectionName: "nact_snapshots", // optional
snapshotsCollectionOptions: { ... }, // optional
}),
),
);