@casual-simulation/causal-tree-store-mongodb
v3.2.1-alpha.5649263218
Published
A causal tree store that interfaces with MongoDB
Downloads
175
Readme
Causal Tree Store MongoDB
A causal repo store that interfaces with MongoDB.
Usage
Create a MongoDB Causal Repo Store
import { MongoDBRepoStore } from '@casual-simulation/causal-tree-store-mongodb';
import { MongoClient } from 'mongodb';
MongoClient.connect('mongodb://127.0.0.1:27017', client => {
const db = client.db('my_db');
const objects = db.collection('objects');
const heads = db.collection('heads');
const store = new MongoDBRepoStore(objects, heads);
store.init().then(() => {
// TODO: Store or create objects and heads
});
});