# sharedb-mingo-memory

> In-memory database adapter with MongoDB API for ShareDB

Latest version **5.0.3** (published 2026-11-12) · MIT license · 0 weekly downloads

## Install

```sh
npm install sharedb-mingo-memory
pnpm add sharedb-mingo-memory
yarn add sharedb-mingo-memory
bun add sharedb-mingo-memory
```

## Health

**Score 55/100 (C)** — status: active.

Positive: no vulnerabilities; recently updated; high maintenance score.

Warnings: low downloads; no types; no esm support.

## Facts

| | |
|---|---|
| Version | 5.0.3 |
| Published | 2026-11-12 |
| First published | 2016-04-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 34.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5 |
| Author | Avital Oliver |
| Maintainers | nateps, avital, pypmannetjies, ericyhwang, alecgibson |

## Links

- npm: https://www.npmjs.com/package/sharedb-mingo-memory
- Repository: https://github.com/share/sharedb-mingo-memory
- Homepage: https://github.com/share/sharedb-mingo-memory#readme
- Issues: https://github.com/share/sharedb-mingo-memory/issues
- npm.io page: https://npm.io/package/sharedb-mingo-memory

## Dependencies (3)

- [mingo](https://npm.io/package/mingo.md) ^6.1.0 || ^7.0.0
- [lodash.isobject](https://npm.io/package/lodash.isobject.md) ^3.0.2
- [lodash.clonedeep](https://npm.io/package/lodash.clonedeep.md) ^4.5.0

## Recent versions

- 5.0.3 (latest) — 2026-11-12
- 5.0.2 — 2026-10-22
- 5.0.1 — 2026-08-24
- 5.0.0 — 2026-06-23
- 4.1.0 — 2025-06-10
- 4.0.1 — 2024-10-15
- 4.0.0 — 2024-06-25
- 3.0.2 — 2024-05-17
- 3.0.1 — 2024-04-02
- 3.0.0 — 2023-05-16
- 2.1.2 — 2023-01-05
- 2.1.1 — 2022-11-08
- 2.1.0 — 2022-08-09
- 2.0.0 — 2022-05-03
- 1.2.0 — 2021-10-05
- … 27 more at https://npm.io/package/sharedb-mingo-memory/versions

## README

# ShareDBMingo

  [![NPM Version](https://img.shields.io/npm/v/sharedb-mingo-memory.svg)](https://npmjs.org/package/sharedb-mingo-memory)
  [![Test](https://github.com/share/sharedb-mingo-memory/actions/workflows/test.yml/badge.svg)](https://github.com/share/sharedb-mingo-memory/actions/workflows/test.yml)
  [![Coverage Status](https://coveralls.io/repos/github/share/sharedb-mingo-memory/badge.svg?branch=main)](https://coveralls.io/github/share/sharedb-mingo-memory?branch=main)

A database adapter for [sharedb](https://github.com/share/sharedb)
that implements a subset of Mongo operations using an in-memory
database. This adapter can be useful for running application tests
faster by not requiring a full database. It is also used by tests for
sharedb itself.

## Usage

```js
var ShareDBMingo = require('sharedb-mingo-memory');
var db = new ShareDBMingo();
```

Another form is useful at times:
`ShareDBMingo.extendMemoryDB(MemoryDB)`.  This creates a new
ShareDBMingo class that extends from a particular MemoryDB class, in
case there are more than one available. This is particularly important
to ensure sharedb tests aren't testing the version of sharedb being
used by sharedb-mingo-memory.

## Queries

sharedb-mingo-memory uses [mingo](https://github.com/kofrasa/mingo)
and supports the same queries mingo supports. In addition, some special
top-level fields are supported, and map to Mongo cursor methods:
* `$orderby` (TODO: rename to `$sort`)
* `$skip`
* `$limit`
* `$count`

Other special operators that are supported in sharedb-mongo such as
`$mapReduce` and `$aggregate` aren't supported and will throw an error
if used.

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