UNPKG

eventric-store-lowdb

Version:
112 lines (55 loc) 2.4 kB
## eventric LowDB Store Adapter [![Build Status](https://travis-ci.org/efacilitation/eventric-store-lowdb.svg?branch=master)](https://travis-ci.org/efacilitation/eventric-store-lowdb) ## API ### initialize(contextName, options, callback) `contextName` String Name of the context for which the store is responsible `callback(error)` * `error` null or Error if one happened ### saveDomainEvent(domainEvent, callback) `domainEvent` The DomainEvent to be stored `callback(error, domainEvents)` * `error` null or Error if one happened * `domainEvents` The stored domainEvents in an array ### findAllDomainEvents(callback) Finds all DomainEvents in the Store `callback(error, domainEvents)` * `error` null or Error if one happened * `domainEvents` The domainEvents found ### findDomainEventsByName(domainEventName, callback) Finds DomainEvents with the given Name in Store `name` String|Array Name, or array of names, of the DomainEvent `callback(error, domainEvents)` * `error` null or Error if one happened * `domainEvents` The domainEvents found ### findDomainEventsByAggregateId(aggregateId, callback) Finds DomainEvents with the given AggregateId in Store `aggregateId` String|Array Id, or array of ids, of the Aggregate `callback(error, domainEvents)` * `error` null or Error if one happened * `domainEvents` The domainEvents found ### findDomainEventsByAggregateName(aggregateName, callback) Finds DomainEvents with the given AggregateName in the Store `aggregateName` String|Array Name, or array of names, of the Aggregate `callback(error, domainEvents)` * `error` null or Error if one happened * `domainEvents` The domainEvents found ### getProjectionStore(projectionName, callback) callbacks with a mongodb collection which can be used for a projection `projectionName` Name of the Projection for which a projectionStore should be returned `callback(error, projectionStore)` * `error` null or Error if one happened * `projectionStore` MongoDb Collection Projection Store ### clearProjectionStore(projectionName, callback) -> clears the projectionStore with the given name `projectionName` Name of the Projection which should be cleared `callback(error, result)` * `error` null or Error if one happened * `result` Result of the dropCollection call ## Running Tests Install dependencies ``` npm install ``` Execute specs and watcher ``` gulp ```