@zilliz/milvus2-sdk-node 2.3.4 → 2.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +154 -35
- package/dist/milvus/HttpClient.d.ts +165 -2
- package/dist/milvus/HttpClient.js +17 -3
- package/dist/milvus/HttpClient.js.map +1 -1
- package/dist/milvus/MilvusClient.d.ts +3 -3
- package/dist/milvus/MilvusClient.js +42 -8
- package/dist/milvus/MilvusClient.js.map +1 -1
- package/dist/milvus/const/client.d.ts +4 -3
- package/dist/milvus/const/client.js +4 -3
- package/dist/milvus/const/client.js.map +1 -1
- package/dist/milvus/const/defaults.d.ts +5 -4
- package/dist/milvus/const/defaults.js +14 -13
- package/dist/milvus/const/defaults.js.map +1 -1
- package/dist/milvus/const/error.js +1 -1
- package/dist/milvus/const/error.js.map +1 -1
- package/dist/milvus/const/milvus.d.ts +45 -8
- package/dist/milvus/const/milvus.js +41 -3
- package/dist/milvus/const/milvus.js.map +1 -1
- package/dist/milvus/grpc/BaseClient.d.ts +11 -9
- package/dist/milvus/grpc/BaseClient.js +59 -21
- package/dist/milvus/grpc/BaseClient.js.map +1 -1
- package/dist/milvus/grpc/Collection.d.ts +311 -366
- package/dist/milvus/grpc/Collection.js +355 -387
- package/dist/milvus/grpc/Collection.js.map +1 -1
- package/dist/milvus/grpc/Data.d.ts +244 -291
- package/dist/milvus/grpc/Data.js +402 -539
- package/dist/milvus/grpc/Data.js.map +1 -1
- package/dist/milvus/grpc/Database.d.ts +29 -41
- package/dist/milvus/grpc/Database.js +32 -44
- package/dist/milvus/grpc/Database.js.map +1 -1
- package/dist/milvus/grpc/GrpcClient.d.ts +34 -13
- package/dist/milvus/grpc/GrpcClient.js +80 -70
- package/dist/milvus/grpc/GrpcClient.js.map +1 -1
- package/dist/milvus/grpc/MilvusIndex.d.ts +127 -67
- package/dist/milvus/grpc/MilvusIndex.js +166 -70
- package/dist/milvus/grpc/MilvusIndex.js.map +1 -1
- package/dist/milvus/grpc/Partition.d.ts +78 -113
- package/dist/milvus/grpc/Partition.js +109 -119
- package/dist/milvus/grpc/Partition.js.map +1 -1
- package/dist/milvus/grpc/Resource.d.ts +63 -92
- package/dist/milvus/grpc/Resource.js +69 -98
- package/dist/milvus/grpc/Resource.js.map +1 -1
- package/dist/milvus/grpc/User.d.ts +263 -295
- package/dist/milvus/grpc/User.js +287 -310
- package/dist/milvus/grpc/User.js.map +1 -1
- package/dist/milvus/http/Alias.d.ts +37 -0
- package/dist/milvus/http/Alias.js +62 -0
- package/dist/milvus/http/Alias.js.map +1 -0
- package/dist/milvus/http/Collection.d.ts +15 -1
- package/dist/milvus/http/Collection.js +55 -9
- package/dist/milvus/http/Collection.js.map +1 -1
- package/dist/milvus/http/Import.d.ts +33 -0
- package/dist/milvus/http/Import.js +48 -0
- package/dist/milvus/http/Import.js.map +1 -0
- package/dist/milvus/http/MilvusIndex.d.ts +35 -0
- package/dist/milvus/http/MilvusIndex.js +55 -0
- package/dist/milvus/http/MilvusIndex.js.map +1 -0
- package/dist/milvus/http/Partition.d.ts +41 -0
- package/dist/milvus/http/Partition.js +76 -0
- package/dist/milvus/http/Partition.js.map +1 -0
- package/dist/milvus/http/Role.d.ts +39 -0
- package/dist/milvus/http/Role.js +69 -0
- package/dist/milvus/http/Role.js.map +1 -0
- package/dist/milvus/http/User.d.ts +41 -0
- package/dist/milvus/http/User.js +76 -0
- package/dist/milvus/http/User.js.map +1 -0
- package/dist/milvus/http/Vector.d.ts +5 -3
- package/dist/milvus/http/Vector.js +10 -7
- package/dist/milvus/http/Vector.js.map +1 -1
- package/dist/milvus/http/index.d.ts +6 -0
- package/dist/milvus/http/index.js +6 -0
- package/dist/milvus/http/index.js.map +1 -1
- package/dist/milvus/index.d.ts +0 -1
- package/dist/milvus/index.js +0 -1
- package/dist/milvus/index.js.map +1 -1
- package/dist/milvus/types/Client.d.ts +5 -0
- package/dist/milvus/types/Collection.d.ts +34 -9
- package/dist/milvus/types/Common.d.ts +1 -3
- package/dist/milvus/types/Data.d.ts +79 -23
- package/dist/milvus/types/Data.js +1 -0
- package/dist/milvus/types/Data.js.map +1 -1
- package/dist/milvus/types/HighLevel.d.ts +6 -3
- package/dist/milvus/types/Http.d.ts +191 -9
- package/dist/milvus/types/MilvusIndex.d.ts +17 -3
- package/dist/milvus/types/User.d.ts +10 -9
- package/dist/milvus/utils/Bytes.d.ts +84 -0
- package/dist/milvus/utils/Bytes.js +261 -0
- package/dist/milvus/utils/Bytes.js.map +1 -0
- package/dist/milvus/utils/Format.d.ts +126 -68
- package/dist/milvus/utils/Format.js +375 -94
- package/dist/milvus/utils/Format.js.map +1 -1
- package/dist/milvus/utils/Function.d.ts +4 -2
- package/dist/milvus/utils/Function.js +58 -25
- package/dist/milvus/utils/Function.js.map +1 -1
- package/dist/milvus/utils/Grpc.d.ts +3 -2
- package/dist/milvus/utils/Grpc.js +65 -98
- package/dist/milvus/utils/Grpc.js.map +1 -1
- package/dist/milvus/utils/Validate.d.ts +18 -3
- package/dist/milvus/utils/Validate.js +38 -12
- package/dist/milvus/utils/Validate.js.map +1 -1
- package/dist/milvus/utils/index.d.ts +1 -1
- package/dist/milvus/utils/index.js +1 -1
- package/dist/milvus/utils/index.js.map +1 -1
- package/dist/proto/proto/common.proto +29 -1
- package/dist/proto/proto/google/protobuf/descriptor.proto +96 -34
- package/dist/proto/proto/milvus.proto +168 -2
- package/dist/proto/proto/rg.proto +28 -0
- package/dist/proto/proto/schema.proto +36 -0
- package/dist/sdk.json +1 -1
- package/package.json +8 -5
- package/dist/milvus/OrmClient.d.ts +0 -19
- package/dist/milvus/OrmClient.js +0 -51
- package/dist/milvus/OrmClient.js.map +0 -1
- package/dist/milvus/orm/Collection.d.ts +0 -43
- package/dist/milvus/orm/Collection.js +0 -165
- package/dist/milvus/orm/Collection.js.map +0 -1
- package/dist/milvus/orm/index.d.ts +0 -1
- package/dist/milvus/orm/index.js +0 -18
- package/dist/milvus/orm/index.js.map +0 -1
- package/dist/milvus/utils/Blob.d.ts +0 -4
- package/dist/milvus/utils/Blob.js +0 -18
- package/dist/milvus/utils/Blob.js.map +0 -1
|
@@ -1,34 +1,30 @@
|
|
|
1
1
|
import { Database } from './Database';
|
|
2
2
|
import { LRUCache } from 'lru-cache';
|
|
3
|
-
import { CreateCollectionReq, DescribeCollectionReq, DropCollectionReq, GetCollectionStatisticsReq, LoadCollectionReq, ReleaseLoadCollectionReq, ShowCollectionsReq, HasCollectionReq, CreateAliasReq, DropAliasReq, AlterAliasReq, CompactReq, GetCompactionStateReq, GetCompactionPlansReq, GetReplicaReq, RenameCollectionReq, GetLoadingProgressReq, GetLoadStateReq, BoolResponse, ResStatus, CompactionResponse, DescribeCollectionResponse, GetCompactionPlansResponse, GetCompactionStateResponse, ShowCollectionsResponse, StatisticsResponse, ReplicasResponse, GetLoadingProgressResponse, GetLoadStateResponse, AlterCollectionReq, DataType } from '../';
|
|
3
|
+
import { CreateCollectionReq, DescribeCollectionReq, DropCollectionReq, GetCollectionStatisticsReq, LoadCollectionReq, ReleaseLoadCollectionReq, ShowCollectionsReq, HasCollectionReq, CreateAliasReq, DescribeAliasReq, ListAliasesReq, DropAliasReq, AlterAliasReq, CompactReq, GetCompactionStateReq, GetCompactionPlansReq, GetReplicaReq, RenameCollectionReq, GetLoadingProgressReq, GetLoadStateReq, BoolResponse, ResStatus, CompactionResponse, DescribeCollectionResponse, GetCompactionPlansResponse, GetCompactionStateResponse, ShowCollectionsResponse, StatisticsResponse, ReplicasResponse, GetLoadingProgressResponse, GetLoadStateResponse, DescribeAliasResponse, ListAliasesResponse, AlterCollectionReq, DataType } from '../';
|
|
4
4
|
/**
|
|
5
5
|
* @see [collection operation examples](https://github.com/milvus-io/milvus-sdk-node/blob/main/example/Collection.ts)
|
|
6
6
|
*/
|
|
7
7
|
export declare class Collection extends Database {
|
|
8
8
|
protected collectionInfoCache: LRUCache<string, DescribeCollectionResponse, unknown>;
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* @param data
|
|
13
|
-
* | Property | Type | Description |
|
|
14
|
-
* | :-- | :-- | :-- |
|
|
15
|
-
* | collection_name | String | Collection name |
|
|
16
|
-
* | description | String | Collection description |
|
|
17
|
-
* | num_partitions | number | number of partitions allowed |
|
|
18
|
-
* | consistency_level | String | "Strong"(Milvus default) | "Session" | "Bounded"| "Eventually" | "Customized"; |
|
|
19
|
-
* | fields | <a href="https://github.com/milvus-io/milvus-sdk-node/blob/main/milvus/types/Collection.ts#L8" target="_blank">FieldType</a> | Field data |
|
|
20
|
-
* | 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 |
|
|
10
|
+
* Creates a new collection in Milvus.
|
|
21
11
|
*
|
|
22
|
-
* @
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
12
|
+
* @param {CreateCollectionReq} data - The data for the new collection.
|
|
13
|
+
* @param {string} data.collection_name - The name of the new collection.
|
|
14
|
+
* @param {string} [data.description] - The description of the new collection.
|
|
15
|
+
* @param {number} [data.num_partitions] - The number of partitions allowed in the new collection.
|
|
16
|
+
* @param {string} [data.consistency_level] - The consistency level of the new collection. Can be "Strong" (Milvus default), "Session", "Bounded", "Eventually", or "Customized".
|
|
17
|
+
* @param {FieldType[]} data.fields - The fields of the new collection. See [FieldType](https://github.com/milvus-io/milvus-sdk-node/blob/main/milvus/types/Collection.ts#L8) for more details.
|
|
18
|
+
* @param {number} [data.timeout] - An optional duration of time in milliseconds 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.
|
|
27
19
|
*
|
|
28
|
-
*
|
|
20
|
+
* @returns {Promise<ResStatus>} The response status of the operation.
|
|
21
|
+
* @returns {string} status.error_code - The error code of the operation.
|
|
22
|
+
* @returns {string} status.reason - The reason for the error, if any.
|
|
29
23
|
*
|
|
24
|
+
* @example
|
|
30
25
|
* ```
|
|
31
|
-
* new milvusClient(MILUVS_ADDRESS)
|
|
26
|
+
* const milvusClient = new milvusClient(MILUVS_ADDRESS);
|
|
27
|
+
* const resStatus = await milvusClient.createCollection({
|
|
32
28
|
* collection_name: 'my_collection',
|
|
33
29
|
* fields: [
|
|
34
30
|
* {
|
|
@@ -46,189 +42,154 @@ export declare class Collection extends Database {
|
|
|
46
42
|
* is_primary_key: true,
|
|
47
43
|
* description: "",
|
|
48
44
|
* },
|
|
49
|
-
*
|
|
45
|
+
* ],
|
|
50
46
|
* });
|
|
51
47
|
* ```
|
|
52
48
|
*/
|
|
53
49
|
_createCollection(data: CreateCollectionReq): Promise<ResStatus>;
|
|
54
50
|
/**
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
* ```
|
|
73
|
-
* new milvusClient(MILUVS_ADDRESS).hasCollection({
|
|
74
|
-
* collection_name: 'my_collection',
|
|
75
|
-
* });
|
|
76
|
-
* ```
|
|
77
|
-
*/
|
|
51
|
+
* Checks if a collection exists.
|
|
52
|
+
*
|
|
53
|
+
* @param {HasCollectionReq} data - The request parameters.
|
|
54
|
+
* @param {string} data.collection_name - The name of the collection to check.
|
|
55
|
+
* @param {number} [data.timeout] - An optional duration of time in milliseconds 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.
|
|
56
|
+
*
|
|
57
|
+
* @returns {Promise<BoolResponse>} The response from the server.
|
|
58
|
+
* @returns {string} status.error_code - The error code of the operation.
|
|
59
|
+
* @returns {string} status.reason - The reason for the error, if any.
|
|
60
|
+
* @returns {boolean} value - `true` if the collection exists, `false` otherwise.
|
|
61
|
+
*
|
|
62
|
+
* @example
|
|
63
|
+
* ```
|
|
64
|
+
* const milvusClient = new milvusClient(MILUVS_ADDRESS);
|
|
65
|
+
* const res = await milvusClient.hasCollection({ collection_name: 'my_collection' });
|
|
66
|
+
* ```
|
|
67
|
+
*/
|
|
78
68
|
hasCollection(data: HasCollectionReq): Promise<BoolResponse>;
|
|
79
69
|
/**
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
*
|
|
99
|
-
* ```
|
|
100
|
-
* new milvusClient(MILUVS_ADDRESS).showCollections();
|
|
101
|
-
* ```
|
|
102
|
-
*/
|
|
70
|
+
* Lists all collections or gets the loading status of a collection.
|
|
71
|
+
*
|
|
72
|
+
* @param {ShowCollectionsReq} data - The request parameters.
|
|
73
|
+
* @param {ShowCollectionsType} [data.type] - The type of collections to show. Can be "All" (default) or "Loaded".
|
|
74
|
+
* @param {string[]} [data.collection_names] - If `type` is "Loaded", Milvus will return `collection_names` along with their in-memory percentages.
|
|
75
|
+
* @param {number} [data.timeout] - An optional duration of time in milliseconds 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.
|
|
76
|
+
*
|
|
77
|
+
* @returns {Promise<ShowCollectionsResponse>} The response from the server.
|
|
78
|
+
* @returns {string} status.error_code - The error code of the operation.
|
|
79
|
+
* @returns {string} status.reason - The reason for the error, if any.
|
|
80
|
+
* @returns {CollectionData[]} data - An array containing information about each collection, including its name, ID, creation timestamp (UTC), and loaded percentage (100 means fully loaded).
|
|
81
|
+
*
|
|
82
|
+
* @example
|
|
83
|
+
* ```
|
|
84
|
+
* const milvusClient = new milvusClient(MILUVS_ADDRESS);
|
|
85
|
+
* const res = await milvusClient.showCollections();
|
|
86
|
+
* ```
|
|
87
|
+
*/
|
|
103
88
|
showCollections(data?: ShowCollectionsReq): Promise<ShowCollectionsResponse>;
|
|
104
89
|
/**
|
|
105
|
-
*
|
|
90
|
+
* Modifies collection properties.
|
|
106
91
|
*
|
|
107
|
-
* @param data
|
|
108
|
-
*
|
|
109
|
-
*
|
|
110
|
-
*
|
|
111
|
-
* | 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 |
|
|
92
|
+
* @param {AlterCollectionReq} data - The request parameters.
|
|
93
|
+
* @param {string} data.collection_name - The name of the collection to modify.
|
|
94
|
+
* @param {Object} data.properties - The properties to modify. For example, to change the TTL, use {"collection.ttl.seconds": 18000}.
|
|
95
|
+
* @param {number} [data.timeout] - An optional duration of time in milliseconds 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.
|
|
112
96
|
*
|
|
113
|
-
* @returns
|
|
114
|
-
*
|
|
115
|
-
*
|
|
116
|
-
* | status | { error_code: number, reason: string } |
|
|
117
|
-
*
|
|
118
|
-
* #### Example
|
|
97
|
+
* @returns {Promise<ResStatus>} The response status of the operation.
|
|
98
|
+
* @returns {string} status.error_code - The error code of the operation.
|
|
99
|
+
* @returns {string} status.reason - The reason for the error, if any.
|
|
119
100
|
*
|
|
101
|
+
* @example
|
|
120
102
|
* ```
|
|
121
|
-
* new milvusClient(MILUVS_ADDRESS)
|
|
103
|
+
* const milvusClient = new milvusClient(MILUVS_ADDRESS);
|
|
104
|
+
* const resStatus = await milvusClient.alterCollection({
|
|
122
105
|
* collection_name: 'my-collection',
|
|
123
106
|
* properties: {"collection.ttl.seconds": 18000}
|
|
124
|
-
*
|
|
107
|
+
* });
|
|
125
108
|
* ```
|
|
126
109
|
*/
|
|
127
110
|
alterCollection(data: AlterCollectionReq): Promise<ResStatus>;
|
|
128
111
|
list_collections: (data?: ShowCollectionsReq) => Promise<ShowCollectionsResponse>;
|
|
112
|
+
listCollections: (data?: ShowCollectionsReq) => Promise<ShowCollectionsResponse>;
|
|
129
113
|
/**
|
|
130
|
-
*
|
|
131
|
-
*
|
|
132
|
-
* @param data
|
|
133
|
-
* | Property | Type | Description |
|
|
134
|
-
* | :-- | :-- | :-- |
|
|
135
|
-
* | collection_name | String | Collection name |
|
|
136
|
-
* | 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 |
|
|
114
|
+
* Shows the details of a collection, such as its name and schema.
|
|
137
115
|
*
|
|
138
|
-
* @
|
|
139
|
-
*
|
|
140
|
-
*
|
|
141
|
-
* | status | { error_code: number, reason: string } |
|
|
142
|
-
* | schema | Information of all fields in this collection |
|
|
143
|
-
* | collectionID | Collection ID |
|
|
116
|
+
* @param {DescribeCollectionReq} data - The request parameters.
|
|
117
|
+
* @param {string} data.collection_name - The name of the collection to describe.
|
|
118
|
+
* @param {number} [data.timeout] - An optional duration of time in milliseconds 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.
|
|
144
119
|
*
|
|
120
|
+
* @returns {Promise<DescribeCollectionResponse>} The response from the server.
|
|
121
|
+
* @returns {string} status.error_code - The error code of the operation.
|
|
122
|
+
* @returns {string} status.reason - The reason for the error, if any.
|
|
123
|
+
* @returns {FieldSchema[]} schema - Information of all fields in this collection.
|
|
124
|
+
* @returns {string} collectionID - The ID of the collection.
|
|
145
125
|
*
|
|
146
|
-
*
|
|
147
|
-
*
|
|
126
|
+
* @example
|
|
148
127
|
* ```
|
|
149
|
-
* new milvusClient(MILUVS_ADDRESS)
|
|
150
|
-
*
|
|
151
|
-
* });
|
|
128
|
+
* const milvusClient = new milvusClient(MILUVS_ADDRESS);
|
|
129
|
+
* const res = await milvusClient.describeCollection({ collection_name: 'my_collection' });
|
|
152
130
|
* ```
|
|
153
131
|
*/
|
|
154
132
|
describeCollection(data: DescribeCollectionReq): Promise<DescribeCollectionResponse>;
|
|
155
133
|
/**
|
|
156
134
|
* Show the statistics information of a collection.
|
|
157
135
|
*
|
|
158
|
-
* @param data
|
|
159
|
-
*
|
|
160
|
-
*
|
|
161
|
-
* | collection_name | String | Collection name |
|
|
162
|
-
* | 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 |
|
|
163
|
-
*
|
|
164
|
-
* @returns
|
|
165
|
-
* | Property | Description |
|
|
166
|
-
* | :-- | :-- |
|
|
167
|
-
* | status | { error_code: number, reason: string } |
|
|
168
|
-
* | stats | [{key: string, value: string}] |
|
|
169
|
-
* | data | Transform **stats** to { row_count: 0 } |
|
|
170
|
-
*
|
|
136
|
+
* @param {GetCollectionStatisticsReq} data - The request parameters.
|
|
137
|
+
* @param {string} data.collection_name - The name of the collection to get statistics for.
|
|
138
|
+
* @param {number} [data.timeout] - An optional duration of time in milliseconds 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.
|
|
171
139
|
*
|
|
172
|
-
*
|
|
140
|
+
* @returns {Promise<StatisticsResponse>} The response from the server.
|
|
141
|
+
* @returns {string} status.error_code - The error code of the operation.
|
|
142
|
+
* @returns {string} status.reason - The reason for the error, if any.
|
|
143
|
+
* @returns {Object[]} stats - An array of objects, each containing a key-value pair representing a statistic.
|
|
144
|
+
* @returns {Object} data - Transforms **stats** to an object with properties representing statistics (e.g., { row_count: 0 }).
|
|
173
145
|
*
|
|
146
|
+
* @example
|
|
174
147
|
* ```
|
|
175
|
-
* new milvusClient(MILUVS_ADDRESS)
|
|
176
|
-
*
|
|
177
|
-
* });
|
|
148
|
+
* const milvusClient = new milvusClient(MILUVS_ADDRESS);
|
|
149
|
+
* const res = await milvusClient.getCollectionStatistics({ collection_name: 'my_collection' });
|
|
178
150
|
* ```
|
|
179
151
|
*/
|
|
180
152
|
getCollectionStatistics(data: GetCollectionStatisticsReq): Promise<StatisticsResponse>;
|
|
153
|
+
getCollectionStats: (data: GetCollectionStatisticsReq) => Promise<StatisticsResponse>;
|
|
181
154
|
/**
|
|
182
155
|
* Load collection data into query nodes, then you can do vector search on this collection.
|
|
183
|
-
* It's async function, but
|
|
156
|
+
* It's an async function, but you can use showCollections to check loading status.
|
|
184
157
|
*
|
|
185
|
-
* @param data
|
|
186
|
-
*
|
|
187
|
-
*
|
|
188
|
-
*
|
|
189
|
-
*
|
|
190
|
-
* | resource_groups? | String[] | resource group names |
|
|
191
|
-
* | 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 |
|
|
158
|
+
* @param {LoadCollectionReq} data - The request parameters.
|
|
159
|
+
* @param {string} data.collection_name - The name of the collection to load.
|
|
160
|
+
* @param {number} [data.replica_number] - The number of replicas.
|
|
161
|
+
* @param {string[]} [data.resource_groups] - The names of the resource groups.
|
|
162
|
+
* @param {number} [data.timeout] - An optional duration of time in milliseconds 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.
|
|
192
163
|
*
|
|
193
|
-
* @returns
|
|
194
|
-
*
|
|
195
|
-
*
|
|
196
|
-
* | error_code | Error code number |
|
|
197
|
-
* | reason | Error cause |
|
|
198
|
-
*
|
|
199
|
-
* #### Example
|
|
164
|
+
* @returns {Promise<ResStatus>} The response status of the operation.
|
|
165
|
+
* @returns {string} status.error_code - The error code of the operation.
|
|
166
|
+
* @returns {string} status.reason - The reason for the error, if any.
|
|
200
167
|
*
|
|
168
|
+
* @example
|
|
201
169
|
* ```
|
|
202
|
-
* new milvusClient(MILUVS_ADDRESS)
|
|
203
|
-
*
|
|
204
|
-
* });
|
|
170
|
+
* const milvusClient = new milvusClient(MILUVS_ADDRESS);
|
|
171
|
+
* const resStatus = await milvusClient.loadCollection({ collection_name: 'my_collection' });
|
|
205
172
|
* ```
|
|
206
173
|
*/
|
|
207
174
|
loadCollection(data: LoadCollectionReq): Promise<ResStatus>;
|
|
208
175
|
/**
|
|
209
|
-
* Same function
|
|
210
|
-
*
|
|
176
|
+
* Same function as loadCollection, but it's a synchronous function.
|
|
177
|
+
* Helps to ensure this collection is loaded.
|
|
211
178
|
*
|
|
212
|
-
* @param data
|
|
213
|
-
*
|
|
214
|
-
*
|
|
215
|
-
*
|
|
216
|
-
*
|
|
217
|
-
* | resource_groups? | String[] | resource group |
|
|
218
|
-
* | 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 |
|
|
179
|
+
* @param {LoadCollectionReq} data - The request parameters.
|
|
180
|
+
* @param {string} data.collection_name - The name of the collection to load.
|
|
181
|
+
* @param {number} [data.replica_number] - The number of replicas.
|
|
182
|
+
* @param {string[]} [data.resource_groups] - The names of the resource groups.
|
|
183
|
+
* @param {number} [data.timeout] - An optional duration of time in milliseconds 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.
|
|
219
184
|
*
|
|
220
|
-
* @returns
|
|
221
|
-
*
|
|
222
|
-
*
|
|
223
|
-
* | error_code | Error code number |
|
|
224
|
-
* | reason | Error cause |
|
|
225
|
-
*
|
|
226
|
-
* #### Example
|
|
185
|
+
* @returns {Promise<ResStatus>} The response status of the operation.
|
|
186
|
+
* @returns {string} status.error_code - The error code of the operation.
|
|
187
|
+
* @returns {string} status.reason - The reason for the error, if any.
|
|
227
188
|
*
|
|
189
|
+
* @example
|
|
228
190
|
* ```
|
|
229
|
-
* new milvusClient(MILUVS_ADDRESS)
|
|
230
|
-
*
|
|
231
|
-
* });
|
|
191
|
+
* const milvusClient = new milvusClient(MILUVS_ADDRESS);
|
|
192
|
+
* const resStatus = await milvusClient.loadCollectionSync({ collection_name: 'my_collection' });
|
|
232
193
|
* ```
|
|
233
194
|
*/
|
|
234
195
|
loadCollectionSync(data: LoadCollectionReq): Promise<ResStatus>;
|
|
@@ -236,47 +197,37 @@ export declare class Collection extends Database {
|
|
|
236
197
|
* Release a collection from cache to reduce cache usage.
|
|
237
198
|
* Note that you cannot search while the corresponding collection is unloaded.
|
|
238
199
|
*
|
|
239
|
-
* @param data
|
|
240
|
-
*
|
|
241
|
-
*
|
|
242
|
-
* | collection_name | String | Collection name |
|
|
243
|
-
* | 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 |
|
|
244
|
-
*
|
|
245
|
-
* @returns
|
|
246
|
-
* | Property | Description |
|
|
247
|
-
* | :-- | :-- |
|
|
248
|
-
* | error_code | Error code number |
|
|
249
|
-
* | reason | Error cause |
|
|
200
|
+
* @param {ReleaseLoadCollectionReq} data - The request parameters.
|
|
201
|
+
* @param {string} data.collection_name - The name of the collection to release.
|
|
202
|
+
* @param {number} [data.timeout] - An optional duration of time in milliseconds 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.
|
|
250
203
|
*
|
|
251
|
-
*
|
|
204
|
+
* @returns {Promise<ResStatus>} The response status of the operation.
|
|
205
|
+
* @returns {string} status.error_code - The error code of the operation.
|
|
206
|
+
* @returns {string} status.reason - The reason for the error, if any.
|
|
252
207
|
*
|
|
208
|
+
* @example
|
|
253
209
|
* ```
|
|
254
|
-
* new milvusClient(MILUVS_ADDRESS)
|
|
255
|
-
*
|
|
256
|
-
* });
|
|
210
|
+
* const milvusClient = new milvusClient(MILUVS_ADDRESS);
|
|
211
|
+
* const resStatus = await milvusClient.releaseCollection({ collection_name: 'my_collection' });
|
|
257
212
|
* ```
|
|
258
213
|
*/
|
|
259
214
|
releaseCollection(data: ReleaseLoadCollectionReq): Promise<ResStatus>;
|
|
260
215
|
/**
|
|
261
|
-
* Rename a collection
|
|
216
|
+
* Rename a collection.
|
|
262
217
|
*
|
|
263
|
-
* @param data
|
|
264
|
-
*
|
|
265
|
-
*
|
|
266
|
-
*
|
|
267
|
-
* | new_collection_name | String | new collection name |
|
|
268
|
-
* | 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 |
|
|
218
|
+
* @param {RenameCollectionReq} data - The request parameters.
|
|
219
|
+
* @param {string} data.collection_name - The current name of the collection.
|
|
220
|
+
* @param {string} data.new_collection_name - The new name for the collection.
|
|
221
|
+
* @param {number} [data.timeout] - An optional duration of time in milliseconds 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.
|
|
269
222
|
*
|
|
270
|
-
* @returns
|
|
271
|
-
*
|
|
272
|
-
*
|
|
273
|
-
* | error_code | Error code number |
|
|
274
|
-
* | reason | Error cause |
|
|
275
|
-
*
|
|
276
|
-
* #### Example
|
|
223
|
+
* @returns {Promise<ResStatus>} The response status of the operation.
|
|
224
|
+
* @returns {string} status.error_code - The error code of the operation.
|
|
225
|
+
* @returns {string} status.reason - The reason for the error, if any.
|
|
277
226
|
*
|
|
227
|
+
* @example
|
|
278
228
|
* ```
|
|
279
|
-
* new milvusClient(MILUVS_ADDRESS)
|
|
229
|
+
* const milvusClient = new milvusClient(MILUVS_ADDRESS);
|
|
230
|
+
* const resStatus = await milvusClient.renameCollection({
|
|
280
231
|
* collection_name: 'my_collection',
|
|
281
232
|
* new_collection_name: 'my_new_collection'
|
|
282
233
|
* });
|
|
@@ -286,206 +237,217 @@ export declare class Collection extends Database {
|
|
|
286
237
|
/**
|
|
287
238
|
* Drop a collection. Note that this drops all data in the collection.
|
|
288
239
|
*
|
|
289
|
-
* @param data
|
|
290
|
-
*
|
|
291
|
-
*
|
|
292
|
-
* | collection_name | String | Collection name |
|
|
293
|
-
* | 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. |
|
|
294
|
-
*
|
|
295
|
-
* @returns
|
|
296
|
-
* | Property | Description |
|
|
297
|
-
* | :-- | :-- |
|
|
298
|
-
* | error_code | Error code number |
|
|
299
|
-
* | reason | Error cause |
|
|
240
|
+
* @param {DropCollectionReq} data - The request parameters.
|
|
241
|
+
* @param {string} data.collection_name - The name of the collection to drop.
|
|
242
|
+
* @param {number} [data.timeout] - An optional duration of time in milliseconds 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.
|
|
300
243
|
*
|
|
301
|
-
*
|
|
244
|
+
* @returns {Promise<ResStatus>} The response status of the operation.
|
|
245
|
+
* @returns {string} status.error_code - The error code of the operation.
|
|
246
|
+
* @returns {string} status.reason - The reason for the error, if any.
|
|
302
247
|
*
|
|
248
|
+
* @example
|
|
303
249
|
* ```
|
|
304
|
-
* new milvusClient(MILUVS_ADDRESS)
|
|
305
|
-
*
|
|
306
|
-
* });
|
|
250
|
+
* const milvusClient = new milvusClient(MILUVS_ADDRESS);
|
|
251
|
+
* const resStatus = await milvusClient.dropCollection({ collection_name: 'my_collection' });
|
|
307
252
|
* ```
|
|
308
253
|
*/
|
|
309
254
|
dropCollection(data: DropCollectionReq): Promise<ResStatus>;
|
|
310
255
|
drop_collection: (data: DropCollectionReq) => Promise<ResStatus>;
|
|
311
256
|
/**
|
|
312
|
-
* Create collection alias, then you can use alias instead of collection_name when you
|
|
313
|
-
*
|
|
314
|
-
* @param data
|
|
315
|
-
* | Property | Type | Description |
|
|
316
|
-
* | :-- | :-- | :-- |
|
|
317
|
-
* | alias | String | alias name |
|
|
318
|
-
* | collection_name | String | Collection name |
|
|
319
|
-
* | 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. |
|
|
320
|
-
*
|
|
321
|
-
* @returns
|
|
322
|
-
* | Property | Description |
|
|
323
|
-
* | :-- | :-- |
|
|
324
|
-
* | error_code | Error code number |
|
|
325
|
-
* | reason | Error cause |
|
|
257
|
+
* Create a collection alias, then you can use the alias instead of the collection_name when you perform a vector search.
|
|
326
258
|
*
|
|
259
|
+
* @param {CreateAliasReq} data - The request parameters.
|
|
260
|
+
* @param {string} data.alias - The alias name.
|
|
261
|
+
* @param {string} data.collection_name - The name of the collection.
|
|
262
|
+
* @param {number} [data.timeout] - An optional duration of time in milliseconds 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.
|
|
327
263
|
*
|
|
328
|
-
*
|
|
264
|
+
* @returns {Promise<ResStatus>} The response status of the operation.
|
|
265
|
+
* @returns {string} status.error_code - The error code of the operation.
|
|
266
|
+
* @returns {string} status.reason - The reason for the error, if any.
|
|
329
267
|
*
|
|
268
|
+
* @example
|
|
330
269
|
* ```
|
|
331
|
-
* new milvusClient(MILUVS_ADDRESS)
|
|
332
|
-
*
|
|
270
|
+
* const milvusClient = new milvusClient(MILUVS_ADDRESS);
|
|
271
|
+
* const resStatus = await milvusClient.createAlias({
|
|
272
|
+
* alias: 'my_collection_alias',
|
|
333
273
|
* collection_name: 'my_collection',
|
|
334
274
|
* });
|
|
335
275
|
* ```
|
|
336
276
|
*/
|
|
337
277
|
createAlias(data: CreateAliasReq): Promise<ResStatus>;
|
|
338
278
|
/**
|
|
339
|
-
*
|
|
279
|
+
* Describe a collection alias.
|
|
340
280
|
*
|
|
341
|
-
* @param data
|
|
342
|
-
*
|
|
343
|
-
*
|
|
344
|
-
*
|
|
345
|
-
* | collection_name | String | Collection name |
|
|
346
|
-
* | 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. |
|
|
281
|
+
* @param {DescribeAliasReq} data - The request parameters.
|
|
282
|
+
* @param {string} data.alias - The alias name.
|
|
283
|
+
* @param {string} data.collection_name - The name of the collection.
|
|
284
|
+
* @param {number} [data.timeout] - An optional duration of time in milliseconds 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.
|
|
347
285
|
*
|
|
348
|
-
* @returns
|
|
349
|
-
*
|
|
350
|
-
*
|
|
351
|
-
*
|
|
352
|
-
*
|
|
286
|
+
* @returns {Promise<DescribeAliasResponse>} The response from the server.
|
|
287
|
+
* @returns {string} status.error_code - The error code of the operation.
|
|
288
|
+
* @returns {string} status.reason - The reason for the error, if any.
|
|
289
|
+
* @returns {string} collection - The name of the collection that the alias points to.
|
|
290
|
+
* @returns {string} alias - The alias of the collection.
|
|
291
|
+
*
|
|
292
|
+
* @example
|
|
293
|
+
* ```
|
|
294
|
+
* const milvusClient = new milvusClient(MILUVS_ADDRESS);
|
|
295
|
+
* const res = await milvusClient.describeAlias({
|
|
296
|
+
* alias: 'my_collection_alias',
|
|
297
|
+
* collection_name: 'my_collection',
|
|
298
|
+
* });
|
|
299
|
+
* ```
|
|
300
|
+
*/
|
|
301
|
+
describeAlias(data: DescribeAliasReq): Promise<DescribeAliasResponse>;
|
|
302
|
+
/**
|
|
303
|
+
* List all aliases of a collection.
|
|
353
304
|
*
|
|
305
|
+
* @param {ListAliasesReq} data - The request parameters.
|
|
306
|
+
* @param {string} data.collection_name - The name of the collection.
|
|
307
|
+
* @param {number} [data.timeout] - An optional duration of time in milliseconds 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.
|
|
354
308
|
*
|
|
355
|
-
*
|
|
309
|
+
* @returns {Promise<ListAliasesResponse>} The response from the server.
|
|
310
|
+
* @returns {string} status.error_code - The error code of the operation.
|
|
311
|
+
* @returns {string} status.reason - The reason for the error, if any.
|
|
312
|
+
* @returns {string[]} aliases - The list of aliases of the collection.
|
|
356
313
|
*
|
|
314
|
+
* @example
|
|
357
315
|
* ```
|
|
358
|
-
* new milvusClient(MILUVS_ADDRESS)
|
|
359
|
-
*
|
|
316
|
+
* const milvusClient = new milvusClient(MILUVS_ADDRESS);
|
|
317
|
+
* const res = await milvusClient.listAliases({
|
|
360
318
|
* collection_name: 'my_collection',
|
|
361
319
|
* });
|
|
362
320
|
* ```
|
|
363
321
|
*/
|
|
364
|
-
|
|
322
|
+
listAliases(data: ListAliasesReq): Promise<ListAliasesResponse>;
|
|
365
323
|
/**
|
|
366
|
-
*
|
|
324
|
+
* Drop a collection alias.
|
|
367
325
|
*
|
|
368
|
-
* @param data
|
|
369
|
-
*
|
|
370
|
-
*
|
|
371
|
-
*
|
|
372
|
-
* | collection_name | String | Collection name |
|
|
373
|
-
* | 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. |
|
|
326
|
+
* @param {DropAliasReq} data - The request parameters.
|
|
327
|
+
* @param {string} data.alias - The alias name.
|
|
328
|
+
* @param {string} data.collection_name - The name of the collection.
|
|
329
|
+
* @param {number} [data.timeout] - An optional duration of time in milliseconds 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.
|
|
374
330
|
*
|
|
375
|
-
* @returns
|
|
376
|
-
*
|
|
377
|
-
*
|
|
378
|
-
* | error_code | Error code number |
|
|
379
|
-
* | reason | Error cause |
|
|
331
|
+
* @returns {Promise<ResStatus>} The response status of the operation.
|
|
332
|
+
* @returns {string} status.error_code - The error code of the operation.
|
|
333
|
+
* @returns {string} status.reason - The reason for the error, if any.
|
|
380
334
|
*
|
|
335
|
+
* @example
|
|
336
|
+
* ```
|
|
337
|
+
* const milvusClient = new milvusClient(MILUVS_ADDRESS);
|
|
338
|
+
* const resStatus = await milvusClient.dropAlias({
|
|
339
|
+
* alias: 'my_collection_alias',
|
|
340
|
+
* collection_name: 'my_collection',
|
|
341
|
+
* });
|
|
342
|
+
* ```
|
|
343
|
+
*/
|
|
344
|
+
dropAlias(data: DropAliasReq): Promise<ResStatus>;
|
|
345
|
+
/**
|
|
346
|
+
* Alter a collection alias.
|
|
347
|
+
*
|
|
348
|
+
* @param {AlterAliasReq} data - The request parameters.
|
|
349
|
+
* @param {string} data.alias - The alias name.
|
|
350
|
+
* @param {string} data.collection_name - The name of the collection.
|
|
351
|
+
* @param {number} [data.timeout] - An optional duration of time in milliseconds 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.
|
|
381
352
|
*
|
|
382
|
-
*
|
|
353
|
+
* @returns {Promise<ResStatus>} The response status of the operation.
|
|
354
|
+
* @returns {string} status.error_code - The error code of the operation.
|
|
355
|
+
* @returns {string} status.reason - The reason for the error, if any.
|
|
383
356
|
*
|
|
357
|
+
* @example
|
|
384
358
|
* ```
|
|
385
|
-
* new milvusClient(MILUVS_ADDRESS)
|
|
386
|
-
*
|
|
359
|
+
* const milvusClient = new milvusClient(MILUVS_ADDRESS);
|
|
360
|
+
* const resStatus = await milvusClient.alterAlias({
|
|
361
|
+
* alias: 'my_collection_alias',
|
|
387
362
|
* collection_name: 'my_collection',
|
|
388
363
|
* });
|
|
389
364
|
* ```
|
|
390
365
|
*/
|
|
391
366
|
alterAlias(data: AlterAliasReq): Promise<ResStatus>;
|
|
392
367
|
/**
|
|
393
|
-
*
|
|
394
|
-
*
|
|
395
|
-
* @param data
|
|
396
|
-
* | Property | Type | Description |
|
|
397
|
-
* | :-- | :-- | :-- |
|
|
398
|
-
* | collection_name | String | The collection name to compact |
|
|
399
|
-
* | 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 |
|
|
368
|
+
* Perform compaction on a collection. This operation reduces the storage space used by the collection by removing deleted data and optimizing the data layout.
|
|
400
369
|
*
|
|
401
|
-
* @
|
|
402
|
-
*
|
|
403
|
-
*
|
|
404
|
-
* | status | { error_code: number, reason: string } |
|
|
405
|
-
* | compactionID | compaction ID |
|
|
370
|
+
* @param {CompactReq} data - The request parameters.
|
|
371
|
+
* @param {string} data.collection_name - The name of the collection to compact.
|
|
372
|
+
* @param {number} [data.timeout] - An optional duration of time in milliseconds 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.
|
|
406
373
|
*
|
|
407
|
-
*
|
|
374
|
+
* @returns {Promise<CompactionResponse>} The response of the operation.
|
|
375
|
+
* @returns {string} status.error_code - The error code of the operation.
|
|
376
|
+
* @returns {string} status.reason - The reason for the error, if any.
|
|
377
|
+
* @returns {string} compactionID - The ID of the compaction operation.
|
|
408
378
|
*
|
|
379
|
+
* @example
|
|
409
380
|
* ```
|
|
410
|
-
* new milvusClient(MILUVS_ADDRESS)
|
|
381
|
+
* const milvusClient = new milvusClient(MILUVS_ADDRESS);
|
|
382
|
+
* const resStatus = await milvusClient.compact({
|
|
411
383
|
* collection_name: 'my_collection',
|
|
412
384
|
* });
|
|
413
385
|
* ```
|
|
414
386
|
*/
|
|
415
387
|
compact(data: CompactReq): Promise<CompactionResponse>;
|
|
416
388
|
/**
|
|
417
|
-
* Get compaction
|
|
418
|
-
*
|
|
419
|
-
* @param data
|
|
420
|
-
* | Property | Type | Description |
|
|
421
|
-
* | :-- | :-- | :-- |
|
|
422
|
-
* | compactionID | number or string | the id returned by compact |
|
|
423
|
-
* | 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 |
|
|
389
|
+
* Get the compaction state of a targeted compaction id.
|
|
424
390
|
*
|
|
425
|
-
* @
|
|
426
|
-
*
|
|
427
|
-
*
|
|
428
|
-
* | status | { error_code: number, reason: string } |
|
|
429
|
-
* | state | the state of the compaction |
|
|
391
|
+
* @param {GetCompactionStateReq} data - The request parameters.
|
|
392
|
+
* @param {number|string} data.compactionID - The ID of the compaction operation, returned by the compact method.
|
|
393
|
+
* @param {number} [data.timeout] - An optional duration of time in milliseconds 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.
|
|
430
394
|
*
|
|
431
|
-
*
|
|
395
|
+
* @returns {Promise<GetCompactionStateResponse>} The response of the operation.
|
|
396
|
+
* @returns {string} status.error_code - The error code of the operation.
|
|
397
|
+
* @returns {string} status.reason - The reason for the error, if any.
|
|
398
|
+
* @returns {string} state - The state of the compaction operation.
|
|
432
399
|
*
|
|
400
|
+
* @example
|
|
433
401
|
* ```
|
|
434
|
-
* new milvusClient(MILUVS_ADDRESS)
|
|
435
|
-
*
|
|
402
|
+
* const milvusClient = new milvusClient(MILUVS_ADDRESS);
|
|
403
|
+
* const resStatus = await milvusClient.getCompactionState({
|
|
404
|
+
* compactionID: 'your_compaction_id',
|
|
436
405
|
* });
|
|
437
406
|
* ```
|
|
438
407
|
*/
|
|
439
408
|
getCompactionState(data: GetCompactionStateReq): Promise<GetCompactionStateResponse>;
|
|
440
409
|
/**
|
|
441
|
-
* Get compaction states of a targeted compaction id
|
|
410
|
+
* Get the compaction states of a targeted compaction id.
|
|
442
411
|
*
|
|
443
|
-
* @param data
|
|
444
|
-
*
|
|
445
|
-
*
|
|
446
|
-
* | compactionID | number or string | the id returned by compact |
|
|
447
|
-
* | 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 |
|
|
412
|
+
* @param {GetCompactionPlansReq} data - The request parameters.
|
|
413
|
+
* @param {number|string} data.compactionID - The ID of the compaction operation, returned by the compact method.
|
|
414
|
+
* @param {number} [data.timeout] - An optional duration of time in milliseconds 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.
|
|
448
415
|
*
|
|
449
|
-
* @returns
|
|
450
|
-
*
|
|
451
|
-
*
|
|
452
|
-
*
|
|
453
|
-
* | state | the state of the compaction |
|
|
454
|
-
*
|
|
455
|
-
* #### Example
|
|
416
|
+
* @returns {Promise<GetCompactionPlansResponse>} The response of the operation.
|
|
417
|
+
* @returns {string} status.error_code - The error code of the operation.
|
|
418
|
+
* @returns {string} status.reason - The reason for the error, if any.
|
|
419
|
+
* @returns {string} state - The state of the compaction operation.
|
|
456
420
|
*
|
|
421
|
+
* @example
|
|
457
422
|
* ```
|
|
458
|
-
* new milvusClient(MILUVS_ADDRESS)
|
|
459
|
-
*
|
|
423
|
+
* const milvusClient = new milvusClient(MILUVS_ADDRESS);
|
|
424
|
+
* const resStatus = await milvusClient.getCompactionStateWithPlans({
|
|
425
|
+
* compactionID: 'your_compaction_id',
|
|
460
426
|
* });
|
|
461
427
|
* ```
|
|
462
428
|
*/
|
|
463
429
|
getCompactionStateWithPlans(data: GetCompactionPlansReq): Promise<GetCompactionPlansResponse>;
|
|
464
430
|
/**
|
|
465
|
-
* Get replicas
|
|
431
|
+
* Get replicas of a collection.
|
|
466
432
|
*
|
|
467
|
-
* @param data
|
|
468
|
-
*
|
|
469
|
-
*
|
|
470
|
-
* | collectionID | number or string | the id returned by compact |
|
|
471
|
-
* | 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 |
|
|
433
|
+
* @param {GetReplicaReq} data - The request parameters.
|
|
434
|
+
* @param {number|string} data.collectionID - The ID of the collection, returned by the compact method.
|
|
435
|
+
* @param {number} [data.timeout] - An optional duration of time in milliseconds 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.
|
|
472
436
|
*
|
|
473
|
-
* @returns
|
|
474
|
-
*
|
|
475
|
-
*
|
|
476
|
-
*
|
|
477
|
-
* | ReplicaInfo[] | replica info array |
|
|
478
|
-
*
|
|
479
|
-
* #### Example
|
|
437
|
+
* @returns {Promise<ReplicasResponse>} The response of the operation.
|
|
438
|
+
* @returns {string} status.error_code - The error code of the operation.
|
|
439
|
+
* @returns {string} status.reason - The reason for the error, if any.
|
|
440
|
+
* @returns {ReplicaInfo[]} replicas - An array of replica information.
|
|
480
441
|
*
|
|
442
|
+
* @example
|
|
481
443
|
* ```
|
|
482
|
-
* new milvusClient(MILUVS_ADDRESS)
|
|
483
|
-
*
|
|
444
|
+
* const milvusClient = new milvusClient(MILUVS_ADDRESS);
|
|
445
|
+
* const resStatus = await milvusClient.getReplicas({
|
|
446
|
+
* collectionID: 'your_collection_id',
|
|
484
447
|
* });
|
|
485
|
-
*
|
|
486
448
|
* ```
|
|
487
449
|
*
|
|
488
|
-
*
|
|
450
|
+
* @returns
|
|
489
451
|
* ```
|
|
490
452
|
* {
|
|
491
453
|
* replicas: [
|
|
@@ -503,104 +465,87 @@ export declare class Collection extends Database {
|
|
|
503
465
|
*/
|
|
504
466
|
getReplicas(data: GetReplicaReq): Promise<ReplicasResponse>;
|
|
505
467
|
/**
|
|
506
|
-
* Get loading progress of a collection
|
|
507
|
-
*
|
|
508
|
-
* @param data
|
|
509
|
-
* | Property | Type | Description |
|
|
510
|
-
* | :-- | :-- | :-- |
|
|
511
|
-
* | collection_name | string | the name of the collection |
|
|
512
|
-
* | 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 |
|
|
468
|
+
* Get the loading progress of a collection.
|
|
513
469
|
*
|
|
514
|
-
* @
|
|
515
|
-
*
|
|
516
|
-
*
|
|
517
|
-
* | status | { error_code: number, reason: string } |
|
|
518
|
-
* | total_row_num | the total number of rows in the collection |
|
|
519
|
-
* | total_loaded_row_num | the total number of loaded rows in the collection |
|
|
470
|
+
* @param {GetLoadingProgressReq} data - The request parameters.
|
|
471
|
+
* @param {string} data.collection_name - The name of the collection.
|
|
472
|
+
* @param {number} [data.timeout] - An optional duration of time in milliseconds 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.
|
|
520
473
|
*
|
|
521
|
-
* @
|
|
474
|
+
* @returns {Promise<GetLoadingProgressResponse>} The response of the operation.
|
|
475
|
+
* @returns {string} status.error_code - The error code of the operation.
|
|
476
|
+
* @returns {string} status.reason - The reason for the error, if any.
|
|
477
|
+
* @returns {number} total_row_num - The total number of rows in the collection.
|
|
478
|
+
* @returns {number} total_loaded_row_num - The total number of loaded rows in the collection.
|
|
522
479
|
*
|
|
523
|
-
*
|
|
480
|
+
* @throws {Error} if `collection_name` property is not present in `data`.
|
|
524
481
|
*
|
|
482
|
+
* @example
|
|
525
483
|
* ```
|
|
526
|
-
* new milvusClient(MILUVS_ADDRESS)
|
|
484
|
+
* const milvusClient = new milvusClient(MILUVS_ADDRESS);
|
|
485
|
+
* const resStatus = await milvusClient.getLoadingProgress({
|
|
527
486
|
* collection_name: 'my_collection',
|
|
528
487
|
* });
|
|
529
488
|
* ```
|
|
530
489
|
*/
|
|
531
490
|
getLoadingProgress(data: GetLoadingProgressReq): Promise<GetLoadingProgressResponse>;
|
|
532
491
|
/**
|
|
533
|
-
* Get the loading state of a collection
|
|
492
|
+
* Get the loading state of a collection.
|
|
534
493
|
*
|
|
535
|
-
* @param data
|
|
536
|
-
*
|
|
537
|
-
*
|
|
538
|
-
* | collection_name | string | the name of the collection |
|
|
539
|
-
* | timeout? | number | An optional duration of time in milliseconds to allow for the RPC. If it is set to undefined, the client keeps waiting until the server responds or an error occurs. Default is undefined |
|
|
540
|
-
*
|
|
541
|
-
* @returns
|
|
542
|
-
* | Property | Description |
|
|
543
|
-
* | :-- | :-- |
|
|
544
|
-
* | status | { error_code: number, reason: string } |
|
|
545
|
-
* | state | the loading state of the collection |
|
|
494
|
+
* @param {GetLoadStateReq} data - The request parameters.
|
|
495
|
+
* @param {string} data.collection_name - The name of the collection.
|
|
496
|
+
* @param {number} [data.timeout] - An optional duration of time in milliseconds 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.
|
|
546
497
|
*
|
|
547
|
-
* @
|
|
498
|
+
* @returns {Promise<GetLoadStateResponse>} The response of the operation.
|
|
499
|
+
* @returns {string} status.error_code - The error code of the operation.
|
|
500
|
+
* @returns {string} status.reason - The reason for the error, if any.
|
|
501
|
+
* @returns {string} state - The loading state of the collection.
|
|
548
502
|
*
|
|
549
|
-
*
|
|
503
|
+
* @throws {Error} if `collection_name` property is not present in `data`.
|
|
550
504
|
*
|
|
505
|
+
* @example
|
|
551
506
|
* ```
|
|
552
|
-
* new milvusClient(MILUVS_ADDRESS)
|
|
507
|
+
* const milvusClient = new milvusClient(MILUVS_ADDRESS);
|
|
508
|
+
* const resStatus = await milvusClient.getLoadState({
|
|
553
509
|
* collection_name: 'my_collection',
|
|
554
510
|
* });
|
|
555
511
|
* ```
|
|
556
512
|
*/
|
|
557
513
|
getLoadState(data: GetLoadStateReq): Promise<GetLoadStateResponse>;
|
|
558
|
-
listCollections: (data?: ShowCollectionsReq) => Promise<ShowCollectionsResponse>;
|
|
559
514
|
/**
|
|
560
|
-
* Get the primary key field name
|
|
561
|
-
*
|
|
562
|
-
* @param data
|
|
563
|
-
* | Property | Type | Description |
|
|
564
|
-
* | :-- | :-- | :-- |
|
|
565
|
-
* | collection_name | string | the name of the collection |
|
|
566
|
-
* | timeout? | number | An optional duration of time in milliseconds to allow for the RPC. If it is set to undefined, the client keeps waiting until the server responds or an error occurs. Default is undefined |
|
|
515
|
+
* Get the primary key field name of a collection.
|
|
567
516
|
*
|
|
568
|
-
* @
|
|
569
|
-
*
|
|
570
|
-
*
|
|
571
|
-
* | pkfield | the primary key field name |
|
|
517
|
+
* @param {DescribeCollectionReq} data - The request parameters.
|
|
518
|
+
* @param {string} data.collection_name - The name of the collection.
|
|
519
|
+
* @param {number} [data.timeout] - An optional duration of time in milliseconds 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.
|
|
572
520
|
*
|
|
573
|
-
* @
|
|
521
|
+
* @returns {Promise<string>} The primary key field name of the collection.
|
|
574
522
|
*
|
|
575
|
-
*
|
|
523
|
+
* @throws {Error} if `collection_name` property is not present in `data`.
|
|
576
524
|
*
|
|
525
|
+
* @example
|
|
577
526
|
* ```
|
|
578
|
-
* new milvusClient(MILUVS_ADDRESS)
|
|
527
|
+
* const milvusClient = new milvusClient(MILUVS_ADDRESS);
|
|
528
|
+
* const pkFieldName = await milvusClient.getPkFieldName({
|
|
579
529
|
* collection_name: 'my_collection',
|
|
580
530
|
* });
|
|
581
531
|
* ```
|
|
582
532
|
*/
|
|
583
533
|
getPkFieldName(data: DescribeCollectionReq): Promise<string>;
|
|
584
534
|
/**
|
|
585
|
-
* Get the primary key field type
|
|
535
|
+
* Get the primary key field type.
|
|
586
536
|
*
|
|
587
|
-
* @param data
|
|
588
|
-
*
|
|
589
|
-
*
|
|
590
|
-
* | collection_name | string | the name of the collection |
|
|
591
|
-
* | timeout? | number | An optional duration of time in milliseconds to allow for the RPC. If it is set to undefined, the client keeps waiting until the server responds or an error occurs. Default is undefined |
|
|
592
|
-
*
|
|
593
|
-
* @returns
|
|
594
|
-
* | Property | Description |
|
|
595
|
-
* | :-- | :-- |
|
|
596
|
-
* | pkFieldType | the primary key field type |
|
|
537
|
+
* @param {DescribeCollectionReq} data - The request parameters.
|
|
538
|
+
* @param {string} data.collection_name - The name of the collection.
|
|
539
|
+
* @param {number} [data.timeout] - An optional duration of time in milliseconds 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.
|
|
597
540
|
*
|
|
598
|
-
* @
|
|
541
|
+
* @returns {Promise<keyof typeof DataType>} The primary key field type.
|
|
599
542
|
*
|
|
600
|
-
*
|
|
543
|
+
* @throws {Error} if `collection_name` property is not present in `data`.
|
|
601
544
|
*
|
|
545
|
+
* @example
|
|
602
546
|
* ```
|
|
603
|
-
* new milvusClient(MILUVS_ADDRESS)
|
|
547
|
+
* const milvusClient = new milvusClient(MILUVS_ADDRESS);
|
|
548
|
+
* const pkFieldType = await milvusClient.getPkFieldType({
|
|
604
549
|
* collection_name: 'my_collection',
|
|
605
550
|
* });
|
|
606
551
|
* ```
|