Property | Type | Description |
---|---|---|
collection_name | String | The collection name to compact |
Property | Description |
---|---|
status | { error_code: number, reason: string } |
compactionID | compaction ID |
new milvusClient(MILUVS_ADDRESS).collectionManager.compact({
collection_name: 'my_collection',
});
Create a collection in Milvus.
Property | Type | Description |
---|---|---|
collection_name | String | Collection name |
description | String | Collection description |
fields | FieldType | Field data |
Property | Description |
---|---|
error_code | Error code number |
reason | Error cause |
new milvusClient(MILUVS_ADDRESS).collectionManager.createCollection({
collection_name: 'my_collection',
fields: [
{
name: "vector_01",
description: "vector field",
data_type: DataType.FloatVect,
type_params: {
dim: "8"
}
},
{
name: "age",
data_type: DataType.Int64,
autoID: true,
is_primary_key: true,
description: "",
},
],
});
Show the details of a collection, e.g. name, schema.
Property | Type | Description |
---|---|---|
collection_name | String | Collection name |
Property | Description |
---|---|
status | { error_code: number, reason: string } |
schema | Information of all fields in this collection |
collectionID | Collection ID |
new milvusClient(MILUVS_ADDRESS).collectionManager.describeCollection({
collection_name: 'my_collection',
});
Drop a collection. Note that this drops all data in the collection.
Property | Type | Description |
---|---|---|
collection_name | String | Collection name |
Property | Description |
---|---|
error_code | Error code number |
reason | Error cause |
new milvusClient(MILUVS_ADDRESS).collectionManager.dropCollection({
collection_name: 'my_collection',
});
Show the statistics information of a collection.
Property | Type | Description |
---|---|---|
collection_name | String | Collection name |
Property | Description |
---|---|
status | { error_code: number, reason: string } |
stats | [{key: string, value: string}] |
data | Transform stats to { row_count: 0 } |
new milvusClient(MILUVS_ADDRESS).collectionManager.getCollectionStatistics({
collection_name: 'my_collection',
});
Get compaction states of a targeted compaction id
Property | Type | Description |
---|---|---|
compactionID | number or string | the id returned by compact |
Property | Description |
---|---|
status | { error_code: number, reason: string } |
state | the state of the compaction |
new milvusClient(MILUVS_ADDRESS).collectionManager.getCompactionState({
compactionID: compactionID,
});
Get compaction states of a targeted compaction id
Property | Type | Description |
---|---|---|
compactionID | number or string | the id returned by compact |
Property | Description |
---|---|
status | { error_code: number, reason: string } |
state | the state of the compaction |
new milvusClient(MILUVS_ADDRESS).collectionManager.getCompactionStateWithPlans({
compactionID: compactionID,
});
Check if a collection exists.
Property | Type | Description |
---|---|---|
collection_name | String | Collection name |
Property | Description |
---|---|
status | { error_code: number, reason: string } |
value | true or false |
new milvusClient(MILUVS_ADDRESS).collectionManager.hasCollection({
collection_name: 'my_collection',
});
Load collection data into query nodes, then you can do vector search on this collection. It's async function, but we can use showCollections to check loading status.
Property | Type | Description |
---|---|---|
collection_name | String | Collection name |
Property | Description |
---|---|
error_code | Error code number |
reason | Error cause |
new milvusClient(MILUVS_ADDRESS).collectionManager.loadCollection({
collection_name: 'my_collection',
});
Same function with loadCollection, but it's sync function. Help to ensure this collection is loaded.
Property | Type | Description |
---|---|---|
collection_name | String | Collection name |
Property | Description |
---|---|
error_code | Error code number |
reason | Error cause |
new milvusClient(MILUVS_ADDRESS).collectionManager.loadCollectionSync({
collection_name: 'my_collection',
});
Release a collection from cache to reduce cache usage. Note that you cannot search while the corresponding collection is unloaded.
Property | Type | Description |
---|---|---|
collection_name | String | Collection name |
Property | Description |
---|---|
error_code | Error code number |
reason | Error cause |
new milvusClient(MILUVS_ADDRESS).collectionManager.releaseCollection({
collection_name: 'my_collection',
});
List all collections or get collection loading status.
Property | Type | Description |
---|---|---|
type(optional) | enum | All -> 0, Loaded -> 1 |
collection_names(optional) | String[] | If type = Loaded , Milvus will return collection_names inMemory_percentages |
Property | Description |
---|---|
status | { error_code: number, reason: string } |
data | Contains collection name, ID , timestamp (UTC created time), and loadedPercentage (100 means loaded) |
new milvusClient(MILUVS_ADDRESS).collectionManager.showCollections();
Do compaction for the collection.