MongoDB
Type:
mongo
• Category:flow
• Tags:mongodb
,data
,database
Description
Perform MongoDB operations
Parameters
Name | Type | Description | Required | Default |
---|---|---|---|---|
database_type | string | Database type: internal (managed) or external (custom) | no | "internal" |
uri | string | Custom MongoDB URI (external only, optional) | no | |
database | string | Database name | no | "chatai" |
prefix | string | User prefix for internal database namespacing | no | "" |
collection | string | Collection name (will be prefixed with user namespace) | no | |
operation | string | MongoDB operation to perform | no | "insert" |
document | object | Document for insert operations | no | |
filter | object | Filter/query for find/update/delete/count operations | no | {} |
update | object | Update document for update operations | no | |
limit | number | Limit for find operations | no | 10 |
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