@zilliz/milvus2-sdk-node 2.2.4 → 2.2.6

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.
Files changed (78) hide show
  1. package/README.md +4 -21
  2. package/dist/milvus/BaseClient.d.ts +17 -0
  3. package/dist/milvus/BaseClient.js +58 -0
  4. package/dist/milvus/BaseClient.js.map +1 -0
  5. package/dist/milvus/Collection.d.ts +116 -65
  6. package/dist/milvus/Collection.js +200 -125
  7. package/dist/milvus/Collection.js.map +1 -1
  8. package/dist/milvus/Data.d.ts +14 -18
  9. package/dist/milvus/Data.js +82 -94
  10. package/dist/milvus/Data.js.map +1 -1
  11. package/dist/milvus/MilvusClient.d.ts +17 -0
  12. package/dist/milvus/MilvusClient.js +163 -0
  13. package/dist/milvus/MilvusClient.js.map +1 -0
  14. package/dist/milvus/MilvusIndex.d.ts +8 -8
  15. package/dist/milvus/MilvusIndex.js +19 -20
  16. package/dist/milvus/MilvusIndex.js.map +1 -1
  17. package/dist/milvus/Partition.d.ts +10 -10
  18. package/dist/milvus/Partition.js +27 -29
  19. package/dist/milvus/Partition.js.map +1 -1
  20. package/dist/milvus/Resource.d.ts +10 -11
  21. package/dist/milvus/Resource.js +18 -18
  22. package/dist/milvus/Resource.js.map +1 -1
  23. package/dist/milvus/User.d.ts +20 -20
  24. package/dist/milvus/User.js +45 -47
  25. package/dist/milvus/User.js.map +1 -1
  26. package/dist/milvus/Utils.d.ts +1 -1
  27. package/dist/milvus/Utils.js +1 -1
  28. package/dist/milvus/Utils.js.map +1 -1
  29. package/dist/milvus/const/ErrorReason.d.ts +9 -9
  30. package/dist/milvus/const/ErrorReason.js +9 -9
  31. package/dist/milvus/const/ErrorReason.js.map +1 -1
  32. package/dist/milvus/const/Milvus.d.ts +23 -19
  33. package/dist/milvus/const/Milvus.js +25 -31
  34. package/dist/milvus/const/Milvus.js.map +1 -1
  35. package/dist/milvus/index.d.ts +11 -48
  36. package/dist/milvus/index.js +16 -188
  37. package/dist/milvus/index.js.map +1 -1
  38. package/dist/milvus/types/Collection.d.ts +33 -16
  39. package/dist/milvus/types/Collection.js.map +1 -1
  40. package/dist/milvus/types/Common.d.ts +1 -1
  41. package/dist/milvus/types/User.d.ts +3 -3
  42. package/dist/proto/proto/common.proto +7 -1
  43. package/dist/proto/proto/feder.proto +40 -0
  44. package/dist/proto/proto/google/protobuf/descriptor.proto +41 -3
  45. package/dist/proto/proto/milvus.proto +61 -0
  46. package/dist/proto/proto/schema.proto +21 -22
  47. package/dist/sdk.json +1 -1
  48. package/dist/utils/Blob.js.map +1 -0
  49. package/dist/{milvus/utils → utils}/Format.d.ts +21 -1
  50. package/dist/{milvus/utils → utils}/Format.js +48 -11
  51. package/dist/utils/Format.js.map +1 -0
  52. package/dist/utils/Function.d.ts +4 -0
  53. package/dist/utils/Function.js +33 -0
  54. package/dist/utils/Function.js.map +1 -0
  55. package/dist/utils/Grpc.d.ts +19 -0
  56. package/dist/utils/Grpc.js +64 -0
  57. package/dist/utils/Grpc.js.map +1 -0
  58. package/dist/{milvus/utils → utils}/Validate.d.ts +1 -1
  59. package/dist/{milvus/utils → utils}/Validate.js +2 -2
  60. package/dist/utils/Validate.js.map +1 -0
  61. package/dist/utils/index.d.ts +5 -1
  62. package/dist/utils/index.js +19 -24
  63. package/dist/utils/index.js.map +1 -1
  64. package/dist/utils/test.d.ts +14 -0
  65. package/dist/utils/test.js +68 -0
  66. package/dist/utils/test.js.map +1 -0
  67. package/package.json +4 -4
  68. package/dist/milvus/Client.d.ts +0 -4
  69. package/dist/milvus/Client.js +0 -11
  70. package/dist/milvus/Client.js.map +0 -1
  71. package/dist/milvus/utils/Blob.js.map +0 -1
  72. package/dist/milvus/utils/Format.js.map +0 -1
  73. package/dist/milvus/utils/Validate.js.map +0 -1
  74. package/dist/milvus/utils/index.d.ts +0 -3
  75. package/dist/milvus/utils/index.js +0 -10
  76. package/dist/milvus/utils/index.js.map +0 -1
  77. /package/dist/{milvus/utils → utils}/Blob.d.ts +0 -0
  78. /package/dist/{milvus/utils → utils}/Blob.js +0 -0
