Portal Community
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

Full definition replacement. This operation replaces the entire index definition. It is not a partial patch — you must supply the complete new mapping definition, including all fields that should be retained. To preserve existing fields while adding new ones, first retrieve the current definition using searchindex/list, merge in the new fields, and then submit the complete merged definition.

Configuration

Connection

FieldRequiredDescription
ConnectionUriRequiredMongoDB Atlas connection string. Reference via {{ $credentials.mongodbAtlas }}.
DatabaseRequiredDatabase containing the collection with the index to update.
CollectionRequiredCollection name on which the target search index is defined.

Operation

FieldRequiredDescription
IndexNameRequiredThe exact name of the existing Atlas Search index to update. The index must already exist — this operation does not create a new index if the name is not found. Use searchindex/list to verify the index name before updating.
DefinitionOptionalThe complete new index definition as a JSON object. Default {} resets the index to a dynamic mapping. For production, provide the full mappings object including all fields that should be indexed — both existing fields you want to preserve and any new fields being added. Supports all Atlas Search field types and analyzer configurations.

Sample Configuration

Update a product search index to add a brand field and a knnVector embedding field alongside existing mappings:

{
  "resource": "search-index",
  "operation": "update",
  "ConnectionUri": "{{ $credentials.mongodbAtlas }}",
  "Database": "ecommerce",
  "Collection": "products",
  "IndexName": "product_fulltext_search",
  "Definition": {
    "mappings": {
      "dynamic": false,
      "fields": {
        "name": {
          "type": "string",
          "analyzer": "lucene.standard",
          "searchAnalyzer": "lucene.standard"
        },
        "description": {
          "type": "string",
          "analyzer": "lucene.standard"
        },
        "category": {
          "type": "string",
          "analyzer": "lucene.keyword"
        },
        "brand": {
          "type": "string",
          "analyzer": "lucene.keyword"
        },
        "price": {
          "type": "number"
        },
        "inStock": {
          "type": "boolean"
        },
        "tags": {
          "type": "string",
          "analyzer": "lucene.standard"
        },
        "embedding": {
          "type": "knnVector",
          "dimensions": 1536,
          "similarity": "cosine"
        }
      }
    }
  }
}

Validation Errors

ErrorCause
connectionUri is requiredConnectionUri is empty or not provided.
database is requiredDatabase field is empty.
collection is requiredCollection field is empty.
indexName is requiredIndexName is empty or whitespace.

Output — Success Port

FieldTypeDescription
successbooleantrue when MongoDB accepted the update request. The index rebuild is still in progress — poll searchindex/list to confirm status: "READY".
statusstringAlways "success" on the success port.
resourcestringAlways "search-index".
operationstringAlways "update".

Sample Output

{
  "success": true,
  "status": "success",
  "resource": "search-index",
  "operation": "update"
}

Expression Reference

ExpressionReturnsDescription
{{ $output.UpdateSearchIndex.success }}booleanConfirm the update was accepted. Branch on false to handle rejection (e.g. index name not found).
{{ $output.UpdateSearchIndex.status }}stringConfirm "success" for downstream conditional logic.

Node Policies & GuardRails

PolicyRecommendation
Credential storageAlways reference ConnectionUri from BizFirst Credentials Manager. Never embed raw Atlas credentials in workflow node fields.
Full definition — not a patchSupply the complete new definition including all fields to retain. Any field omitted from the Definition object will no longer be indexed after the rebuild. Read the current definition first using searchindex/list and merge before submitting.
Verify index exists firstRun searchindex/list before updating to confirm the index name exists. An update to a non-existent index name raises an error. Use an IfCondition to handle the not-found case by routing to searchindex/create instead.
Zero-downtime rebuildAtlas rebuilds the index against the new definition while the old definition continues to serve queries. During the rebuild, searches return results based on the prior definition. After READY is reached, queries use the new definition. Plan for a temporary relevance gap during the rebuild window.
Poll for READY after updateAlways follow searchindex/update with a polling loop using searchindex/list to confirm the rebuilt index has reached status: "READY" before announcing the schema change as complete in a deployment pipeline.
Test definition in stagingApply and validate new index definitions in a staging environment before running searchindex/update in production. An incorrect definition can produce a FAILED index that requires manual intervention to recover.
Atlas tier requirementConfirm the cluster tier is M10+ before running this operation. A connection to a shared-tier cluster or self-hosted instance returns a driver-level error.

Workflow Examples

Example 1 — Add New Field to Existing Index

// Step 1: List to get current definition
{
  "resource": "search-index",
  "operation": "list",
  "ConnectionUri": "{{ $credentials.mongodbAtlas }}",
  "Database": "ecommerce",
  "Collection": "products"
}
// Step 2: Use Function node to merge new field into existing definition
// Step 3: Update with merged definition
{
  "resource": "search-index",
  "operation": "update",
  "ConnectionUri": "{{ $credentials.mongodbAtlas }}",
  "Database": "ecommerce",
  "Collection": "products",
  "IndexName": "product_fulltext_search",
  "Definition": "{{ $json.mergedDefinition }}"
}

Example 2 — Drift Correction from Config Store

{
  "resource": "search-index",
  "operation": "update",
  "ConnectionUri": "{{ $credentials.mongodbAtlas }}",
  "Database": "{{ $json.database }}",
  "Collection": "{{ $json.collection }}",
  "IndexName": "{{ $json.indexName }}",
  "Definition": "{{ $json.canonicalDefinition }}"
}

Example 3 — Analyzer Upgrade for Language Support

{
  "resource": "search-index",
  "operation": "update",
  "ConnectionUri": "{{ $credentials.mongodbAtlas }}",
  "Database": "catalog",
  "Collection": "products",
  "IndexName": "product_search",
  "Definition": {
    "mappings": {
      "dynamic": false,
      "fields": {
        "name": [
          { "type": "string", "analyzer": "lucene.standard" },
          { "type": "string", "analyzer": "lucene.japanese", "name": "name_ja" }
        ],
        "category": { "type": "string", "analyzer": "lucene.keyword" },
        "price":    { "type": "number" }
      }
    }
  }
}