Emmanuel Katto : How to Remove a Reference Property from Weaviate Collection Using Python Client?

Hi everyone,

I’m Emmanuel Katto, I’ve added a reference property to a Weaviate collection using the Python client, but now I’m looking for a way to remove it without recreating the entire collection and losing data.

Here’s the code I used to add the reference property:

I’m wondering if there’s a way to remove this reference property using the Weaviate Python client without the need to recreate the collection and lose the data. Has anyone done this before or can point me in the right direction?

Looking forward to hearing your suggestions!
from weaviate.classes.config import ReferenceProperty

category = client.collections.get(“Rechtspraak_nl”)
category.config.add_reference(
ReferenceProperty(
name=“extracted_content_outline”,
target_collection=“Rechtspraak_nl_metadata”
)
)

Hello @emmanuelkatto,

Some parameters are mutable after you create your collection, but not all. To modify immutable parameters, you’ll need to export your data, create a new collection, and then import your data into it.

Note that changes involving Cross-References will require a re-import as they involve schema changes.

Regards,
Mohamed Shahin,
Weaviate Support