A Node.js SDK for MongoDB Atlas Data API, providing a typed, promise-based client to interact with MongoDB via HTTP endpoints. Current stable version is 0.4.0, released as an early-stage package with monthly commits. Key differentiators: full TypeScript support, method chaining for cluster/database/collection selection, and native support for all Data API actions (CRUD, aggregation). Alternatives like the official MongoDB driver require direct database connection, while this SDK works over HTTP-only Data API, suitable for serverless or restricted network environments.
npm install mongodb-data-apiNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Initialize the client using environment variables and perform a findOne operation.
Pin to a specific version and test upgrades carefully.
Use 'urlEndpoint' instead of 'appId' when possible for clarity.
Wrap calls in try/catch and check error message for HTTP status.
Use chaining after creating API instance; see chaining example in README.
Check the actual API response and add explicit type assertions if needed.
Configure tsconfig.json properly or use .mjs extension for Node.js ESM.
Use dynamic import: const { createMongoDBDataAPI } = await import('mongodb-data-api'); or switch to ESM.Use the returned property directly (e.g., result.document) rather than result.data.
Provide either urlEndpoint or appId, not both; in newer versions both are allowed but urlEndpoint takes precedence.
No dependency data recorded yet.