@zilliz/milvus2-sdk-node 2.2.9 → 2.2.11

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 (149) hide show
  1. package/README.md +76 -12
  2. package/dist/milvus/MilvusClient.d.ts +21 -2
  3. package/dist/milvus/MilvusClient.js +35 -29
  4. package/dist/milvus/MilvusClient.js.map +1 -1
  5. package/dist/milvus/OrmClient.d.ts +19 -0
  6. package/dist/milvus/OrmClient.js +77 -0
  7. package/dist/milvus/OrmClient.js.map +1 -0
  8. package/dist/milvus/const/ErrorReason.d.ts +36 -31
  9. package/dist/milvus/const/ErrorReason.js +39 -32
  10. package/dist/milvus/const/ErrorReason.js.map +1 -1
  11. package/dist/milvus/const/Milvus.d.ts +2 -9
  12. package/dist/milvus/const/Milvus.js +16 -33
  13. package/dist/milvus/const/Milvus.js.map +1 -1
  14. package/dist/milvus/const/client.d.ts +5 -0
  15. package/dist/milvus/const/client.js +10 -0
  16. package/dist/milvus/const/client.js.map +1 -0
  17. package/dist/milvus/const/defaults.d.ts +11 -0
  18. package/dist/milvus/const/defaults.js +16 -0
  19. package/dist/milvus/const/defaults.js.map +1 -0
  20. package/dist/milvus/const/highLevel.d.ts +23 -0
  21. package/dist/milvus/const/highLevel.js +26 -0
  22. package/dist/milvus/const/highLevel.js.map +1 -0
  23. package/dist/milvus/const/index.d.ts +5 -0
  24. package/dist/milvus/{types.js → const/index.js} +7 -10
  25. package/dist/milvus/const/index.js.map +1 -0
  26. package/dist/milvus/const/limits.d.ts +2 -0
  27. package/dist/milvus/const/limits.js +7 -0
  28. package/dist/milvus/const/limits.js.map +1 -0
  29. package/dist/milvus/{BaseClient.d.ts → grpc/BaseClient.d.ts} +20 -8
  30. package/dist/milvus/grpc/BaseClient.js +83 -0
  31. package/dist/milvus/grpc/BaseClient.js.map +1 -0
  32. package/dist/milvus/{Collection.d.ts → grpc/Collection.d.ts} +32 -3
  33. package/dist/milvus/grpc/Collection.js +786 -0
  34. package/dist/milvus/grpc/Collection.js.map +1 -0
  35. package/dist/milvus/{Data.d.ts → grpc/Data.d.ts} +68 -10
  36. package/dist/milvus/grpc/Data.js +880 -0
  37. package/dist/milvus/grpc/Data.js.map +1 -0
  38. package/dist/milvus/grpc/Database.d.ts +69 -0
  39. package/dist/milvus/grpc/Database.js +98 -0
  40. package/dist/milvus/grpc/Database.js.map +1 -0
  41. package/dist/milvus/grpc/GrpcClient.d.ts +46 -0
  42. package/dist/milvus/grpc/GrpcClient.js +150 -0
  43. package/dist/milvus/grpc/GrpcClient.js.map +1 -0
  44. package/dist/milvus/{MilvusIndex.d.ts → grpc/MilvusIndex.d.ts} +1 -1
  45. package/dist/milvus/grpc/MilvusIndex.js +203 -0
  46. package/dist/milvus/grpc/MilvusIndex.js.map +1 -0
  47. package/dist/milvus/{Partition.d.ts → grpc/Partition.d.ts} +1 -1
  48. package/dist/milvus/grpc/Partition.js +265 -0
  49. package/dist/milvus/grpc/Partition.js.map +1 -0
  50. package/dist/milvus/{Resource.d.ts → grpc/Resource.d.ts} +2 -2
  51. package/dist/milvus/grpc/Resource.js +250 -0
  52. package/dist/milvus/grpc/Resource.js.map +1 -0
  53. package/dist/milvus/{User.d.ts → grpc/User.d.ts} +1 -1
  54. package/dist/milvus/grpc/User.js +619 -0
  55. package/dist/milvus/grpc/User.js.map +1 -0
  56. package/dist/milvus/index.d.ts +4 -13
  57. package/dist/milvus/index.js +6 -14
  58. package/dist/milvus/index.js.map +1 -1
  59. package/dist/milvus/orm/Collection.d.ts +45 -0
  60. package/dist/milvus/orm/Collection.js +172 -0
  61. package/dist/milvus/orm/Collection.js.map +1 -0
  62. package/dist/milvus/orm/index.d.ts +2 -0
  63. package/dist/milvus/orm/index.js +19 -0
  64. package/dist/milvus/orm/index.js.map +1 -0
  65. package/dist/milvus/orm/utils.d.ts +27 -0
  66. package/dist/milvus/orm/utils.js +27 -0
  67. package/dist/milvus/orm/utils.js.map +1 -0
  68. package/dist/milvus/types/Client.d.ts +12 -1
  69. package/dist/milvus/types/Collection.d.ts +18 -4
  70. package/dist/milvus/types/Common.d.ts +1 -1
  71. package/dist/milvus/types/Data.d.ts +41 -5
  72. package/dist/milvus/types/Database.d.ts +12 -0
  73. package/dist/milvus/types/{Index.js → Database.js} +1 -1
  74. package/dist/milvus/types/Database.js.map +1 -0
  75. package/dist/milvus/types/HighLevel.d.ts +13 -0
  76. package/dist/milvus/types/HighLevel.js +3 -0
  77. package/dist/milvus/types/HighLevel.js.map +1 -0
  78. package/dist/milvus/types/{Index.d.ts → MilvusIndex.d.ts} +3 -2
  79. package/dist/milvus/types/MilvusIndex.js +3 -0
  80. package/dist/milvus/types/MilvusIndex.js.map +1 -0
  81. package/dist/milvus/types/Resource.d.ts +1 -1
  82. package/dist/milvus/types/User.d.ts +1 -1
  83. package/dist/milvus/types/index.d.ts +12 -0
  84. package/dist/milvus/types/index.js +30 -0
  85. package/dist/milvus/types/index.js.map +1 -0
  86. package/dist/{utils → milvus/utils}/Blob.js +4 -4
  87. package/dist/milvus/utils/Blob.js.map +1 -0
  88. package/dist/{utils → milvus/utils}/Format.d.ts +66 -2
  89. package/dist/milvus/utils/Format.js +416 -0
  90. package/dist/milvus/utils/Format.js.map +1 -0
  91. package/dist/{utils → milvus/utils}/Function.d.ts +1 -1
  92. package/dist/{utils → milvus/utils}/Function.js +7 -7
  93. package/dist/milvus/utils/Function.js.map +1 -0
  94. package/dist/{utils → milvus/utils}/Grpc.d.ts +9 -8
  95. package/dist/milvus/utils/Grpc.js +190 -0
  96. package/dist/milvus/utils/Grpc.js.map +1 -0
  97. package/dist/{utils → milvus/utils}/Validate.d.ts +7 -1
  98. package/dist/milvus/utils/Validate.js +140 -0
  99. package/dist/milvus/utils/Validate.js.map +1 -0
  100. package/dist/{utils → milvus/utils}/index.d.ts +2 -0
  101. package/dist/{utils → milvus/utils}/index.js +2 -0
  102. package/dist/milvus/utils/index.js.map +1 -0
  103. package/dist/milvus/utils/logger.d.ts +1 -0
  104. package/dist/milvus/utils/logger.js +18 -0
  105. package/dist/milvus/utils/logger.js.map +1 -0
  106. package/dist/proto/proto/common.proto +38 -14
  107. package/dist/proto/proto/google/protobuf/descriptor.proto +8 -4
  108. package/dist/proto/proto/milvus.proto +86 -83
  109. package/dist/proto/proto/schema.proto +5 -0
  110. package/dist/sdk.json +1 -1
  111. package/package.json +14 -11
  112. package/dist/milvus/BaseClient.js +0 -62
  113. package/dist/milvus/BaseClient.js.map +0 -1
  114. package/dist/milvus/Collection.js +0 -960
  115. package/dist/milvus/Collection.js.map +0 -1
  116. package/dist/milvus/Data.js +0 -909
  117. package/dist/milvus/Data.js.map +0 -1
  118. package/dist/milvus/GrpcClient.d.ts +0 -32
  119. package/dist/milvus/GrpcClient.js +0 -236
  120. package/dist/milvus/GrpcClient.js.map +0 -1
  121. package/dist/milvus/MilvusIndex.js +0 -299
  122. package/dist/milvus/MilvusIndex.js.map +0 -1
  123. package/dist/milvus/Partition.js +0 -369
  124. package/dist/milvus/Partition.js.map +0 -1
  125. package/dist/milvus/Resource.js +0 -356
  126. package/dist/milvus/Resource.js.map +0 -1
  127. package/dist/milvus/User.js +0 -806
  128. package/dist/milvus/User.js.map +0 -1
  129. package/dist/milvus/Utils.d.ts +0 -1
  130. package/dist/milvus/Utils.js +0 -8
  131. package/dist/milvus/Utils.js.map +0 -1
  132. package/dist/milvus/types/Index.js.map +0 -1
  133. package/dist/milvus/types.d.ts +0 -9
  134. package/dist/milvus/types.js.map +0 -1
  135. package/dist/proto/proto/feder.proto +0 -40
  136. package/dist/proto/proto/msg.proto +0 -107
  137. package/dist/utils/Blob.js.map +0 -1
  138. package/dist/utils/Format.js +0 -252
  139. package/dist/utils/Format.js.map +0 -1
  140. package/dist/utils/Function.js.map +0 -1
  141. package/dist/utils/Grpc.js +0 -170
  142. package/dist/utils/Grpc.js.map +0 -1
  143. package/dist/utils/Validate.js +0 -124
  144. package/dist/utils/Validate.js.map +0 -1
  145. package/dist/utils/index.js.map +0 -1
  146. package/dist/utils/test.d.ts +0 -15
  147. package/dist/utils/test.js +0 -98
  148. package/dist/utils/test.js.map +0 -1
  149. /package/dist/{utils → milvus/utils}/Blob.d.ts +0 -0
