Skip to main content
PATCH
Use this endpoint to add new fields to a database’s database_metadata_schema.
This endpoint is additive only. It cannot delete fields, rename fields, or change the type/flags of existing fields.

Request

Path parameters

Body

Each add_fields[] item uses the same field shape as database_metadata_schema on Create Database:

Rules

  • Additions only.
  • Existing field names cannot be reused, case-insensitively.
  • Existing fields cannot be deleted or changed.
  • Total custom database metadata fields cannot exceed 32.
  • Reserved names such as source_id, chunk_id, metadata, and document_metadata are rejected.
  • Dense/sparse embedding flags are only valid on VARCHAR fields.
  • MongoDB indexes for enable_match fields are created before the merged schema is persisted.
This endpoint persists the updated schema and MongoDB filter indexes. It does not yet alter/backfill existing Milvus collections for newly added dense/sparse metadata fields. Create the desired semantic metadata fields before ingesting, or migrate/re-ingest into a database with the final schema if those fields must participate in semantic/BM25 metadata search.

Response

Errors

Authorizations

Authorization
string
header
required

API key sent as a Bearer token: "Bearer prefix.secret"

Path Parameters

database
string
required

Database identifier

Example:

"acme_corp"

Body

application/json

Metadata schema fields to add

add_fields
object[]

New metadata schema fields to add to the database. Additive only — no deletes, renames, or type changes.

Example:

Response

OK

added_fields
string[]

Names of the metadata schema fields successfully added.

Example:
database
string

Owning database. Formerly tenant_id; the tenant_id alias is still accepted (deprecated).

Example:

"acme_corp"

tenant_id
string
deprecated
Example:

"acme_corp"