Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
9ccb760
fix(organizations): remove org calls when billing is disabled (#1211)
waleedlatif1 Sep 1, 2025
ea09fce
fix(build): consolidate pdf parsing dependencies, remove extraneous h…
waleedlatif1 Sep 1, 2025
5bbb349
fix(build): add missing pdf-parse dep, add docker build in staging (#…
waleedlatif1 Sep 1, 2025
9ea7ea7
feat(workspace-vars): add workspace scoped environment + fix cancella…
icecrasher321 Sep 1, 2025
f75c807
improvement(performance): added new indexes for improved session perf…
waleedlatif1 Sep 1, 2025
12135d2
improvement(copilot): improve context inputs and fix some bugs (#1216)
Sg312 Sep 1, 2025
65e8618
fix(ui): dark mode styling for switch, trigger modal UI, signup/login…
waleedlatif1 Sep 2, 2025
2c2c32c
improvement(hygiene): refactored routes to be more restful, reduced c…
waleedlatif1 Sep 2, 2025
54d42b3
fix(wand): remove duplicate transfer encoding header meant to be set …
waleedlatif1 Sep 2, 2025
4273161
fix 80th migration
icecrasher321 Sep 2, 2025
461d7b2
Merge branch 'staging' of github.com:simstudioai/sim into staging
icecrasher321 Sep 2, 2025
a618d28
add if not exists check
icecrasher321 Sep 2, 2025
1f2a317
fix if not exists check
icecrasher321 Sep 2, 2025
9ffb48e
make 79th migration idempotent
icecrasher321 Sep 2, 2025
3db73ff
fix(whitelabel): make terms and privacy URL envvars available at buil…
waleedlatif1 Sep 2, 2025
9de0d91
feat(llms): added additional params to llm-based blocks for alternati…
waleedlatif1 Sep 2, 2025
1a5d5dd
feat(e2b-execution): add remote code execution to support Python + Im…
icecrasher321 Sep 3, 2025
c2d668c
feat(copilot): stats tracking (#1227)
Sg312 Sep 3, 2025
533b4c5
feat(tools): add MongoDB (#1225)
waleedlatif1 Sep 3, 2025
b74ab46
fix(e2b-env-var): use isTruthy and getEnv (#1228)
icecrasher321 Sep 3, 2025
baef8d7
fix(styling): fix styling inconsistencies in dark mode, fix invites f…
waleedlatif1 Sep 3, 2025
0cf87e6
v0.3.44: removing unused routes, whitelabeling terms & policy URLs, e…
waleedlatif1 Sep 3, 2025
36c98d1
fix(team): fix organization invitation URL for teams (#1232)
waleedlatif1 Sep 3, 2025
11d8188
fix(rce): always use VM over RCE for custom tools (#1233)
waleedlatif1 Sep 3, 2025
581929b
v0.3.45: fixes for organization invites, custom tool execution
waleedlatif1 Sep 3, 2025
3656d3d
Updates (#1237)
Sg312 Sep 3, 2025
fce1423
v0.3.46: fix copilot stats updates
Sg312 Sep 3, 2025
26243b9
fix(code-subblock): added validation to not parse non-variables as va…
waleedlatif1 Sep 3, 2025
1de5966
fix(whitelabel): move redirects (build-time) for whitelabeling to mid…
waleedlatif1 Sep 3, 2025
a672f17
Add input/output multipliers
Sg312 Sep 4, 2025
59b2023
Lint
Sg312 Sep 4, 2025
95d93a2
change
Sg312 Sep 4, 2025
c68cadf
Docs
Sg312 Sep 4, 2025
fc558a8
Lint + tests
Sg312 Sep 4, 2025
56eee2c
Waring
Sg312 Sep 4, 2025
afc1632
Merge pull request #1245 from simstudioai/fix/copilot-billing
Sg312 Sep 4, 2025
0f7dfe0
fix(hydration): duplicate overlay after idle + subblocks race conditi…
icecrasher321 Sep 4, 2025
57c98d8
fix(race-condition-workflow-switching): another race condition betwee…
icecrasher321 Sep 5, 2025
e31627c
fix(sidebar): re-ordering based on last edit is confusing (#1248)
icecrasher321 Sep 5, 2025
37dcde2
feat(enterprise-plan-webhooks): skip webhook queue for enterprise pla…
icecrasher321 Sep 5, 2025
47da5eb
fix(rehydration): consolidate store rehydration code (#1249)
icecrasher321 Sep 5, 2025
0e8e8c7
fix(sidebar): order by created at (#1251)
icecrasher321 Sep 5, 2025
53dd277
fix(cost): restored cost reporting for agent block in console entry (…
waleedlatif1 Sep 5, 2025
8668622
feat(duplicate): duplicate variables when duplicating a workflow (#1254)
waleedlatif1 Sep 5, 2025
864622c
fix(ratelimits): enterprise and team checks should be pooled limit (#…
icecrasher321 Sep 5, 2025
ab71fcf
feat(invitations): add ability to resend invitations with cooldown, f…
waleedlatif1 Sep 5, 2025
60a061e
v0.3.47: race condition fixes, store rehydration consolidation, other…
waleedlatif1 Sep 5, 2025
0a86eda
Revert "feat(enterprise-plan-webhooks): skip webhook queue for enterp…
icecrasher321 Sep 5, 2025
21beca8
fix(cleanup): cleanup unused vars + webhook typo (#1259)
icecrasher321 Sep 5, 2025
bd6d4a9
0.3.48: revert trigger dev bypass for enterprise users
icecrasher321 Sep 5, 2025
f2a046f
improvement(docs): readme.md to mention .env setup for copilot setup
icecrasher321 Sep 5, 2025
abb835d
fix(schedule-self-host): remove incorrect migration (#1260)
icecrasher321 Sep 5, 2025
3811b50
fix(router): change router block `content` to `prompt` (#1261)
waleedlatif1 Sep 5, 2025
8510312
fix(variables): add back ability to reference root block like <start>…
waleedlatif1 Sep 5, 2025
a0bb754
0.3.49: readme updates, router block and variables improvements
waleedlatif1 Sep 5, 2025
d45324b
fix(sidebar): draggable cursor on sidebar when switching workflows (#…
waleedlatif1 Sep 7, 2025
56482f4
Merge branch 'simstudioai:main' into main
arenadeveloper02 Sep 8, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 5 additions & 13 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ name: Build and Publish Docker Image

on:
push:
branches: [main]
tags: ['v*']
branches: [main, staging]

jobs:
build-and-push:
Expand Down Expand Up @@ -56,7 +55,7 @@ jobs:
uses: docker/setup-buildx-action@v3

- name: Log in to the Container registry
if: github.event_name != 'pull_request'
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/main'
uses: docker/login-action@v3
with:
registry: ghcr.io
Expand All @@ -70,10 +69,7 @@ jobs:
images: ${{ matrix.image }}
tags: |
type=raw,value=latest-${{ matrix.arch }},enable=${{ github.ref == 'refs/heads/main' }}
type=ref,event=pr,suffix=-${{ matrix.arch }}
type=semver,pattern={{version}},suffix=-${{ matrix.arch }}
type=semver,pattern={{major}}.{{minor}},suffix=-${{ matrix.arch }}
type=semver,pattern={{major}}.{{minor}}.{{patch}},suffix=-${{ matrix.arch }}
type=raw,value=staging-${{ github.sha }}-${{ matrix.arch }},enable=${{ github.ref == 'refs/heads/staging' }}
type=sha,format=long,suffix=-${{ matrix.arch }}

- name: Build and push Docker image
Expand All @@ -82,7 +78,7 @@ jobs:
context: .
file: ${{ matrix.dockerfile }}
platforms: ${{ matrix.platform }}
push: ${{ github.event_name != 'pull_request' }}
push: ${{ github.event_name != 'pull_request' && github.ref == 'refs/heads/main' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha,scope=build-v3
Expand All @@ -93,7 +89,7 @@ jobs:
create-manifests:
runs-on: ubuntu-latest
needs: build-and-push
if: github.event_name != 'pull_request'
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/main'
strategy:
matrix:
include:
Expand All @@ -119,10 +115,6 @@ jobs:
images: ${{ matrix.image }}
tags: |
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }}
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}.{{minor}}.{{patch}}
type=sha,format=long

- name: Create and push manifest
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ bun run dev:sockets
Copilot is a Sim-managed service. To use Copilot on a self-hosted instance:

- Go to https://sim.ai → Settings → Copilot and generate a Copilot API key
- Set `COPILOT_API_KEY` in your self-hosted environment to that value
- Set `COPILOT_API_KEY` environment variable in your self-hosted apps/sim/.env file to that value

## Tech Stack

Expand Down
4 changes: 2 additions & 2 deletions apps/docs/content/docs/blocks/router.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ Your API key for the selected LLM provider. This is securely stored and used for

After a router makes a decision, you can access its outputs:

- **`<router.content>`**: Summary of the routing decision made
- **`<router.prompt>`**: Summary of the routing prompt used
- **`<router.selected_path>`**: Details of the chosen destination block
- **`<router.tokens>`**: Token usage statistics from the LLM
- **`<router.model>`**: The model used for decision-making
Expand Down Expand Up @@ -182,7 +182,7 @@ Confidence Threshold: 0.7 // Minimum confidence for routing
<Tab>
<ul className="list-disc space-y-2 pl-6">
<li>
<strong>router.content</strong>: Summary of routing decision
<strong>router.prompt</strong>: Summary of routing prompt used
</li>
<li>
<strong>router.selected_path</strong>: Details of chosen destination
Expand Down
29 changes: 28 additions & 1 deletion apps/docs/content/docs/copilot/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,31 @@ Copilot is your in-editor assistant that helps you build, understand, and improv
>
<div className="m-0 text-sm">Maximum reasoning for deep planning, debugging, and complex architectural changes.</div>
</Card>
</Cards>
</Cards>

## Billing and Cost Calculation

### How Costs Are Calculated

Copilot usage is billed per token from the underlying LLM:

- **Input tokens**: billed at the provider's base rate (**at-cost**)
- **Output tokens**: billed at **1.5×** the provider's base output rate

```javascript
copilotCost = (inputTokens × inputPrice + outputTokens × (outputPrice × 1.5)) / 1,000,000
```

| Component | Rate Applied |
|----------|----------------------|
| Input | inputPrice |
| Output | outputPrice × 1.5 |

<Callout type="warning">
Pricing shown reflects rates as of September 4, 2025. Check provider documentation for current pricing.
</Callout>

<Callout type="info">
Model prices are per million tokens. The calculation divides by 1,000,000 to get the actual cost. See <a href="/execution/advanced#cost-calculation">Logging and Cost Calculation</a> for background and examples.
</Callout>

1 change: 1 addition & 0 deletions apps/docs/content/docs/tools/meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"microsoft_planner",
"microsoft_teams",
"mistral_parse",
"mongodb",
"mysql",
"notion",
"onedrive",
Expand Down
264 changes: 264 additions & 0 deletions apps/docs/content/docs/tools/mongodb.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,264 @@
---
title: MongoDB
description: Connect to MongoDB database
---

import { BlockInfoCard } from "@/components/ui/block-info-card"

<BlockInfoCard
type="mongodb"
color="#E0E0E0"
icon={true}
iconSvg={`<svg className="block-icon" xmlns='http://www.w3.org/2000/svg' viewBox='0 0 128 128'>
<path
fillRule='evenodd'
clipRule='evenodd'
fill='currentColor'
d='M88.038 42.812c1.605 4.643 2.761 9.383 3.141 14.296.472 6.095.256 12.147-1.029 18.142-.035.165-.109.32-.164.48-.403.001-.814-.049-1.208.012-3.329.523-6.655 1.065-9.981 1.604-3.438.557-6.881 1.092-10.313 1.687-1.216.21-2.721-.041-3.212 1.641-.014.046-.154.054-.235.08l.166-10.051-.169-24.252 1.602-.275c2.62-.429 5.24-.864 7.862-1.281 3.129-.497 6.261-.98 9.392-1.465 1.381-.215 2.764-.412 4.148-.618z'
/>
<path
fillRule='evenodd'
clipRule='evenodd'
fill='#45A538'
d='M61.729 110.054c-1.69-1.453-3.439-2.842-5.059-4.37-8.717-8.222-15.093-17.899-18.233-29.566-.865-3.211-1.442-6.474-1.627-9.792-.13-2.322-.318-4.665-.154-6.975.437-6.144 1.325-12.229 3.127-18.147l.099-.138c.175.233.427.439.516.702 1.759 5.18 3.505 10.364 5.242 15.551 5.458 16.3 10.909 32.604 16.376 48.9.107.318.384.579.583.866l-.87 2.969z'
/>
<path
fillRule='evenodd'
clipRule='evenodd'
fill='#46A037'
d='M88.038 42.812c-1.384.206-2.768.403-4.149.616-3.131.485-6.263.968-9.392 1.465-2.622.417-5.242.852-7.862 1.281l-1.602.275-.012-1.045c-.053-.859-.144-1.717-.154-2.576-.069-5.478-.112-10.956-.18-16.434-.042-3.429-.105-6.857-.175-10.285-.043-2.13-.089-4.261-.185-6.388-.052-1.143-.236-2.28-.311-3.423-.042-.657.016-1.319.029-1.979.817 1.583 1.616 3.178 2.456 4.749 1.327 2.484 3.441 4.314 5.344 6.311 7.523 7.892 12.864 17.068 16.193 27.433z'
/>
<path
fillRule='evenodd'
clipRule='evenodd'
fill='#409433'
d='M65.036 80.753c.081-.026.222-.034.235-.08.491-1.682 1.996-1.431 3.212-1.641 3.432-.594 6.875-1.13 10.313-1.687 3.326-.539 6.652-1.081 9.981-1.604.394-.062.805-.011 1.208-.012-.622 2.22-1.112 4.488-1.901 6.647-.896 2.449-1.98 4.839-3.131 7.182a49.142 49.142 0 01-6.353 9.763c-1.919 2.308-4.058 4.441-6.202 6.548-1.185 1.165-2.582 2.114-3.882 3.161l-.337-.23-1.214-1.038-1.256-2.753a41.402 41.402 0 01-1.394-9.838l.023-.561.171-2.426c.057-.828.133-1.655.168-2.485.129-2.982.241-5.964.359-8.946z'
/>
<path
fillRule='evenodd'
clipRule='evenodd'
fill='#4FAA41'
d='M65.036 80.753c-.118 2.982-.23 5.964-.357 8.947-.035.83-.111 1.657-.168 2.485l-.765.289c-1.699-5.002-3.399-9.951-5.062-14.913-2.75-8.209-5.467-16.431-8.213-24.642a4498.887 4498.887 0 00-6.7-19.867c-.105-.31-.407-.552-.617-.826l4.896-9.002c.168.292.39.565.496.879a6167.476 6167.476 0 016.768 20.118c2.916 8.73 5.814 17.467 8.728 26.198.116.349.308.671.491 1.062l.67-.78-.167 10.052z'
/>
<path
fillRule='evenodd'
clipRule='evenodd'
fill='#4AA73C'
d='M43.155 32.227c.21.274.511.516.617.826a4498.887 4498.887 0 016.7 19.867c2.746 8.211 5.463 16.433 8.213 24.642 1.662 4.961 3.362 9.911 5.062 14.913l.765-.289-.171 2.426-.155.559c-.266 2.656-.49 5.318-.814 7.968-.163 1.328-.509 2.632-.772 3.947-.198-.287-.476-.548-.583-.866-5.467-16.297-10.918-32.6-16.376-48.9a3888.972 3888.972 0 00-5.242-15.551c-.089-.263-.34-.469-.516-.702l3.272-8.84z'
/>
<path
fillRule='evenodd'
clipRule='evenodd'
fill='#57AE47'
d='M65.202 70.702l-.67.78c-.183-.391-.375-.714-.491-1.062-2.913-8.731-5.812-17.468-8.728-26.198a6167.476 6167.476 0 00-6.768-20.118c-.105-.314-.327-.588-.496-.879l6.055-7.965c.191.255.463.482.562.769 1.681 4.921 3.347 9.848 5.003 14.778 1.547 4.604 3.071 9.215 4.636 13.813.105.308.47.526.714.786l.012 1.045c.058 8.082.115 16.167.171 24.251z'
/>
<path
fillRule='evenodd'
clipRule='evenodd'
fill='#60B24F'
d='M65.021 45.404c-.244-.26-.609-.478-.714-.786-1.565-4.598-3.089-9.209-4.636-13.813-1.656-4.93-3.322-9.856-5.003-14.778-.099-.287-.371-.514-.562-.769 1.969-1.928 3.877-3.925 5.925-5.764 1.821-1.634 3.285-3.386 3.352-5.968.003-.107.059-.214.145-.514l.519 1.306c-.013.661-.072 1.322-.029 1.979.075 1.143.259 2.28.311 3.423.096 2.127.142 4.258.185 6.388.069 3.428.132 6.856.175 10.285.067 5.478.111 10.956.18 16.434.008.861.098 1.718.152 2.577z'
/>
<path
fillRule='evenodd'
clipRule='evenodd'
fill='#A9AA88'
d='M62.598 107.085c.263-1.315.609-2.62.772-3.947.325-2.649.548-5.312.814-7.968l.066-.01.066.011a41.402 41.402 0 001.394 9.838c-.176.232-.425.439-.518.701-.727 2.05-1.412 4.116-2.143 6.166-.1.28-.378.498-.574.744l-.747-2.566.87-2.969z'
/>
<path
fillRule='evenodd'
clipRule='evenodd'
fill='#B6B598'
d='M62.476 112.621c.196-.246.475-.464.574-.744.731-2.05 1.417-4.115 2.143-6.166.093-.262.341-.469.518-.701l1.255 2.754c-.248.352-.59.669-.728 1.061l-2.404 7.059c-.099.283-.437.483-.663.722l-.695-3.985z'
/>
<path
fillRule='evenodd'
clipRule='evenodd'
fill='#C2C1A7'
d='M63.171 116.605c.227-.238.564-.439.663-.722l2.404-7.059c.137-.391.48-.709.728-1.061l1.215 1.037c-.587.58-.913 1.25-.717 2.097l-.369 1.208c-.168.207-.411.387-.494.624-.839 2.403-1.64 4.819-2.485 7.222-.107.305-.404.544-.614.812-.109-1.387-.22-2.771-.331-4.158z'
/>
<path
fillRule='evenodd'
clipRule='evenodd'
fill='#CECDB7'
d='M63.503 120.763c.209-.269.506-.508.614-.812.845-2.402 1.646-4.818 2.485-7.222.083-.236.325-.417.494-.624l-.509 5.545c-.136.157-.333.294-.398.477-.575 1.614-1.117 3.24-1.694 4.854-.119.333-.347.627-.525.938-.158-.207-.441-.407-.454-.623-.051-.841-.016-1.688-.013-2.533z'
/>
<path
fillRule='evenodd'
clipRule='evenodd'
fill='#DBDAC7'
d='M63.969 123.919c.178-.312.406-.606.525-.938.578-1.613 1.119-3.239 1.694-4.854.065-.183.263-.319.398-.477l.012 3.64-1.218 3.124-1.411-.495z'
/>
<path
fillRule='evenodd'
clipRule='evenodd'
fill='#EBE9DC'
d='M65.38 124.415l1.218-3.124.251 3.696-1.469-.572z'
/>
<path
fillRule='evenodd'
clipRule='evenodd'
fill='#CECDB7'
d='M67.464 110.898c-.196-.847.129-1.518.717-2.097l.337.23-1.054 1.867z'
/>
<path
fillRule='evenodd'
clipRule='evenodd'
fill='#4FAA41'
d='M64.316 95.172l-.066-.011-.066.01.155-.559-.023.56z'
/>
</svg>`}
/>

## Usage Instructions

Connect to any MongoDB database to execute queries, manage data, and perform database operations. Supports find, insert, update, delete, and aggregation operations with secure connection handling.



## Tools

### `mongodb_query`

Execute find operation on MongoDB collection

#### Input

| Parameter | Type | Required | Description |
| --------- | ---- | -------- | ----------- |
| `host` | string | Yes | MongoDB server hostname or IP address |
| `port` | number | Yes | MongoDB server port \(default: 27017\) |
| `database` | string | Yes | Database name to connect to |
| `username` | string | No | MongoDB username |
| `password` | string | No | MongoDB password |
| `authSource` | string | No | Authentication database |
| `ssl` | string | No | SSL connection mode \(disabled, required, preferred\) |
| `collection` | string | Yes | Collection name to query |
| `query` | string | No | MongoDB query filter as JSON string |
| `limit` | number | No | Maximum number of documents to return |
| `sort` | string | No | Sort criteria as JSON string |

#### Output

| Parameter | Type | Description |
| --------- | ---- | ----------- |
| `message` | string | Operation status message |
| `documents` | array | Array of documents returned from the query |
| `documentCount` | number | Number of documents returned |

### `mongodb_insert`

Insert documents into MongoDB collection

#### Input

| Parameter | Type | Required | Description |
| --------- | ---- | -------- | ----------- |
| `host` | string | Yes | MongoDB server hostname or IP address |
| `port` | number | Yes | MongoDB server port \(default: 27017\) |
| `database` | string | Yes | Database name to connect to |
| `username` | string | No | MongoDB username |
| `password` | string | No | MongoDB password |
| `authSource` | string | No | Authentication database |
| `ssl` | string | No | SSL connection mode \(disabled, required, preferred\) |
| `collection` | string | Yes | Collection name to insert into |
| `documents` | array | Yes | Array of documents to insert |

#### Output

| Parameter | Type | Description |
| --------- | ---- | ----------- |
| `message` | string | Operation status message |
| `documentCount` | number | Number of documents inserted |
| `insertedId` | string | ID of inserted document \(single insert\) |
| `insertedIds` | array | Array of inserted document IDs \(multiple insert\) |

### `mongodb_update`

Update documents in MongoDB collection

#### Input

| Parameter | Type | Required | Description |
| --------- | ---- | -------- | ----------- |
| `host` | string | Yes | MongoDB server hostname or IP address |
| `port` | number | Yes | MongoDB server port \(default: 27017\) |
| `database` | string | Yes | Database name to connect to |
| `username` | string | No | MongoDB username |
| `password` | string | No | MongoDB password |
| `authSource` | string | No | Authentication database |
| `ssl` | string | No | SSL connection mode \(disabled, required, preferred\) |
| `collection` | string | Yes | Collection name to update |
| `filter` | string | Yes | Filter criteria as JSON string |
| `update` | string | Yes | Update operations as JSON string |
| `upsert` | boolean | No | Create document if not found |
| `multi` | boolean | No | Update multiple documents |

#### Output

| Parameter | Type | Description |
| --------- | ---- | ----------- |
| `message` | string | Operation status message |
| `matchedCount` | number | Number of documents matched by filter |
| `modifiedCount` | number | Number of documents modified |
| `documentCount` | number | Total number of documents affected |
| `insertedId` | string | ID of inserted document \(if upsert\) |

### `mongodb_delete`

Delete documents from MongoDB collection

#### Input

| Parameter | Type | Required | Description |
| --------- | ---- | -------- | ----------- |
| `host` | string | Yes | MongoDB server hostname or IP address |
| `port` | number | Yes | MongoDB server port \(default: 27017\) |
| `database` | string | Yes | Database name to connect to |
| `username` | string | No | MongoDB username |
| `password` | string | No | MongoDB password |
| `authSource` | string | No | Authentication database |
| `ssl` | string | No | SSL connection mode \(disabled, required, preferred\) |
| `collection` | string | Yes | Collection name to delete from |
| `filter` | string | Yes | Filter criteria as JSON string |
| `multi` | boolean | No | Delete multiple documents |

#### Output

| Parameter | Type | Description |
| --------- | ---- | ----------- |
| `message` | string | Operation status message |
| `deletedCount` | number | Number of documents deleted |
| `documentCount` | number | Total number of documents affected |

### `mongodb_execute`

Execute MongoDB aggregation pipeline

#### Input

| Parameter | Type | Required | Description |
| --------- | ---- | -------- | ----------- |
| `host` | string | Yes | MongoDB server hostname or IP address |
| `port` | number | Yes | MongoDB server port \(default: 27017\) |
| `database` | string | Yes | Database name to connect to |
| `username` | string | No | MongoDB username |
| `password` | string | No | MongoDB password |
| `authSource` | string | No | Authentication database |
| `ssl` | string | No | SSL connection mode \(disabled, required, preferred\) |
| `collection` | string | Yes | Collection name to execute pipeline on |
| `pipeline` | string | Yes | Aggregation pipeline as JSON string |

#### Output

| Parameter | Type | Description |
| --------- | ---- | ----------- |
| `message` | string | Operation status message |
| `documents` | array | Array of documents returned from aggregation |
| `documentCount` | number | Number of documents returned |



## Notes

- Category: `tools`
- Type: `mongodb`
Loading
Loading