Collection Properties Field
properties: Option<serde_json::Value>
field to CollectionConfigInternal
and CollectionInfo
.REST API Endpoints
/collections/{name}/properties
: Retrieve all collection-level properties as a JSON object./collections/{name}/properties
: Set or update one or more properties by sending a JSON object./collections/{name}/properties/{key}
: Remove a property by key.Collection Methods
Collection
struct for setting, getting, and removing properties, with persistence.Forward-Compatible Pattern Matching
CollectionConfigInternal
and CollectionInfo
to use ..
for forward compatibility.You can verify the feature with the following curl
commands:
Create Collection
curl -X PUT "http://localhost:6333/collections/test_collection" \
-H "Content-Type: application/json" \
-d '{"vectors":{"size":4,"distance":"Cosine"}}'
Response:
{"result":true,"status":"ok","time":...}
Purpose: Creates a new collection named test_collection
.
Get Properties (Initially)
curl "http://localhost:6333/collections/test_collection/properties"
Response:
{}
Purpose: Confirms no properties are set initially.
Set Multiple Properties
curl -X PATCH "http://localhost:6333/collections/test_collection/properties" \
-H "Content-Type: application/json" \
-d '{"main_column":"column a", "description":"Test collection"}'
Response:
{"result":"ok"}
Purpose: Sets main_column
and description
.
Get Properties (After Setting)
curl "http://localhost:6333/collections/test_collection/properties"
Response:
{"main_column":"column a","description":"Test collection"}
Update a Single Property
curl -X PATCH "http://localhost:6333/collections/test_collection/properties" \
-H "Content-Type: application/json" \
-d '{"description":"Updated description"}'
Response:
{"result":"ok"}
Get Properties (After Update)
curl "http://localhost:6333/collections/test_collection/properties"
Response:
{"main_column":"column a","description":"Updated description"}
Delete a Property
curl -X DELETE "http://localhost:6333/collections/test_collection/properties/main_column"
Response:
{"result":"ok"}
Get Properties (After Deletion)
curl "http://localhost:6333/collections/test_collection/properties"
Response:
{"description":"Updated description"}
Delete Last Property
curl -X DELETE "http://localhost:6333/collections/test_collection/properties/description"
Response:
{"result":"ok"}
Get Properties (After All Deletions)
curl "http://localhost:6333/collections/test_collection/properties"
Response:
{}
dev
branch. Did you create your branch from dev
?cargo +nightly fmt --all
command prior to submission?cargo clippy --all --all-features
command?Solves - #3957 /claim #3957
Luffy
@luffy-orf
Qdrant
@Qdrant