A lightweight HTTP server that simulates the MongoDB Atlas Data API for local development and testing. Version 1.0.1 provides parity with the official Data API endpoints (find, insert, aggregate, etc.) without requiring a cloud Atlas connection. Designed for exact endpoint simulation, not production use. Release cadence is low; maintained by a single developer. Differentiator: enables offline/local testing with a real MongoDB instance instead of mocking HTTP calls or using a remote Atlas cluster.
npm install mongodb-local-data-apiNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Initializes the local Data API with programmatic setup, inserts one document into a local MongoDB, and logs the response status and body.
Use only in development or test environments. For production, use the real MongoDB Atlas Data API.
No action needed, but test your code against v1.
Use multiple `--key` flags in CLI or set `MONGODBLOCAL_KEY` for a single key. For multiple keys via environment, use programmatic setup.
Set `retryCount` to a finite number (e.g., 3) to avoid blocking indefinitely.
Run `npm install mongodb-local-data-api` and ensure MongoDB driver is installed (it's a peer dependency).
Use `import { setup } from 'mongodb-local-data-api'` instead of importing default.Start MongoDB locally (e.g., `docker run -p 27017:27017 mongo`) and verify `url` or `username`/`password`/`dbPort` options.