Namespace: Databases-Events

Databases.Databases-Events

Events database is an immutable, append-only event log database.

Source:

Extends

Methods

(async) add(value) → {string}

Adds an event to the store.

Parameters:
Name Type Description
value *

The event to be added.

Source:
Returns:

The hash of the new oplog entry.

Type
string

(async) all()

Returns all events.

Source:
Returns:

[][string, string] An array of events as hash/value entries.

(async) get(hash) → {*}

Gets an event from the store by hash.

Parameters:
Name Type Description
hash string

The hash of the event to get.

Source:
Returns:

The value corresponding to hash or null.

Type
*

(async, generator) iterator(filtersopt)

Iterates over events.

Parameters:
Name Type Attributes Default Description
filters Object <optional>
{}

Various filters to apply to the iterator.

Properties
Name Type Attributes Default Description
gt string <optional>

All events which are greater than the given hash.

gte string <optional>

All events which are greater than or equal to the given hash.

lt string <optional>

All events which are less than the given hash.

lte string <optional>

All events which are less than or equal to the given hash.

amount string <optional>
-1

The number of results to fetch.

Source:
Yields:
[string, string] The next event as hash/value.