# documentdb-driver

Covers MongoDB driver basics for Azure DocumentDB, such as creating one shared client and reusing connections.

Skill by Microsoft. Category: Data and backend.

## Install

Project (for this project only):

```sh
npx skills add azure/documentdb-agent-kit --skill documentdb-driver
```

Works with: Claude Code, Codex CLI, Cursor, Antigravity, Copilot CLI, opencode.

Global (for every project on this machine):

```sh
npx skills add azure/documentdb-agent-kit --skill documentdb-driver -g
```

Works with: Claude Code, Codex CLI, Cursor, Antigravity, Copilot CLI, opencode.

## Tags

- Runs on your computer: It runs as a program on your machine, with your access.

## Security audits

- Gen Agent Trust Hub: Pass
- Socket: Pass
- Snyk: Pass

Installs: 14. Installs counted by skills.sh. [Open on skills.sh](https://www.skills.sh/azure/documentdb-agent-kit/documentdb-driver)

## Source

[Open the source](https://github.com/azure/documentdb-agent-kit/tree/HEAD/skills/driver). Checked 2026-10-10. This summary may contain AI-generated text, so it can be wrong. Check the source before you rely on it.

## SKILL.md

````markdown
---
name: documentdb-driver
description: MongoDB driver and SDK best practices for Azure DocumentDB — singleton `MongoClient`, connection reuse, connection-pool fundamentals. Use when writing code that instantiates a MongoDB client, reviewing driver initialization, or diagnosing connection-related bugs. For full connection-pool tuning (serverless vs OLTP vs OLAP, timeouts, retries), see the `documentdb-connection` skill.
license: MIT
---

# Driver Best Practices — Azure DocumentDB

MongoDB driver usage patterns that apply across Node.js, Python, Java, Go, and .NET. For in-depth pool-size / timeout / retry tuning, see the `documentdb-connection` skill.

## Rules

- [driver-singleton-client](driver-singleton-client.md) — Reuse `MongoClient` as a process-wide singleton; never create a new client per request.
````

- Previous: [documentdb-data-modeling](https://syn4pse.dev/terminal/documentdb-data-modeling.md)
- Next: [documentdb-full-text-search](https://syn4pse.dev/terminal/documentdb-full-text-search.md)
- [Terminal](https://syn4pse.dev/terminal.md)
- [Suggest a change](mailto:terminal@syn4pse.dev?subject=Terminal%20suggestion)