package/README.md CHANGED
@@ -29,32 +29,15 @@ The following collection shows Milvus versions and recommended @zilliz/milvus2-s
29
29
  npm install @zilliz/milvus2-sdk-node
30
30
  ```
31
31
 
32
- ## SDK
33
-
34
- - [Client](./milvus/Index.ts)
35
- - [Collection](./milvus/Collection.ts)
36
- - [Index](./milvus/MilvusIndex.ts)
37
- - [FLAT](https://github.com/milvus-io/milvus-sdk-node/blob/main/test/Index.spec.ts#L63)
38
- - [IVF_FLAT](https://github.com/milvus-io/milvus-sdk-node/blob/main/test/Index.spec.ts#L76)
39
- - [IVF_SQ8](https://github.com/milvus-io/milvus-sdk-node/blob/main/test/Index.spec.ts#L91)
40
- - [IVF_PQ](https://github.com/milvus-io/milvus-sdk-node/blob/main/test/Index.spec.ts#L106)
41
- - [HNSW](https://github.com/milvus-io/milvus-sdk-node/blob/main/test/Index.spec.ts#L121)
42
- - [ANNOY](https://github.com/milvus-io/milvus-sdk-node/blob/main/test/Index.spec.ts#L136)
43
- - DISKANN (not supported yet)
44
- - [Partition](./milvus/Partition.ts)
45
- - [User](./milvus/User.ts)
46
- - [Utils](./milvus/Utils.ts)
47
- - [Data](./milvus/Data.ts)
48
-
49
32
  More documentation, you can refer [Milvus offical website](https://milvus.io/).
50
33
 
51
34
  ## Example
52
35
 
53
36
  1. [Hello World](https://github.com/milvus-io/milvus-sdk-node/blob/main/example/HelloMilvus.ts)
54
- 2. [How to operate collection](https://github.com/milvus-io/milvus-sdk-node/blob/main/example/Collection.ts)
55
- 3. [How to insert data](https://github.com/milvus-io/milvus-sdk-node/blob/main/example/Insert.ts)
56
- 4. [Vector similarity search on float field](https://github.com/milvus-io/milvus-sdk-node/blob/main/example/Search.ts)
57
- 5. [Vector similarity search on binary field](https://github.com/milvus-io/milvus-sdk-node/blob/main/example/BinarySearch.ts)
37
+ 2. [Create a collection](https://milvus.io/docs/create_collection.md)
38
+ 3. [Insert data](https://milvus.io/docs/insert_data.md)
39
+ 4. [Build index](https://milvus.io/docs/build_index.md)
40
+ 5. [Do vector search](https://milvus.io/docs/search.md)
58
41
 
59
42
  ## How to contribute
60
43
 
@@ -0,0 +1,17 @@
1
+ import { Root } from 'protobufjs';
2
+ import { Client } from '@grpc/grpc-js';
3
+ export declare class BaseClient {
4
+ schemaProto: Root;
5
+ milvusProto: Root;
6
+ grpcClient: Client;
7
+ /**
8
+ * Connect to milvus grpc client.
9
+ *
10
+ * @param address milvus address like: 127.0.0.1:19530
11
+ * @param ssl ssl connect or not, default is false
12
+ * @param username After created user in Milvus, username is required
13
+ * @param password After created user in Milvus, password is required
14
+ *
15
+ */
16
+ constructor(address: string, ssl?: boolean, username?: string, password?: string);
17
+ }
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.BaseClient = void 0;
7
+ var path_1 = __importDefault(require("path"));
8
+ var protobufjs_1 = __importDefault(require("protobufjs"));
9
+ var grpc_js_1 = require("@grpc/grpc-js");
10
+ var _1 = require(".");
11
+ var utils_1 = require("../utils");
12
+ // pathes
13
+ var protoPath = path_1.default.resolve(__dirname, '../proto/proto/milvus.proto');
14
+ var schemaProtoPath = path_1.default.resolve(__dirname, '../proto/proto/schema.proto');
15
+ // Base Client
16
+ var BaseClient = /** @class */ (function () {
17
+ /**
18
+ * Connect to milvus grpc client.
19
+ *
20
+ * @param address milvus address like: 127.0.0.1:19530
21
+ * @param ssl ssl connect or not, default is false
22
+ * @param username After created user in Milvus, username is required
23
+ * @param password After created user in Milvus, password is required
24
+ *
25
+ */
26
+ function BaseClient(address, ssl, username, password) {
27
+ // check if address is set
28
+ if (!address) {
29
+ throw new Error(_1.ERROR_REASONS.MILVUS_ADDRESS_IS_REQUIRED);
30
+ }
31
+ // if we need to create auth interceptors
32
+ var needAuth = username !== undefined && password !== undefined;
33
+ // get Milvus GRPC service
34
+ var MilvusService = (0, utils_1.getGRPCService)({
35
+ protoPath: protoPath,
36
+ serviceName: 'milvus.proto.milvus.MilvusService', // the name of the Milvus service
37
+ });
38
+ // create interceptors
39
+ var interceptors = needAuth
40
+ ? (0, utils_1.getAuthInterceptor)(username, password)
41
+ : null;
42
+ // load proto
43
+ this.schemaProto = protobufjs_1.default.loadSync(schemaProtoPath);
44
+ this.milvusProto = protobufjs_1.default.loadSync(protoPath);
45
+ // create grpc client
46
+ this.grpcClient = new MilvusService((0, utils_1.formatAddress)(address), // format the address
47
+ ssl ? grpc_js_1.credentials.createSsl() : grpc_js_1.credentials.createInsecure(), // create SSL or insecure credentials
48
+ {
49
+ interceptors: [interceptors],
50
+ // Milvus default max_receive_message_length is 100MB, but Milvus support change max_receive_message_length .
51
+ // So SDK should support max_receive_message_length unlimited.
52
+ 'grpc.max_receive_message_length': -1, // set max_receive_message_length to unlimited
53
+ });
54
+ }
55
+ return BaseClient;
56
+ }());
57
+ exports.BaseClient = BaseClient;
58
+ //# sourceMappingURL=BaseClient.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BaseClient.js","sourceRoot":"","sources":["../../milvus/BaseClient.ts"],"names":[],"mappings":";;;;;;AAAA,8CAAwB;AACxB,0DAA4C;AAC5C,yCAAoD;AACpD,sBAAkC;AAClC,kCAA6E;AAE7E,SAAS;AACT,IAAM,SAAS,GAAG,cAAI,CAAC,OAAO,CAAC,SAAS,EAAE,6BAA6B,CAAC,CAAC;AACzE,IAAM,eAAe,GAAG,cAAI,CAAC,OAAO,CAAC,SAAS,EAAE,6BAA6B,CAAC,CAAC;AAE/E,cAAc;AACd;IAQE;;;;;;;;OAQG;IACH,oBACE,OAAe,EACf,GAAa,EACb,QAAiB,EACjB,QAAiB;QAEjB,0BAA0B;QAC1B,IAAI,CAAC,OAAO,EAAE;YACZ,MAAM,IAAI,KAAK,CAAC,gBAAa,CAAC,0BAA0B,CAAC,CAAC;SAC3D;QAED,yCAAyC;QACzC,IAAM,QAAQ,GAAG,QAAQ,KAAK,SAAS,IAAI,QAAQ,KAAK,SAAS,CAAC;QAElE,0BAA0B;QAC1B,IAAM,aAAa,GAAG,IAAA,sBAAc,EAAC;YACnC,SAAS,WAAA;YACT,WAAW,EAAE,mCAAmC,EAAE,iCAAiC;SACpF,CAAC,CAAC;QAEH,sBAAsB;QACtB,IAAM,YAAY,GAAG,QAAQ;YAC3B,CAAC,CAAC,IAAA,0BAAkB,EAAC,QAAQ,EAAE,QAAQ,CAAC;YACxC,CAAC,CAAC,IAAI,CAAC;QAET,aAAa;QACb,IAAI,CAAC,WAAW,GAAG,oBAAQ,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAC;QACtD,IAAI,CAAC,WAAW,GAAG,oBAAQ,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;QAEhD,qBAAqB;QACrB,IAAI,CAAC,UAAU,GAAG,IAAI,aAAa,CACjC,IAAA,qBAAa,EAAC,OAAO,CAAC,EAAE,qBAAqB;QAC7C,GAAG,CAAC,CAAC,CAAC,qBAAW,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,qBAAW,CAAC,cAAc,EAAE,EAAE,qCAAqC;QACnG;YACE,YAAY,EAAE,CAAC,YAAY,CAAC;YAC5B,6GAA6G;YAC7G,8DAA8D;YAC9D,iCAAiC,EAAE,CAAC,CAAC,EAAE,8CAA8C;SACtF,CACF,CAAC;IACJ,CAAC;IACH,iBAAC;AAAD,CAAC,AA1DD,IA0DC;AA1DY,gCAAU"}
@@ -1,11 +1,9 @@
1
- import { Client } from './Client';
2
- import { CreateCollectionReq, DescribeCollectionReq, DropCollectionReq, GetCollectionStatisticsReq, LoadCollectionReq, ReleaseLoadCollectionReq, ShowCollectionsReq, HasCollectionReq, CreateAliasReq, DropAliasReq, AlterAliasReq, CompactReq, GetCompactionStateReq, GetCompactionPlansReq, GetReplicaReq, RenameCollectionReq, BoolResponse, ResStatus, CompactionResponse, DescribeCollectionResponse, GetCompactionPlansResponse, GetCompactionStateResponse, ShowCollectionsResponse, StatisticsResponse, ReplicasResponse } from './types';
1
+ import { BaseClient } from './BaseClient';
2
+ 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 } from '.';
3
3
  /**
4
4
  * @see [collection operation examples](https://github.com/milvus-io/milvus-sdk-node/blob/main/example/Collection.ts)
5
5
  */
6
- export declare class Collection extends Client {
7
- private readonly _protoRoot;
8
- constructor(client: any);
6
+ export declare class Collection extends BaseClient {
9
7
  /**
10
8
  * Create a collection in Milvus.
11
9
  *
@@ -27,7 +25,7 @@ export declare class Collection extends Client {
27
25
  * #### Example
28
26
  *
29
27
  * ```
