This is an n8n community node for reading and writing data in Azure DocumentDB and MongoDB-compatible open-source DocumentDB deployments.
n8n is a workflow automation platform. DocumentDB is a document database with MongoDB-compatible connectivity.
- Node.js 22 or later for local package development
- An Azure DocumentDB cluster or a reachable DocumentDB-compatible deployment
- A database user with only the permissions required by your workflows
- Network access from the n8n host to the database endpoint
Install this package from Settings > Community Nodes in a self-hosted n8n instance using:
n8n-nodes-documentdb
Alternatively, install it in the n8n community nodes directory:
npm install n8n-nodes-documentdbRestart n8n after manual installation. Verified packages can also be installed through n8n's node panel when approved in the Creator Portal.
Create a DocumentDB credential in n8n. Choose one of these configuration types:
- Connection String: Paste the MongoDB-compatible connection string supplied by your deployment. The value must begin with
mongodb://ormongodb+srv://. - Connection Values: Enter host, port, user, password, authentication database, and TLS preference separately.
Set Default Database for every operation except List Databases. Azure DocumentDB commonly requires TLS. Store credentials only in n8n's credential store; do not place secrets in workflow fields.
Use Test credential to connect and run a database ping command.
- List Databases: List databases visible to the credential.
- List Collections: List collections in the default database.
- Find: Find documents with optional projection, sorting, skip, and limit.
- Insert: Insert one JSON document for each input item.
- Update: Update the first or all matching documents with operators such as
$set. - Delete: Delete the first or all matching documents.
- Aggregate: Execute a MongoDB-compatible aggregation pipeline.
- Add a trigger that emits JSON.
- Add DocumentDB and select Insert.
- Set the collection name.
- Leave Document as
={{$json}}, or map a smaller JSON object.
- Select Find and set the collection to
orders. - Use
{"status":"open"}as the filter. - Add Sort with
{"createdAt":-1}and set Limit to25.
- Select Update and use
{"externalId":"={{$json.id}}"}as the filter. - Use
{"$set":{"status":"processed"}}as the update. - Enable Update All Matches only when every matching document should change.
- Supported commands depend on the MongoDB compatibility level of the target DocumentDB deployment.
- Extended JSON strings are not converted automatically to BSON types. Values are sent as standard JSON values.
- Operations run once per incoming item, except database and collection listing.
- The node does not read environment variables, certificates from disk, or other filesystem content at runtime.
- DocumentDB uses the MongoDB wire protocol. The MongoDB Node.js driver is bundled into the compiled node during the build, so the published package has no external runtime dependencies.
npm install
npm run lint
npm run build
npm run devnpm run dev starts an n8n development instance with the node loaded. npm run release performs the official @n8n/node-cli release workflow.