@mongosh/shell-api 5.0.1 → 5.1.4
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/lib/abstract-cursor.d.ts +30 -3
- package/lib/abstract-cursor.js +20 -13
- package/lib/abstract-cursor.js.map +1 -1
- package/lib/aggregate-or-find-cursor.js +4 -5
- package/lib/aggregate-or-find-cursor.js.map +1 -1
- package/lib/aggregation-cursor.d.ts +2 -1
- package/lib/aggregation-cursor.js +3 -4
- package/lib/aggregation-cursor.js.map +1 -1
- package/lib/api-export.js +1 -1
- package/lib/api-processed.d.ts +43 -13
- package/lib/api-raw.d.ts +47 -14
- package/lib/bulk.js +2 -4
- package/lib/bulk.js.map +1 -1
- package/lib/change-stream-cursor.js +1 -2
- package/lib/change-stream-cursor.js.map +1 -1
- package/lib/collection.js +71 -37
- package/lib/collection.js.map +1 -1
- package/lib/cursor.d.ts +2 -1
- package/lib/cursor.js +20 -21
- package/lib/cursor.js.map +1 -1
- package/lib/database.js +41 -17
- package/lib/database.js.map +1 -1
- package/lib/dbquery.js +1 -2
- package/lib/dbquery.js.map +1 -1
- package/lib/decorators.d.ts +5 -0
- package/lib/decorators.js +38 -26
- package/lib/decorators.js.map +1 -1
- package/lib/deep-inspect/custom-inspect.js +1 -1
- package/lib/deep-inspect/custom-inspect.js.map +1 -1
- package/lib/explainable-cursor.js +2 -4
- package/lib/explainable-cursor.js.map +1 -1
- package/lib/explainable.js +3 -5
- package/lib/explainable.js.map +1 -1
- package/lib/field-level-encryption.js +11 -14
- package/lib/field-level-encryption.js.map +1 -1
- package/lib/helpers.d.ts +6 -4
- package/lib/helpers.js +26 -23
- package/lib/helpers.js.map +1 -1
- package/lib/index.d.ts +3 -1
- package/lib/index.js +3 -1
- package/lib/index.js.map +1 -1
- package/lib/interruptor.js +1 -1
- package/lib/interruptor.js.map +1 -1
- package/lib/log-entry.js +2 -3
- package/lib/log-entry.js.map +1 -1
- package/lib/mongo-errors.js +1 -2
- package/lib/mongo-errors.js.map +1 -1
- package/lib/mongo.js +19 -24
- package/lib/mongo.js.map +1 -1
- package/lib/mongosh-version.d.ts +1 -1
- package/lib/mongosh-version.js +1 -1
- package/lib/plan-cache.js +1 -2
- package/lib/plan-cache.js.map +1 -1
- package/lib/reconstruct-cursor.d.ts +6 -0
- package/lib/reconstruct-cursor.js +16 -0
- package/lib/reconstruct-cursor.js.map +1 -0
- package/lib/replica-set.js +5 -8
- package/lib/replica-set.js.map +1 -1
- package/lib/result.js +8 -16
- package/lib/result.js.map +1 -1
- package/lib/run-command-cursor.d.ts +2 -1
- package/lib/run-command-cursor.js +3 -4
- package/lib/run-command-cursor.js.map +1 -1
- package/lib/session.js +1 -2
- package/lib/session.js.map +1 -1
- package/lib/shard.js +15 -20
- package/lib/shard.js.map +1 -1
- package/lib/shell-api.js +17 -31
- package/lib/shell-api.js.map +1 -1
- package/lib/shell-instance-state.d.ts +1 -0
- package/lib/shell-instance-state.js +70 -78
- package/lib/shell-instance-state.js.map +1 -1
- package/lib/shell-log.js +2 -4
- package/lib/shell-log.js.map +1 -1
- package/lib/stream-processor.js +1 -2
- package/lib/stream-processor.js.map +1 -1
- package/lib/streams.js +2 -3
- package/lib/streams.js.map +1 -1
- package/package.json +9 -8
package/lib/api-processed.d.ts
CHANGED
|
@@ -337,7 +337,7 @@ declare interface AbstractCursorOptions extends BSONSerializeOptions {
|
|
|
337
337
|
}
|
|
338
338
|
declare abstract class AbstractFiniteCursor<CursorType extends ServiceProviderAggregationCursor | ServiceProviderFindCursor | ServiceProviderRunCommandCursor> extends BaseCursor<CursorType> {
|
|
339
339
|
_currentIterationResult: CursorIterationResult | null;
|
|
340
|
-
constructor(mongo: Mongo, cursor: CursorType);
|
|
340
|
+
constructor(mongo: Mongo, cursor: CursorType, constructionOptionsWithChains?: CursorConstructionOptionsWithChains);
|
|
341
341
|
[asPrintable](): Promise<CursorIterationResult | string>;
|
|
342
342
|
_it(): Promise<CursorIterationResult>;
|
|
343
343
|
batchSize(size: number): this;
|
|
@@ -458,7 +458,7 @@ declare interface Admin_2 {
|
|
|
458
458
|
listDatabases(database: string, options?: ListDatabasesOptions): Promise<Document_2>;
|
|
459
459
|
getNewConnection(uri: string, options: MongoClientOptions): Promise<ServiceProvider>;
|
|
460
460
|
getURI(): string | undefined;
|
|
461
|
-
getConnectionInfo(): Promise<
|
|
461
|
+
getConnectionInfo(): Promise<ConnectionInfo>;
|
|
462
462
|
authenticate(authDoc: ShellAuthOptions): Promise<{
|
|
463
463
|
ok: number;
|
|
464
464
|
}>;
|
|
@@ -648,7 +648,7 @@ declare class AggregationCursor<TSchema = any> extends ExplainableCursor<TSchema
|
|
|
648
648
|
geoNear($geoNear: Document_2): this;
|
|
649
649
|
}
|
|
650
650
|
declare class AggregationCursor_2 extends AggregateOrFindCursor<ServiceProviderAggregationCursor> {
|
|
651
|
-
constructor(mongo: Mongo, cursor: ServiceProviderAggregationCursor);
|
|
651
|
+
constructor(mongo: Mongo, cursor: ServiceProviderAggregationCursor, constructionOptionsWithChains?: CursorConstructionOptionsWithChains);
|
|
652
652
|
}
|
|
653
653
|
declare const ALL_TOPOLOGIES: readonly ["ReplSet", "Standalone", "Sharded", "LoadBalanced"];
|
|
654
654
|
|
|
@@ -1022,9 +1022,11 @@ declare type AzureKMSProviderConfiguration = {
|
|
|
1022
1022
|
declare abstract class BaseCursor<CursorType extends ServiceProviderBaseCursor> extends ShellApiWithMongoClass {
|
|
1023
1023
|
_mongo: Mongo;
|
|
1024
1024
|
_cursor: CursorType;
|
|
1025
|
+
readonly _constructionOptions?: CursorConstructionOptions;
|
|
1026
|
+
_chains: CursorChainOptions[];
|
|
1025
1027
|
_transform: ((doc: any) => any) | null;
|
|
1026
1028
|
_blockingWarningDisabled: boolean;
|
|
1027
|
-
constructor(mongo: Mongo, cursor: CursorType);
|
|
1029
|
+
constructor(mongo: Mongo, cursor: CursorType, constructionOptionsWithChains?: CursorConstructionOptionsWithChains);
|
|
1028
1030
|
close(): Promise<void>;
|
|
1029
1031
|
forEach(f: (doc: Document_2) => void | boolean | Promise<void> | Promise<boolean>): Promise<void>;
|
|
1030
1032
|
hasNext(): Promise<boolean>;
|
|
@@ -4204,16 +4206,16 @@ declare type ConnectionExtraInfo = {
|
|
|
4204
4206
|
is_local_atlas?: boolean;
|
|
4205
4207
|
} & HostInformation;
|
|
4206
4208
|
declare interface ConnectionInfo {
|
|
4207
|
-
connectionString: string;
|
|
4208
|
-
driverOptions: Omit<DevtoolsConnectOptions, 'productName' | 'productDocsLink'>;
|
|
4209
|
-
}
|
|
4210
|
-
declare interface ConnectionInfo_2 {
|
|
4211
4209
|
buildInfo: Document_2 | null;
|
|
4212
4210
|
resolvedHostname?: string;
|
|
4213
4211
|
extraInfo: (ConnectionExtraInfo & {
|
|
4214
4212
|
fcv?: string;
|
|
4215
4213
|
}) | null;
|
|
4216
4214
|
}
|
|
4215
|
+
declare interface ConnectionInfo_2 {
|
|
4216
|
+
connectionString: string;
|
|
4217
|
+
driverOptions: Omit<DevtoolsConnectOptions, 'productName' | 'productDocsLink'>;
|
|
4218
|
+
}
|
|
4217
4219
|
|
|
4218
4220
|
/** @public */
|
|
4219
4221
|
declare interface ConnectionOptions_2 extends SupportedNodeConnectionOptions, StreamDescriptionOptions, ProxyOptions {
|
|
@@ -4519,7 +4521,7 @@ declare type CSFLEKMSTlsOptions = {
|
|
|
4519
4521
|
};
|
|
4520
4522
|
declare class Cursor extends AggregateOrFindCursor<ServiceProviderFindCursor> {
|
|
4521
4523
|
_tailable: boolean;
|
|
4522
|
-
constructor(mongo: Mongo, cursor: ServiceProviderFindCursor);
|
|
4524
|
+
constructor(mongo: Mongo, cursor: ServiceProviderFindCursor, constructionOptionsWithChains?: CursorConstructionOptionsWithChains);
|
|
4523
4525
|
toJSON(): void;
|
|
4524
4526
|
private _addFlag;
|
|
4525
4527
|
/*
|
|
@@ -4616,6 +4618,31 @@ declare class Cursor extends AggregateOrFindCursor<ServiceProviderFindCursor> {
|
|
|
4616
4618
|
|
|
4617
4619
|
/** @public */
|
|
4618
4620
|
declare const CURSOR_FLAGS: readonly ["tailable", "oplogReplay", "noCursorTimeout", "awaitData", "exhaust", "partial"];
|
|
4621
|
+
declare type CursorChainOptions = {
|
|
4622
|
+
method: string;
|
|
4623
|
+
args: any[];
|
|
4624
|
+
};
|
|
4625
|
+
declare type CursorConstructionOptions = {
|
|
4626
|
+
method: 'find';
|
|
4627
|
+
args: Parameters<ServiceProvider['find']>;
|
|
4628
|
+
cursorType: 'Cursor';
|
|
4629
|
+
} | {
|
|
4630
|
+
method: 'aggregate';
|
|
4631
|
+
args: Parameters<ServiceProvider['aggregate']>;
|
|
4632
|
+
cursorType: 'AggregationCursor';
|
|
4633
|
+
} | {
|
|
4634
|
+
method: 'aggregateDb';
|
|
4635
|
+
args: Parameters<ServiceProvider['aggregateDb']>;
|
|
4636
|
+
cursorType: 'AggregationCursor';
|
|
4637
|
+
} | {
|
|
4638
|
+
method: 'runCursorCommand';
|
|
4639
|
+
args: Parameters<ServiceProvider['runCursorCommand']>;
|
|
4640
|
+
cursorType: 'RunCommandCursor';
|
|
4641
|
+
};
|
|
4642
|
+
declare type CursorConstructionOptionsWithChains = {
|
|
4643
|
+
options: CursorConstructionOptions;
|
|
4644
|
+
chains?: CursorChainOptions[];
|
|
4645
|
+
};
|
|
4619
4646
|
|
|
4620
4647
|
/** @public */
|
|
4621
4648
|
declare type CursorFlag = (typeof CURSOR_FLAGS)[number];
|
|
@@ -6864,7 +6891,7 @@ export declare class Mongo<M extends GenericServerSideSchema = GenericServerSide
|
|
|
6864
6891
|
readonly _databases: Record<StringKey<M>, DatabaseWithSchema<M>>;
|
|
6865
6892
|
private _connectionId;
|
|
6866
6893
|
_instanceState: ShellInstanceState;
|
|
6867
|
-
_connectionInfo:
|
|
6894
|
+
_connectionInfo: ConnectionInfo_2;
|
|
6868
6895
|
private _explicitEncryptionOnly;
|
|
6869
6896
|
private _keyVault;
|
|
6870
6897
|
private _clientEncryption;
|
|
@@ -8407,6 +8434,7 @@ declare interface RangeOptions {
|
|
|
8407
8434
|
declare interface Readable_2 {
|
|
8408
8435
|
aggregate(database: string, collection: string, pipeline: Document_2[], options?: AggregateOptions & Abortable_2, dbOptions?: DbOptions): ServiceProviderAggregationCursor;
|
|
8409
8436
|
aggregateDb(database: string, pipeline: Document_2[], options?: AggregateOptions & Abortable_2, dbOptions?: DbOptions): ServiceProviderAggregationCursor;
|
|
8437
|
+
hasUnifiedAggregateOptions?(): boolean;
|
|
8410
8438
|
count(db: string, coll: string, query?: Document_2, options?: CountOptions, dbOptions?: DbOptions): Promise<number>;
|
|
8411
8439
|
countDocuments(database: string, collection: string, filter?: Document_2, options?: CountDocumentsOptions & Abortable_2, dbOptions?: DbOptions): Promise<number>;
|
|
8412
8440
|
distinct(database: string, collection: string, fieldName: string, filter?: Document_2, options?: DistinctOptions, dbOptions?: DbOptions): Promise<Document_2>;
|
|
@@ -8825,7 +8853,7 @@ declare class RunCommandCursor extends AbstractCursor {
|
|
|
8825
8853
|
/* Excluded from this release type: getMore */
|
|
8826
8854
|
}
|
|
8827
8855
|
declare class RunCommandCursor_2 extends AbstractFiniteCursor<ServiceProviderRunCommandCursor> {
|
|
8828
|
-
constructor(mongo: Mongo, cursor: ServiceProviderRunCommandCursor);
|
|
8856
|
+
constructor(mongo: Mongo, cursor: ServiceProviderRunCommandCursor, constructionOptionsWithChains?: CursorConstructionOptionsWithChains);
|
|
8829
8857
|
}
|
|
8830
8858
|
|
|
8831
8859
|
/** @public */
|
|
@@ -9695,9 +9723,10 @@ declare class ShellInstanceState {
|
|
|
9695
9723
|
private alreadyTransformedErrors;
|
|
9696
9724
|
private preFetchCollectionAndDatabaseNames;
|
|
9697
9725
|
constructor(initialServiceProvider: ServiceProvider, messageBus?: any, cliOptions?: ShellCliOptions, bsonLibrary?: BSON);
|
|
9726
|
+
private static commonConstructShellBsonProps;
|
|
9698
9727
|
private constructShellBson;
|
|
9699
|
-
fetchConnectionInfo(): Promise<
|
|
9700
|
-
cachedConnectionInfo():
|
|
9728
|
+
fetchConnectionInfo(): Promise<ConnectionInfo | undefined>;
|
|
9729
|
+
cachedConnectionInfo(): ConnectionInfo | undefined;
|
|
9701
9730
|
close(): Promise<void>;
|
|
9702
9731
|
setPreFetchCollectionAndDatabaseNames(value: boolean): void;
|
|
9703
9732
|
setDbFunc(newDb: any): DatabaseWithSchema;
|
|
@@ -9758,6 +9787,7 @@ declare interface ShellResult {
|
|
|
9758
9787
|
printable: any;
|
|
9759
9788
|
type: string | null;
|
|
9760
9789
|
source?: ShellResultSourceInformation;
|
|
9790
|
+
constructionOptions?: CursorConstructionOptionsWithChains;
|
|
9761
9791
|
}
|
|
9762
9792
|
declare interface ShellResultSourceInformation {
|
|
9763
9793
|
namespace: Namespace;
|
package/lib/api-raw.d.ts
CHANGED
|
@@ -338,7 +338,7 @@ declare interface AbstractCursorOptions extends BSONSerializeOptions {
|
|
|
338
338
|
|
|
339
339
|
declare abstract class AbstractFiniteCursor<CursorType extends ServiceProviderAggregationCursor | ServiceProviderFindCursor | ServiceProviderRunCommandCursor> extends BaseCursor<CursorType> {
|
|
340
340
|
_currentIterationResult: CursorIterationResult | null;
|
|
341
|
-
constructor(mongo: Mongo, cursor: CursorType);
|
|
341
|
+
constructor(mongo: Mongo, cursor: CursorType, constructionOptionsWithChains?: CursorConstructionOptionsWithChains);
|
|
342
342
|
[asPrintable](): Promise<CursorIterationResult | string>;
|
|
343
343
|
_it(): Promise<CursorIterationResult>;
|
|
344
344
|
batchSize(size: number): this;
|
|
@@ -462,7 +462,7 @@ declare interface Admin_2 {
|
|
|
462
462
|
listDatabases(database: string, options?: ListDatabasesOptions): Promise<Document_2>;
|
|
463
463
|
getNewConnection(uri: string, options: MongoClientOptions): Promise<ServiceProvider>;
|
|
464
464
|
getURI(): string | undefined;
|
|
465
|
-
getConnectionInfo(): Promise<
|
|
465
|
+
getConnectionInfo(): Promise<ConnectionInfo>;
|
|
466
466
|
authenticate(authDoc: ShellAuthOptions): Promise<{
|
|
467
467
|
ok: number;
|
|
468
468
|
}>;
|
|
@@ -634,7 +634,7 @@ declare class AggregationCursor<TSchema = any> extends ExplainableCursor<TSchema
|
|
|
634
634
|
}
|
|
635
635
|
|
|
636
636
|
declare class AggregationCursor_2 extends AggregateOrFindCursor<ServiceProviderAggregationCursor> {
|
|
637
|
-
constructor(mongo: Mongo, cursor: ServiceProviderAggregationCursor);
|
|
637
|
+
constructor(mongo: Mongo, cursor: ServiceProviderAggregationCursor, constructionOptionsWithChains?: CursorConstructionOptionsWithChains);
|
|
638
638
|
}
|
|
639
639
|
|
|
640
640
|
declare const ALL_TOPOLOGIES: readonly ["ReplSet", "Standalone", "Sharded", "LoadBalanced"];
|
|
@@ -1019,9 +1019,11 @@ declare type AzureKMSProviderConfiguration = {
|
|
|
1019
1019
|
declare abstract class BaseCursor<CursorType extends ServiceProviderBaseCursor> extends ShellApiWithMongoClass {
|
|
1020
1020
|
_mongo: Mongo;
|
|
1021
1021
|
_cursor: CursorType;
|
|
1022
|
+
readonly _constructionOptions?: CursorConstructionOptions;
|
|
1023
|
+
_chains: CursorChainOptions[];
|
|
1022
1024
|
_transform: ((doc: any) => any) | null;
|
|
1023
1025
|
_blockingWarningDisabled: boolean;
|
|
1024
|
-
constructor(mongo: Mongo, cursor: CursorType);
|
|
1026
|
+
constructor(mongo: Mongo, cursor: CursorType, constructionOptionsWithChains?: CursorConstructionOptionsWithChains);
|
|
1025
1027
|
close(): Promise<void>;
|
|
1026
1028
|
forEach(f: (doc: Document_2) => void | boolean | Promise<void> | Promise<boolean>): Promise<void>;
|
|
1027
1029
|
hasNext(): Promise<boolean>;
|
|
@@ -3917,11 +3919,6 @@ declare type ConnectionExtraInfo = {
|
|
|
3917
3919
|
} & HostInformation;
|
|
3918
3920
|
|
|
3919
3921
|
declare interface ConnectionInfo {
|
|
3920
|
-
connectionString: string;
|
|
3921
|
-
driverOptions: Omit<DevtoolsConnectOptions, 'productName' | 'productDocsLink'>;
|
|
3922
|
-
}
|
|
3923
|
-
|
|
3924
|
-
declare interface ConnectionInfo_2 {
|
|
3925
3922
|
buildInfo: Document_2 | null;
|
|
3926
3923
|
resolvedHostname?: string;
|
|
3927
3924
|
extraInfo: (ConnectionExtraInfo & {
|
|
@@ -3929,6 +3926,11 @@ declare interface ConnectionInfo_2 {
|
|
|
3929
3926
|
}) | null;
|
|
3930
3927
|
}
|
|
3931
3928
|
|
|
3929
|
+
declare interface ConnectionInfo_2 {
|
|
3930
|
+
connectionString: string;
|
|
3931
|
+
driverOptions: Omit<DevtoolsConnectOptions, 'productName' | 'productDocsLink'>;
|
|
3932
|
+
}
|
|
3933
|
+
|
|
3932
3934
|
/** @public */
|
|
3933
3935
|
declare interface ConnectionOptions_2 extends SupportedNodeConnectionOptions, StreamDescriptionOptions, ProxyOptions {
|
|
3934
3936
|
id: number | '<monitor>';
|
|
@@ -4243,7 +4245,7 @@ declare type CSFLEKMSTlsOptions = {
|
|
|
4243
4245
|
|
|
4244
4246
|
declare class Cursor extends AggregateOrFindCursor<ServiceProviderFindCursor> {
|
|
4245
4247
|
_tailable: boolean;
|
|
4246
|
-
constructor(mongo: Mongo, cursor: ServiceProviderFindCursor);
|
|
4248
|
+
constructor(mongo: Mongo, cursor: ServiceProviderFindCursor, constructionOptionsWithChains?: CursorConstructionOptionsWithChains);
|
|
4247
4249
|
toJSON(): void;
|
|
4248
4250
|
private _addFlag;
|
|
4249
4251
|
addOption(optionFlagNumber: number): this;
|
|
@@ -4275,6 +4277,34 @@ declare class Cursor extends AggregateOrFindCursor<ServiceProviderFindCursor> {
|
|
|
4275
4277
|
/** @public */
|
|
4276
4278
|
declare const CURSOR_FLAGS: readonly ["tailable", "oplogReplay", "noCursorTimeout", "awaitData", "exhaust", "partial"];
|
|
4277
4279
|
|
|
4280
|
+
declare type CursorChainOptions = {
|
|
4281
|
+
method: string;
|
|
4282
|
+
args: any[];
|
|
4283
|
+
};
|
|
4284
|
+
|
|
4285
|
+
declare type CursorConstructionOptions = {
|
|
4286
|
+
method: 'find';
|
|
4287
|
+
args: Parameters<ServiceProvider['find']>;
|
|
4288
|
+
cursorType: 'Cursor';
|
|
4289
|
+
} | {
|
|
4290
|
+
method: 'aggregate';
|
|
4291
|
+
args: Parameters<ServiceProvider['aggregate']>;
|
|
4292
|
+
cursorType: 'AggregationCursor';
|
|
4293
|
+
} | {
|
|
4294
|
+
method: 'aggregateDb';
|
|
4295
|
+
args: Parameters<ServiceProvider['aggregateDb']>;
|
|
4296
|
+
cursorType: 'AggregationCursor';
|
|
4297
|
+
} | {
|
|
4298
|
+
method: 'runCursorCommand';
|
|
4299
|
+
args: Parameters<ServiceProvider['runCursorCommand']>;
|
|
4300
|
+
cursorType: 'RunCommandCursor';
|
|
4301
|
+
};
|
|
4302
|
+
|
|
4303
|
+
declare type CursorConstructionOptionsWithChains = {
|
|
4304
|
+
options: CursorConstructionOptions;
|
|
4305
|
+
chains?: CursorChainOptions[];
|
|
4306
|
+
};
|
|
4307
|
+
|
|
4278
4308
|
/** @public */
|
|
4279
4309
|
declare type CursorFlag = (typeof CURSOR_FLAGS)[number];
|
|
4280
4310
|
|
|
@@ -6281,7 +6311,7 @@ export declare class Mongo<M extends GenericServerSideSchema = GenericServerSide
|
|
|
6281
6311
|
readonly _databases: Record<StringKey<M>, DatabaseWithSchema<M>>;
|
|
6282
6312
|
private _connectionId;
|
|
6283
6313
|
_instanceState: ShellInstanceState;
|
|
6284
|
-
_connectionInfo:
|
|
6314
|
+
_connectionInfo: ConnectionInfo_2;
|
|
6285
6315
|
private _explicitEncryptionOnly;
|
|
6286
6316
|
private _keyVault;
|
|
6287
6317
|
private _clientEncryption;
|
|
@@ -7755,6 +7785,7 @@ declare interface RangeOptions {
|
|
|
7755
7785
|
declare interface Readable_2 {
|
|
7756
7786
|
aggregate(database: string, collection: string, pipeline: Document_2[], options?: AggregateOptions & Abortable_2, dbOptions?: DbOptions): ServiceProviderAggregationCursor;
|
|
7757
7787
|
aggregateDb(database: string, pipeline: Document_2[], options?: AggregateOptions & Abortable_2, dbOptions?: DbOptions): ServiceProviderAggregationCursor;
|
|
7788
|
+
hasUnifiedAggregateOptions?(): boolean;
|
|
7758
7789
|
count(db: string, coll: string, query?: Document_2, options?: CountOptions, dbOptions?: DbOptions): Promise<number>;
|
|
7759
7790
|
countDocuments(database: string, collection: string, filter?: Document_2, options?: CountDocumentsOptions & Abortable_2, dbOptions?: DbOptions): Promise<number>;
|
|
7760
7791
|
distinct(database: string, collection: string, fieldName: string, filter?: Document_2, options?: DistinctOptions, dbOptions?: DbOptions): Promise<Document_2>;
|
|
@@ -8119,7 +8150,7 @@ declare class RunCommandCursor extends AbstractCursor {
|
|
|
8119
8150
|
}
|
|
8120
8151
|
|
|
8121
8152
|
declare class RunCommandCursor_2 extends AbstractFiniteCursor<ServiceProviderRunCommandCursor> {
|
|
8122
|
-
constructor(mongo: Mongo, cursor: ServiceProviderRunCommandCursor);
|
|
8153
|
+
constructor(mongo: Mongo, cursor: ServiceProviderRunCommandCursor, constructionOptionsWithChains?: CursorConstructionOptionsWithChains);
|
|
8123
8154
|
}
|
|
8124
8155
|
|
|
8125
8156
|
/** @public */
|
|
@@ -8776,9 +8807,10 @@ declare class ShellInstanceState {
|
|
|
8776
8807
|
private alreadyTransformedErrors;
|
|
8777
8808
|
private preFetchCollectionAndDatabaseNames;
|
|
8778
8809
|
constructor(initialServiceProvider: ServiceProvider, messageBus?: any, cliOptions?: ShellCliOptions, bsonLibrary?: BSON);
|
|
8810
|
+
private static commonConstructShellBsonProps;
|
|
8779
8811
|
private constructShellBson;
|
|
8780
|
-
fetchConnectionInfo(): Promise<
|
|
8781
|
-
cachedConnectionInfo():
|
|
8812
|
+
fetchConnectionInfo(): Promise<ConnectionInfo | undefined>;
|
|
8813
|
+
cachedConnectionInfo(): ConnectionInfo | undefined;
|
|
8782
8814
|
close(): Promise<void>;
|
|
8783
8815
|
setPreFetchCollectionAndDatabaseNames(value: boolean): void;
|
|
8784
8816
|
setDbFunc(newDb: any): DatabaseWithSchema;
|
|
@@ -8824,6 +8856,7 @@ declare interface ShellResult {
|
|
|
8824
8856
|
printable: any;
|
|
8825
8857
|
type: string | null;
|
|
8826
8858
|
source?: ShellResultSourceInformation;
|
|
8859
|
+
constructionOptions?: CursorConstructionOptionsWithChains;
|
|
8827
8860
|
}
|
|
8828
8861
|
|
|
8829
8862
|
declare interface ShellResultSourceInformation {
|
package/lib/bulk.js
CHANGED
|
@@ -132,8 +132,7 @@ let BulkFindOp = (() => {
|
|
|
132
132
|
};
|
|
133
133
|
__setFunctionName(_classThis, "BulkFindOp");
|
|
134
134
|
(() => {
|
|
135
|
-
|
|
136
|
-
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create((_a = _classSuper[Symbol.metadata]) !== null && _a !== void 0 ? _a : null) : void 0;
|
|
135
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
137
136
|
_collation_decorators = [(0, decorators_1.returnType)('BulkFindOp'), (0, decorators_1.apiVersions)([1])];
|
|
138
137
|
_arrayFilters_decorators = [(0, decorators_1.returnType)('BulkFindOp'), (0, decorators_1.apiVersions)([1])];
|
|
139
138
|
_hint_decorators = [(0, decorators_1.returnType)('BulkFindOp'), (0, decorators_1.apiVersions)([1])];
|
|
@@ -240,8 +239,7 @@ let Bulk = (() => {
|
|
|
240
239
|
};
|
|
241
240
|
__setFunctionName(_classThis, "Bulk");
|
|
242
241
|
(() => {
|
|
243
|
-
|
|
244
|
-
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create((_a = _classSuper[Symbol.metadata]) !== null && _a !== void 0 ? _a : null) : void 0;
|
|
242
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
245
243
|
_execute_decorators = [decorators_1.returnsPromise, (0, decorators_1.apiVersions)([1])];
|
|
246
244
|
_find_decorators = [(0, decorators_1.returnType)('BulkFindOp'), (0, decorators_1.apiVersions)([1])];
|
|
247
245
|
_insert_decorators = [(0, decorators_1.returnType)('Bulk'), (0, decorators_1.apiVersions)([1])];
|
package/lib/bulk.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bulk.js","sourceRoot":"","sources":["../src/bulk.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAOsB;AAEtB,4CAAyE;AAUzE,mCAAsC;AACtC,uCAAgE;AAChE,qCAA2C;IAK9B,UAAU;4BADtB,iCAAoB;;;;sBACW,mCAAsB;;;;;;;;;;;;;uCAA9B,SAAQ,WAAsB;QAGpD,YAAY,SAAwB,EAAE,UAAgB;YACpD,KAAK,EAAE,CAAC;YAHV,+BAA0B,GADf,mDAAU,CACqB;YAIxC,IAAI,CAAC,0BAA0B,GAAG,SAAS,CAAC;YAC5C,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;QAChC,CAAC;QAED,IAAI,MAAM;YACR,OAAO,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC;QACjC,CAAC;QAED,CAAC,mBAAW,CAAC;YACX,OAAO,YAAY,CAAC;QACtB,CAAC;QAID,SAAS,CAAC,IAAsB;YAC9B,IAAI,CAAC,0BAA0B,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;YAChD,OAAO,IAAI,CAAC;QACd,CAAC;QAID,YAAY,CAAC,OAAmB;YAC9B,IAAI,CAAC,0BAA0B,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;YACtD,OAAO,IAAI,CAAC;QACd,CAAC;QAID,IAAI,CAAC,OAAiB;YACpB,IAAA,+BAAqB,EAAC,CAAC,OAAO,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,iBAAiB,CAAC,CAAC;YAC5D,IAAI,CAAC,0BAA0B,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YAC9C,OAAO,IAAI,CAAC;QACd,CAAC;QAID,MAAM;YACJ,IAAI,CAAC,WAAW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StreamCursor");
|
|
113
113
|
(() => {
|
|
114
|
-
|
|
115
|
-
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create((_a = _classSuper[Symbol.metadata]) !== null && _a !== void 0 ? _a : null) : void 0;
|
|
114
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
116
115
|
_hasNext_decorators = [decorators_1.returnsPromise, decorators_1.deprecated];
|
|
117
116
|
_tryNext_decorators = [decorators_1.returnsPromise];
|
|
118
117
|
_next_decorators = [decorators_1.returnsPromise];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"change-stream-cursor.js","sourceRoot":"","sources":["../src/change-stream-cursor.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAAgF;AAMhF,qCAAiD;AACjD,mCAAsC;AACtC,4CAIyB;AACzB,uCAAoC;AAEpC,uDAA+C;;4BAE9C,iCAAoB;;;;sBAC2B,4BAAU;;;;;+CAAlB,SAAQ,WAAuC;QAIrF,YAAY,MAAmC,EAAE,EAAU,EAAE,KAAY;YACvE,KAAK,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;YAJvB,4BAAuB,IADJ,mDAAkB,EACmB,IAAI,EAAC;YAK3D,IAAI,CAAC,GAAG,GAAG,EAAE,CAAC;QAChB,CAAC;QAEQ,KAAK,CAAC,GAAG;YAChB,IAAI,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC;gBACxB,MAAM,IAAI,4BAAmB,CAAC,8BAA8B,CAAC,CAAC;YAChE,CAAC;YACD,MAAM,MAAM,GAAG,CAAC,IAAI,CAAC,uBAAuB,GAAG,IAAI,8BAAqB,EAAE,CAAC,CAAC;YAC5E,OAAO,IAAA,iBAAO,EAAC,MAAM,EAAE,IAAI,EAAE,MAAM,IAAI,CAAC,MAAM,CAAC,iBAAiB,EAAE,CAAC,CAAC;QACtE,CAAC;QAKQ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B,IAAI,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC;gBACxB,MAAM,IAAI,4BAAmB,CAAC,sCAAsC,CAAC,CAAC;YACxE,CAAC;YACD,OAAO,KAAK,CAAC,OAAO,EAAE,CAAC;QACzB,CAAC;QAEQ,WAAW;YAClB,MAAM,IAAI,iCAAwB,CAChC,oRAAoR,CACrR,CAAC;QACJ,CAAC;QAGQ,KAAK,CAAC,IAAI;YACjB,IAAI,CAAC,IAAI,CAAC,wBAAwB,EAAE,CAAC;gBACnC,MAAM,IAAI,CAAC,cAAc,CAAC,YAAY,CACpC,yGAAyG;oBACvG,sGAAsG,CACzG,CAAC;YACJ,CAAC;YACD,OAAO,CAAC,MAAM,KAAK,CAAC,IAAI,EAAE,CAAa,CAAC;QAC1C,CAAC;QAED,cAAc;YACZ,OAAO,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC;QAClC,CAAC;QAEQ,OAAO;YACd,MAAM,IAAI,kCAAyB,CACjC,+CAA+C,CAChD,CAAC;QACJ,CAAC;QAEQ,SAAS;YAChB,MAAM,IAAI,kCAAyB,CACjC,iDAAiD,CAClD,CAAC;QACJ,CAAC;QAEQ,eAAe;YACtB,MAAM,IAAI,kCAAyB,CACjC,uDAAuD,CACxD,CAAC;QACJ,CAAC;QAEQ,SAAS;YAChB,MAAM,IAAI,kCAAyB,CACjC,iDAAiD,CAClD,CAAC;QACJ,CAAC;;;;;+BA/DA,2BAAc,EACd,uBAAU;+BAWV,2BAAc;4BAcd,2BAAc;QAxBf,8KAAe,OAAO,6DAQrB;QAGD,8KAAe,OAAO,6DAKrB;QASD,qKAAe,IAAI,6DAQlB;QA3DH,6KAwFC;;;QAxFoB,uDAAkB"}
|
package/lib/collection.js
CHANGED
|
@@ -179,9 +179,29 @@ let Collection = (() => {
|
|
|
179
179
|
await this._instanceState.printWarning(helpers_1.aggregateBackgroundOptionNotSupportedHelp);
|
|
180
180
|
}
|
|
181
181
|
this._emitCollectionApiCall('aggregate', { options, pipeline });
|
|
182
|
-
const { aggOptions,
|
|
183
|
-
const
|
|
184
|
-
|
|
182
|
+
const { aggOptions, explain, dbOptions } = (0, helpers_1.adaptAggregateOptions)(options, !!this._mongo._serviceProvider.hasUnifiedAggregateOptions?.());
|
|
183
|
+
const aggregateOptions = {
|
|
184
|
+
...(await this._database._baseOptions()),
|
|
185
|
+
...aggOptions,
|
|
186
|
+
};
|
|
187
|
+
const constructionOptions = {
|
|
188
|
+
method: 'aggregate',
|
|
189
|
+
args: [
|
|
190
|
+
this._database._name,
|
|
191
|
+
this._name,
|
|
192
|
+
pipeline,
|
|
193
|
+
aggregateOptions,
|
|
194
|
+
dbOptions,
|
|
195
|
+
],
|
|
196
|
+
cursorType: 'AggregationCursor',
|
|
197
|
+
};
|
|
198
|
+
const providerCursor = this._mongo._serviceProvider[constructionOptions.method](...constructionOptions.args);
|
|
199
|
+
const constructionOptionsWithChains = aggregateOptions.session
|
|
200
|
+
? undefined
|
|
201
|
+
: {
|
|
202
|
+
options: constructionOptions,
|
|
203
|
+
};
|
|
204
|
+
const cursor = new index_1.AggregationCursor(this._mongo, providerCursor, constructionOptionsWithChains);
|
|
185
205
|
if (explain) {
|
|
186
206
|
return await cursor.explain(explain);
|
|
187
207
|
}
|
|
@@ -235,8 +255,28 @@ let Collection = (() => {
|
|
|
235
255
|
if (projection) {
|
|
236
256
|
options.projection = projection;
|
|
237
257
|
}
|
|
258
|
+
const findOptions = {
|
|
259
|
+
...(await this._database._baseOptions()),
|
|
260
|
+
...options,
|
|
261
|
+
};
|
|
238
262
|
this._emitCollectionApiCall('find', { query, options });
|
|
239
|
-
const
|
|
263
|
+
const constructionOptions = {
|
|
264
|
+
method: 'find',
|
|
265
|
+
args: [
|
|
266
|
+
this._database._name,
|
|
267
|
+
this._name,
|
|
268
|
+
query,
|
|
269
|
+
findOptions,
|
|
270
|
+
],
|
|
271
|
+
cursorType: 'Cursor',
|
|
272
|
+
};
|
|
273
|
+
const providerCursor = this._mongo._serviceProvider[constructionOptions.method](...constructionOptions.args);
|
|
274
|
+
const constructionOptionsWithChains = findOptions.session
|
|
275
|
+
? undefined
|
|
276
|
+
: {
|
|
277
|
+
options: constructionOptions,
|
|
278
|
+
};
|
|
279
|
+
const cursor = new index_1.Cursor(this._mongo, providerCursor, constructionOptionsWithChains);
|
|
240
280
|
const explain = options.explain;
|
|
241
281
|
if (explain) {
|
|
242
282
|
return await cursor.explain(explain);
|
|
@@ -245,7 +285,6 @@ let Collection = (() => {
|
|
|
245
285
|
return cursor;
|
|
246
286
|
}
|
|
247
287
|
async findAndModify(options) {
|
|
248
|
-
var _a;
|
|
249
288
|
(0, helpers_1.assertArgsDefinedType)([options], [true], 'Collection.findAndModify');
|
|
250
289
|
(0, helpers_1.assertKeysDefined)(options, ['query']);
|
|
251
290
|
this._emitCollectionApiCall('findAndModify', {
|
|
@@ -258,7 +297,7 @@ let Collection = (() => {
|
|
|
258
297
|
}
|
|
259
298
|
if (reducedOptions.projection === undefined &&
|
|
260
299
|
reducedOptions.fields !== undefined) {
|
|
261
|
-
|
|
300
|
+
reducedOptions.projection ??= reducedOptions.fields;
|
|
262
301
|
}
|
|
263
302
|
delete reducedOptions.query;
|
|
264
303
|
delete reducedOptions.update;
|
|
@@ -295,7 +334,7 @@ let Collection = (() => {
|
|
|
295
334
|
};
|
|
296
335
|
}
|
|
297
336
|
catch (e) {
|
|
298
|
-
if (
|
|
337
|
+
if (e?.name === 'MongoError') {
|
|
299
338
|
return {
|
|
300
339
|
ok: 0,
|
|
301
340
|
errmsg: e.errmsg,
|
|
@@ -313,7 +352,7 @@ let Collection = (() => {
|
|
|
313
352
|
if (options.explain && result) {
|
|
314
353
|
return (0, helpers_1.markAsExplainOutput)(result);
|
|
315
354
|
}
|
|
316
|
-
return result
|
|
355
|
+
return result?.value;
|
|
317
356
|
}
|
|
318
357
|
async findOneAndReplace(filter, replacement, options = {}) {
|
|
319
358
|
(0, helpers_1.assertArgsDefinedType)([filter], [true], 'Collection.findOneAndReplace');
|
|
@@ -373,13 +412,12 @@ let Collection = (() => {
|
|
|
373
412
|
return new index_1.InsertOneResult(!!result.acknowledged, result.insertedId);
|
|
374
413
|
}
|
|
375
414
|
async isCapped() {
|
|
376
|
-
var _a, _b;
|
|
377
415
|
this._emitCollectionApiCall('isCapped');
|
|
378
416
|
const colls = await this._database._listCollections({ name: this._name }, { nameOnly: false });
|
|
379
417
|
if (colls.length === 0) {
|
|
380
418
|
throw new errors_1.MongoshRuntimeError(`collection ${this.getFullName()} not found`);
|
|
381
419
|
}
|
|
382
|
-
return !!
|
|
420
|
+
return !!colls[0]?.options?.capped;
|
|
383
421
|
}
|
|
384
422
|
async remove(query, options = {}) {
|
|
385
423
|
await this._instanceState.printDeprecationWarning('Collection.remove() is deprecated. Use deleteOne, deleteMany, findOneAndDelete, or bulkWrite.');
|
|
@@ -518,10 +556,10 @@ let Collection = (() => {
|
|
|
518
556
|
});
|
|
519
557
|
}
|
|
520
558
|
catch (error) {
|
|
521
|
-
if ((
|
|
522
|
-
|
|
523
|
-
(
|
|
524
|
-
|
|
559
|
+
if ((error?.codeName === 'IndexNotFound' ||
|
|
560
|
+
error?.codeName === undefined) &&
|
|
561
|
+
(error?.errmsg === 'invalid index name spec' ||
|
|
562
|
+
error?.errmsg === undefined) &&
|
|
525
563
|
Array.isArray(indexes) &&
|
|
526
564
|
indexes.length > 0 &&
|
|
527
565
|
/^4\.0\./.exec(await this._database.version())) {
|
|
@@ -587,17 +625,16 @@ let Collection = (() => {
|
|
|
587
625
|
return this._getSingleStorageStatValue('totalSize');
|
|
588
626
|
}
|
|
589
627
|
async drop(options = {}) {
|
|
590
|
-
var _a, _b, _c;
|
|
591
628
|
this._emitCollectionApiCall('drop');
|
|
592
629
|
let encryptedFieldsOptions = {};
|
|
593
|
-
const encryptedFieldsMap =
|
|
594
|
-
const encryptedFields = encryptedFieldsMap
|
|
630
|
+
const encryptedFieldsMap = this._mongo._fleOptions?.encryptedFieldsMap;
|
|
631
|
+
const encryptedFields = encryptedFieldsMap?.[`${this._database._name}.${this._name}`];
|
|
595
632
|
if (!encryptedFields && !options.encryptedFields) {
|
|
596
633
|
try {
|
|
597
634
|
const collectionInfos = await this._mongo._serviceProvider.listCollections(this._database._name, {
|
|
598
635
|
name: this._name,
|
|
599
636
|
}, await this._database._baseOptions());
|
|
600
|
-
const encryptedFields =
|
|
637
|
+
const encryptedFields = collectionInfos?.[0]?.options?.encryptedFields;
|
|
601
638
|
if (encryptedFields) {
|
|
602
639
|
encryptedFieldsOptions = { encryptedFields };
|
|
603
640
|
}
|
|
@@ -613,7 +650,7 @@ let Collection = (() => {
|
|
|
613
650
|
});
|
|
614
651
|
}
|
|
615
652
|
catch (error) {
|
|
616
|
-
if (
|
|
653
|
+
if (error?.codeName === 'NamespaceNotFound') {
|
|
617
654
|
this._mongo._instanceState.messageBus.emit('mongosh:warn', {
|
|
618
655
|
method: 'drop',
|
|
619
656
|
class: 'Collection',
|
|
@@ -676,7 +713,6 @@ let Collection = (() => {
|
|
|
676
713
|
return result;
|
|
677
714
|
}
|
|
678
715
|
async _aggregateAndScaleCollStats(collStats, scale) {
|
|
679
|
-
var _a;
|
|
680
716
|
const result = {
|
|
681
717
|
ok: 1,
|
|
682
718
|
};
|
|
@@ -706,13 +742,13 @@ let Collection = (() => {
|
|
|
706
742
|
'indexDetails',
|
|
707
743
|
'wiredTiger',
|
|
708
744
|
].includes(fieldName)) {
|
|
709
|
-
|
|
745
|
+
result[fieldName] ??= shardStorageStats[fieldName];
|
|
710
746
|
}
|
|
711
747
|
else if (fieldName === 'timeseries') {
|
|
712
748
|
timeseriesHasStats = true;
|
|
713
749
|
const shardTimeseriesStats = shardStorageStats[fieldName];
|
|
714
750
|
if (typeof shardTimeseriesStats.bucketsNs === 'string')
|
|
715
|
-
timeseriesBucketsNs
|
|
751
|
+
timeseriesBucketsNs ??= shardTimeseriesStats.bucketsNs;
|
|
716
752
|
for (const [timeseriesStatName, timeseriesStat] of Object.entries(shardTimeseriesStats)) {
|
|
717
753
|
if (typeof timeseriesStat === 'string') {
|
|
718
754
|
}
|
|
@@ -843,9 +879,9 @@ let Collection = (() => {
|
|
|
843
879
|
return await this._aggregateAndScaleCollStats(collStats, scale);
|
|
844
880
|
}
|
|
845
881
|
catch (e) {
|
|
846
|
-
if (
|
|
847
|
-
|
|
848
|
-
|
|
882
|
+
if (e?.codeName === 'StaleConfig' ||
|
|
883
|
+
e?.code === 13388 ||
|
|
884
|
+
e?.codeName === 'FailedToParse') {
|
|
849
885
|
try {
|
|
850
886
|
return await this._getLegacyCollStats(scale);
|
|
851
887
|
}
|
|
@@ -857,7 +893,6 @@ let Collection = (() => {
|
|
|
857
893
|
}
|
|
858
894
|
}
|
|
859
895
|
async stats(originalOptions = {}) {
|
|
860
|
-
var _a;
|
|
861
896
|
const options = typeof originalOptions === 'number'
|
|
862
897
|
? { scale: originalOptions }
|
|
863
898
|
: originalOptions;
|
|
@@ -904,7 +939,7 @@ let Collection = (() => {
|
|
|
904
939
|
}
|
|
905
940
|
};
|
|
906
941
|
updateStats(result);
|
|
907
|
-
for (const shardName of Object.keys(
|
|
942
|
+
for (const shardName of Object.keys(result.shards ?? {})) {
|
|
908
943
|
updateStats(result.shards[shardName]);
|
|
909
944
|
}
|
|
910
945
|
return result;
|
|
@@ -979,7 +1014,7 @@ let Collection = (() => {
|
|
|
979
1014
|
return existingConfigCollectionsInfo;
|
|
980
1015
|
}
|
|
981
1016
|
const timeseriesBucketNs = collStats
|
|
982
|
-
.map((extractedShardStats) =>
|
|
1017
|
+
.map((extractedShardStats) => extractedShardStats.storageStats?.timeseries?.bucketsNs)
|
|
983
1018
|
.find((bucketsNs) => typeof bucketsNs === 'string');
|
|
984
1019
|
if (!timeseriesBucketNs) {
|
|
985
1020
|
throw new errors_1.MongoshInvalidInputError(`Collection ${this._name} is not sharded`, error_codes_1.ShellApiErrors.NotConnectedToShardedCluster);
|
|
@@ -1004,7 +1039,6 @@ let Collection = (() => {
|
|
|
1004
1039
|
const conciseShardsStats = [];
|
|
1005
1040
|
const configCollectionsInfo = await this._getShardedCollectionInfo(config, collStats);
|
|
1006
1041
|
await Promise.all(collStats.map((extractedShardStats) => (async () => {
|
|
1007
|
-
var _a, _b, _c;
|
|
1008
1042
|
const { shard } = extractedShardStats;
|
|
1009
1043
|
const countChunksQuery = {
|
|
1010
1044
|
...(0, helpers_1.buildConfigChunksCollectionMatch)(configCollectionsInfo),
|
|
@@ -1016,8 +1050,8 @@ let Collection = (() => {
|
|
|
1016
1050
|
.findOne({ _id: extractedShardStats.shard }),
|
|
1017
1051
|
config.getCollection('chunks').countDocuments(countChunksQuery),
|
|
1018
1052
|
]);
|
|
1019
|
-
const orphanDocumentsSize = (
|
|
1020
|
-
(
|
|
1053
|
+
const orphanDocumentsSize = (extractedShardStats.storageStats.numOrphanDocs ?? 0) *
|
|
1054
|
+
(extractedShardStats.storageStats.avgObjSize ?? 0);
|
|
1021
1055
|
const ownedSize = extractedShardStats.storageStats.size - orphanDocumentsSize;
|
|
1022
1056
|
const shardStats = {
|
|
1023
1057
|
shardId: shard,
|
|
@@ -1027,7 +1061,7 @@ let Collection = (() => {
|
|
|
1027
1061
|
numChunks: numChunks,
|
|
1028
1062
|
avgObjSize: extractedShardStats.storageStats.avgObjSize,
|
|
1029
1063
|
};
|
|
1030
|
-
const shardStatsCount =
|
|
1064
|
+
const shardStatsCount = shardStats.count ?? NaN;
|
|
1031
1065
|
const estimatedChunkDataPerChunk = shardStats.numChunks === 0
|
|
1032
1066
|
? 0
|
|
1033
1067
|
: shardStats.size / shardStats.numChunks;
|
|
@@ -1142,7 +1176,8 @@ let Collection = (() => {
|
|
|
1142
1176
|
this._emitCollectionApiCall('checkMetadataConsistency', { options });
|
|
1143
1177
|
return await this._database._runCursorCommand({
|
|
1144
1178
|
checkMetadataConsistency: this._name,
|
|
1145
|
-
|
|
1179
|
+
...options,
|
|
1180
|
+
}, {});
|
|
1146
1181
|
}
|
|
1147
1182
|
async getSearchIndexes(indexName, options) {
|
|
1148
1183
|
if (typeof indexName === 'object' && indexName !== null) {
|
|
@@ -1175,7 +1210,7 @@ let Collection = (() => {
|
|
|
1175
1210
|
indexName = nameOrOptions;
|
|
1176
1211
|
}
|
|
1177
1212
|
indexDescription = {
|
|
1178
|
-
name: indexName
|
|
1213
|
+
name: indexName ?? 'default',
|
|
1179
1214
|
...(indexType &&
|
|
1180
1215
|
indexType !== 'search' && {
|
|
1181
1216
|
type: indexType,
|
|
@@ -1218,7 +1253,7 @@ let Collection = (() => {
|
|
|
1218
1253
|
return result;
|
|
1219
1254
|
})(),
|
|
1220
1255
|
(async () => {
|
|
1221
|
-
await new Promise((resolve) =>
|
|
1256
|
+
await new Promise((resolve) => setTimeout(resolve, 200)?.unref?.());
|
|
1222
1257
|
return this._cachedSampleDocs;
|
|
1223
1258
|
})(),
|
|
1224
1259
|
]);
|
|
@@ -1226,8 +1261,7 @@ let Collection = (() => {
|
|
|
1226
1261
|
};
|
|
1227
1262
|
__setFunctionName(_classThis, "Collection");
|
|
1228
1263
|
(() => {
|
|
1229
|
-
|
|
1230
|
-
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create((_a = _classSuper[Symbol.metadata]) !== null && _a !== void 0 ? _a : null) : void 0;
|
|
1264
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
1231
1265
|
_aggregate_decorators = [decorators_1.returnsPromise, (0, decorators_1.returnType)('AggregationCursor'), (0, decorators_1.apiVersions)([1])];
|
|
1232
1266
|
_bulkWrite_decorators = [decorators_1.returnsPromise, (0, decorators_1.serverVersions)(['3.2.0', enums_1.ServerVersions.latest]), (0, decorators_1.apiVersions)([1])];
|
|
1233
1267
|
_count_decorators = [decorators_1.returnsPromise, decorators_1.deprecated, (0, decorators_1.serverVersions)([enums_1.ServerVersions.earliest, '4.0.0']), (0, decorators_1.apiVersions)([])];
|