package/README.md CHANGED
@@ -78,7 +78,7 @@ Create a new app.js file and add the following code to try out some basic vector
78
78
  ```javascript
79
79
  import { MilvusClient, DataType } from '@zilliz/milvus2-sdk-node';
80
80
 
81
- const address = 'your-milvus-ip';
81
+ const address = 'your-milvus-ip-with-port';
82
82
  const username = 'your-milvus-username'; // optional username
83
83
  const password = 'your-milvus-password'; // optional password
84
84
  const ssl = false; // secure or not
@@ -87,17 +87,20 @@ const ssl = false; // secure or not
87
87
  const client = new MilvusClient({ address, ssl, username, password });
88
88
  ```
89
89
 
90
- | Parameters | Description | Type | Example |
91
- | ----------- | --------------------------------------------------------------------------------- | ------- | ------------------- |
92
- | address | The Milvus IP address | String | '192.168.0.1:19530' |
93
- | ssl? | SSL connection. It is false by default. | Boolean | false |
94
- | username? | The username used to connect to Milvus | String | milvus |
95
- | address? | The password used to connect to Milvus | String | milvus |
96
- | maxRetries? | The number of retries for the grpc method, by default: 3 | Number | 3 |
97
- | retryDelay? | The delay between attempts at retrying a failed grpc method in ms, by default: 30 | Number | 30 |
90
+ | Parameters | Description | Type | Example |
91
+ | --------------- | ------------------------------------------------------------------------------------------------------------------------ | ------- | ------------------- |
92
+ | address | The Milvus IP address | String | '192.168.0.1:19530' |
93
+ | ssl? | SSL connection. It is false by default. | Boolean | false |
94
+ | username? | The username used to connect to Milvus | String | milvus |
95
+ | address? | The password used to connect to Milvus | String | milvus |
96
+ | maxRetries? | The number of retries for the grpc method, by default: 3 | Number | 3 |
97
+ | retryDelay? | The delay between attempts at retrying a failed grpc method in ms, by default: 30 | Number | 30 |
98
+ | channelOptions? | an optional configuration object that can be passed to a gRPC client when creating a channel to connect to a gRPC server | Object | |
98
99
 
99
100
  ### define schema for collection
100
101
 
102
+ The code shows an example of how to define a schema for a collection in Milvus using the Milvus Node SDK. A schema defines the properties of a collection, such as the names and data types of the fields that make up the vectors.
103
+
101
104
  ```javascript
102
105
  // define schema
103
106
  const collection_name = `book`;
@@ -124,6 +127,20 @@ const schema = [
124
127
  ];
125
128
  ```
126
129
 
130
+ In the code, the schema variable is defined as an array of objects, where each object represents a field in the collection. The fields are defined using the following properties:
131
+
132
+ `name`: The name of the field, which must be unique within the collection.
133
+
134
+ `description`: A description of the field, which can be used to provide additional information about the field.
135
+
136
+ `data_type`: The data type of the field, which can be one of several predefined data types such as Int64 or FloatVector.
137
+
138
+ `is_primary_key`: A boolean flag that indicates whether the field is a primary key. Primary keys are unique identifiers for each vector in the collection, and can be used to efficiently retrieve specific vectors.
139
+
140
+ `autoID`: A boolean flag that indicates whether the primary key is automatically generated by Milvus.
141
+
142
+ `dim`: The dimensionality of the vector field. For fields of type FloatVector, this specifies the number of dimensions in each vector.
143
+
127
144
  ### create collection
128
145
 
129
146
  ```javascript
@@ -136,6 +153,8 @@ await client.createCollection({
136
153
 
137
154
  ### prepare data
138
155
 
156
+ When using the Milvus Node SDK to insert data into a collection, it's important to ensure that the data format of the input matches the schema defined for the collection. The data format used by the Milvus Node SDK consists of an array of objects, where each object represents an entity. Typically, each object contains a unique identifier for the entity, which can be an integer or string, and a vector field that stores the feature values as an array of floating-point numbers.
157
+
139
158
  ```javascript
140
159
  // generate mock data
141
160
  const fields_data = [];
@@ -155,6 +174,8 @@ for (let i = 0; i < 1000; i++) {
155
174
 
156
175
  ### insert data into collection
157
176
 
177
+ Once we have the data, you can insert data into the collection.
178
+
158
179
  ```javascript
159
180
  await client.insert({
160
181
  collection_name,
@@ -162,7 +183,9 @@ await client.insert({
162
183
  });
163
184
  ```
164
185
 
165
- ### create index and load collection into memory
186
+ ### create index
187
+
188
+ By creating an index and loading the collection into memory, you can improve the performance of search and retrieval operations in Milvus, making it faster and more efficient to work with large-scale datasets.
166
189
 
167
190
  ```javascript
168
191
  // create index
@@ -170,9 +193,31 @@ await client.createIndex({
170
193
  collection_name,
171
194
  field_name: 'book_intro',
172
195
  index_name: 'myindex',
173
- index_type: 'IVF_FLAT',
196
+ index_type: 'HNSW',
197
+ params: { efConstruction: 10, M: 4 },
174
198
  metric_type: 'L2',
175
199
  });
200
+ ```
201
+
202
+ Milvus supports [several different types of indexes](https://milvus.io/docs/index.md), each of which is optimized for different use cases and data distributions. Some of the most commonly used index types in Milvus include IVF_FLAT, IVF_SQ8, IVF_PQ, and HNSW. When creating an index in Milvus, you must choose an appropriate index type based on your specific use case and data distribution.
203
+
204
+ `collection_name`: The name of the collection to create the index for.
205
+
206
+ `field_name`: The name of the field to create the index on.
207
+
208
+ `index_name`: The name of the index to create.
209
+
210
+ `index_type`: The type of index to create.
211
+
212
+ `param`: The index build parameters, please refer to the [index docs](https://milvus.io/docs/index.md).
213
+
214
+ `metric_type`: The distance metric to use when computing the similarity between vectors. In this case, the metric type is set to L2, which is a commonly used metric for computing the Euclidean distance between vectors.
215
+
216
+ ### load collection
217
+
218
+ When you create a collection in Milvus, the collection data is initially stored on disk, and it is not immediately available for search and retrieval. In order to search or retrieve data from the collection, you must first load the collection into memory using the loadCollectionSync method.
219
+
220
+ ```javascript
176
221
  // load collection
177
222
  await client.loadCollectionSync({
178
223
  collection_name,
@@ -181,6 +226,8 @@ await client.loadCollectionSync({
181
226
 
182
227
  ### vector search
183
228
 
229
+ Now you can perform vector search on your collection.
230
+
184
231
  ```javascript
185
232
  // Generate a random search vector
186
233
  const searchVector = [...Array(dim)].map(() => Math.random());
@@ -188,7 +235,7 @@ const searchVector = [...Array(dim)].map(() => Math.random());
188
235
  // Perform a vector search on the collection
189
236
  const res = await client.search({
190
237
  collection_name, // required, the collection name
191
- vectors: [0.1, 0.2, 0.3, 0.4], // required, vector used to compare other vectors in milvus
238
+ vector: [0.1, 0.2, 0.3, 0.4], // required, vector used to compare other vectors in milvus
192
239
  filter: 'word_count > 0', // optional, filter
193
240
  params: { nprobe: 64 }, // optional, specify the search parameters
194
241
  limit: 1, // specify the number of nearest neighbors to return
@@ -197,6 +244,23 @@ const res = await client.search({
197
244
  });
198
245
  ```
199
246
 
247
+ The code snippet performs a vector search on the collection.
248
+
249
+ First, a random search vector is generated. Then, the `client.search()` method is called with several parameters:
250
+ `collection_name`: Required. Specifies the name of the Milvus collection to search.
251
+
252
+ `vectors`: Required. Specifies the vector used to compare other vectors in Milvus. The example code passes an array of floating-point numbers as the vector.
253
+
254
+ `filter` or `expr`: Optional. Specifies a filter to apply to the search query. The example code passes a filter that only includes vectors where the word_count field is greater than 0.
255
+
256
+ `params`: Optional. Specifies additional search parameters. The example code sets nprobe to 64, which controls the number of clusters to search during the query. By default, nothing will be set.
257
+
258
+ `limit` or `topk`: Optional. Specifies the number of nearest neighbors to return. The example code sets this to 1. By default, it will be `100`
259
+
260
+ `metric_type`: Optional. Specifies the metric used to calculate the similarity of two vectors. The example code sets this to `"L2"`. By default, it will be `"L2"`.
261
+
262
+ `output_fields`: Optional. Specifies which fields to include in the search results. The example code specifies the `book_id` and `word_count` fields, by default the node sdk will output all fields.
263
+
200
264
  ## Next Steps
201
265
 
202
266
  - [What is Milvus](https://milvus.io/)
@@ -1,6 +1,25 @@
1
- import { GRPCClient, ClientConfig } from '.';
2
1
  import { ChannelOptions } from '@grpc/grpc-js';
2
+ import { GRPCClient, ClientConfig } from '.';
3
+ /**
4
+ * Milvus Client class that extends GRPCClient and handles communication with Milvus server.
5
+ */
3
6
  export declare class MilvusClient extends GRPCClient {
7
+ /**
8
+ * Returns the SDK information.
9
+ * SDK information will be generated on the building phase
10
+ * @returns Object containing SDK version and recommended Milvus version.
11
+ */
12
+ static get sdkInfo(): {
13
+ version: string;
14
+ recommandMilvus: string;
15
+ };
16
+ /**
17
+ * Creates a new instance of MilvusClient.
18
+ * @param configOrAddress The Milvus server's address or client configuration object.
19
+ * @param ssl Whether to use SSL or not.
20
+ * @param username The username for authentication.
21
+ * @param password The password for authentication.
22
+ * @param channelOptions Additional channel options for gRPC.
23
+ */
4
24
  constructor(configOrAddress: ClientConfig | string, ssl?: boolean, username?: string, password?: string, channelOptions?: ChannelOptions);
5
- connect(): void;
6
25
  }
@@ -1,35 +1,41 @@
1
1
  "use strict";
2
- var __extends = (this && this.__extends) || (function () {
3
- var extendStatics = function (d, b) {
4
- extendStatics = Object.setPrototypeOf ||
5
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
- return extendStatics(d, b);
8
- };
9
- return function (d, b) {
10
- if (typeof b !== "function" && b !== null)
11
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
- extendStatics(d, b);
13
- function __() { this.constructor = d; }
14
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
- };
16
- })();
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
17
5
  Object.defineProperty(exports, "__esModule", { value: true });
18
6
  exports.MilvusClient = void 0;
19
- var _1 = require(".");
20
- var MilvusClient = /** @class */ (function (_super) {
21
- __extends(MilvusClient, _super);
22
- function MilvusClient(configOrAddress, ssl, username, password, channelOptions) {
23
- var _this = _super.call(this, configOrAddress, ssl, username, password, channelOptions) || this;
24
- // connect
25
- _this.connect();
26
- return _this;
7
+ const _1 = require(".");
8
+ const sdk_json_1 = __importDefault(require("../sdk.json"));
9
+ /**
10
+ * Milvus Client class that extends GRPCClient and handles communication with Milvus server.
11
+ */
12
+ class MilvusClient extends _1.GRPCClient {
13
+ /**
14
+ * Returns the SDK information.
15
+ * SDK information will be generated on the building phase
16
+ * @returns Object containing SDK version and recommended Milvus version.
17
+ */
18
+ static get sdkInfo() {
19
+ return {
20
+ version: sdk_json_1.default.version,
21
+ recommandMilvus: sdk_json_1.default.milvusVersion,
22
+ };
27
23
  }
28
- // overload
29
- MilvusClient.prototype.connect = function () {
30
- _super.prototype.connect.call(this);
31
- };
32
- return MilvusClient;
33
- }(_1.GRPCClient));
24
+ /**
25
+ * Creates a new instance of MilvusClient.
26
+ * @param configOrAddress The Milvus server's address or client configuration object.
27
+ * @param ssl Whether to use SSL or not.
28
+ * @param username The username for authentication.
29
+ * @param password The password for authentication.
30
+ * @param channelOptions Additional channel options for gRPC.
31
+ */
32
+ constructor(configOrAddress, ssl, username, password, channelOptions) {
33
+ // setup the configuration
34
+ super(configOrAddress, ssl, username, password, channelOptions);
35
+ _1.logger.debug(`new client initialized, version: ${MilvusClient.sdkInfo.version} `);
36
+ // connect();
37
+ this.connect(MilvusClient.sdkInfo.version);
38
+ }
39
+ }
34
40
  exports.MilvusClient = MilvusClient;
35
41
  //# sourceMappingURL=MilvusClient.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"MilvusClient.js","sourceRoot":"","sources":["../../milvus/MilvusClient.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,sBAA6C;AAG7C;IAAkC,gCAAU;IAC1C,sBACE,eAAsC,EACtC,GAAa,EACb,QAAiB,EACjB,QAAiB,EACjB,cAA+B;QALjC,YAOE,kBAAM,eAAe,EAAE,GAAG,EAAE,QAAQ,EAAE,QAAQ,EAAE,cAAc,CAAC,SAIhE;QAFC,UAAU;QACV,KAAI,CAAC,OAAO,EAAE,CAAC;;IACjB,CAAC;IAED,WAAW;IACX,8BAAO,GAAP;QACE,iBAAM,OAAO,WAAE,CAAC;IAClB,CAAC;IACH,mBAAC;AAAD,CAAC,AAlBD,CAAkC,aAAU,GAkB3C;AAlBY,oCAAY"}
1
+ {"version":3,"file":"MilvusClient.js","sourceRoot":"","sources":["../../milvus/MilvusClient.ts"],"names":[],"mappings":";;;;;;AACA,wBAAqD;AACrD,2DAAkC;AAElC;;GAEG;AACH,MAAa,YAAa,SAAQ,aAAU;IAC1C;;;;OAIG;IACH,MAAM,KAAK,OAAO;QAChB,OAAO;YACL,OAAO,EAAE,kBAAO,CAAC,OAAO;YACxB,eAAe,EAAE,kBAAO,CAAC,aAAa;SACvC,CAAC;IACJ,CAAC;IAED;;;;;;;OAOG;IACH,YACE,eAAsC,EACtC,GAAa,EACb,QAAiB,EACjB,QAAiB,EACjB,cAA+B;QAE/B,0BAA0B;QAC1B,KAAK,CAAC,eAAe,EAAE,GAAG,EAAE,QAAQ,EAAE,QAAQ,EAAE,cAAc,CAAC,CAAC;QAChE,SAAM,CAAC,KAAK,CACV,oCAAoC,YAAY,CAAC,OAAO,CAAC,OAAO,GAAG,CACpE,CAAC;QACF,aAAa;QACb,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IAC7C,CAAC;CACF;AApCD,oCAoCC"}
@@ -0,0 +1,19 @@
1
+ import { ShowCollectionsReq, CreateColReq, MilvusClient } from './';
2
+ import { Collection } from './orm';
3
+ /**
4
+ * ORM client that extends Milvus client
5
+ */
6
+ export declare class OrmClient extends MilvusClient {
7
+ /**
8
+ * Creates a new collection with the given name and schema, or returns an existing one with the same name.
9
+ * @param data An object containing the collection name, dimension, schema (optional), enable_dynamic_field (optional), and description (optional).
10
+ * @returns A Collection object representing the newly created or existing collection, and it is indexed and loaded
11
+ */
12
+ collection(data: CreateColReq): Promise<Collection>;
13
+ /**
14
+ * Retrieves a list of collections from the Milvus server.
15
+ * @param data An optional object containing parameters for filtering the list of collections.
16
+ * @returns An array of Collection objects representing the collections returned by the server.
17
+ */
18
+ collections(data?: ShowCollectionsReq): Promise<Collection[]>;
19
+ }
@@ -0,0 +1,77 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.OrmClient = void 0;
13
+ const _1 = require("./");
14
+ const orm_1 = require("./orm");
15
+ /**
16
+ * ORM client that extends Milvus client
17
+ */
18
+ class OrmClient extends _1.MilvusClient {
19
+ // ORM-like APIs
20
+ /**
21
+ * Creates a new collection with the given name and schema, or returns an existing one with the same name.
22
+ * @param data An object containing the collection name, dimension, schema (optional), enable_dynamic_field (optional), and description (optional).
23
+ * @returns A Collection object representing the newly created or existing collection, and it is indexed and loaded
24
+ */
25
+ collection(data) {
26
+ return __awaiter(this, void 0, void 0, function* () {
27
+ // get params
28
+ const { collection_name, dimension, primary_field_name = 'id', id_type = _1.DataType.Int64, vector_field_name = 'vector', enableDynamicField = true, loadOnInit = true, } = data;
29
+ // check exist
30
+ const exist = yield this.hasCollection({ collection_name });
31
+ // build schema
32
+ const schema = (0, orm_1.buildSchema)({
33
+ primary_field_name,
34
+ id_type,
35
+ vector_field_name,
36
+ dimension,
37
+ });
38
+ // not exist, create a new one
39
+ if (!exist.value) {
40
+ // create a new collection with fixed schema
41
+ yield this.createCollection({
42
+ collection_name,
43
+ enable_dynamic_field: enableDynamicField,
44
+ fields: schema,
45
+ });
46
+ }
47
+ // return collection object
48
+ const col = new orm_1.Collection({
49
+ name: collection_name,
50
+ client: this,
51
+ });
52
+ try {
53
+ // init
54
+ yield col.init(loadOnInit);
55
+ }
56
+ catch (error) {
57
+ console.log('creation error ', error);
58
+ }
59
+ return col;
60
+ });
61
+ }
62
+ /**
63
+ * Retrieves a list of collections from the Milvus server.
64
+ * @param data An optional object containing parameters for filtering the list of collections.
65
+ * @returns An array of Collection objects representing the collections returned by the server.
66
+ */
67
+ collections(data) {
68
+ return __awaiter(this, void 0, void 0, function* () {
69
+ const cols = yield this.showCollections(data);
70
+ return cols.data.map(col => {
71
+ return new orm_1.Collection({ name: col.name, client: this });
72
+ });
73
+ });
74
+ }
75
+ }
76
+ exports.OrmClient = OrmClient;
77
+ //# sourceMappingURL=OrmClient.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OrmClient.js","sourceRoot":"","sources":["../../milvus/OrmClient.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yBAA8E;AAC9E,+BAAgD;AAEhD;;GAEG;AACH,MAAa,SAAU,SAAQ,eAAY;IACzC,gBAAgB;IAChB;;;;OAIG;IACG,UAAU,CAAC,IAAkB;;YACjC,aAAa;YACb,MAAM,EACJ,eAAe,EACf,SAAS,EACT,kBAAkB,GAAG,IAAI,EACzB,OAAO,GAAG,WAAQ,CAAC,KAAK,EACxB,iBAAiB,GAAG,QAAQ,EAC5B,kBAAkB,GAAG,IAAI,EACzB,UAAU,GAAG,IAAI,GAClB,GAAG,IAAI,CAAC;YAET,cAAc;YACd,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,EAAE,eAAe,EAAE,CAAC,CAAC;YAE5D,eAAe;YACf,MAAM,MAAM,GAAG,IAAA,iBAAW,EAAC;gBACzB,kBAAkB;gBAClB,OAAO;gBACP,iBAAiB;gBACjB,SAAS;aACV,CAAC,CAAC;YAEH,8BAA8B;YAC9B,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE;gBAChB,4CAA4C;gBAC5C,MAAM,IAAI,CAAC,gBAAgB,CAAC;oBAC1B,eAAe;oBACf,oBAAoB,EAAE,kBAAkB;oBACxC,MAAM,EAAE,MAAM;iBACf,CAAC,CAAC;aACJ;YAED,2BAA2B;YAC3B,MAAM,GAAG,GAAG,IAAI,gBAAU,CAAC;gBACzB,IAAI,EAAE,eAAe;gBACrB,MAAM,EAAE,IAAI;aACb,CAAC,CAAC;YAEH,IAAI;gBACF,OAAO;gBACP,MAAM,GAAG,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;aAC5B;YAAC,OAAO,KAAK,EAAE;gBACd,OAAO,CAAC,GAAG,CAAC,iBAAiB,EAAE,KAAK,CAAC,CAAC;aACvC;YAED,OAAO,GAAG,CAAC;QACb,CAAC;KAAA;IAED;;;;OAIG;IACG,WAAW,CAAC,IAAyB;;YACzC,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;YAE9C,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE;gBACzB,OAAO,IAAI,gBAAU,CAAC,EAAE,IAAI,EAAE,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;YAC1D,CAAC,CAAC,CAAC;QACL,CAAC;KAAA;CACF;AApED,8BAoEC"}
@@ -1,31 +1,36 @@
1
- export declare enum ERROR_REASONS {
2
- MILVUS_ADDRESS_IS_REQUIRED = "The `address` property is missing.",
3
- CREATE_COLLECTION_MISS_DATA_TYPE = "The `data_type` property is missing in the `field` object.",
4
- CREATE_COLLECTION_CHECK_PARAMS = "The `fields` or `collection_name` property is missing.",
5
- CREATE_COLLECTION_CHECK_PRIMARY_KEY = "The `data_type` for the primary key field must be DataType.Int64.",
6
- CREATE_COLLECTION_CHECK_VECTOR_FIELD_EXIST = "The `data_type` of a vector field must be either DataType.FloatVector or DataType.BinaryVector.",
7
- CREATE_COLLECTION_CHECK_MISS_DIM = "The `dim` property is missing.",
8
- CREATE_COLLECTION_CHECK_MISS_MAXLENGTH = "The `max_length` property is missing",
9
- CREATE_COLLECTION_CHECK_BINARY_DIM = "The `dim` property of the Binary vector should be value mutiples of 8.",
10
- COLLECTION_NAME_IS_REQUIRED = "The `collection_name` property is missing.",
11
- COLLECTION_ID_IS_REQUIRED = "The `collectionID` property is missing.",
12
- COLLECTION_PARTITION_NAME_ARE_REQUIRED = "The `collection_name` or the `partition_name` property is missing.",
13
- INSERT_CHECK_FILEDS_DATA_IS_REQUIRED = "The type of the `fields_data` should be an array.",
14
- INSERT_CHECK_WRONG_FIELD = "Insert fail: some field does not exist for this collection in line.",
15
- INSERT_CHECK_WRONG_DIM = "Insert fail: the length of the binary vector should be (dimension / 8).",
16
- INSERT_CHECK_WRONG_DATA_TYPE = "The value of the `data_type` property is not supported:",
17
- DELETE_PARAMS_CHECK = "The `collection_name` or the `expr` property is missing.",
18
- GET_METRIC_CHECK_PARAMS = "The `metric_type` property is missing.",
19
- GET_FLUSH_STATE_CHECK_PARAMS = "The type of the `segmentIDs` property should be an array.",
20
- LOAD_BALANCE_CHECK_PARAMS = "The `src_nodeID` property is missing.",
21
- PARTITION_NAMES_IS_REQUIRED = "The `partition_names` property is missing.",
22
- ALIAS_NAME_IS_REQUIRED = "The `alias` property is missing.",
23
- COMPACTIONID_IS_REQUIRED = "The `compactionID` property is missing.",
24
- USERNAME_PWD_ARE_REQUIRED = "The `username` or `password` property is missing.",
25
- USERNAME_IS_REQUIRED = "The `username` property is missing.",
26
- TIMESTAMP_PARAM_CHECK = "The type of the `hybridts` property should be string (only contains number) or bigint.",
27
- DATE_TYPE_CHECK = "The type of the `datetime` property should be Date.",
28
- IMPORT_FILE_CHECK = "The `files` property is missing.",
29
- SEARCH_PARAMS_IS_NOT_MATCH = "Some of the search parameters are not match.",
30
- VECTORS_OR_VECTOR_IS_MISSING = "The `vector` or `vectors` property is missing."
31
- }
1
+ export declare const ERROR_REASONS: {
2
+ MILVUS_ADDRESS_IS_REQUIRED: string;
3
+ CREATE_COLLECTION_MISS_DATA_TYPE: string;
4
+ CREATE_COLLECTION_CHECK_PARAMS: string;
5
+ CREATE_COLLECTION_CHECK_PRIMARY_KEY: string;
6
+ CREATE_COLLECTION_CHECK_VECTOR_FIELD_EXIST: string;
7
+ CREATE_COLLECTION_CHECK_MISS_DIM: string;
8
+ CREATE_COLLECTION_CHECK_MISS_MAX_LENGTH: string;
9
+ CREATE_COLLECTION_CHECK_BINARY_DIM: string;
10
+ COLLECTION_NAME_IS_REQUIRED: string;
11
+ COLLECTION_ID_IS_REQUIRED: string;
12
+ COLLECTION_PARTITION_NAME_ARE_REQUIRED: string;
13
+ INSERT_CHECK_FIELD_DATA_IS_REQUIRED: string;
14
+ INSERT_CHECK_WRONG_FIELD: string;
15
+ INSERT_CHECK_WRONG_DIM: string;
16
+ INSERT_CHECK_WRONG_DATA_TYPE: string;
17
+ GET_METRIC_CHECK_PARAMS: string;
18
+ GET_FLUSH_STATE_CHECK_PARAMS: string;
19
+ LOAD_BALANCE_CHECK_PARAMS: string;
20
+ PARTITION_NAMES_IS_REQUIRED: string;
21
+ ALIAS_NAME_IS_REQUIRED: string;
22
+ COMPACTION_ID_IS_REQUIRED: string;
23
+ USERNAME_PWD_ARE_REQUIRED: string;
24
+ USERNAME_IS_REQUIRED: string;
25
+ FILTER_EXPR_REQUIRED: string;
26
+ TIMESTAMP_PARAM_CHECK: string;
27
+ DATE_TYPE_CHECK: string;
28
+ IMPORT_FILE_CHECK: string;
29
+ SEARCH_PARAMS_IS_NOT_MATCH: string;
30
+ VECTORS_OR_VECTOR_IS_MISSING: string;
31
+ FIELD_TYPE_IS_NOT_SUPPORT: string;
32
+ INVALID_PARTITION_NUM: string;
33
+ INVALID_PARTITION_KEY_FIELD_TYPE: string;
34
+ PARTITION_KEY_FIELD_MAXED_OUT: string;
35
+ IDS_REQUIRED: string;
36
+ };
@@ -1,36 +1,43 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ERROR_REASONS = void 0;
4
- var ERROR_REASONS;
5
- (function (ERROR_REASONS) {
6
- ERROR_REASONS["MILVUS_ADDRESS_IS_REQUIRED"] = "The `address` property is missing.";
7
- ERROR_REASONS["CREATE_COLLECTION_MISS_DATA_TYPE"] = "The `data_type` property is missing in the `field` object.";
8
- ERROR_REASONS["CREATE_COLLECTION_CHECK_PARAMS"] = "The `fields` or `collection_name` property is missing.";
9
- ERROR_REASONS["CREATE_COLLECTION_CHECK_PRIMARY_KEY"] = "The `data_type` for the primary key field must be DataType.Int64.";
10
- ERROR_REASONS["CREATE_COLLECTION_CHECK_VECTOR_FIELD_EXIST"] = "The `data_type` of a vector field must be either DataType.FloatVector or DataType.BinaryVector.";
11
- ERROR_REASONS["CREATE_COLLECTION_CHECK_MISS_DIM"] = "The `dim` property is missing.";
12
- ERROR_REASONS["CREATE_COLLECTION_CHECK_MISS_MAXLENGTH"] = "The `max_length` property is missing";
13
- ERROR_REASONS["CREATE_COLLECTION_CHECK_BINARY_DIM"] = "The `dim` property of the Binary vector should be value mutiples of 8.";
14
- ERROR_REASONS["COLLECTION_NAME_IS_REQUIRED"] = "The `collection_name` property is missing.";
15
- ERROR_REASONS["COLLECTION_ID_IS_REQUIRED"] = "The `collectionID` property is missing.";
16
- ERROR_REASONS["COLLECTION_PARTITION_NAME_ARE_REQUIRED"] = "The `collection_name` or the `partition_name` property is missing.";
17
- ERROR_REASONS["INSERT_CHECK_FILEDS_DATA_IS_REQUIRED"] = "The type of the `fields_data` should be an array.";
18
- ERROR_REASONS["INSERT_CHECK_WRONG_FIELD"] = "Insert fail: some field does not exist for this collection in line.";
19
- ERROR_REASONS["INSERT_CHECK_WRONG_DIM"] = "Insert fail: the length of the binary vector should be (dimension / 8).";
20
- ERROR_REASONS["INSERT_CHECK_WRONG_DATA_TYPE"] = "The value of the `data_type` property is not supported:";
21
- ERROR_REASONS["DELETE_PARAMS_CHECK"] = "The `collection_name` or the `expr` property is missing.";
22
- ERROR_REASONS["GET_METRIC_CHECK_PARAMS"] = "The `metric_type` property is missing.";
23
- ERROR_REASONS["GET_FLUSH_STATE_CHECK_PARAMS"] = "The type of the `segmentIDs` property should be an array.";
24
- ERROR_REASONS["LOAD_BALANCE_CHECK_PARAMS"] = "The `src_nodeID` property is missing.";
25
- ERROR_REASONS["PARTITION_NAMES_IS_REQUIRED"] = "The `partition_names` property is missing.";
26
- ERROR_REASONS["ALIAS_NAME_IS_REQUIRED"] = "The `alias` property is missing.";
27
- ERROR_REASONS["COMPACTIONID_IS_REQUIRED"] = "The `compactionID` property is missing.";
28
- ERROR_REASONS["USERNAME_PWD_ARE_REQUIRED"] = "The `username` or `password` property is missing.";
29
- ERROR_REASONS["USERNAME_IS_REQUIRED"] = "The `username` property is missing.";
30
- ERROR_REASONS["TIMESTAMP_PARAM_CHECK"] = "The type of the `hybridts` property should be string (only contains number) or bigint.";
31
- ERROR_REASONS["DATE_TYPE_CHECK"] = "The type of the `datetime` property should be Date.";
32
- ERROR_REASONS["IMPORT_FILE_CHECK"] = "The `files` property is missing.";
33
- ERROR_REASONS["SEARCH_PARAMS_IS_NOT_MATCH"] = "Some of the search parameters are not match.";
34
- ERROR_REASONS["VECTORS_OR_VECTOR_IS_MISSING"] = "The `vector` or `vectors` property is missing.";
35
- })(ERROR_REASONS = exports.ERROR_REASONS || (exports.ERROR_REASONS = {}));
4
+ const _1 = require("./");
5
+ exports.ERROR_REASONS = {
6
+ MILVUS_ADDRESS_IS_REQUIRED: 'The `address` property is missing.',
7
+ CREATE_COLLECTION_MISS_DATA_TYPE: 'The `data_type` property is missing in the `field` object.',
8
+ CREATE_COLLECTION_CHECK_PARAMS: 'The `fields` or `collection_name` property is missing.',
9
+ CREATE_COLLECTION_CHECK_PRIMARY_KEY: 'The `data_type` for the primary key field must be DataType.Int64.',
10
+ CREATE_COLLECTION_CHECK_VECTOR_FIELD_EXIST: 'The `data_type` of a vector field must be either DataType.FloatVector or DataType.BinaryVector.',
11
+ CREATE_COLLECTION_CHECK_MISS_DIM: 'The `dim` property is missing.',
12
+ CREATE_COLLECTION_CHECK_MISS_MAX_LENGTH: 'The `max_length` property is missing',
13
+ CREATE_COLLECTION_CHECK_BINARY_DIM: 'The `dim` property of the Binary vector should be value multiples of 8.',
14
+ COLLECTION_NAME_IS_REQUIRED: 'The `collection_name` property is missing.',
15
+ COLLECTION_ID_IS_REQUIRED: 'The `collectionID` property is missing.',
16
+ COLLECTION_PARTITION_NAME_ARE_REQUIRED: 'The `collection_name` or the `partition_name` property is missing.',
17
+ INSERT_CHECK_FIELD_DATA_IS_REQUIRED: 'The type of the `fields_data` should be an array.',
18
+ INSERT_CHECK_WRONG_FIELD: 'Insert fail: some field does not exist for this collection in line.',
19
+ INSERT_CHECK_WRONG_DIM: 'Insert fail: the length of the binary vector should be (dimension / 8).',
20
+ INSERT_CHECK_WRONG_DATA_TYPE: 'The value of the `data_type` property is not supported:',
21
+ GET_METRIC_CHECK_PARAMS: 'The `metric_type` property is missing.',
22
+ GET_FLUSH_STATE_CHECK_PARAMS: 'The type of the `segmentIDs` property should be an array.',
23
+ LOAD_BALANCE_CHECK_PARAMS: 'The `src_nodeID` property is missing.',
24
+ PARTITION_NAMES_IS_REQUIRED: 'The `partition_names` property is missing.',
25
+ ALIAS_NAME_IS_REQUIRED: 'The `alias` property is missing.',
26
+ COMPACTION_ID_IS_REQUIRED: 'The `compactionID` property is missing.',
27
+ USERNAME_PWD_ARE_REQUIRED: 'The `username` or `password` property is missing.',
28
+ USERNAME_IS_REQUIRED: 'The `username` property is missing.',
29
+ FILTER_EXPR_REQUIRED: 'The `filter` or the `expr` property is missing.',
30
+ TIMESTAMP_PARAM_CHECK: 'The type of the `hybridts` property should be string (only contains number) or bigint.',
31
+ DATE_TYPE_CHECK: 'The type of the `datetime` property should be Date.',
32
+ IMPORT_FILE_CHECK: 'The `files` property is missing.',
33
+ SEARCH_PARAMS_IS_NOT_MATCH: 'Some of the search parameters are not match.',
34
+ VECTORS_OR_VECTOR_IS_MISSING: 'The `vector` or `vectors` property is missing.',
35
+ FIELD_TYPE_IS_NOT_SUPPORT: `The data_type is not supported, please use one of ${Object.keys(_1.DataTypeMap)
36
+ .filter((d) => d !== 'None' && d !== 'String')
37
+ .join(', ')}.`,
38
+ INVALID_PARTITION_NUM: `The partition numbers should between 1 and ${_1.MAX_PARTITIONS_NUMBER}`,
39
+ INVALID_PARTITION_KEY_FIELD_TYPE: 'Only non-primary key Int64 or VarChar field support partition key.',
40
+ PARTITION_KEY_FIELD_MAXED_OUT: `Only ${_1.MAX_PARTITION_KEY_FIELD_COUNT} field supports partition key. `,
41
+ IDS_REQUIRED: 'The `ids` is missing or empty.',
42
+ };
36
43
  //# sourceMappingURL=ErrorReason.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ErrorReason.js","sourceRoot":"","sources":["../../../milvus/const/ErrorReason.ts"],"names":[],"mappings":";;;AAAA,IAAY,aAiCX;AAjCD,WAAY,aAAa;IACvB,kFAAiE,CAAA;IAEjE,gHAA+F,CAAA;IAC/F,0GAAyF,CAAA;IACzF,0HAAyG,CAAA;IACzG,gKAA+I,CAAA;IAC/I,oFAAmE,CAAA;IACnE,gGAA+E,CAAA;IAC/E,8HAA6G,CAAA;IAC7G,2FAA0E,CAAA;IAC1E,sFAAqE,CAAA;IACrE,8HAA6G,CAAA;IAE7G,2GAA0F,CAAA;IAC1F,iHAAgG,CAAA;IAChG,mHAAkG,CAAA;IAClG,yGAAwF,CAAA;IAExF,iGAAgF,CAAA;IAChF,mFAAkE,CAAA;IAClE,2GAA0F,CAAA;IAC1F,oFAAmE,CAAA;IACnE,2FAA0E,CAAA;IAC1E,4EAA2D,CAAA;IAC3D,qFAAoE,CAAA;IACpE,gGAA+E,CAAA;IAC/E,6EAA4D,CAAA;IAC5D,iIAAgH,CAAA;IAChH,wFAAuE,CAAA;IACvE,uEAAsD,CAAA;IACtD,4FAA2E,CAAA;IAC3E,gGAA+E,CAAA;AACjF,CAAC,EAjCW,aAAa,GAAb,qBAAa,KAAb,qBAAa,QAiCxB"}
1
+ {"version":3,"file":"ErrorReason.js","sourceRoot":"","sources":["../../../milvus/const/ErrorReason.ts"],"names":[],"mappings":";;;AAAA,yBAIY;AAEC,QAAA,aAAa,GAAG;IAC3B,0BAA0B,EAAE,oCAAoC;IAChE,gCAAgC,EAC9B,4DAA4D;IAC9D,8BAA8B,EAC5B,wDAAwD;IAC1D,mCAAmC,EACjC,mEAAmE;IACrE,0CAA0C,EACxC,kGAAkG;IACpG,gCAAgC,EAAE,gCAAgC;IAClE,uCAAuC,EACrC,sCAAsC;IACxC,kCAAkC,EAChC,yEAAyE;IAC3E,2BAA2B,EAAE,4CAA4C;IACzE,yBAAyB,EAAE,yCAAyC;IACpE,sCAAsC,EACpC,oEAAoE;IACtE,mCAAmC,EACjC,mDAAmD;IACrD,wBAAwB,EACtB,qEAAqE;IACvE,sBAAsB,EACpB,yEAAyE;IAC3E,4BAA4B,EAC1B,yDAAyD;IAC3D,uBAAuB,EAAE,wCAAwC;IACjE,4BAA4B,EAC1B,2DAA2D;IAC7D,yBAAyB,EAAE,uCAAuC;IAClE,2BAA2B,EAAE,4CAA4C;IACzE,sBAAsB,EAAE,kCAAkC;IAC1D,yBAAyB,EAAE,yCAAyC;IACpE,yBAAyB,EACvB,mDAAmD;IACrD,oBAAoB,EAAE,qCAAqC;IAC3D,oBAAoB,EAAE,iDAAiD;IACvE,qBAAqB,EACnB,wFAAwF;IAC1F,eAAe,EAAE,qDAAqD;IACtE,iBAAiB,EAAE,kCAAkC;IACrD,0BAA0B,EAAE,8CAA8C;IAC1E,4BAA4B,EAC1B,gDAAgD;IAClD,yBAAyB,EAAE,qDAAqD,MAAM,CAAC,IAAI,CACzF,cAAW,CACZ;SACE,MAAM,CAAC,CAAC,CAAS,EAAE,EAAE,CAAC,CAAC,KAAK,MAAM,IAAI,CAAC,KAAK,QAAQ,CAAC;SACrD,IAAI,CAAC,IAAI,CAAC,GAAG;IAEhB,qBAAqB,EAAE,8CAA8C,wBAAqB,EAAE;IAC5F,gCAAgC,EAC9B,oEAAoE;IACtE,6BAA6B,EAAE,QAAQ,gCAA6B,iCAAiC;IACrG,YAAY,EAAE,gCAAgC;CAC/C,CAAC"}
@@ -1,10 +1,3 @@
1
- export declare const DEFAULT_MILVUS_PORT = 19530;
2
- export declare const DEFAULT_CONNECT_TIMEOUT: number;
3
- export declare const DEFAULT_TOPK = 100;
4
- export declare const DEFAULT_METRIC_TYPE = "L2";
5
- export declare const DEFAULT_MAX_RETRIES = 3;
6
- export declare const DEFAULT_RETRY_DELAY = 30;
7
- export declare const DEFAULT_DEBUG = false;
8
1
  export declare enum ConsistencyLevelEnum {
9
2
  Strong = 0,
10
3
  Session = 1,
@@ -189,11 +182,12 @@ export declare enum DataType {
189
182
  Double = 11,
190
183
  String = 20,
191
184
  VarChar = 21,
185
+ JSON = 23,
192
186
  BinaryVector = 100,
193
187
  FloatVector = 101
194
188
  }
195
189
  export declare const DataTypeMap: {
196
- [x: string]: number;
190
+ [key in keyof typeof DataType]: number;
197
191
  };
198
192
  export declare enum OperateUserRoleType {
199
193
  AddUserToRole = 0,
@@ -272,7 +266,6 @@ export declare const Privileges: {
272
266
  Import: CollectionPrivileges.Import;
273
267
  LoadBalance: CollectionPrivileges.LoadBalance;
274
268
  };
275
- export declare const DEFAULT_RESOURCE_GROUP = "__default_resource_group";
276
269
  export declare enum LoadState {
277
270
  LoadStateNotExist = "LoadStateNotExist",
278
271
  LoadStateNotLoad = "LoadStateNotLoad",