Irreversible operation. Dropping an Atlas Search index permanently deletes it and all its built index data. Any workflow or application query that issues a $search aggregation using this index name will immediately begin returning errors or empty results. The collection data is not affected, but the index must be recreated from scratch (and rebuilt) to restore search functionality.
Atlas M10+ only. This operation requires MongoDB Atlas M10 or above. Shared-tier clusters (M0, M2, M5) and self-hosted MongoDB instances do not support programmatic Atlas Search index management.
When to Use
- Environment teardown: A CI/CD pipeline teardown workflow removes all Atlas Search indexes from test or staging collections after a test run completes. This prevents index count accumulation across repeated test cycles and frees Atlas resources.
- Index replacement workflow: When a major index schema change cannot be achieved via searchindex/update (e.g. changing the type of an existing field), drop the old index and create a new one with a different name. This is a common pattern for migrating from text to vector search or from dynamic to explicit mappings.
- Stale index cleanup: A weekly audit workflow (using searchindex/list) detects orphaned search indexes on collections whose schema has changed. Stale indexes consume Atlas compute resources and can cause confusion. The audit workflow drops confirmed-orphaned indexes after generating a report.
- Tenant offboarding: When a tenant is fully offboarded from a SaaS platform, a cleanup workflow deletes the tenant's search indexes before removing their data collection, ensuring no residual index structures remain in the Atlas cluster.
- Feature decommission: When a full-text search feature is decommissioned for a product, an operational workflow drops the corresponding Atlas Search indexes to eliminate unnecessary index maintenance overhead on the cluster.
Configuration
Connection
| Field | Required | Description |
ConnectionUri | Required | MongoDB Atlas connection string. Reference via {{ $credentials.mongodbAtlas }}. |
Database | Required | Database containing the collection with the index to drop. |
Collection | Required | Collection name on which the target search index is defined. |
Operation
| Field | Required | Description |
IndexName | Required | The exact name of the Atlas Search index to drop. The index must exist on the specified collection — dropping a non-existent index name raises an error. Use searchindex/list to verify the index exists before dropping. |
Sample Configuration
{
"resource": "search-index",
"operation": "drop",
"ConnectionUri": "{{ $credentials.mongodbAtlas }}",
"Database": "ecommerce",
"Collection": "products",
"IndexName": "product_fulltext_v1"
}
Validation Errors
| Error | Cause |
connectionUri is required | ConnectionUri is empty or not provided. |
database is required | Database field is empty. |
collection is required | Collection field is empty. |
indexName is required | IndexName is empty or whitespace. |
Output — Success Port
| Field | Type | Description |
success | boolean | true when the index was successfully dropped. The index and all its stored index data are permanently gone. |
status | string | Always "success" on the success port. |
resource | string | Always "search-index". |
operation | string | Always "drop". |
Sample Output
{
"success": true,
"status": "success",
"resource": "search-index",
"operation": "drop"
}
Expression Reference
| Expression | Returns | Description |
{{ $output.DropOldIndex.success }} | boolean | Confirm the drop succeeded. Use in downstream IfCondition to gate subsequent create operations in a replace workflow. |
{{ $output.DropOldIndex.status }} | string | Confirm "success" for conditional branching. |
Node Policies & GuardRails
| Policy | Recommendation |
| Credential storage | Always reference ConnectionUri from BizFirst Credentials Manager. Never embed raw Atlas credentials in workflow node configuration. |
| Verify before drop | Always run searchindex/list before dropping to confirm the index name exists. Attempting to drop a non-existent index name raises an error that may halt a deployment pipeline. |
| Immediate search breakage | The drop takes effect immediately. Any $search aggregation referencing the dropped index name will fail or return empty results from the moment the drop completes. Coordinate with application deployments to avoid user-visible search downtime. |
| Drop-then-create pattern | For index schema migrations that cannot use searchindex/update, follow a drop with an immediate searchindex/create and then poll for READY. Plan for the search gap between drop and rebuild completion. |
| Atlas tier requirement | Confirm the cluster tier is M10+ before running this operation. On shared-tier or self-hosted instances the call raises a driver-level error. |
| Log before drop | Before dropping, capture the current index definition using searchindex/list and insert it into an audit collection. This preserves the ability to recreate the exact prior definition if the drop was accidental. |
| Error port handling | Always connect the error port to a notification node. A failed drop in an environment teardown or migration workflow should be reported, not silently swallowed. |
Workflow Examples
Example 1 — Safe Drop with Existence Check
// Step 1: List indexes
{
"resource": "search-index",
"operation": "list",
"ConnectionUri": "{{ $credentials.mongodbAtlas }}",
"Database": "ecommerce",
"Collection": "products"
}
// Step 2: IfCondition — does target index exist?
// indexes.some(i => i.name === "product_fulltext_v1")
// true → proceed to drop
// false → log "index not found", complete without error
// Step 3: Drop
{
"resource": "search-index",
"operation": "drop",
"ConnectionUri": "{{ $credentials.mongodbAtlas }}",
"Database": "ecommerce",
"Collection": "products",
"IndexName": "product_fulltext_v1"
}
Example 2 — Drop and Replace (Schema Migration)
// Step 1: Capture old definition for audit
// (searchindex/list → document/insert into audit_log)
// Step 2: Drop old index
{
"resource": "search-index",
"operation": "drop",
"ConnectionUri": "{{ $credentials.mongodbAtlas }}",
"Database": "ecommerce",
"Collection": "products",
"IndexName": "product_search_v1"
}
// Step 3: Create new index with updated definition
{
"resource": "search-index",
"operation": "create",
"ConnectionUri": "{{ $credentials.mongodbAtlas }}",
"Database": "ecommerce",
"Collection": "products",
"IndexName": "product_search_v2",
"Definition": {
"mappings": {
"dynamic": false,
"fields": {
"name": { "type": "string", "analyzer": "lucene.standard" },
"embedding": { "type": "knnVector", "dimensions": 1536, "similarity": "cosine" }
}
}
}
}
// Step 4: Poll until READY (searchindex/list in Loop with Delay)
Example 3 — Environment Teardown (Loop Over Index List)
// Loop node over all index names returned by searchindex/list
// Each iteration drops one index:
{
"resource": "search-index",
"operation": "drop",
"ConnectionUri": "{{ $credentials.mongodbAtlas }}",
"Database": "{{ $json.database }}",
"Collection": "{{ $json.collection }}",
"IndexName": "{{ $json.currentItem.name }}"
}