# typegoose/mongodb-memory-server

Manage & spin up mongodb server binaries with zero(or slight) configuration for tests.

Repository: https://github.com/typegoose/mongodb-memory-server
Canonical: https://ross.abutalabs.com/products/mongodb-memory-server
Homepage: https://typegoose.github.io/mongodb-memory-server/
Language: TypeScript
License: MIT
License Family: permissive
Topics: mongodb, mongoose, mock, testing, testing-tools, tests
Last push: 2026-08-11T09:43:50+00:00

## Health v2 (maintenance only)
Score: 94/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 97, release rhythm 86, longevity 100
- inputs: {"age_days": 3401, "days_push": 22, "days_rel": 97, "gap_med": 18, "n_releases_24m": 20}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 2844, forks 188 (observed 2026-08-28T04:07:24.910306+00:00)

## What it is
A Node.js library that programmatically downloads and spins up real MongoDB server binaries for testing, holding data in memory with zero or minimal configuration. It supports single instances and replica sets, automatically cleaning up servers when tests finish.

## Use cases
- spin up a real mongodb server for integration tests
- run mongoose models against an in-memory mongodb in jest
- create isolated per-test mongodb instances on free ports
- mock mongodb during development without installing a local server
- test against a mongodb replica set in CI
- auto-download mongod binaries for the current OS

## When to choose
- you need real MongoDB behavior (queries, transactions, replica sets) in tests rather than a fake in-process mock
- you want zero-configuration ephemeral databases for Node.js test suites
- you use Mongoose or another ODM and need isolated integration tests
- you run tests in CI and cannot provision a persistent MongoDB service

## When to avoid
- your stack is not Node.js/TypeScript
- you only need a lightweight in-memory fake and cannot afford binary downloads or the first-run download time
- you are behind a restrictive network without proxy support for binary downloads
- you need a long-running shared MongoDB server rather than per-test instances

## Facets
- artifact type: library
- maturity: active
- function: testing, mocking, database, database-driver
- domain: testing, databases, developer-tools, backend
- platform: cross-platform, cli
- tags: mongodb, in-memory-database, integration-testing, mongoose, test-fixtures, ephemeral-database, typescript, nodejs

## Member repositories
- typegoose/mongodb-memory-server (main) score 94

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:07:24.910306+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T07:37:12.446621+00:00, confidence not recorded.
  - readme: https://github.com/typegoose/mongodb-memory-server (fetched 2026-08-28T04:07:24.910306+00:00, sha e53762c934e5)
  - homepage: https://typegoose.github.io/mongodb-memory-server/ (fetched 2026-08-29T09:52:56.171208+00:00, sha 174139aa187a)
- Data as of 2026-08-30T08:39:29.467469+00:00.
