Module: Database

Database is the base class for OrbitDB data stores and handles all lower level add operations and database sync-ing using IPFS.

Source:

Methods

(async) Database(params) → {module:Databases~Database}

Creates an instance of Database.

Parameters:
Name Type Description
params Object

One or more parameters for configuring Database.

Properties
Name Type Attributes Default Description
ipfs IPFS

An IPFS instance.

identity Identity <optional>

An Identity instance.

address string <optional>

The address of the database.

name string <optional>

The name of the database.

access module:AccessControllers <optional>

An AccessController instance.

directory string <optional>

A location for storing Database-related data. Defaults to ./orbitdb/[params.address].

meta * <optional>
{}

The database's metadata.

headsStorage module:Storage <optional>

A compatible storage instance for storing log heads. Defaults to ComposedStorage.

entryStorage module:Storage <optional>

A compatible storage instance for storing log entries. Defaults to ComposedStorage.

indexStorage module:Storage <optional>

A compatible storage instance for storing an index of log entries. Defaults to ComposedStorage.

referencesCount number <optional>
16

The maximum distance between references to other entries.

syncAutomatically boolean <optional>
false

If true, sync databases automatically. Otherwise, false.

onUpdate function <optional>

A function callback. Fired when an entry is added to the oplog.

Source:
Returns:

An instance of Database.

Type
module:Databases~Database