# mongodb-atlas-data-api-sdk

> Node SDK for Mongo Atlas Data API

Latest version **1.0.5** (published 2022-01-23) · MIT license · 0 weekly downloads

## Install

```sh
npm install mongodb-atlas-data-api-sdk
pnpm add mongodb-atlas-data-api-sdk
yarn add mongodb-atlas-data-api-sdk
bun add mongodb-atlas-data-api-sdk
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 1.0.5 |
| Published | 2022-01-23 |
| First published | 2022-01-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM |
| Node | ^12.20.0 \|\| ^14.13.1 \|\| >=16.0.0 |
| Dependencies | 2 |
| Unpacked size | 11.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Michael W. Clark |
| Maintainers | michaelwclark |
| Keywords | mongodb, atlas, data, api, sdk |

## Links

- npm: https://www.npmjs.com/package/mongodb-atlas-data-api-sdk
- Repository: https://github.com/michaelwclark/mongodb-atlas-data-api-sdk
- Homepage: https://github.com/michaelwclark/mongodb-atlas-data-api-sdk#readme
- Issues: https://github.com/michaelwclark/mongodb-atlas-data-api-sdk/issues/new
- npm.io page: https://npm.io/package/mongodb-atlas-data-api-sdk

## Dependencies (2)

- [node-fetch](https://npm.io/package/node-fetch.md) ^3.2.0
- [json-colorizer](https://npm.io/package/json-colorizer.md) ^2.2.2

## Alternatives

- [angular-pipes](https://npm.io/package/angular-pipes.md) — 5.6K weekly downloads
- [@ng-web-apis/midi](https://npm.io/package/@ng-web-apis/midi.md) — 2.6K weekly downloads
- [happn-3](https://npm.io/package/happn-3.md) — 1.6K weekly downloads
- [@opensip-cli/lang-go](https://npm.io/package/@opensip-cli/lang-go.md) — 1.2K weekly downloads
- [mongoose-typescript](https://npm.io/package/mongoose-typescript.md) — 85 weekly downloads

## Recent versions

- 1.0.5 (latest) — 2022-01-23
- 1.0.3 — 2022-01-23
- 1.0.2 — 2022-01-23
- 1.0.1 — 2022-01-23
- 1.0.0 — 2022-01-23

## README

# mongodb-atlas-data-api-sdk
Node SDK for Mongo Atlas Data API

Mongo Atlas recently released a Beta version of a Data API. Using this API you can access your MongoDB commands via API. This SDK attempts to make that as simple as possible.

## API Documentation
[Mongo Atlas Data API - BETA](https://docs.atlas.mongodb.com/api/data-api/)

[Resources](https://docs.atlas.mongodb.com/api/data-api-resources/)

## Examples
For examples of how to use the SDK see [this repository](https://github.com/michaelwclark/mongodb-atlas-data-api-sdk-examples).

## Usage
```javascript
import MongoAtlasDataApiSDK from 'mongodb-atlas-data-api-sdk'

const mongoAtlasDataApiSdk = new MongoAtlasDataApiSDK({
    apiKey: API_KEY,
    apiUrl: API_URL,
    dbCluster: DB_CLUSTER,
    dbName: DB_NAME,
    quiet: false
})

const { documents } = await mongoAtlasDataApiSdk.find({
  collection: COLLECTION_NAME,
  filter: {
    _id: {
      $in:
        [
            { $oid: "61c3472a1396e0693eba124c" },
            { $oid: "61eb2496b8f08060d1dee50a" },
        ]
    }
  }
})
```

## Available Methods
[findOne](https://docs.atlas.mongodb.com/api/data-api-resources/#find-a-single-document)

[find](https://docs.atlas.mongodb.com/api/data-api-resources/#find-multiple-documents)

[insertOne](https://docs.atlas.mongodb.com/api/data-api-resources/#insert-a-single-document)

[insertMany](https://docs.atlas.mongodb.com/api/data-api-resources/#insert-multiple-documents)

[updateOne](https://docs.atlas.mongodb.com/api/data-api-resources/#update-a-single-document)

[updateMany](https://docs.atlas.mongodb.com/api/data-api-resources/#update-multiple-documents)

[replaceOne](https://docs.atlas.mongodb.com/api/data-api-resources/#replace-a-single-document)

[deleteOne](https://docs.atlas.mongodb.com/api/data-api-resources/#delete-a-single-document)

[deleteMany](https://docs.atlas.mongodb.com/api/data-api-resources/#delete-multiple-documents)

[aggregate](https://docs.atlas.mongodb.com/api/data-api-resources/#run-an-aggregation-pipeline)

[Errors](https://docs.atlas.mongodb.com/api/data-api-resources/#error-codes)

# Notes
This projects uses ESM loader, if you need commonJS please open an issue and I'll add it in for you.

# Todo
Testing, better documentation, flow types or typescript.

---
_Source: https://npm.io/package/mongodb-atlas-data-api-sdk · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
