@mongosh/shell-api 3.20.0 → 3.23.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,26 +3,20 @@
3
3
  import type { Agent } from 'https';
4
4
  import type { AgentConnectOpts } from 'agent-base';
5
5
  import { Binary } from 'bson';
6
+ import type { BSON } from '@mongosh/shell-bson';
6
7
  import { BSONRegExp } from 'bson';
7
- import { BSONSymbol } from 'bson';
8
8
  import { BSONType } from 'bson';
9
- import { calculateObjectSize } from 'bson';
10
9
  import type { ClientRequest } from 'http';
11
- import { Code } from 'bson';
12
10
  import type { ConnectionOptions } from 'tls';
13
- import { DBRef } from 'bson';
14
11
  import { Decimal128 } from 'bson';
15
12
  import type { DeserializeOptions } from 'bson';
16
13
  import { Document as Document_2 } from 'bson';
17
14
  import { Double } from 'bson';
18
15
  import type { Duplex } from 'stream';
19
- import { EJSONOptions } from 'bson';
20
16
  import { EventEmitter } from 'events';
21
17
  import type { IncomingMessage } from 'http';
22
18
  import { Int32 } from 'bson';
23
19
  import { Long } from 'bson';
24
- import { MaxKey } from 'bson';
25
- import { MinKey } from 'bson';
26
20
  import { ObjectId } from 'bson';
27
21
  import type { ObjectIdLike } from 'bson';
28
22
  import { Readable } from 'stream';
@@ -30,6 +24,7 @@ import type { RequestOptions } from 'https';
30
24
  import type { SecureContextOptions } from 'tls';
31
25
  import type { SerializeOptions } from 'bson';
32
26
  import type { ServerResponse } from 'http';
27
+ import { ShellBson } from '@mongosh/shell-bson';
33
28
  import type { SrvRecord } from 'dns';
34
29
  import type { TcpNetConnectOpts } from 'net';
35
30
  import { Timestamp } from 'bson';
@@ -253,32 +248,6 @@ declare abstract class AbstractCursor<TSchema = any, CursorEvents extends Abstra
253
248
  /* Excluded from this release type: transformDocument */
254
249
  /* Excluded from this release type: throwIfInitialized */
255
250
  }
256
- declare abstract class AbstractCursor_2<CursorType extends ServiceProviderAggregationCursor | ServiceProviderFindCursor | ServiceProviderRunCommandCursor> extends ShellApiWithMongoClass {
257
- _mongo: Mongo;
258
- _cursor: CursorType;
259
- _transform: ((doc: any) => any) | null;
260
- _currentIterationResult: CursorIterationResult | null;
261
- constructor(mongo: Mongo, cursor: CursorType);
262
- [asPrintable](): Promise<CursorIterationResult>;
263
- _it(): Promise<CursorIterationResult>;
264
- batchSize(size: number): this;
265
- close(): Promise<void>;
266
- forEach(f: (doc: Document_2) => void | boolean | Promise<void> | Promise<boolean>): Promise<void>;
267
- hasNext(): Promise<boolean>;
268
- tryNext(): Promise<Document_2 | null>;
269
- _tryNext(): Promise<Document_2 | null>;
270
- _canDelegateIterationToUnderlyingCursor(): boolean;
271
- [Symbol.asyncIterator](): AsyncGenerator<Document_2, void, void>;
272
- isClosed(): boolean;
273
- isExhausted(): boolean;
274
- itcount(): Promise<number>;
275
- toArray(): Promise<Document_2[]>;
276
- pretty(): this;
277
- map(f: (doc: Document_2) => Document_2): this;
278
- maxTimeMS(value: number): this;
279
- next(): Promise<Document_2 | null>;
280
- objsLeftInBatch(): number;
281
- }
282
251
 
283
252
  /** @public */
