GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - orbitdb/nested-db: Nested key-value database for OrbitDB

BranchesTags
Open more actions menu

Latest commit

 

History

102 Commits
102 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
src
src
 
 
test
test
 
 
.aegir.js
.aegir.js
 
 
.editorconfig
.editorconfig
 
 
.gitignore
.gitignore
 
 
.npmignore
.npmignore
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
eslint.config.js
eslint.config.js
 
 
package.json
package.json
 
 
pnpm-lock.yaml
pnpm-lock.yaml
 
 
pnpm-workspace.yaml
pnpm-workspace.yaml
 
 
renovate.json
renovate.json
 
 
tsconfig.build.json
tsconfig.build.json
 
 
tsconfig.json
tsconfig.json
 
 

Repository files navigation

@orbitdb/nested-db

Nested key-value database type for OrbitDB.

orbit-db-nested tests codecov

Installation

$ pnpm add @orbitdb/nested-db

Introduction

As Nested database is like a KeyValue database, but it can contain nested values that can be accessed as JSON.

Examples

A simple example with Nested:

import { createOrbitDB, useDatabaseType } from "@orbitdb/core";
import { Nested } from "@orbitdb/nested-db";

// Register nested database type. IMPORTANT - must call before creating orbit instance !
useDatabaseType(Nested);

const orbitdb = await createOrbitDB({ ipfs })

const db = await orbitdb.open({ type: "nested" });

await db.put("a", 1);
await db.put("b/c", 2);
await db.put(["b", "d"], 3)  // Alternative syntax

const all = await db.all();  // { a: 1, b: { c: 2, d: 3 } }

await db.get("b")  // { c: 2, d: 3 }

await db.del("b");
await db.all();  // { "a": 1 }

A more complex example with object types:

import { createOrbitDB, useDatabaseType } from "@orbitdb/core";
import { Nested } from "@orbitdb/nested-db";

// Register nested database type. IMPORTANT - must call before creating orbit instance !
useDatabaseType(Nested);

const orbit = await createOrbitDB({ ipfs })

const db = await orbitdb.open({ type: "nested" });

await db.insert({ a: { b: 1 }, d: 3 });
await db.insert("a", { c: 2 });

const all = await db.all();  // { a: { b: 1, c: 2}, d: 3 }

About

Nested key-value database for OrbitDB

Resources

Readme
AGPL-3.0 license

Code of conduct

Code of conduct

Contributing

Contributing
Activity
Custom properties

Stars

1 star

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.