@constl/multi-db
v0.1.0
Published
Multi-type database type for orbit-db.
Downloads
1,001
Readme
@orbitdb/multi-db
Multi-type database type for OrbitDB.
Installation
$ pnpm add @orbitdb/multi-dbIntroduction
As Multi database is like a Nested database, but it can contain other sub-database types such as a Set, a Feed, an Event store or even your own custom database type.
Note: While Nested, KeyValue, and OrderedKeyvalue databases can technically be included as subdatabases of a Multi database, this is not necessary or recommended in practice because the Multi database already provides all functionalities (key-value pairs, nested key-value pairs and key (re-)ordering) present in these database types.
Examples
Note: as Multi is a superset of Nested, all methods documented in the latter are also available on Multi databases.
A simple example with Multi:
import { createOrbitDB, useDatabaseType } from "@orbitdb/core";
import { Multi } from "@orbitdb/multi-db";
// Register multi database type. IMPORTANT - must call before creating orbit instance !
useDatabaseType(Multi);
