sm
@jerni/store-mongo
npm i @jerni/store-mongo
sm

@jerni/store-mongo

Components for building event-sourced, CQRS systems

by Tung Vu

1.1.1 (see all)License:MITTypeScript:Not Found
npm i @jerni/store-mongo
Readme

@jerni/store-mongo

Transform events provided by jerni and persist the output to a MongoDB Database.

Installation

> npm i jerni @jerni/store-mongo

or, for yarn user

> yarn add jerni @jerni/store-mongo

Usage

Before you start, please make yourself comfortable with the concept of jerni architecture

Create a JavaScript file as follow (given it's located at src/journey.js)

// src/journey.js
const createJourney = require("jerni");
const { makeStore } = require("@jerni/store-mongo");

// an example journey initializer
// for more examples, please visit: https://github.com/tungv/jerni/tree/master/examples
// for API documentations: please visit: https://docs.jerni.dev
module.exports = async function() {
  const mongoStore = await makeStore({
    name: "your store name",
    url: "mongodb://<...hostname...>:<...port...>",
    dbName: "database name",
    models: [
      collection1, // see more about models below
      collection2,
    ],
  });

  // at this point, mongoStore is ready to use

  const journey = createJourney({
    writeTo: "http://localhost:6181",
    stores: [store],
  });

  return journey;
};

Downloads/wk

41

GitHub Stars

28

LAST COMMIT

1yr ago

MAINTAINERS

1

CONTRIBUTORS

4

OPEN ISSUES

0

OPEN PRs

35
VersionTagPublished
1.1.1
latest
1yr ago
1.0.0-rc.7
next
2yrs ago
No alternatives found
No tutorials found
Add a tutorial
No dependencies found

Rate & Review

100
No reviews found
Be the first to rate