Skip to main content

MongoDB

Type: mongo • Category: flow • Tags: mongodb, data, database

Description

Perform MongoDB operations

Parameters

NameTypeDescriptionRequiredDefault
database_typestringDatabase type: internal (managed) or external (custom)no"internal"
uristringCustom MongoDB URI (external only, optional)no
databasestringDatabase nameno"chatai"
prefixstringUser prefix for internal database namespacingno""
collectionstringCollection name (will be prefixed with user namespace)no
operationstringMongoDB operation to performno"insert"
documentobjectDocument for insert operationsno
filterobjectFilter/query for find/update/delete/count operationsno{}
updateobjectUpdate document for update operationsno
limitnumberLimit for find operationsno10

Help

MongoDB Worker

Perform MongoDB CRUD with automatic per-user isolation.

Connection modes

  • internal: Managed connection with a single built‑in collection (no setup required).
  • external: Your own database + collection (bring your connection details if needed).

Benefits

  • No setup in internal mode — start saving data instantly
  • Automatic user isolation (no cross‑tenant leaks)
  • Flexible: switch between internal and external when you need control
  • Auto timestamps (created_at/updated_at) and auto‑create collections
  • Clean JSON results (ObjectIds returned as strings)

Operations

  • insert, find, update, delete, count

Parameters

  • database_type: internal | external
  • uri (external only): Custom Mongo URI (optional)
  • database (external only): Database name
  • collection (external only): Collection name
  • prefix (internal): Optional string appended to user_id (userId:prefix)
  • document/filter/update/limit: As in MongoDB

Examples

  • Internal insert: database_type=internal, prefix="workflow", operation=insert, document={"name":"test","value":123}
  • External insert: database_type=external, database="mydb", collection="mydata", operation=insert, document={"name":"test","value":123}

Notes

  • Collections are auto-created when missing
  • created_at/updated_at timestamps are added automatically
  • ObjectIds are returned as strings