@casual-simulation/causal-tree-store-mongodb
TypeScript icon, indicating that this package has built-in type declarations

3.2.1-alpha.5649263218 • Public • Published

Causal Tree Store MongoDB

npm (scoped)

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
    });
});

Package Sidebar

Install

npm i @casual-simulation/causal-tree-store-mongodb

Weekly Downloads

0

Version

3.2.1-alpha.5649263218

License

MIT

Unpacked Size

30.5 kB

Total Files

15

Last publish

Collaborators

  • kallyngowdyyeti
  • casualsimulation