mongodb-atlas-data-api-sdk
v1.0.5
Published
Node SDK for Mongo Atlas Data API
Downloads
10
Maintainers
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
Examples
For examples of how to use the SDK see this repository.
Usage
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
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.