284
253
  declare type AbstractCursorEvents = {
@@ -362,6 +331,16 @@ declare interface AbstractCursorOptions extends BSONSerializeOptions {
362
331
  timeoutMode?: CursorTimeoutMode;
363
332
  /* Excluded from this release type: timeoutContext */
364
333
  }
334
+ declare abstract class AbstractFiniteCursor<CursorType extends ServiceProviderAggregationCursor | ServiceProviderFindCursor | ServiceProviderRunCommandCursor> extends BaseCursor<CursorType> {
335
+ _currentIterationResult: CursorIterationResult | null;
336
+ constructor(mongo: Mongo, cursor: CursorType);
337
+ [asPrintable](): Promise<CursorIterationResult | string>;
338
+ _it(): Promise<CursorIterationResult>;
339
+ batchSize(size: number): this;
340
+ toArray(): Promise<Document_2[]>;
341
+ maxTimeMS(value: number): this;
342
+ objsLeftInBatch(): number;
343
+ }
365
344
 
366
345
  /** @public */
367
346
  declare type AcceptedFields<TSchema, FieldType, AssignableType> = { readonly [key in KeysOfAType<TSchema, FieldType>]?: AssignableType };
@@ -470,7 +449,7 @@ declare class Admin {
470
449
  declare interface Admin_2 {
471
450
  platform: ReplPlatform;
472
451
  initialDb: string;
473
- bsonLibrary: typeof bson;
452
+ bsonLibrary: BSON;
474
453
  listDatabases(database: string, options?: ListDatabasesOptions): Promise<Document_2>;
475
454
  getNewConnection(uri: string, options: MongoClientOptions): Promise<any>;
476
455
  getURI(): string | undefined;
@@ -532,7 +511,7 @@ declare interface AggregateOptions extends Omit<CommandOperationOptions, 'explai
532
511
  explain?: ExplainOptions['explain'];
533
512
  /* Excluded from this release type: timeoutMode */
534
513
  }
535
- declare abstract class AggregateOrFindCursor<CursorType extends ServiceProviderAggregationCursor | ServiceProviderFindCursor> extends AbstractCursor_2<CursorType> {
514
+ declare abstract class AggregateOrFindCursor<CursorType extends ServiceProviderAggregationCursor | ServiceProviderFindCursor> extends AbstractFiniteCursor<CursorType> {
536
515
  projection(spec: Document_2): this;
537
516
  skip(value: number): this;
538
517
  sort(spec: Document_2): this;
@@ -1043,6 +1022,32 @@ declare type AzureKMSProviderConfiguration = {
1043
1022
  */
1044
1023
  accessToken: string;
1045
1024
  };
1025
+ declare abstract class BaseCursor<CursorType extends ServiceProviderBaseCursor> extends ShellApiWithMongoClass {
1026
+ _mongo: Mongo;
1027
+ _cursor: CursorType;
1028
+ _transform: ((doc: any) => any) | null;
1029
+ _blockingWarningDisabled: boolean;
1030
+ constructor(mongo: Mongo, cursor: CursorType);
1031
+ close(): Promise<void>;
1032
+ forEach(f: (doc: Document_2) => void | boolean | Promise<void> | Promise<boolean>): Promise<void>;
1033
+ hasNext(): Promise<boolean>;
1034
+ tryNext(): Promise<Document_2 | null>;
1035
+ _tryNext(): Promise<Document_2 | null>;
1036
+ _canDelegateIterationToUnderlyingCursor(): boolean;
1037
+ [Symbol.asyncIterator](): AsyncGenerator<Document_2, void, void>;
1038
+ isClosed(): boolean;
1039
+ isExhausted(): boolean;
1040
+ itcount(): Promise<number>;
1041
+ pretty(): this;
1042
+ map(f: (doc: Document_2) => Document_2): this;
1043
+ next(): Promise<Document_2 | null>;
1044
+ disableBlockWarnings(): this;
1045
+ abstract batchSize(size: number): this;
1046
+ abstract toArray(): Promise<Document_2[]>;
1047
+ abstract maxTimeMS(value: number): this;
1048
+ abstract objsLeftInBatch(): number;
1049
+ abstract _it(): Promise<CursorIterationResult>;
1050
+ }
1046
1051
  declare interface BaseSocks5RequestMetadata {
1047
1052
  srcAddr: string;
1048
1053
  srcPort: number;
@@ -1079,28 +1084,6 @@ declare type BatchType = (typeof BatchType)[keyof typeof BatchType];
1079
1084
 
1080
1085
  /** @public */
1081
1086
  declare type BitwiseFilter = number /** numeric bit mask */ | Binary /** BinData bit mask */ | ReadonlyArray<number>;
1082
- declare const bson: {
1083
- ObjectId: typeof ObjectId;
1084
- DBRef: typeof DBRef;
1085
- MaxKey: typeof MaxKey;
1086
- MinKey: typeof MinKey;
1087
- Timestamp: typeof Timestamp;
1088
- BSONSymbol: typeof BSONSymbol;
1089
- Code: typeof Code;
1090
- Decimal128: typeof Decimal128;
1091
- Int32: typeof Int32;
1092
- Long: typeof Long;
1093
- Binary: typeof Binary;
1094
- calculateObjectSize: typeof calculateObjectSize;
1095
- Double: typeof Double;
1096
- EJSON: {
1097
- parse: (text: string, options?: EJSONOptions) => any;
1098
- stringify: (value: any, replacer?: (number | string)[] | ((this: any, key: string, value: any) => any) | EJSONOptions, space?: string | number, options?: EJSONOptions) => string;
1099
- serialize: (value: any, options?: EJSONOptions) => Document_2;
1100
- deserialize: (ejson: Document_2, options?: EJSONOptions) => any;
1101
- };
1102
- BSONRegExp: typeof BSONRegExp;
1103
- };
1104
1087
 
1105
1088
  /**
1106
1089
  * BSON Serialization options.
@@ -1532,18 +1515,12 @@ declare interface ChangeStreamCreateIndexDocument extends ChangeStreamDocumentCo
1532
1515
  /** Describes the type of operation represented in this change notification */
1533
1516
  operationType: 'createIndexes';
1534
1517
  }
1535
- declare class ChangeStreamCursor extends ShellApiWithMongoClass {
1536
- _mongo: Mongo;
1537
- _cursor: ServiceProviderChangeStream<Document_2>;
1518
+ declare class ChangeStreamCursor extends BaseCursor<ServiceProviderChangeStream> {
1538
1519
  _currentIterationResult: CursorIterationResult | null;
1539
1520
  _on: string;
1540
- constructor(cursor: ServiceProviderChangeStream<Document_2>, on: string, mongo: Mongo);
1521
+ constructor(cursor: ServiceProviderChangeStream, on: string, mongo: Mongo);
1541
1522
  _it(): Promise<CursorIterationResult>;
1542
- [asPrintable](): string;
1543
- /*
1544
- Instructs the server to close a cursor and free associated server resources.
1545
- */
1546
- close(): void;
1523
+ [asPrintable](): Promise<string>;
1547
1524
  /*
1548
1525
  WARNING: on change streams this method will block unless the cursor is closed. Use tryNext to check if there are any documents in the batch. This is a breaking change
1549
1526
  */
@@ -1552,20 +1529,11 @@ declare class ChangeStreamCursor extends ShellApiWithMongoClass {
1552
1529
  If there is a document in the change stream, it will be returned. Otherwise returns null.
1553
1530
  */
1554
1531
  tryNext(): Document_2 | null;
1555
- [Symbol.asyncIterator](): AsyncGenerator<Document_2, void, unknown>;
1556
- /*
1557
- Returns true if the cursor is closed
1558
- */
1559
- isClosed(): boolean;
1560
1532
  /*
1561
1533
  This method is deprecated because because after closing a cursor, the remaining documents in the batch are no longer accessible. If you want to see if the cursor is closed use cursor.isClosed. If you want to see if there are documents left in the batch, use cursor.tryNext. This is a breaking change
1562
1534
  */
1563
1535
  isExhausted(): never;
1564
1536
  /*
1565
- Returns the number of documents in the current batch. NOTE: this method exhausts the cursor batch
1566
- */
1567
- itcount(): number;
1568
- /*
1569
1537
  WARNING: on change streams this method will block unless the cursor is closed. Use tryNext to get the next document in the batch. This is a breaking change
1570
1538
  */
1571
1539
  next(): Document_2;
@@ -1573,11 +1541,16 @@ declare class ChangeStreamCursor extends ShellApiWithMongoClass {
1573
1541
  Returns the ResumeToken of the change stream
1574
1542
  */
1575
1543
  getResumeToken(): ResumeToken;
1576
- map(): ChangeStreamCursor;
1577
- forEach(): Promise<void>;
1578
- toArray(): Promise<Document_2[]>;
1579
- objsLeftInBatch(): void;
1580
- pretty(): ChangeStreamCursor;
1544
+ toArray(): never;
1545
+ /*
1546
+ Not available on change streams
1547
+ */
1548
+ batchSize(): never;
1549
+ objsLeftInBatch(): never;
1550
+ /*
1551
+ Not available on change streams
1552
+ */
1553
+ maxTimeMS(): never;
1581
1554
  }
1582
1555
 
1583
1556
  /**
@@ -2462,7 +2435,7 @@ declare interface ClientEncryptionEncryptOptions {
2462
2435
  /**
2463
2436
  * The algorithm to use for encryption.
2464
2437
  */
2465
- algorithm: 'AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic' | 'AEAD_AES_256_CBC_HMAC_SHA_512-Random' | 'Indexed' | 'Unindexed' | 'Range';
2438
+ algorithm: 'AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic' | 'AEAD_AES_256_CBC_HMAC_SHA_512-Random' | 'Indexed' | 'Unindexed' | 'Range' | 'TextPreview';
2466
2439
  /**
2467
2440
  * The id of the Binary dataKey to use for encryption
2468
2441
  */
@@ -2476,9 +2449,15 @@ declare interface ClientEncryptionEncryptOptions {
2476
2449
  /**
2477
2450
  * The query type.
2478
2451
  */
2479
- queryType?: 'equality' | 'range';
2452
+ queryType?: 'equality' | 'range' | 'prefixPreview' | 'suffixPreview' | 'substringPreview';
2480
2453
  /** The index options for a Queryable Encryption field supporting "range" queries.*/
2481
2454
  rangeOptions?: RangeOptions;
2455
+ /**
2456
+ * Options for a Queryable Encryption field supporting text queries. Only valid when `algorithm` is `TextPreview`.
2457
+ *
2458
+ * @experimental Public Technical Preview: `textPreview` is an experimental feature and may break at any time.
2459
+ */
2460
+ textOptions?: TextQueryOptions;
2482
2461
  }
2483
2462
 
2484
2463
  /**
@@ -2569,7 +2548,7 @@ declare interface ClientEncryptionRewrapManyDataKeyProviderOptions {
2569
2548
  *
2570
2549
  * These options are not included in the type, and are ignored if provided.
2571
2550
  */
2572
- declare type ClientEncryptionTlsOptions = Pick<MongoClientOptions, 'tlsCAFile' | 'tlsCertificateKeyFile' | 'tlsCertificateKeyFilePassword'>;
2551
+ declare type ClientEncryptionTlsOptions = Pick<MongoClientOptions, 'tlsCAFile' | 'tlsCertificateKeyFile' | 'tlsCertificateKeyFilePassword' | 'secureContext'>;
2573
2552
 
2574
2553
  /** @public */
2575
2554
  declare interface ClientInsertOneModel<TSchema> extends ClientWriteModel {
@@ -3474,10 +3453,10 @@ declare class Collection_2<TSchema extends Document_2 = Document_2> {
3474
3453
  */
3475
3454
  findOne(): Promise<WithId<TSchema> | null>;
3476
3455
  findOne(filter: Filter<TSchema>): Promise<WithId<TSchema> | null>;
3477
- findOne(filter: Filter<TSchema>, options: Omit<FindOptions, 'timeoutMode'> & Abortable): Promise<WithId<TSchema> | null>;
3456
+ findOne(filter: Filter<TSchema>, options: Omit<FindOneOptions, 'timeoutMode'> & Abortable): Promise<WithId<TSchema> | null>;
3478
3457
  findOne<T = TSchema>(): Promise<T | null>;
3479
3458
  findOne<T = TSchema>(filter: Filter<TSchema>): Promise<T | null>;
3480
- findOne<T = TSchema>(filter: Filter<TSchema>, options?: Omit<FindOptions, 'timeoutMode'> & Abortable): Promise<T | null>;
3459
+ findOne<T = TSchema>(filter: Filter<TSchema>, options?: Omit<FindOneOptions, 'timeoutMode'> & Abortable): Promise<T | null>;
3481
3460
  /**
3482
3461
  * Creates a cursor for a filter that can be used to iterate over results from MongoDB
3483
3462
  *
@@ -3651,6 +3630,9 @@ declare class Collection_2<TSchema extends Document_2 = Document_2> {
3651
3630
  distinct<Key extends keyof WithId<TSchema>>(key: Key): Promise<Array<Flatten<WithId<TSchema>[Key]>>>;
3652
3631
  distinct<Key extends keyof WithId<TSchema>>(key: Key, filter: Filter<TSchema>): Promise<Array<Flatten<WithId<TSchema>[Key]>>>;
3653
3632
  distinct<Key extends keyof WithId<TSchema>>(key: Key, filter: Filter<TSchema>, options: DistinctOptions): Promise<Array<Flatten<WithId<TSchema>[Key]>>>;
3633
+ distinct<Key extends keyof WithId<TSchema>>(key: Key, filter: Filter<TSchema>, options: DistinctOptions & {
3634
+ explain: ExplainVerbosityLike | ExplainCommandOptions;
3635
+ }): Promise<Document_2>;
3654
3636
  distinct(key: string): Promise<any[]>;
3655
3637
  distinct(key: string, filter: Filter<TSchema>): Promise<any[]>;
3656
3638
  distinct(key: string, filter: Filter<TSchema>, options: DistinctOptions): Promise<any[]>;
@@ -6052,6 +6034,16 @@ declare interface FindOneAndUpdateOptions extends CommandOperationOptions {
6052
6034
  includeResultMetadata?: boolean;
6053
6035
  }
6054
6036
 
6037
+ /** @public */
6038
+ declare interface FindOneOptions extends FindOptions {
6039
+ /** @deprecated Will be removed in the next major version. User provided value will be ignored. */
6040
+ batchSize?: number;
6041
+ /** @deprecated Will be removed in the next major version. User provided value will be ignored. */
6042
+ limit?: number;
6043
+ /** @deprecated Will be removed in the next major version. User provided value will be ignored. */
6044
+ noCursorTimeout?: boolean;
6045
+ }
6046
+
6055
6047
  /**
6056
6048
  * A builder object that is returned from {@link BulkOperationBase#find}.
6057
6049
  * Is used to build a write operation that involves a query filter.
@@ -6246,26 +6238,6 @@ declare interface HedgeOptions {
6246
6238
  /** Explicitly enable or disable hedged reads. */
6247
6239
  enabled?: boolean;
6248
6240
  }
6249
- declare class Help {
6250
- private help;
6251
- private docs;
6252
- private attr;
6253
- constructor(properties: HelpProperties, options?: HelpOptions);
6254
- [asPrintable](): HelpProperties;
6255
- get [shellApiType](): string;
6256
- }
6257
- declare type HelpOptions = {
6258
- translate(key: string): string | undefined;
6259
- };
6260
- declare type HelpProperties = {
6261
- help: string;
6262
- docs?: string;
6263
- attr?: HelpPropertiesAttr[];
6264
- };
6265
- declare type HelpPropertiesAttr = {
6266
- name?: string;
6267
- description: string;
6268
- };
6269
6241
 
6270
6242
  /** @public */
6271
6243
  declare type Hint = string | Document_2;
@@ -6922,7 +6894,6 @@ declare interface LogComponentSeveritiesClientOptions {
6922
6894
  /** Optional default severity level to be used if any of the above are unset */
6923
6895
  default?: SeverityLevel;
6924
6896
  }
6925
- declare type LongWithoutAccidentallyExposedMethods = Omit<typeof bson.Long, 'fromExtendedJSON'>;
6926
6897
  declare type MapReduceShellOptions = Document_2 | string;
6927
6898
  declare type MasterKey = AWSEncryptionKeyOptions | AzureEncryptionKeyOptions | GCPEncryptionKeyOptions;
6928
6899
 
@@ -6978,7 +6949,7 @@ export declare class Mongo<M extends GenericServerSideSchema = GenericServerSide
6978
6949
  _listDatabases(opts?: ListDatabasesOptions): Promise<{
6979
6950
  databases: {
6980
6951
  name: string;
6981
- sizeOnDisk: number | ShellBson['Long'];
6952
+ sizeOnDisk: number | BSON['Long']['prototype'];
6982
6953
  empty: boolean;
6983
6954
  }[];
6984
6955
  ok: 1;
@@ -6990,7 +6961,7 @@ export declare class Mongo<M extends GenericServerSideSchema = GenericServerSide
6990
6961
  getDBs(options?: ListDatabasesOptions): {
6991
6962
  databases: {
6992
6963
  name: string;
6993
- sizeOnDisk: number | ShellBson['Long'];
6964
+ sizeOnDisk: number | BSON['Long']['prototype'];
6994
6965
  empty: boolean;
6995
6966
  }[];
6996
6967
  ok: 1;
@@ -7083,7 +7054,7 @@ export declare class Mongo<M extends GenericServerSideSchema = GenericServerSide
7083
7054
  /*
7084
7055
  Returns the hashed value for the input using the same hashing function as a hashed index.
7085
7056
  */
7086
- convertShardKeyToHashed(value: any): unknown;
7057
+ convertShardKeyToHashed(value: any): ShellBson['Long']['prototype'];
7087
7058
  }
7088
7059
 
7089
7060
  /** @public */
@@ -7711,7 +7682,7 @@ declare interface MongoDBOIDCLogEventsMap {
7711
7682
  }) => void;
7712
7683
  'mongodb-oidc-plugin:skip-auth-attempt': (event: {
7713
7684
  authStateId: string;
7714
- reason: string;
7685
+ reason: 'not-expired' | 'not-expired-refresh-failed' | 'refresh-succeeded';
7715
7686
  }) => void;
7716
7687
  'mongodb-oidc-plugin:auth-failed': (event: {
7717
7688
  authStateId: string;
@@ -8288,7 +8259,6 @@ declare interface OperationOptions extends BSONSerializeOptions {
8288
8259
  /** The preferred read preference (ReadPreference.primary, ReadPreference.primary_preferred, ReadPreference.secondary, ReadPreference.secondary_preferred, ReadPreference.nearest). */
8289
8260
  readPreference?: ReadPreferenceLike;
8290
8261
  /* Excluded from this release type: bypassPinningCheck */
8291
- omitReadPreference?: boolean;
8292
8262
  /* Excluded from this release type: omitMaxTimeMS */
8293
8263
  /**
8294
8264
  * @experimental
@@ -8476,7 +8446,7 @@ declare interface Readable_2 {
8476
8446
  distinct(database: string, collection: string, fieldName: string, filter?: Document_2, options?: DistinctOptions, dbOptions?: DbOptions): Promise<Document_2>;
8477
8447
  estimatedDocumentCount(database: string, collection: string, options?: EstimatedDocumentCountOptions, dbOptions?: DbOptions): Promise<number>;
8478
8448
  find(database: string, collection: string, filter?: Document_2, options?: FindOptions, dbOptions?: DbOptions): ServiceProviderFindCursor;
8479
- getTopology(): any;
8449
+ getTopologyDescription(): TopologyDescription_2 | undefined;
8480
8450
  getIndexes(database: string, collection: string, options: ListIndexesOptions, dbOptions?: DbOptions): Promise<Document_2[]>;
8481
8451
  listCollections(database: string, filter?: Document_2, options?: ListCollectionsOptions, dbOptions?: DbOptions): Promise<Document_2[]>;
8482
8452
  readPreferenceFromOptions(options?: Omit<ReadPreferenceFromOptions, 'session'>): ReadPreferenceLike | undefined;
@@ -8884,7 +8854,7 @@ declare class RunCommandCursor extends AbstractCursor {
8884
8854
  /* Excluded from this release type: _initialize */
8885
8855
  /* Excluded from this release type: getMore */
8886
8856
  }
8887
- declare class RunCommandCursor_2 extends AbstractCursor_2<ServiceProviderRunCommandCursor> {
8857
+ declare class RunCommandCursor_2 extends AbstractFiniteCursor<ServiceProviderRunCommandCursor> {
8888
8858
  constructor(mongo: Mongo, cursor: ServiceProviderRunCommandCursor);
8889
8859
  }
8890
8860
 
@@ -8900,7 +8870,8 @@ declare type RunCommandOptions = {
8900
8870
  */
8901
8871
  timeoutMS?: number;
8902
8872
  /* Excluded from this release type: omitMaxTimeMS */
8903
- } & BSONSerializeOptions;
8873
+ /* Excluded from this release type: bypassPinningCheck */
8874
+ } & BSONSerializeOptions & Abortable;
8904
8875
 
8905
8876
  /** @public */
8906
8877
  declare type RunCursorCommandOptions = {
@@ -9047,6 +9018,10 @@ declare class ServerDescription {
9047
9018
  */
9048
9019
  equals(other?: ServerDescription | null): boolean;
9049
9020
  }
9021
+ declare interface ServerDescription_2 {
9022
+ type?: ServerType;
9023
+ setName?: string | null;
9024
+ }
9050
9025
 
9051
9026
  /**
9052
9027
  * Emitted when server description changes, but does NOT include changes to the RTT.
@@ -9620,7 +9595,7 @@ export declare class ShellApi extends ShellApiClass {
9620
9595
  /*
9621
9596
  result of the last line evaluated; use to further iterate
9622
9597
  */
9623
- it(): any;
9598
+ it(): CursorIterationResult;
9624
9599
  /*
9625
9600
  Shell version
9626
9601
  */
@@ -9690,35 +9665,7 @@ declare interface ShellAuthOptions {
9690
9665
  digestPassword?: boolean;
9691
9666
  authDb?: string;
9692
9667
  }
9693
- export declare type ShellBson = WithHelp<ShellBsonBase>;
9694
- declare interface ShellBsonBase {
9695
- DBRef: (namespace: string, oid: any, db?: string, fields?: Document_2) => typeof bson.DBRef.prototype;
9696
- bsonsize: (object: any) => number;
9697
- MaxKey: () => typeof bson.MaxKey.prototype;
9698
- MinKey: () => typeof bson.MinKey.prototype;
9699
- ObjectId: (id?: string | number | typeof bson.ObjectId.prototype | Buffer) => typeof bson.ObjectId.prototype;
9700
- Timestamp: (t?: number | typeof bson.Long.prototype | {
9701
- t: number;
9702
- i: number;
9703
- }, i?: number) => typeof bson.Timestamp.prototype;
9704
- Code: (c?: string | Function, s?: any) => typeof bson.Code.prototype;
9705
- NumberDecimal: (s?: string) => typeof bson.Decimal128.prototype;
9706
- NumberInt: (v?: string) => typeof bson.Int32.prototype;
9707
- NumberLong: (s?: string | number) => typeof bson.Long.prototype;
9708
- ISODate: (input?: string) => Date;
9709
- BinData: (subtype: number, b64string: string) => Binary;
9710
- HexData: (subtype: number, hexstr: string) => Binary;
9711
- UUID: (hexstr?: string) => Binary;
9712
- MD5: (hexstr: string) => Binary;
9713
- Decimal128: typeof bson.Decimal128;
9714
- BSONSymbol: typeof bson.BSONSymbol;
9715
- Int32: typeof bson.Int32;
9716
- Long: LongWithoutAccidentallyExposedMethods;
9717
- Binary: typeof bson.Binary;
9718
- Double: typeof bson.Double;
9719
- EJSON: typeof bson.EJSON;
9720
- BSONRegExp: typeof bson.BSONRegExp;
9721
- }
9668
+ export { ShellBson };
9722
9669
  declare interface ShellCliOptions {
9723
9670
  nodb?: boolean;
9724
9671
  }
@@ -9742,7 +9689,7 @@ declare class ShellConfig extends ShellApiClass {
9742
9689
  [asPrintable](): Promise<Map<keyof ShellUserConfig, ShellUserConfig[keyof ShellUserConfig]>>;
9743
9690
  }
9744
9691
  declare class ShellInstanceState {
9745
- currentCursor: Cursor | AggregationCursor_2 | ChangeStreamCursor | RunCommandCursor_2 | null;
9692
+ currentCursor: BaseCursor<ServiceProviderBaseCursor> | null;
9746
9693
  currentDb: DatabaseWithSchema;
9747
9694
  messageBus: MongoshBus;
9748
9695
  initialServiceProvider: ServiceProvider;
@@ -9767,6 +9714,7 @@ declare class ShellInstanceState {
9767
9714
  private alreadyTransformedErrors;
9768
9715
  private preFetchCollectionAndDatabaseNames;
9769
9716
  constructor(initialServiceProvider: ServiceProvider, messageBus?: any, cliOptions?: ShellCliOptions);
9717
+ private constructShellBson;
9770
9718
  fetchConnectionInfo(): Promise<ConnectionInfo_2 | undefined>;
9771
9719
  cachedConnectionInfo(): ConnectionInfo_2 | undefined;
9772
9720
  close(): Promise<void>;
@@ -10012,6 +9960,39 @@ declare type TagSet = {
10012
9960
  [key: string]: string;
10013
9961
  };
10014
9962
 
9963
+ /**
9964
+ * Options for a Queryable Encryption field supporting text queries.
9965
+ *
9966
+ * @public
9967
+ * @experimental Public Technical Preview: `textPreview` is an experimental feature and may break at any time.
9968
+ */
9969
+ declare interface TextQueryOptions {
9970
+ /** Indicates that text indexes for this field are case sensitive */
9971
+ caseSensitive: boolean;
9972
+ /** Indicates that text indexes for this field are diacritic sensitive. */
9973
+ diacriticSensitive: boolean;
9974
+ prefix?: {
9975
+ /** The maximum allowed query length. */
9976
+ strMaxQueryLength: Int32 | number;
9977
+ /** The minimum allowed query length. */
9978
+ strMinQueryLength: Int32 | number;
9979
+ };
9980
+ suffix?: {
9981
+ /** The maximum allowed query length. */
9982
+ strMaxQueryLength: Int32 | number;
9983
+ /** The minimum allowed query length. */
9984
+ strMinQueryLength: Int32 | number;
9985
+ };
9986
+ substring?: {
9987
+ /** The maximum allowed length to insert. */
9988
+ strMaxLength: Int32 | number;
9989
+ /** The maximum allowed query length. */
9990
+ strMaxQueryLength: Int32 | number;
9991
+ /** The minimum allowed query length. */
9992
+ strMinQueryLength: Int32 | number;
9993
+ };
9994
+ }
9995
+
10015
9996
  /** @public
10016
9997
  * Configuration options for timeseries collections
10017
9998
  * @see https://www.mongodb.com/docs/manual/core/timeseries-collections/
@@ -10083,6 +10064,11 @@ declare class TopologyDescription {
10083
10064
  */
10084
10065
  toJSON(): Document_2;
10085
10066
  }
10067
+ declare interface TopologyDescription_2 {
10068
+ type?: TopologyType;
10069
+ setName?: string | null;
10070
+ servers?: Map<string, ServerDescription_2>;
10071
+ }
10086
10072
 
10087
10073
  /**
10088
10074
  * Emitted when topology description changes.
@@ -10455,9 +10441,6 @@ declare interface ValidateCollectionOptions extends CommandOperationOptions {
10455
10441
 
10456
10442
  /** @public */
10457
10443
  declare type W = number | 'majority';
10458
- declare type WithHelp<T> = { [prop in keyof T]: T[prop] & {
10459
- help?: () => Help;
10460
- } };
10461
10444
 
10462
10445
  /** Add an _id field to an object shaped type @public */
10463
10446
  declare type WithId<TSchema> = EnhancedOmit<TSchema, '_id'> & {