MongoDB Atlas

@crvouga/mockingbird-service-mongoatlas

Stateful MongoDB Atlas public vendor API emulator with native namespaces, checkpoints and test controls.

Parity: Vendor API workflows compared with the pinned Emulate package oracleInfrastructure24 of 24 operationsIn-process fetchNode servermockingbird-mongoatlas
$
npm install -D @crvouga/mockingbird-service-mongoatlas

Playground

Requests go to the real emulator running in this tab. State persists across requests, and the journal shows what it received. A green dot marks operations whose sample succeeds as-is; others need ids from earlier responses.

Loads the real @crvouga/mockingbird-service-mongoatlas into this tab on first send
https://cloud.mongodb.com

Send a request to see the emulator's response.

Operations

24 of 24 operations in the vendored contract are emulated.

MethodPathOperationStatus
GET/api/atlas/v2/groups/{groupId}GET /api/atlas/v2/groups/:groupIdGET /api/atlas/v2/groups/:groupId
DELETE/api/atlas/v2/groups/{groupId}DELETE /api/atlas/v2/groups/:groupIdDELETE /api/atlas/v2/groups/:groupId
GET/api/atlas/v2/groups/{groupId}/clusters/{clusterName}GET /api/atlas/v2/groups/:groupId/clusters/:clusterNameGET /api/atlas/v2/groups/:groupId/clusters/:clusterName
PATCH/api/atlas/v2/groups/{groupId}/clusters/{clusterName}PATCH /api/atlas/v2/groups/:groupId/clusters/:clusterNamePATCH /api/atlas/v2/groups/:groupId/clusters/:clusterName
DELETE/api/atlas/v2/groups/{groupId}/clusters/{clusterName}DELETE /api/atlas/v2/groups/:groupId/clusters/:clusterNameDELETE /api/atlas/v2/groups/:groupId/clusters/:clusterName
GET/api/atlas/v2/groups/{groupId}/databaseUsers/admin/{username}GET /api/atlas/v2/groups/:groupId/databaseUsers/admin/:usernameGET /api/atlas/v2/groups/:groupId/databaseUsers/admin/:username
DELETE/api/atlas/v2/groups/{groupId}/databaseUsers/admin/{username}DELETE /api/atlas/v2/groups/:groupId/databaseUsers/admin/:usernameDELETE /api/atlas/v2/groups/:groupId/databaseUsers/admin/:username
GET/api/atlas/v2/groupsGET /api/atlas/v2/groupsGET /api/atlas/v2/groups
POST/api/atlas/v2/groupsPOST /api/atlas/v2/groupsPOST /api/atlas/v2/groups
GET/api/atlas/v2/groups/{groupId}/clustersGET /api/atlas/v2/groups/:groupId/clustersGET /api/atlas/v2/groups/:groupId/clusters
POST/api/atlas/v2/groups/{groupId}/clustersPOST /api/atlas/v2/groups/:groupId/clustersPOST /api/atlas/v2/groups/:groupId/clusters
GET/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/databasesGET /api/atlas/v2/groups/:groupId/clusters/:clusterName/databasesGET /api/atlas/v2/groups/:groupId/clusters/:clusterName/databases
GET/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/databases/{databaseName}/collectionsGET /api/atlas/v2/groups/:groupId/clusters/:clusterName/databases/:databaseName/collectionsGET /api/atlas/v2/groups/:groupId/clusters/:clusterName/databases/:databaseName/collections
GET/api/atlas/v2/groups/{groupId}/databaseUsersGET /api/atlas/v2/groups/:groupId/databaseUsersGET /api/atlas/v2/groups/:groupId/databaseUsers
POST/api/atlas/v2/groups/{groupId}/databaseUsersPOST /api/atlas/v2/groups/:groupId/databaseUsersPOST /api/atlas/v2/groups/:groupId/databaseUsers
POST/app/data-api/v1/action/aggregatePOST /app/data-api/v1/action/aggregatePOST /app/data-api/v1/action/aggregate
POST/app/data-api/v1/action/deleteManyPOST /app/data-api/v1/action/deleteManyPOST /app/data-api/v1/action/deleteMany
POST/app/data-api/v1/action/deleteOnePOST /app/data-api/v1/action/deleteOnePOST /app/data-api/v1/action/deleteOne
POST/app/data-api/v1/action/findPOST /app/data-api/v1/action/findPOST /app/data-api/v1/action/find
POST/app/data-api/v1/action/findOnePOST /app/data-api/v1/action/findOnePOST /app/data-api/v1/action/findOne
POST/app/data-api/v1/action/insertManyPOST /app/data-api/v1/action/insertManyPOST /app/data-api/v1/action/insertMany
POST/app/data-api/v1/action/insertOnePOST /app/data-api/v1/action/insertOnePOST /app/data-api/v1/action/insertOne
POST/app/data-api/v1/action/updateManyPOST /app/data-api/v1/action/updateManyPOST /app/data-api/v1/action/updateMany
POST/app/data-api/v1/action/updateOnePOST /app/data-api/v1/action/updateOnePOST /app/data-api/v1/action/updateOne

Documentation

The package README, the same file that ships in the npm tarball.Edit on GitHub

Local emulators. Real API contracts. Part of Mockingbird.

Atlas Admin API v2 (projects, clusters, database users, databases, collections), Atlas Data API v1 (findOne, find, insertOne, insertMany, updateOne, updateMany, deleteOne, deleteMany, aggregate). Runs through Mockingbird's portable Fetch runtime with SQLite persistence, namespaces, checkpoints, faults and admin controls.

Install

Shell
npm install @crvouga/mockingbird-service-mongoatlas

Usage

TypeScript
import { createServer } from "@crvouga/mockingbird-service-mongoatlas/server"

const server = await createServer({ seed: 1 })

// Atlas publishes no JavaScript SDK for the Admin API, so the application calls it over HTTP.
// Only the base URL changes: the emulator instead of https://cloud.mongodb.com.
const atlas = (path: string) =>
  fetch(`${server.url}/api/atlas/v2${path}`, {
    headers: { accept: "application/vnd.atlas.2025-03-12+json", authorization: "Bearer mock_atlas_token" },
  })
const projects = (await (await atlas("/groups")).json()) as { results: { id: string; name: string }[] }
const clusters = await atlas(`/groups/${projects.results[0]?.id}/clusters`)
console.log(projects.results[0]?.name, clusters.status) // Project0 200

await server.close()

API

  • MongoAtlasAPI: portable provider instance; accepts SQLite, namespace, clock, fixtures and baseUrl.
  • createRuntime: shared runtime, including native namespace and checkpoint controls.
  • MONGOATLAS_NAMESPACE: default storage namespace.
  • document, operationIds, supportedOperationIds: registered provider route inventory.
  • createServer, DEFAULT_PORT, serveTarget from /server: loopback listener and CLI configuration.

fixtures accepts synthetic provider seed records. reset() restores defaults. Emulate 0.12.1 is a test oracle only, never a runtime dependency. Vendor handlers ported under Apache-2.0 retain their license and attribution; see LICENSE_EMULATE and THIRD_PARTY_NOTICES.md.

See SUPPORT.md for coverage and limits and API_EVIDENCE.md for validation status.

↑↓ to navigate↵ to open