Class Partition

Methods

createPartition

  • Create partition in milvus collection

    Parameters

    • data: CreatePartitionReq
      Property Type Description
      collection_name string collection name
      partition_name string partition name

    Returns Promise<ResStatus>

    Property Description
    error_code error code number
    reason reason

    Example

     new milvusClient(MILUVS_IP).partitionManager.createPartition({
        collection_name: 'my_collection',
        partition_name: 'my_partition',
     });
    

dropPartition

  • Drop partition will drop all data in this partition and the _default partition can not dropped.

    Parameters

    • data: DropPartitionReq
      Property Type Description
      collection_name string collection name
      partition_name string partition name

    Returns Promise<ResStatus>

    Property Description
    error_code error code number
    reason reason

    Example

     new milvusClient(MILUVS_IP).partitionManager.dropPartition({
        collection_name: 'my_collection',
        partition_name: 'my_partition',
     });
    

getPartitionStatistics

  • Get partition statistics for one partition.

    Parameters

    • data: GetPartitionStatisticsReq
      Property Type Description
      collection_name string collection name
      partition_name string partition name

    Returns Promise<StatisticsResponse>

    Property Description
    status { error_code: number,reason:string }
    stats [{key: string,value:string}]
    data transform stats to { row_count: 0 }

    Example

     new milvusClient(MILUVS_IP).partitionManager.getPartitionStatistics({
        collection_name: 'my_collection',
        partition_name: "_default",
     });
    

hasPartition

  • Check partition exist or not in one collection

    Parameters

    • data: HasPartitionReq
      Property Type Description
      collection_name string collection name
      partition_name string parititon name

    Returns Promise<BoolResponse>

    Property Description
    status { error_code: number,reason:string }
    value true or false

    Example

     new milvusClient(MILUVS_IP).partitionManager.hasPartition({
        collection_name: 'my_collection',
        partition_name: 'my_partition',
     });
    

loadPartitions

  • Load partition data into cache

    Parameters

    • data: LoadPartitionsReq
      Property Type Description
      collection_name string collection name
      partition_names string[] partition name array

    Returns Promise<ResStatus>

    Property Description
    error_code error code number
    reason reason

    Example

     new milvusClient(MILUVS_IP).partitionManager.loadPartitions({
        collection_name: 'my_collection',
        partition_names: ['my_partition'],
     });
    

releasePartitions

  • Release partition data into cache

    Parameters

    • data: ReleasePartitionsReq
      Property Type Description
      collection_name string collection name
      partition_names string[] partition name array

    Returns Promise<ResStatus>

    Property Description
    error_code error code number
    reason reason

    Example

     new milvusClient(MILUVS_IP).partitionManager.releasePartitions({
        collection_name: 'my_collection',
        partition_names: ['my_partition'],
     });
    

showPartitions

  • Show all partitions in one collection

    Parameters

    • data: ShowPartitionsReq
      Property Type Description
      collection_name string collection name

    Returns Promise<ShowPartitionsResponse>

    Property Description
    status { error_code: number,reason:string }
    partition_names partition name array
    partitionIDs partition id array

    Example

     new milvusClient(MILUVS_IP).partitionManager.showPartitions({
        collection_name: 'my_collection',
     });