30
- * new milvusClient(MILUVS_ADDRESS).collectionManager.createCollection({
28
+ * new milvusClient(MILUVS_ADDRESS).createCollection({
31
29
  * collection_name: 'my_collection',
32
30
  * fields: [
33
31
  * {
@@ -51,54 +49,54 @@ export declare class Collection extends Client {
51
49
  */
52
50
  createCollection(data: CreateCollectionReq): Promise<ResStatus>;
53
51
  /**
54
- * Check if a collection exists.
55
- *
56
- * @param data
57
- * | Property | Type | Description |
58
- * | :-- | :-- | :-- |
59
- * | collection_name | String | Collection name |
60
- * | 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 |
61
- *
62
- * @returns
63
- * | Property | Description |
64
- * | :-- | :-- |
65
- * | status | { error_code: number, reason: string } |
66
- * | value | `true` or `false` |
67
-
68
- *
69
- * #### Example
70
- *
71
- * ```
72
- * new milvusClient(MILUVS_ADDRESS).collectionManager.hasCollection({
73
- * collection_name: 'my_collection',
74
- * });
75
- * ```
76
- */
52
+ * Check if a collection exists.
53
+ *
54
+ * @param data
55
+ * | Property | Type | Description |
56
+ * | :-- | :-- | :-- |
57
+ * | collection_name | String | Collection name |
58
+ * | 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 |
59
+ *
60
+ * @returns
61
+ * | Property | Description |
62
+ * | :-- | :-- |
63
+ * | status | { error_code: number, reason: string } |
64
+ * | value | `true` or `false` |
65
+
66
+ *
67
+ * #### Example
68
+ *
69
+ * ```
70
+ * new milvusClient(MILUVS_ADDRESS).hasCollection({
71
+ * collection_name: 'my_collection',
72
+ * });
73
+ * ```
74
+ */
77
75
  hasCollection(data: HasCollectionReq): Promise<BoolResponse>;
78
76
  /**
79
- * List all collections or get collection loading status.
80
- *
81
- * @param data
82
- * | Property | Type | Description |
83
- * | :-- | :-- | :-- |
84
- * | type(optional) | enum | All -> 0, Loaded -> 1 |
85
- * | collection_names(optional) | String[] | If `type = Loaded`, Milvus will return `collection_names inMemory_percentages` |
86
- * | 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 |
77
+ * List all collections or get collection loading status.
78
+ *
79
+ * @param data
80
+ * | Property | Type | Description |
81
+ * | :-- | :-- | :-- |
82
+ * | type(optional) | enum | All -> 0, Loaded -> 1 |
83
+ * | collection_names(optional) | String[] | If `type = Loaded`, Milvus will return `collection_names inMemory_percentages` |
84
+ * | 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 |
87
85
 
88
- *
89
- * @returns
90
- * | Property | Description |
91
- * | :-- | :-- |
92
- * | status | { error_code: number, reason: string } |
93
- * | data | Contains collection name, ID , timestamp (UTC created time), and loadedPercentage (100 means loaded) |
94
- *
95
- *
96
- * #### Example
97
- *
98
- * ```
99
- * new milvusClient(MILUVS_ADDRESS).collectionManager.showCollections();
100
- * ```
101
- */
86
+ *
87
+ * @returns
88
+ * | Property | Description |
89
+ * | :-- | :-- |
90
+ * | status | { error_code: number, reason: string } |
91
+ * | data | Contains collection name, ID , timestamp (UTC created time), and loadedPercentage (100 means loaded) |
92
+ *
93
+ *
94
+ * #### Example
95
+ *
96
+ * ```
97
+ * new milvusClient(MILUVS_ADDRESS).showCollections();
98
+ * ```
99
+ */
102
100
  showCollections(data?: ShowCollectionsReq): Promise<ShowCollectionsResponse>;
103
101
  /**
104
102
  * Show the details of a collection, e.g. name, schema.
@@ -120,7 +118,7 @@ export declare class Collection extends Client {
120
118
  * #### Example
121
119
  *
122
120
  * ```
123
- * new milvusClient(MILUVS_ADDRESS).collectionManager.describeCollection({
121
+ * new milvusClient(MILUVS_ADDRESS).describeCollection({
124
122
  * collection_name: 'my_collection',
125
123
  * });
126
124
  * ```
@@ -146,7 +144,7 @@ export declare class Collection extends Client {
146
144
  * #### Example
147
145
  *
148
146
  * ```
149
- * new milvusClient(MILUVS_ADDRESS).collectionManager.getCollectionStatistics({
147
+ * new milvusClient(MILUVS_ADDRESS).getCollectionStatistics({
150
148
  * collection_name: 'my_collection',
151
149
  * });
152
150
  * ```
@@ -173,7 +171,7 @@ export declare class Collection extends Client {
173
171
  * #### Example
174
172
  *
175
173
  * ```
176
- * new milvusClient(MILUVS_ADDRESS).collectionManager.loadCollection({
174
+ * new milvusClient(MILUVS_ADDRESS).loadCollection({
177
175
  * collection_name: 'my_collection',
178
176
  * });
179
177
  * ```
@@ -200,7 +198,7 @@ export declare class Collection extends Client {
200
198
  * #### Example
201
199
  *
202
200
  * ```
203
- * new milvusClient(MILUVS_ADDRESS).collectionManager.loadCollectionSync({
201
+ * new milvusClient(MILUVS_ADDRESS).loadCollectionSync({
204
202
  * collection_name: 'my_collection',
205
203
  * });
206
204
  * ```
@@ -225,7 +223,7 @@ export declare class Collection extends Client {
225
223
  * #### Example
226
224
  *
227
225
  * ```
228
- * new milvusClient(MILUVS_ADDRESS).collectionManager.releaseCollection({
226
+ * new milvusClient(MILUVS_ADDRESS).releaseCollection({
229
227
  * collection_name: 'my_collection',
230
228
  * });
231
229
  * ```
@@ -250,7 +248,7 @@ export declare class Collection extends Client {
250
248
  * #### Example
251
249
  *
252
250
  * ```
253
- * new milvusClient(MILUVS_ADDRESS).collectionManager.renameCollection({
251
+ * new milvusClient(MILUVS_ADDRESS).renameCollection({
254
252
  * collection_name: 'my_collection',
255
253
  * new_collection_name: 'my_new_collection'
256
254
  * });
@@ -275,7 +273,7 @@ export declare class Collection extends Client {
275
273
  * #### Example
276
274
  *
277
275
  * ```
278
- * new milvusClient(MILUVS_ADDRESS).collectionManager.dropCollection({
276
+ * new milvusClient(MILUVS_ADDRESS).dropCollection({
279
277
  * collection_name: 'my_collection',
280
278
  * });
281
279
  * ```
@@ -301,7 +299,7 @@ export declare class Collection extends Client {
301
299
  * #### Example
302
300
  *
303
301
  * ```
304
- * new milvusClient(MILUVS_ADDRESS).collectionManager.createAlias({
302
+ * new milvusClient(MILUVS_ADDRESS).createAlias({
305
303
  * alias: 'my_collection_alis',
306
304
  * collection_name: 'my_collection',
307
305
  * });
@@ -328,7 +326,7 @@ export declare class Collection extends Client {
328
326
  * #### Example
329
327
  *
330
328
  * ```
331
- * new milvusClient(MILUVS_ADDRESS).collectionManager.dropAlias({
329
+ * new milvusClient(MILUVS_ADDRESS).dropAlias({
332
330
  * alias: 'my_collection_alis',
333
331
  * collection_name: 'my_collection',
334
332
  * });
@@ -355,7 +353,7 @@ export declare class Collection extends Client {
355
353
  * #### Example
356
354
  *
357
355
  * ```
358
- * new milvusClient(MILUVS_ADDRESS).collectionManager.alterAlais({
356
+ * new milvusClient(MILUVS_ADDRESS).alterAlais({
359
357
  * alias: 'my_collection_alis',
360
358
  * collection_name: 'my_collection',
361
359
  * });
@@ -380,7 +378,7 @@ export declare class Collection extends Client {
380
378
  * #### Example
381
379
  *
382
380
  * ```
383
- * new milvusClient(MILUVS_ADDRESS).collectionManager.compact({
381
+ * new milvusClient(MILUVS_ADDRESS).compact({
384
382
  * collection_name: 'my_collection',
385
383
  * });
386
384
  * ```
@@ -404,7 +402,7 @@ export declare class Collection extends Client {
404
402
  * #### Example
405
403
  *
406
404
  * ```
407
- * new milvusClient(MILUVS_ADDRESS).collectionManager.getCompactionState({
405
+ * new milvusClient(MILUVS_ADDRESS).getCompactionState({
408
406
  * compactionID: compactionID,
409
407
  * });
410
408
  * ```
@@ -428,7 +426,7 @@ export declare class Collection extends Client {
428
426
  * #### Example
429
427
  *
430
428
  * ```
431
- * new milvusClient(MILUVS_ADDRESS).collectionManager.getCompactionStateWithPlans({
429
+ * new milvusClient(MILUVS_ADDRESS).getCompactionStateWithPlans({
432
430
  * compactionID: compactionID,
433
431
  * });
434
432
  * ```
@@ -452,7 +450,7 @@ export declare class Collection extends Client {
452
450
  * #### Example
453
451
  *
454
452
  * ```
455
- * new milvusClient(MILUVS_ADDRESS).collectionManager.getReplicas({
453
+ * new milvusClient(MILUVS_ADDRESS).getReplicas({
456
454
  * collectionID: collectionID,
457
455
  * });
458
456
  *
@@ -475,4 +473,57 @@ export declare class Collection extends Client {
475
473
  * ```
476
474
  */
477
475
  getReplicas(data: GetReplicaReq): Promise<ReplicasResponse>;
476
+ /**
477
+ * Get loading progress of a collection
478
+ *
479
+ * @param data
480
+ * | Property | Type | Description |
481
+ * | :-- | :-- | :-- |
482
+ * | collection_name | string | the name of the collection |
483
+ * | 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 |
484
+ *
485
+ * @returns
486
+ * | Property | Description |
487
+ * | :-- | :-- |
488
+ * | status | { error_code: number, reason: string } |
489
+ * | total_row_num | the total number of rows in the collection |
490
+ * | total_loaded_row_num | the total number of loaded rows in the collection |
491
+ *
492
+ * @throws {Error} if `collection_name` property is not present in `data`
493
+ *
494
+ * #### Example
495
+ *
496
+ * ```
497
+ * new milvusClient(MILUVS_ADDRESS).getLoadingProgress({
498
+ * collection_name: 'my_collection',
499
+ * });
500
+ * ```
501
+ */
502
+ getLoadingProgress(data: GetLoadingProgressReq): Promise<GetLoadingProgressResponse>;
503
+ /**
504
+ * Get the loading state of a collection
505
+ *
506
+ * @param data
507
+ * | Property | Type | Description |
508
+ * | :-- | :-- | :-- |
509
+ * | collection_name | string | the name of the collection |
510
+ * | 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 |
511
+ *
512
+ * @returns
513
+ * | Property | Description |
514
+ * | :-- | :-- |
515
+ * | status | { error_code: number, reason: string } |
516
+ * | state | the loading state of the collection |
517
+ *
518
+ * @throws {Error} if `collection_name` property is not present in `data`
519
+ *
520
+ * #### Example
521
+ *
522
+ * ```
523
+ * new milvusClient(MILUVS_ADDRESS).getLoadState({
524
+ * collection_name: 'my_collection',
525
+ * });
526
+ * ```
527
+ */
528
+ getLoadState(data: GetLoadStateReq): Promise<GetLoadStateResponse>;
478
529
  }