array_remove()

Creates an operation that removes matching array elements from the existing field value during an upsert.

Request Syntax

FieldOp.array_remove() -> FieldPartialUpdateOp

RETURN TYPE:

FieldPartialUpdateOp

RETURNS:

Operation message that selects ARRAY_REMOVE behavior.

Examples

Applies ARRAY_REMOVE to the tags field.

from pymilvus import FieldOp, MilvusClient

client = MilvusClient(uri="http://localhost:19530")
client.upsert(
    collection_name="book_chunks",
    data=[
        {
            "id": 1,
            "vector": [0.1, 0.2, 0.3, 0.4],
            "tags": ["obsolete"],
        }
    ],
    field_ops={"tags": FieldOp.array_remove()},
)

Try Managed Milvus for Free

Zilliz Cloud is hassle-free, powered by Milvus and 10x faster.

Get Started
Feedback

Was this page helpful?