# cloudflare-mongodb

> MongoDB driver for Cloudflare Workers

Latest version **0.1.6** (published 2023-05-24) · ISC license · 0 weekly downloads

## Install

```sh
npm install cloudflare-mongodb
pnpm add cloudflare-mongodb
yarn add cloudflare-mongodb
bun add cloudflare-mongodb
```

## Health

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

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.6 |
| Published | 2023-05-24 |
| First published | 2023-05-24 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 62.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | EZ, ezeki@game7.io |
| Maintainers | ezeki |
| Keywords | cloudflare, workers, mongo, mongodb |

## Links

- npm: https://www.npmjs.com/package/cloudflare-mongodb
- npm.io page: https://npm.io/package/cloudflare-mongodb

## 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
- [@temporal-architect/claude-plugin](https://npm.io/package/@temporal-architect/claude-plugin.md) — 335 weekly downloads

## Recent versions

- 0.1.6 (latest) — 2023-05-24
- 0.1.5 — 2023-05-24
- 0.1.4 — 2023-05-24
- 0.1.3 — 2023-05-24
- 0.1.2 — 2023-05-24
- 0.1.1 — 2023-05-24
- 0.1.0 — 2023-05-24

## README

# Cloudflare MongoDB

MongoDB Driver for Cloudflare Workers

## Example

```ts
import { CloudflareMongoClient, Document } from 'cloudflare-mongodb'

type User = Document & {
  firstName: string
}

const client = new CloudflareMongoClient({
  /**
   * Proxy api url
   */
  apiServiceUrls: ['https://mongodb-proxy.g7p.io'],
  /**
   * Authentication token, keep it secured
   */
  apiAuthToken: process.env.API_AUTH_TOKEN,
})

const db = client.db('g7')
const users = db.collection<User>('users')

// Insert
const user = await users.insertOne({
  firstName: 'Ezeki',
})

// Update
await users.updateOne(
  { _id: user?.id },
  {
    $set: {
      firstName: 'EzekiX',
    },
  },
)
```

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