# bumbledb

> Embedded, file-based database with MongoDB-like API for Node.js

Latest version **0.11.0** (published 2026-02-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install bumbledb
pnpm add bumbledb
yarn add bumbledb
bun add bumbledb
```

## Health

**Score 60/100 (C)** — status: stable.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.11.0 |
| Published | 2026-02-27 |
| First published | 2019-10-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM |
| Dependencies | 1 |
| Unpacked size | 21.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | BumbleDev |
| Maintainers | bumbledev |
| Keywords | database, datastore, db, embedded, lokijs, mongodb, nedb, nosql, tingodb |

## Links

- npm: https://www.npmjs.com/package/bumbledb
- Repository: https://github.com/Ricki-BumbleDev/bumbledb
- Homepage: https://github.com/Ricki-BumbleDev/bumbledb#readme
- Issues: https://github.com/Ricki-BumbleDev/bumbledb/issues
- npm.io page: https://npm.io/package/bumbledb

## Dependencies (1)

- [lodash.get](https://npm.io/package/lodash.get.md) ^4.4.2

## Alternatives

- [angular-pipes](https://npm.io/package/angular-pipes.md) — 5.6K weekly downloads
- [@ng-web-apis/midi](https://npm.io/package/@ng-web-apis/midi.md) — 2.6K weekly downloads
- [happn-3](https://npm.io/package/happn-3.md) — 1.6K weekly downloads
- [@opensip-cli/lang-go](https://npm.io/package/@opensip-cli/lang-go.md) — 1.2K weekly downloads
- [mongoose-typescript](https://npm.io/package/mongoose-typescript.md) — 85 weekly downloads

## Recent versions

- 0.11.0 (latest) — 2026-02-27
- 0.10.0 — 2023-11-28
- 0.9.0 — 2023-11-28
- 0.8.0 — 2023-11-28
- 0.7.0 — 2023-11-28
- 0.6.0 — 2023-10-31
- 0.5.2 — 2023-10-31
- 0.5.1 — 2023-10-31
- 0.5.0 — 2023-10-31
- 0.4.0 — 2023-01-27
- 0.3.0 — 2021-01-10
- 0.2.0 — 2020-10-16
- 0.1.1 — 2019-10-11
- 0.1.0 — 2019-10-06

## README

# BumbleDB

Embedded, file-based database with MongoDB-like API for Node.js

## Getting started

```ts
import initializeDb from 'bumbledb';

const dataDirectory = process.env.DATA_DIRECTORY ?? '.data';

const db = await initializeDb(dataDirectory);

const someDocument = { id: 1, name: 'Meredith', country: 'US' };
await db.collection('users').insertOne(someDocument);

const result = await db.collection('users').find({}).toArray();
console.log(result);
```

## Insert data

### `insertOne`

```ts
const someDocument = { id: 1, name: 'Meredith', country: 'US' };
await db.collection('users').insertOne(someDocument);
```

### `insertMany`

```ts
const someDocuments = [
  { id: 1, name: 'Meredith', country: 'US' },
  { id: 2, name: 'Monika', country: 'DE' }
];
await db.collection('users').insertMany(someDocuments);
```

## Query data

### `findOne`

```ts
const result = await db.collection('users').findOne({ id: 5 });
```

### `find`

Get all documents

```ts
const result = await db
  .collection('users')
  .find({})
  .toArray();
```

Get documents matching query

```ts
const result = await db
  .collection('users')
  .find({ name: 'Monika', country: 'DE' })
  .toArray();
```

Query using nested attributes

```ts
const result = await db
  .collection('users')
  .find({ 'address.country': 'DE' })
  .toArray();
```

Stream results with async iteration

```ts
for await (const user of db.collection('users').find({ country: 'DE' })) {
  console.log(user);
}
```

## Update data

### `update`

```ts
const newDocument = { id: 1, name: 'users', country: 'US' };
await db.collection('users').update({ id: 1 }, newDocument);
```

## Delete data

### `delete`

```ts
const affected = await db.collection('users').delete({ id: 1 });
```

## Drop data

### Drop a collection

```ts
await db.collection('users').drop();
```

### Drop the database

```ts
await db.drop();
```

## List collections

### `collections`

```ts
const names = await db.collections();
// ['users', 'posts']
```

---
_Source: https://npm.io/package/bumbledb · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
