https://github.com/tonyfromundefined/nact-persistence-mongodb
🐠 A MongoDB persistence plugin for NAct
https://github.com/tonyfromundefined/nact-persistence-mongodb
actor-model cqrs ddd event-sourcing mongodb nact
Last synced: 4 months ago
JSON representation
🐠 A MongoDB persistence plugin for NAct
- Host: GitHub
- URL: https://github.com/tonyfromundefined/nact-persistence-mongodb
- Owner: tonyfromundefined
- Created: 2022-12-27T09:03:53.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2022-12-27T09:30:20.000Z (almost 3 years ago)
- Last Synced: 2025-05-28T13:42:28.894Z (5 months ago)
- Topics: actor-model, cqrs, ddd, event-sourcing, mongodb, nact
- Language: TypeScript
- Homepage:
- Size: 39.6 MB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README

# nact-persistence-mongodb

A MongoDB persistence plugin for [NAct](https://nact.xyz/).
## Usage
```typescript
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
}),
),
);
```## References
- [`nact`](https://nact.xyz/)
- [`nact-persistence-postgres`](https://github.com/ncthbrt/nact-persistence-postgres)
- [`mongodb`](https://www.mongodb.com/docs/drivers/node/current/)