import { CreateCollectionReq, DescribeCollectionReq, DropCollectionReq, GetCollectionStatisticsReq, LoadCollectionReq, ReleaseLoadCollectionReq, ShowCollectionsReq, HasCollectionReq, CreateAliasReq, DropAliasReq, AlterAliasReq, CompactReq, GetCompactionStateReq, GetCompactionPlansReq, GetReplicaReq } from './types/Collection';
import { BoolResponse, CompactionResponse, DescribeCollectionResponse, GetCompactionPlansResponse, GetCompactionStateResponse, ResStatus, ShowCollectionsResponse, StatisticsResponse, ReplicasResponse } from './types/Response';
import { Client } from './Client';
/**
* See all [collection operation examples](https://github.com/milvus-io/milvus-sdk-node/blob/main/example/Collection.ts).
*/
export declare class Collection extends Client {
/**
* Create a collection in Milvus.
*
* @param data
* | Property | Type | Description |
* | :---------------------- | :---- | :------------------------------- |
* | collection_name | String | Collection name |
* | description | String | Collection description |
* | consistency_level | String | "Strong"(Milvus default) | "Session" | "Bounded"| "Eventually" | "Customized"; |
* | fields | FieldType | Field data |
* | timeout | number | An optional duration of time in millisecond to allow for the RPC. If it is set to undefined, the client keeps waiting until the server responds or error occurs. Default is undefined |
*
* @return
* | Property | Description |
* | :-------------| :-------- |
* | error_code | Error code number |
* | reason | Error cause |
*
* #### Example
*
* ```
* 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: "",
* },
* ],
* });
* ```
*/
createCollection(data: CreateCollectionReq): Promise;
/**
* Check if a collection exists.
*
* @param data
* | Property | Type | Description |
* | :---------------------- | :---- | :------------------------------- |
* | collection_name | String | Collection name |
* | timeout | number | An optional duration of time in millisecond to allow for the RPC. If it is set to undefined, the client keeps waiting until the server responds or error occurs. Default is undefined |
*
* @return
* | Property | Description |
* | :-------------| :------------------------------- |
* | status | { error_code: number, reason: string }|
* | value | `true` or `false` |
*
* #### Example
*
* ```
* new milvusClient(MILUVS_ADDRESS).collectionManager.hasCollection({
* collection_name: 'my_collection',
* });
* ```
*/
hasCollection(data: HasCollectionReq): Promise;
/**
* List all collections or get collection loading status.
*
* @param data
* | Property | Type | Description |
* | :----------------- | :---- | :------------------------------- |
* | type(optional) | enum | All -> 0, Loaded -> 1 |
* | collection_names(optional) | String[] | If `type = Loaded`, Milvus will return `collection_names inMemory_percentages` |
* | timeout | number | An optional duration of time in millisecond to allow for the RPC. If it is set to undefined, the client keeps waiting until the server responds or error occurs. Default is undefined |
*
* @return
* | Property | Description |
* | :-------------| :------------------------------- |
* | status | { error_code: number, reason: string } |
* | data | Contains collection name, ID , timestamp (UTC created time), and loadedPercentage (100 means loaded) |
*
*
* #### Example
*
* ```
* new milvusClient(MILUVS_ADDRESS).collectionManager.showCollections();
* ```
*/
showCollections(data?: ShowCollectionsReq): Promise;
/**
* Show the details of a collection, e.g. name, schema.
*
* @param data
* | Property | Type | Description |
* | :----------------- | :---- | :------------------------------- |
* | collection_name | String | Collection name |
* | timeout | number | An optional duration of time in millisecond to allow for the RPC. If it is set to undefined, the client keeps waiting until the server responds or error occurs. Default is undefined |
*
* @return
* | Property | Description |
* | :-------------| :------------------------------- |
* | status | { error_code: number, reason: string }|
* | schema | Information of all fields in this collection |
* | collectionID | Collection ID |
*
*
* #### Example
*
* ```
* new milvusClient(MILUVS_ADDRESS).collectionManager.describeCollection({
* collection_name: 'my_collection',
* });
* ```
*/
describeCollection(data: DescribeCollectionReq): Promise;
/**
* Show the statistics information of a collection.
*
* @param data
* | Property | Type | Description |
* | :----------------- | :---- | :------------------------------- |
* | collection_name | String | Collection name |
* | timeout | number | An optional duration of time in millisecond to allow for the RPC. If it is set to undefined, the client keeps waiting until the server responds or error occurs. Default is undefined |
*
* @return
* | Property | Description |
* | :-------------| :------------------------------- |
* | status | { error_code: number, reason: string }|
* | stats | [{key: string, value: string}] |
* | data | Transform **stats** to { row_count: 0 } |
*
*
* #### Example
*
* ```
* new milvusClient(MILUVS_ADDRESS).collectionManager.getCollectionStatistics({
* collection_name: 'my_collection',
* });
* ```
*/
getCollectionStatistics(data: GetCollectionStatisticsReq): Promise;
/**
* 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.
*
* @param data
* | Property | Type | Description |
* | :----------------- | :---- | :------------------------------- |
* | collection_name | String | Collection name |
* | replica_number? | number | Collection name |
* | timeout | number | An optional duration of time in millisecond to allow for the RPC. If it is set to undefined, the client keeps waiting until the server responds or error occurs. Default is undefined |
*
* @return
* | Property | Description |
* | :-------------| :-------- |
* | error_code | Error code number |
* | reason | Error cause| *
*
* #### Example
*
* ```
* new milvusClient(MILUVS_ADDRESS).collectionManager.loadCollection({
* collection_name: 'my_collection',
* });
* ```
*/
loadCollection(data: LoadCollectionReq): Promise;
/**
* Same function with loadCollection, but it's sync function.
* Help to ensure this collection is loaded.
*
* @param data
* | Property | Type | Description |
* | :----------------- | :---- | :------------------------------- |
* | collection_name | String | Collection name |
* | timeout | number | An optional duration of time in millisecond to allow for the RPC. If it is set to undefined, the client keeps waiting until the server responds or error occurs. Default is undefined |
*
* @return
* | Property | Description |
* | :-------------| :-------- |
* | error_code | Error code number |
* | reason | Error cause| *
*
* #### Example
*
* ```
* new milvusClient(MILUVS_ADDRESS).collectionManager.loadCollectionSync({
* collection_name: 'my_collection',
* });
* ```
*/
loadCollectionSync(data: LoadCollectionReq): Promise;
/**
* Release a collection from cache to reduce cache usage.
* Note that you cannot search while the corresponding collection is unloaded.
*
* @param data
* | Property | Type | Description |
* | :----------------- | :---- | :------------------------------- |
* | collection_name | String | Collection name |
* | timeout | number | An optional duration of time in millisecond to allow for the RPC. If it is set to undefined, the client keeps waiting until the server responds or error occurs. Default is undefined |
*
* @return
* | Property | Description |
* | :-------------| :-------- |
* | error_code | Error code number |
* | reason | Error cause | *
*
* #### Example
*
* ```
* new milvusClient(MILUVS_ADDRESS).collectionManager.releaseCollection({
* collection_name: 'my_collection',
* });
* ```
*/
releaseCollection(data: ReleaseLoadCollectionReq): Promise;
/**
* Drop a collection. Note that this drops all data in the collection.
*
* @param data
* | Property | Type | Description |
* | :----------------- | :---- | :------------------------------- |
* | collection_name | String | Collection name |
* | timeout | number | An optional duration of time in millisecond to allow for the RPC. If it is set to undefined, the client keeps waiting until the server responds or error occurs. Default is undefined |
*
* @return
* | Property | Description |
* | :-------------| :-------- |
* | error_code | Error code number |
* | reason | Error cause| *
*
* #### Example
*
* ```
* new milvusClient(MILUVS_ADDRESS).collectionManager.dropCollection({
* collection_name: 'my_collection',
* });
* ```
*/
dropCollection(data: DropCollectionReq): Promise;
/**
* @ignore
* Create collection alias, then you can use alias instead of collection_name when you do vector search
* @param data
*/
createAlias(data: CreateAliasReq): Promise;
/**
* @ignore
* @param data
*/
dropAlias(data: DropAliasReq): Promise;
/**
* @ignore
* @param data
*/
alterAlias(data: AlterAliasReq): Promise;
/**
* Do compaction for the collection.
*
* @param data
* | Property | Type | Description |
* | :----------------- | :---- | :------------------------------- |
* | collection_name | String | The collection name to compact |
* | timeout | number | An optional duration of time in millisecond to allow for the RPC. If it is set to undefined, the client keeps waiting until the server responds or error occurs. Default is undefined |
*
* @return
* | Property | Description |
* | :-------------| :-------- |
* | status | { error_code: number, reason: string }|
* | compactionID | compaction ID |
*
* #### Example
*
* ```
* new milvusClient(MILUVS_ADDRESS).collectionManager.compact({
* collection_name: 'my_collection',
* });
* ```
*/
compact(data: CompactReq): Promise;
/**
* Get compaction states of a targeted compaction id
*
* @param data
* | Property | Type | Description |
* | :----------------- | :---- | :------------------------------- |
* | compactionID | number or string | the id returned by compact |
* | timeout | number | An optional duration of time in millisecond to allow for the RPC. If it is set to undefined, the client keeps waiting until the server responds or error occurs. Default is undefined |
*
* @return
* | Property | Description |
* | :-------------| :-------- |
* | status | { error_code: number, reason: string }|
* | state | the state of the compaction |
*
* #### Example
*
* ```
* new milvusClient(MILUVS_ADDRESS).collectionManager.getCompactionState({
* compactionID: compactionID,
* });
* ```
*/
getCompactionState(data: GetCompactionStateReq): Promise;
/**
* Get compaction states of a targeted compaction id
*
* @param data
* | Property | Type | Description |
* | :----------------- | :---- | :------------------------------- |
* | compactionID | number or string | the id returned by compact |
* | timeout | number | An optional duration of time in millisecond to allow for the RPC. If it is set to undefined, the client keeps waiting until the server responds or error occurs. Default is undefined |
*
* @return
* | Property | Description |
* | :-------------| :-------- |
* | status | { error_code: number, reason: string }|
* | state | the state of the compaction |
*
* #### Example
*
* ```
* new milvusClient(MILUVS_ADDRESS).collectionManager.getCompactionStateWithPlans({
* compactionID: compactionID,
* });
* ```
*/
getCompactionStateWithPlans(data: GetCompactionPlansReq): Promise;
/**
* Get replicas
*
* @param data
* | Property | Type | Description |
* | :----------------- | :---- | :------------------------------- |
* | collectionID | number or string | the id returned by compact |
* | timeout | number | An optional duration of time in millisecond to allow for the RPC. If it is set to undefined, the client keeps waiting until the server responds or error occurs. Default is undefined |
*
* @return
* | Property | Description |
* | :-------------| :-------- |
* | status | { error_code: number, reason: string }|
* | ReplicaInfo[] | replica info array |
*
* #### Example
*
* ```
* new milvusClient(MILUVS_ADDRESS).collectionManager.getReplicas({
* collectionID: collectionID,
* });
*
* ```
*
* Return
* ```
* {
* replicas: [
* {
* partition_ids: [Array],
* shard_replicas: [Array],
* node_ids: [Array],
* replicaID: '436724291187770258',
* collectionID: '436777253933154305'
* }
* ],
* status: { error_code: 'Success', reason: '' }
* }
* ```
*/
getReplicas(data: GetReplicaReq): Promise;
}