Collection Documents

Bulk Update Documents

Bulk update documents matching filter conditions.

Partially updates all documents in the collection that match the provided filters. If no filters are provided, updates all documents in the collection.

This endpoint applies the SAME update_data to ALL documents matching the filters. For per-document updates with different values, use POST /batch endpoint instead.

patch/v1/collections/{collection_identifier}/documents/bulk

Path parameters

collection_identifierstring required

The ID of the collection to update documents in.

The ID of the collection to update documents in.

Request body

update_dataobject required

REQUIRED. Dictionary of field-value pairs to update on ALL matching documents. Can update any document field except vectors (metadata, source_blobs, etc.). All matched documents receive the SAME updates. Example: {'metadata.status': 'processed', 'metadata.reviewed': true}

Example request

{
  "description": "Update all pending documents to processed",
  "filters": {
    "AND": [
      {
        "field": "metadata.status",
        "operator": "eq",
        "value": "pending"
      }
    ]
  },
  "update_data": {
    "metadata": {
      "status": "processed"
    }
  }
}

Response

Successful Response

task_idstring nullable

Id of the background task running the bulk update. Poll GET /v1/tasks/{task_id} for status and the final updated_count.

statusstring nullable

Task status at enqueue time (PENDING). The terminal status (COMPLETED / FAILED) and updated_count land on the task record.

updated_countinteger nullable

Number of documents updated. Null on the async enqueue response; populated on the task record when the task completes.

messagestring

Changes

Changed in 3 of the 30 revisions of this API.213

  • 3775e0b36ee123See the full diff
    • the response property updated_count became optional for the status 200

      response-property-became-optional

    • response property updated_count list-of-types was widened by adding types null to media type application/json of response 200

      response-property-list-of-types-widened

    • added the optional property status to the response with the 200 status

      response-optional-property-added

    • added the optional property task_id to the response with the 200 status

      response-optional-property-added

    • the message response's property default value changed from Documents updated successfully to Bulk update enqueued for the status 200

      response-property-default-value-changed

    • the endpoint scheme security BearerAuth AND NamespaceHeader was added to the API

      api-security-added

    This revision also has 3 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog

    • added the new geo_bounding_box enum value to the request property filters/anyOf[subschema #1: LogicalOperator]/AND/anyOf[subschema #1]/items/anyOf[subschema #2: FilterCondition]/operator

      request-property-enum-value-added

    • added the new geo_bounding_box enum value to the request property filters/anyOf[subschema #1: LogicalOperator]/NOT/anyOf[subschema #1]/items/anyOf[subschema #2: FilterCondition]/operator

      request-property-enum-value-added

    • added the new geo_bounding_box enum value to the request property filters/anyOf[subschema #1: LogicalOperator]/OR/anyOf[subschema #1]/items/anyOf[subschema #2: FilterCondition]/operator

      request-property-enum-value-added

    • added the new geo_polygon enum value to the request property filters/anyOf[subschema #1: LogicalOperator]/AND/anyOf[subschema #1]/items/anyOf[subschema #2: FilterCondition]/operator

      request-property-enum-value-added

    • added the new geo_polygon enum value to the request property filters/anyOf[subschema #1: LogicalOperator]/NOT/anyOf[subschema #1]/items/anyOf[subschema #2: FilterCondition]/operator

      request-property-enum-value-added

    • added the new geo_polygon enum value to the request property filters/anyOf[subschema #1: LogicalOperator]/OR/anyOf[subschema #1]/items/anyOf[subschema #2: FilterCondition]/operator

      request-property-enum-value-added

    • added the new geo_radius enum value to the request property filters/anyOf[subschema #1: LogicalOperator]/AND/anyOf[subschema #1]/items/anyOf[subschema #2: FilterCondition]/operator

      request-property-enum-value-added

    • added the new geo_radius enum value to the request property filters/anyOf[subschema #1: LogicalOperator]/NOT/anyOf[subschema #1]/items/anyOf[subschema #2: FilterCondition]/operator

      request-property-enum-value-added

    • added the new geo_radius enum value to the request property filters/anyOf[subschema #1: LogicalOperator]/OR/anyOf[subschema #1]/items/anyOf[subschema #2: FilterCondition]/operator

      request-property-enum-value-added

    This revision also has 1 change that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog