@zilliz/milvus2-sdk-node 2.2.10 → 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.
- package/README.md +3 -3
- package/dist/milvus/MilvusClient.d.ts +0 -4
- package/dist/milvus/MilvusClient.js +20 -48
- package/dist/milvus/MilvusClient.js.map +1 -1
- package/dist/milvus/OrmClient.d.ts +19 -0
- package/dist/milvus/OrmClient.js +77 -0
- package/dist/milvus/OrmClient.js.map +1 -0
- package/dist/milvus/const/ErrorReason.d.ts +36 -31
- package/dist/milvus/const/ErrorReason.js +39 -32
- package/dist/milvus/const/ErrorReason.js.map +1 -1
- package/dist/milvus/const/Milvus.d.ts +2 -9
- package/dist/milvus/const/Milvus.js +16 -33
- package/dist/milvus/const/Milvus.js.map +1 -1
- package/dist/milvus/const/client.d.ts +5 -0
- package/dist/milvus/const/client.js +10 -0
- package/dist/milvus/const/client.js.map +1 -0
- package/dist/milvus/const/defaults.d.ts +11 -0
- package/dist/milvus/const/defaults.js +16 -0
- package/dist/milvus/const/defaults.js.map +1 -0
- package/dist/milvus/const/highLevel.d.ts +23 -0
- package/dist/milvus/const/highLevel.js +26 -0
- package/dist/milvus/const/highLevel.js.map +1 -0
- package/dist/milvus/const/index.d.ts +4 -1
- package/dist/milvus/const/index.js +4 -1
- package/dist/milvus/const/index.js.map +1 -1
- package/dist/milvus/const/limits.d.ts +2 -0
- package/dist/milvus/const/limits.js +7 -0
- package/dist/milvus/const/limits.js.map +1 -0
- package/dist/milvus/grpc/BaseClient.d.ts +16 -7
- package/dist/milvus/grpc/BaseClient.js +37 -18
- package/dist/milvus/grpc/BaseClient.js.map +1 -1
- package/dist/milvus/grpc/Collection.d.ts +32 -3
- package/dist/milvus/grpc/Collection.js +242 -416
- package/dist/milvus/grpc/Collection.js.map +1 -1
- package/dist/milvus/grpc/Data.d.ts +68 -8
- package/dist/milvus/grpc/Data.js +539 -566
- package/dist/milvus/grpc/Data.js.map +1 -1
- package/dist/milvus/grpc/Database.d.ts +69 -0
- package/dist/milvus/grpc/Database.js +98 -0
- package/dist/milvus/grpc/Database.js.map +1 -0
- package/dist/milvus/grpc/GrpcClient.d.ts +18 -8
- package/dist/milvus/grpc/GrpcClient.js +87 -156
- package/dist/milvus/grpc/GrpcClient.js.map +1 -1
- package/dist/milvus/grpc/MilvusIndex.d.ts +1 -1
- package/dist/milvus/grpc/MilvusIndex.js +46 -142
- package/dist/milvus/grpc/MilvusIndex.js.map +1 -1
- package/dist/milvus/grpc/Partition.d.ts +1 -1
- package/dist/milvus/grpc/Partition.js +53 -157
- package/dist/milvus/grpc/Partition.js.map +1 -1
- package/dist/milvus/grpc/Resource.d.ts +2 -2
- package/dist/milvus/grpc/Resource.js +64 -170
- package/dist/milvus/grpc/Resource.js.map +1 -1
- package/dist/milvus/grpc/User.d.ts +1 -1
- package/dist/milvus/grpc/User.js +193 -381
- package/dist/milvus/grpc/User.js.map +1 -1
- package/dist/milvus/index.d.ts +1 -1
- package/dist/milvus/index.js +1 -1
- package/dist/milvus/index.js.map +1 -1
- package/dist/milvus/orm/Collection.d.ts +45 -0
- package/dist/milvus/orm/Collection.js +172 -0
- package/dist/milvus/orm/Collection.js.map +1 -0
- package/dist/milvus/orm/index.d.ts +2 -0
- package/dist/milvus/{types.js → orm/index.js} +3 -11
- package/dist/milvus/orm/index.js.map +1 -0
- package/dist/milvus/orm/utils.d.ts +27 -0
- package/dist/milvus/orm/utils.js +27 -0
- package/dist/milvus/orm/utils.js.map +1 -0
- package/dist/milvus/types/Client.d.ts +12 -1
- package/dist/milvus/types/Collection.d.ts +18 -4
- package/dist/milvus/types/Data.d.ts +41 -5
- package/dist/milvus/types/Database.d.ts +12 -0
- package/dist/milvus/types/Database.js +3 -0
- package/dist/milvus/types/Database.js.map +1 -0
- package/dist/milvus/types/HighLevel.d.ts +13 -0
- package/dist/milvus/types/HighLevel.js +3 -0
- package/dist/milvus/types/HighLevel.js.map +1 -0
- package/dist/milvus/types/MilvusIndex.d.ts +1 -1
- package/dist/milvus/types/Resource.d.ts +1 -1
- package/dist/milvus/types/{Index.d.ts → index.d.ts} +2 -0
- package/dist/milvus/types/{Index.js → index.js} +3 -1
- package/dist/milvus/types/index.js.map +1 -0
- package/dist/{utils → milvus/utils}/Blob.js +4 -4
- package/dist/milvus/utils/Blob.js.map +1 -0
- package/dist/{utils → milvus/utils}/Format.d.ts +66 -2
- package/dist/milvus/utils/Format.js +416 -0
- package/dist/milvus/utils/Format.js.map +1 -0
- package/dist/{utils → milvus/utils}/Function.d.ts +1 -1
- package/dist/{utils → milvus/utils}/Function.js +7 -7
- package/dist/milvus/utils/Function.js.map +1 -0
- package/dist/{utils → milvus/utils}/Grpc.d.ts +9 -8
- package/dist/milvus/utils/Grpc.js +190 -0
- package/dist/milvus/utils/Grpc.js.map +1 -0
- package/dist/{utils → milvus/utils}/Validate.d.ts +7 -1
- package/dist/milvus/utils/Validate.js +140 -0
- package/dist/milvus/utils/Validate.js.map +1 -0
- package/dist/{utils → milvus/utils}/index.d.ts +2 -0
- package/dist/{utils → milvus/utils}/index.js +2 -0
- package/dist/milvus/utils/index.js.map +1 -0
- package/dist/milvus/utils/logger.d.ts +1 -0
- package/dist/milvus/utils/logger.js +18 -0
- package/dist/milvus/utils/logger.js.map +1 -0
- package/dist/proto/proto/common.proto +38 -14
- package/dist/proto/proto/google/protobuf/descriptor.proto +8 -4
- package/dist/proto/proto/milvus.proto +86 -83
- package/dist/proto/proto/schema.proto +5 -0
- package/dist/sdk.json +1 -1
- package/package.json +13 -10
- package/dist/milvus/types/Index.js.map +0 -1
- package/dist/milvus/types.d.ts +0 -9
- package/dist/milvus/types.js.map +0 -1
- package/dist/proto/proto/feder.proto +0 -40
- package/dist/proto/proto/msg.proto +0 -107
- package/dist/utils/Blob.js.map +0 -1
- package/dist/utils/Format.js +0 -252
- package/dist/utils/Format.js.map +0 -1
- package/dist/utils/Function.js.map +0 -1
- package/dist/utils/Grpc.js +0 -170
- package/dist/utils/Grpc.js.map +0 -1
- package/dist/utils/Validate.js +0 -125
- package/dist/utils/Validate.js.map +0 -1
- package/dist/utils/index.js.map +0 -1
- package/dist/utils/test.d.ts +0 -29
- package/dist/utils/test.js +0 -112
- package/dist/utils/test.js.map +0 -1
- /package/dist/{utils → milvus/utils}/Blob.d.ts +0 -0
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DEFAULT_HIGH_LEVEL_INDEX_PARAMS = exports.DEFAULT_HIGH_LEVEL_SCHEMA = void 0;
|
|
4
|
+
const _1 = require("./");
|
|
5
|
+
const DEFAULT_HIGH_LEVEL_SCHEMA = (dimension) => [
|
|
6
|
+
{
|
|
7
|
+
name: 'id',
|
|
8
|
+
data_type: _1.DataType.Int64,
|
|
9
|
+
is_primary_key: true,
|
|
10
|
+
autoID: false,
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
name: 'vector',
|
|
14
|
+
data_type: _1.DataType.FloatVector,
|
|
15
|
+
dim: dimension,
|
|
16
|
+
},
|
|
17
|
+
];
|
|
18
|
+
exports.DEFAULT_HIGH_LEVEL_SCHEMA = DEFAULT_HIGH_LEVEL_SCHEMA;
|
|
19
|
+
const DEFAULT_HIGH_LEVEL_INDEX_PARAMS = (field_name) => ({
|
|
20
|
+
field_name,
|
|
21
|
+
index_type: 'HNSW',
|
|
22
|
+
metric_type: 'L2',
|
|
23
|
+
params: { efConstruction: 10, M: 4 },
|
|
24
|
+
});
|
|
25
|
+
exports.DEFAULT_HIGH_LEVEL_INDEX_PARAMS = DEFAULT_HIGH_LEVEL_INDEX_PARAMS;
|
|
26
|
+
//# sourceMappingURL=highLevel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"highLevel.js","sourceRoot":"","sources":["../../../milvus/const/highLevel.ts"],"names":[],"mappings":";;;AAAA,yBAA8B;AAEvB,MAAM,yBAAyB,GAAG,CAAC,SAAiB,EAAE,EAAE,CAAC;IAC9D;QACE,IAAI,EAAE,IAAI;QACV,SAAS,EAAE,WAAQ,CAAC,KAAK;QACzB,cAAc,EAAE,IAAI;QACpB,MAAM,EAAE,KAAK;KACd;IACD;QACE,IAAI,EAAE,QAAQ;QACd,SAAS,EAAE,WAAQ,CAAC,WAAW;QAC/B,GAAG,EAAE,SAAS;KACf;CACF,CAAC;AAZW,QAAA,yBAAyB,6BAYpC;AAEK,MAAM,+BAA+B,GAAG,CAAC,UAAkB,EAAE,EAAE,CAAC,CAAC;IACtE,UAAU;IACV,UAAU,EAAE,MAAM;IAClB,WAAW,EAAE,IAAI;IACjB,MAAM,EAAE,EAAE,cAAc,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE;CACrC,CAAC,CAAC;AALU,QAAA,+BAA+B,mCAKzC"}
|
|
@@ -15,6 +15,9 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
// consts
|
|
18
|
-
__exportStar(require("./ErrorReason"), exports);
|
|
19
18
|
__exportStar(require("./Milvus"), exports);
|
|
19
|
+
__exportStar(require("./limits"), exports);
|
|
20
|
+
__exportStar(require("./defaults"), exports);
|
|
21
|
+
__exportStar(require("./ErrorReason"), exports);
|
|
22
|
+
__exportStar(require("./client"), exports);
|
|
20
23
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../milvus/const/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,SAAS;AACT,gDAA8B;AAC9B,2CAAyB"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../milvus/const/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,SAAS;AACT,2CAAyB;AACzB,2CAAyB;AACzB,6CAA2B;AAC3B,gDAA8B;AAC9B,2CAAyB"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MAX_PARTITIONS_NUMBER = exports.MAX_PARTITION_KEY_FIELD_COUNT = void 0;
|
|
4
|
+
// limits
|
|
5
|
+
exports.MAX_PARTITION_KEY_FIELD_COUNT = 1;
|
|
6
|
+
exports.MAX_PARTITIONS_NUMBER = 4096;
|
|
7
|
+
//# sourceMappingURL=limits.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"limits.js","sourceRoot":"","sources":["../../../milvus/const/limits.ts"],"names":[],"mappings":";;;AAAA,SAAS;AACI,QAAA,6BAA6B,GAAG,CAAC,CAAC;AAClC,QAAA,qBAAqB,GAAG,IAAI,CAAC"}
|
|
@@ -1,16 +1,25 @@
|
|
|
1
|
-
import { Root } from 'protobufjs';
|
|
1
|
+
import { Root, Type } from 'protobufjs';
|
|
2
2
|
import { Client, ChannelOptions } from '@grpc/grpc-js';
|
|
3
|
-
import { ClientConfig } from '
|
|
3
|
+
import { ClientConfig, ServerInfo } from '../';
|
|
4
4
|
/**
|
|
5
5
|
* Base gRPC client, setup all configuration here
|
|
6
6
|
*/
|
|
7
7
|
export declare class BaseClient {
|
|
8
|
-
|
|
9
|
-
protoPath: string;
|
|
10
|
-
schemaProto: Root;
|
|
11
|
-
milvusProto: Root;
|
|
8
|
+
protected metadata: Map<string, string>;
|
|
9
|
+
protected protoPath: string;
|
|
10
|
+
protected schemaProto: Root;
|
|
11
|
+
protected milvusProto: Root;
|
|
12
|
+
protected collectionSchemaType: Type;
|
|
13
|
+
protected fieldSchemaType: Type;
|
|
14
|
+
protected protoInternalPath: {
|
|
15
|
+
serviceName: string;
|
|
16
|
+
collectionSchema: string;
|
|
17
|
+
fieldSchema: string;
|
|
18
|
+
};
|
|
12
19
|
config: ClientConfig;
|
|
13
|
-
|
|
20
|
+
channelOptions: ChannelOptions;
|
|
21
|
+
client: Client | undefined;
|
|
22
|
+
serverInfo: ServerInfo;
|
|
14
23
|
timeout: number;
|
|
15
24
|
/**
|
|
16
25
|
* Sets up the configuration object for the gRPC client.
|
|
@@ -4,17 +4,16 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.BaseClient = void 0;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
var utils_1 = require("../../utils");
|
|
7
|
+
const path_1 = __importDefault(require("path"));
|
|
8
|
+
const protobufjs_1 = __importDefault(require("protobufjs"));
|
|
9
|
+
const __1 = require("../");
|
|
11
10
|
// path
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
const protoPath = path_1.default.resolve(__dirname, '../../proto/proto/milvus.proto');
|
|
12
|
+
const schemaProtoPath = path_1.default.resolve(__dirname, '../../proto/proto/schema.proto');
|
|
14
13
|
/**
|
|
15
14
|
* Base gRPC client, setup all configuration here
|
|
16
15
|
*/
|
|
17
|
-
|
|
16
|
+
class BaseClient {
|
|
18
17
|
/**
|
|
19
18
|
* Sets up the configuration object for the gRPC client.
|
|
20
19
|
*
|
|
@@ -23,12 +22,20 @@ var BaseClient = /** @class */ (function () {
|
|
|
23
22
|
* @param username The username for authentication. Required if password is provided.
|
|
24
23
|
* @param password The password for authentication. Required if username is provided.
|
|
25
24
|
*/
|
|
26
|
-
|
|
27
|
-
//
|
|
28
|
-
this.
|
|
25
|
+
constructor(configOrAddress, ssl, username, password, channelOptions) {
|
|
26
|
+
// metadata
|
|
27
|
+
this.metadata = new Map();
|
|
28
|
+
// milvus proto
|
|
29
|
+
this.protoInternalPath = {
|
|
30
|
+
serviceName: 'milvus.proto.milvus.MilvusService',
|
|
31
|
+
collectionSchema: 'milvus.proto.schema.CollectionSchema',
|
|
32
|
+
fieldSchema: 'milvus.proto.schema.FieldSchema',
|
|
33
|
+
};
|
|
34
|
+
// server info
|
|
35
|
+
this.serverInfo = {};
|
|
29
36
|
// The timeout for connecting to the Milvus service.
|
|
30
37
|
this.timeout = __1.DEFAULT_CONNECT_TIMEOUT;
|
|
31
|
-
|
|
38
|
+
let config;
|
|
32
39
|
// If a configuration object is provided, use it. Otherwise, create a new object with the provided parameters.
|
|
33
40
|
if (typeof configOrAddress === 'object') {
|
|
34
41
|
config = configOrAddress;
|
|
@@ -36,29 +43,41 @@ var BaseClient = /** @class */ (function () {
|
|
|
36
43
|
else {
|
|
37
44
|
config = {
|
|
38
45
|
address: configOrAddress,
|
|
39
|
-
ssl
|
|
40
|
-
username
|
|
41
|
-
password
|
|
42
|
-
channelOptions
|
|
46
|
+
ssl,
|
|
47
|
+
username,
|
|
48
|
+
password,
|
|
49
|
+
channelOptions,
|
|
43
50
|
};
|
|
44
51
|
}
|
|
45
52
|
// Check if the Milvus address is set.
|
|
46
53
|
if (!config.address) {
|
|
47
54
|
throw new Error(__1.ERROR_REASONS.MILVUS_ADDRESS_IS_REQUIRED);
|
|
48
55
|
}
|
|
56
|
+
// if the address starts with https, no need to set the ssl
|
|
57
|
+
config.ssl = config.address.startsWith('https://') || !!config.ssl;
|
|
58
|
+
// make sure these are strings
|
|
59
|
+
config.username = config.username || '';
|
|
60
|
+
config.password = config.password || '';
|
|
49
61
|
// Assign the configuration object.
|
|
50
62
|
this.config = config;
|
|
51
63
|
// Load the Milvus protobuf.
|
|
52
64
|
this.protoPath = protoPath;
|
|
53
65
|
this.schemaProto = protobufjs_1.default.loadSync(schemaProtoPath);
|
|
54
66
|
this.milvusProto = protobufjs_1.default.loadSync(protoPath);
|
|
67
|
+
// Get the CollectionSchemaType and FieldSchemaType from the schemaProto object.
|
|
68
|
+
this.collectionSchemaType = this.schemaProto.lookupType(this.protoInternalPath.collectionSchema);
|
|
69
|
+
this.fieldSchemaType = this.schemaProto.lookupType(this.protoInternalPath.fieldSchema);
|
|
70
|
+
// options
|
|
71
|
+
this.channelOptions = Object.assign({
|
|
72
|
+
// Milvus default max_receive_message_length is 100MB, but Milvus support change max_receive_message_length .
|
|
73
|
+
// So SDK should support max_receive_message_length unlimited.
|
|
74
|
+
'grpc.max_receive_message_length': -1, 'grpc.max_send_message_length': -1, 'grpc.keepalive_time_ms': 10 * 1000, 'grpc.keepalive_timeout_ms': 5 * 1000, 'grpc.keepalive_permit_without_calls': 1, 'grpc.enable_retries': 1 }, this.config.channelOptions);
|
|
55
75
|
// Set up the timeout for connecting to the Milvus service.
|
|
56
76
|
this.timeout =
|
|
57
77
|
typeof config.timeout === 'string'
|
|
58
|
-
? (0,
|
|
78
|
+
? (0, __1.parseTimeToken)(config.timeout)
|
|
59
79
|
: config.timeout || __1.DEFAULT_CONNECT_TIMEOUT;
|
|
60
80
|
}
|
|
61
|
-
|
|
62
|
-
}());
|
|
81
|
+
}
|
|
63
82
|
exports.BaseClient = BaseClient;
|
|
64
83
|
//# sourceMappingURL=BaseClient.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseClient.js","sourceRoot":"","sources":["../../../milvus/grpc/BaseClient.ts"],"names":[],"mappings":";;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"BaseClient.js","sourceRoot":"","sources":["../../../milvus/grpc/BaseClient.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AACxB,4DAAkD;AAElD,2BAMa;AAEb,OAAO;AACP,MAAM,SAAS,GAAG,cAAI,CAAC,OAAO,CAAC,SAAS,EAAE,gCAAgC,CAAC,CAAC;AAC5E,MAAM,eAAe,GAAG,cAAI,CAAC,OAAO,CAClC,SAAS,EACT,gCAAgC,CACjC,CAAC;AAEF;;GAEG;AACH,MAAa,UAAU;IAiCrB;;;;;;;OAOG;IACH,YACE,eAAsC,EACtC,GAAa,EACb,QAAiB,EACjB,QAAiB,EACjB,cAA+B;QA7CjC,WAAW;QACD,aAAQ,GAAwB,IAAI,GAAG,EAAkB,CAAC;QAYpE,eAAe;QACL,sBAAiB,GAAG;YAC5B,WAAW,EAAE,mCAAmC;YAChD,gBAAgB,EAAE,sCAAsC;YACxD,WAAW,EAAE,iCAAiC;SAC/C,CAAC;QAQF,cAAc;QACP,eAAU,GAAe,EAAE,CAAC;QAEnC,oDAAoD;QAC7C,YAAO,GAAW,2BAAuB,CAAC;QAiB/C,IAAI,MAAoB,CAAC;QAEzB,8GAA8G;QAC9G,IAAI,OAAO,eAAe,KAAK,QAAQ,EAAE;YACvC,MAAM,GAAG,eAAe,CAAC;SAC1B;aAAM;YACL,MAAM,GAAG;gBACP,OAAO,EAAE,eAAe;gBACxB,GAAG;gBACH,QAAQ;gBACR,QAAQ;gBACR,cAAc;aACf,CAAC;SACH;QAED,sCAAsC;QACtC,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE;YACnB,MAAM,IAAI,KAAK,CAAC,iBAAa,CAAC,0BAA0B,CAAC,CAAC;SAC3D;QAED,2DAA2D;QAC3D,MAAM,CAAC,GAAG,GAAG,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC;QACnE,8BAA8B;QAC9B,MAAM,CAAC,QAAQ,GAAG,MAAM,CAAC,QAAQ,IAAI,EAAE,CAAC;QACxC,MAAM,CAAC,QAAQ,GAAG,MAAM,CAAC,QAAQ,IAAI,EAAE,CAAC;QAExC,mCAAmC;QACnC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,4BAA4B;QAC5B,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,WAAW,GAAG,oBAAQ,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAC;QACtD,IAAI,CAAC,WAAW,GAAG,oBAAQ,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;QAEhD,gFAAgF;QAChF,IAAI,CAAC,oBAAoB,GAAG,IAAI,CAAC,WAAW,CAAC,UAAU,CACrD,IAAI,CAAC,iBAAiB,CAAC,gBAAgB,CACxC,CAAC;QACF,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC,WAAW,CAAC,UAAU,CAChD,IAAI,CAAC,iBAAiB,CAAC,WAAW,CACnC,CAAC;QAEF,UAAU;QACV,IAAI,CAAC,cAAc;YACjB,6GAA6G;YAC7G,8DAA8D;YAC9D,iCAAiC,EAAE,CAAC,CAAC,EACrC,8BAA8B,EAAE,CAAC,CAAC,EAClC,wBAAwB,EAAE,EAAE,GAAG,IAAI,EACnC,2BAA2B,EAAE,CAAC,GAAG,IAAI,EACrC,qCAAqC,EAAE,CAAC,EACxC,qBAAqB,EAAE,CAAC,IACrB,IAAI,CAAC,MAAM,CAAC,cAAc,CAC9B,CAAC;QAEF,2DAA2D;QAC3D,IAAI,CAAC,OAAO;YACV,OAAO,MAAM,CAAC,OAAO,KAAK,QAAQ;gBAChC,CAAC,CAAC,IAAA,kBAAc,EAAC,MAAM,CAAC,OAAO,CAAC;gBAChC,CAAC,CAAC,MAAM,CAAC,OAAO,IAAI,2BAAuB,CAAC;IAClD,CAAC;CACF;AA5GD,gCA4GC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
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 '
|
|
1
|
+
import { Database } from './Database';
|
|
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
|
|
6
|
+
export declare class Collection extends Database {
|
|
7
7
|
/**
|
|
8
8
|
* Create a collection in Milvus.
|
|
9
9
|
*
|
|
@@ -12,6 +12,7 @@ export declare class Collection extends BaseClient {
|
|
|
12
12
|
* | :-- | :-- | :-- |
|
|
13
13
|
* | collection_name | String | Collection name |
|
|
14
14
|
* | description | String | Collection description |
|
|
15
|
+
* | num_partitions | number | number of partitions allowed |
|
|
15
16
|
* | consistency_level | String | "Strong"(Milvus default) | "Session" | "Bounded"| "Eventually" | "Customized"; |
|
|
16
17
|
* | fields | <a href="https://github.com/milvus-io/milvus-sdk-node/blob/main/milvus/types/Collection.ts#L8" target="_blank">FieldType</a> | Field data |
|
|
17
18
|
* | 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 |
|
|
@@ -98,6 +99,7 @@ export declare class Collection extends BaseClient {
|
|
|
98
99
|
* ```
|
|
99
100
|
*/
|
|
100
101
|
showCollections(data?: ShowCollectionsReq): Promise<ShowCollectionsResponse>;
|
|
102
|
+
list_collections: (data?: ShowCollectionsReq) => Promise<ShowCollectionsResponse>;
|
|
101
103
|
/**
|
|
102
104
|
* Show the details of a collection, e.g. name, schema.
|
|
103
105
|
*
|
|
@@ -279,6 +281,7 @@ export declare class Collection extends BaseClient {
|
|
|
279
281
|
* ```
|
|
280
282
|
*/
|
|
281
283
|
dropCollection(data: DropCollectionReq): Promise<ResStatus>;
|
|
284
|
+
drop_collection: (data: DropCollectionReq) => Promise<ResStatus>;
|
|
282
285
|
/**
|
|
283
286
|
* Create collection alias, then you can use alias instead of collection_name when you do vector search
|
|
284
287
|
*
|
|
@@ -526,4 +529,30 @@ export declare class Collection extends BaseClient {
|
|
|
526
529
|
* ```
|
|
527
530
|
*/
|
|
528
531
|
getLoadState(data: GetLoadStateReq): Promise<GetLoadStateResponse>;
|
|
532
|
+
listCollections: (data?: ShowCollectionsReq) => Promise<ShowCollectionsResponse>;
|
|
533
|
+
/**
|
|
534
|
+
* Get the primary key field name
|
|
535
|
+
*
|
|
536
|
+
* @param data
|
|
537
|
+
* | Property | Type | Description |
|
|
538
|
+
* | :-- | :-- | :-- |
|
|
539
|
+
* | collection_name | string | the name of the collection |
|
|
540
|
+
* | 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 |
|
|
541
|
+
*
|
|
542
|
+
* @returns
|
|
543
|
+
* | Property | Description |
|
|
544
|
+
* | :-- | :-- |
|
|
545
|
+
* | pkfield | the primary key field name |
|
|
546
|
+
*
|
|
547
|
+
* @throws {Error} if `collection_name` property is not present in `data`
|
|
548
|
+
*
|
|
549
|
+
* #### Example
|
|
550
|
+
*
|
|
551
|
+
* ```
|
|
552
|
+
* new milvusClient(MILUVS_ADDRESS).getPkFieldName({
|
|
553
|
+
* collection_name: 'my_collection',
|
|
554
|
+
* });
|
|
555
|
+
* ```
|
|
556
|
+
*/
|
|
557
|
+
getPkFieldName(data: DescribeCollectionReq): Promise<string>;
|
|
529
558
|
}
|