Class Partition

Methods

createPartition

  • Create a partition in a 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 Error cause

    Example

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

dropPartition

  • To drop a partition will drop all data in this partition and the _default partition cannot be 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 Error cause

    Example

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

getPartitionStatistics

  • Show the statistics information of a 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 { row_count: 0 } transformed from stats

    Example

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

hasPartition

  • Check if a partition exists in a 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_ADDRESS).partitionManager.hasPartition({
        collection_name: 'my_collection',
        partition_name: 'my_partition',
     });
    

loadPartitions

  • Load a partition into cache.

    Parameters

    • data: LoadPartitionsReq
      Property Type Description
      collection_name String Collection name
      partition_names String[] Array of partition names

    Returns Promise<ResStatus>

    Property Description
    error_code Error code number
    reason Error cause

    Example

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

releasePartitions

  • Release a partition from cache.

    Parameters

    • data: ReleasePartitionsReq
      Property Type Description
      collection_name String Collection name
      partition_names String[] Array of partition names

    Returns Promise<ResStatus>

    Property Description
    error_code Error code number
    reason Error cause

    Example

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

showPartitions

  • Show all partitions in a 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 Array of partition names
    partitionIDs Array of partition IDs

    Example

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