@mongosh/shell-api 3.18.0 → 3.22.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.
- package/lib/api-export.js +1 -1
- package/lib/api-processed.d.ts +281 -67
- package/lib/api-raw.d.ts +283 -67
- package/lib/collection.d.ts +3 -1
- package/lib/collection.js.map +1 -1
- package/lib/mongo.d.ts +1 -1
- package/lib/mongo.js +2 -2
- package/lib/mongo.js.map +1 -1
- package/lib/mongosh-version.d.ts +1 -1
- package/lib/mongosh-version.js +1 -1
- package/lib/shell-api.js +1 -1
- package/lib/shell-api.js.map +1 -1
- package/lib/shell-instance-state.d.ts +1 -1
- package/lib/shell-instance-state.js +12 -11
- package/lib/shell-instance-state.js.map +1 -1
- package/package.json +10 -10
package/lib/api-processed.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
|
|
3
3
|
import type { Agent } from 'https';
|
|
4
|
+
import type { AgentConnectOpts } from 'agent-base';
|
|
4
5
|
import { Binary } from 'bson';
|
|
5
6
|
import { BSONRegExp } from 'bson';
|
|
6
7
|
import { BSONSymbol } from 'bson';
|
|
@@ -26,6 +27,7 @@ import { ObjectId } from 'bson';
|
|
|
26
27
|
import type { ObjectIdLike } from 'bson';
|
|
27
28
|
import { Readable } from 'stream';
|
|
28
29
|
import type { RequestOptions } from 'https';
|
|
30
|
+
import type { SecureContextOptions } from 'tls';
|
|
29
31
|
import type { SerializeOptions } from 'bson';
|
|
30
32
|
import type { ServerResponse } from 'http';
|
|
31
33
|
import type { SrvRecord } from 'dns';
|
|
@@ -884,6 +886,10 @@ declare interface AutoEncryptionOptions {
|
|
|
884
886
|
bypassAutoEncryption?: boolean;
|
|
885
887
|
/** Allows users to bypass query analysis */
|
|
886
888
|
bypassQueryAnalysis?: boolean;
|
|
889
|
+
/**
|
|
890
|
+
* Sets the expiration time for the DEK in the cache in milliseconds. Defaults to 60000. 0 means no timeout.
|
|
891
|
+
*/
|
|
892
|
+
keyExpirationMS?: number;
|
|
887
893
|
options?: {
|
|
888
894
|
/** An optional hook to catch logging messages from the underlying encryption engine */
|
|
889
895
|
logger?: (level: AutoEncryptionLoggerLevel, message: string) => void;
|
|
@@ -1214,10 +1220,10 @@ declare class BulkFindOp extends ShellApiWithMongoClass {
|
|
|
1214
1220
|
|
|
1215
1221
|
/** @public */
|
|
1216
1222
|
declare abstract class BulkOperationBase {
|
|
1217
|
-
private collection;
|
|
1218
1223
|
isOrdered: boolean;
|
|
1219
1224
|
/* Excluded from this release type: s */
|
|
1220
1225
|
operationId?: number;
|
|
1226
|
+
private collection;
|
|
1221
1227
|
/* Excluded from this release type: __constructor */
|
|
1222
1228
|
/**
|
|
1223
1229
|
* Add a single insert document to the bulk operation
|
|
@@ -1350,7 +1356,7 @@ declare class BulkWriteResult {
|
|
|
1350
1356
|
getRawResponse(): Document_2;
|
|
1351
1357
|
/** Returns true if the bulk operation contains a write error */
|
|
1352
1358
|
hasWriteErrors(): boolean;
|
|
1353
|
-
/** Returns the number of write errors
|
|
1359
|
+
/** Returns the number of write errors from the bulk operation */
|
|
1354
1360
|
getWriteErrorCount(): number;
|
|
1355
1361
|
/** Returns a specific write error object */
|
|
1356
1362
|
getWriteErrorAt(index: number): WriteError | undefined;
|
|
@@ -1386,7 +1392,10 @@ declare type CacheOptions = {
|
|
|
1386
1392
|
aggregationSchemaTTL: number;
|
|
1387
1393
|
};
|
|
1388
1394
|
|
|
1389
|
-
/**
|
|
1395
|
+
/**
|
|
1396
|
+
* @public
|
|
1397
|
+
* @deprecated Will be removed in favor of `AbortSignal` in the next major release.
|
|
1398
|
+
*/
|
|
1390
1399
|
declare class CancellationToken extends TypedEventEmitter<{
|
|
1391
1400
|
cancel(): void;
|
|
1392
1401
|
}> {
|
|
@@ -1494,7 +1503,7 @@ declare class ChangeStream<TSchema extends Document_2 = Document_2, TChange exte
|
|
|
1494
1503
|
* @public
|
|
1495
1504
|
* @see https://www.mongodb.com/docs/manual/reference/change-events/modify/#mongodb-data-modify
|
|
1496
1505
|
*/
|
|
1497
|
-
declare interface ChangeStreamCollModDocument extends ChangeStreamDocumentCommon, ChangeStreamDocumentCollectionUUID {
|
|
1506
|
+
declare interface ChangeStreamCollModDocument extends ChangeStreamDocumentCommon, ChangeStreamDocumentCollectionUUID, ChangeStreamDocumentWallTime {
|
|
1498
1507
|
/** Describes the type of operation represented in this change notification */
|
|
1499
1508
|
operationType: 'modify';
|
|
1500
1509
|
}
|
|
@@ -1503,7 +1512,7 @@ declare interface ChangeStreamCollModDocument extends ChangeStreamDocumentCommon
|
|
|
1503
1512
|
* @public
|
|
1504
1513
|
* @see https://www.mongodb.com/docs/manual/reference/change-events/create/#mongodb-data-create
|
|
1505
1514
|
*/
|
|
1506
|
-
declare interface ChangeStreamCreateDocument extends ChangeStreamDocumentCommon, ChangeStreamDocumentCollectionUUID {
|
|
1515
|
+
declare interface ChangeStreamCreateDocument extends ChangeStreamDocumentCommon, ChangeStreamDocumentCollectionUUID, ChangeStreamDocumentWallTime {
|
|
1507
1516
|
/** Describes the type of operation represented in this change notification */
|
|
1508
1517
|
operationType: 'create';
|
|
1509
1518
|
/**
|
|
@@ -1519,7 +1528,7 @@ declare interface ChangeStreamCreateDocument extends ChangeStreamDocumentCommon,
|
|
|
1519
1528
|
* @public
|
|
1520
1529
|
* @see https://www.mongodb.com/docs/manual/reference/change-events/createIndexes/#mongodb-data-createIndexes
|
|
1521
1530
|
*/
|
|
1522
|
-
declare interface ChangeStreamCreateIndexDocument extends ChangeStreamDocumentCommon, ChangeStreamDocumentCollectionUUID, ChangeStreamDocumentOperationDescription {
|
|
1531
|
+
declare interface ChangeStreamCreateIndexDocument extends ChangeStreamDocumentCommon, ChangeStreamDocumentCollectionUUID, ChangeStreamDocumentOperationDescription, ChangeStreamDocumentWallTime {
|
|
1523
1532
|
/** Describes the type of operation represented in this change notification */
|
|
1524
1533
|
operationType: 'createIndexes';
|
|
1525
1534
|
}
|
|
@@ -1575,7 +1584,7 @@ declare class ChangeStreamCursor extends ShellApiWithMongoClass {
|
|
|
1575
1584
|
* @public
|
|
1576
1585
|
* @see https://www.mongodb.com/docs/manual/reference/change-events/#delete-event
|
|
1577
1586
|
*/
|
|
1578
|
-
declare interface ChangeStreamDeleteDocument<TSchema extends Document_2 = Document_2> extends ChangeStreamDocumentCommon, ChangeStreamDocumentKey<TSchema>, ChangeStreamDocumentCollectionUUID {
|
|
1587
|
+
declare interface ChangeStreamDeleteDocument<TSchema extends Document_2 = Document_2> extends ChangeStreamDocumentCommon, ChangeStreamDocumentKey<TSchema>, ChangeStreamDocumentCollectionUUID, ChangeStreamDocumentWallTime {
|
|
1579
1588
|
/** Describes the type of operation represented in this change notification */
|
|
1580
1589
|
operationType: 'delete';
|
|
1581
1590
|
/** Namespace the delete event occurred on */
|
|
@@ -1668,11 +1677,21 @@ declare interface ChangeStreamDocumentOperationDescription {
|
|
|
1668
1677
|
operationDescription?: Document_2;
|
|
1669
1678
|
}
|
|
1670
1679
|
|
|
1680
|
+
/** @public */
|
|
1681
|
+
declare interface ChangeStreamDocumentWallTime {
|
|
1682
|
+
/**
|
|
1683
|
+
* The server date and time of the database operation.
|
|
1684
|
+
* wallTime differs from clusterTime in that clusterTime is a timestamp taken from the oplog entry associated with the database operation event.
|
|
1685
|
+
* @sinceServerVersion 6.0.0
|
|
1686
|
+
*/
|
|
1687
|
+
wallTime?: Date;
|
|
1688
|
+
}
|
|
1689
|
+
|
|
1671
1690
|
/**
|
|
1672
1691
|
* @public
|
|
1673
1692
|
* @see https://www.mongodb.com/docs/manual/reference/change-events/#dropdatabase-event
|
|
1674
1693
|
*/
|
|
1675
|
-
declare interface ChangeStreamDropDatabaseDocument extends ChangeStreamDocumentCommon {
|
|
1694
|
+
declare interface ChangeStreamDropDatabaseDocument extends ChangeStreamDocumentCommon, ChangeStreamDocumentWallTime {
|
|
1676
1695
|
/** Describes the type of operation represented in this change notification */
|
|
1677
1696
|
operationType: 'dropDatabase';
|
|
1678
1697
|
/** The database dropped */
|
|
@@ -1685,7 +1704,7 @@ declare interface ChangeStreamDropDatabaseDocument extends ChangeStreamDocumentC
|
|
|
1685
1704
|
* @public
|
|
1686
1705
|
* @see https://www.mongodb.com/docs/manual/reference/change-events/#drop-event
|
|
1687
1706
|
*/
|
|
1688
|
-
declare interface ChangeStreamDropDocument extends ChangeStreamDocumentCommon, ChangeStreamDocumentCollectionUUID {
|
|
1707
|
+
declare interface ChangeStreamDropDocument extends ChangeStreamDocumentCommon, ChangeStreamDocumentCollectionUUID, ChangeStreamDocumentWallTime {
|
|
1689
1708
|
/** Describes the type of operation represented in this change notification */
|
|
1690
1709
|
operationType: 'drop';
|
|
1691
1710
|
/** Namespace the drop event occurred on */
|
|
@@ -1697,7 +1716,7 @@ declare interface ChangeStreamDropDocument extends ChangeStreamDocumentCommon, C
|
|
|
1697
1716
|
* @public
|
|
1698
1717
|
* @see https://www.mongodb.com/docs/manual/reference/change-events/dropIndexes/#mongodb-data-dropIndexes
|
|
1699
1718
|
*/
|
|
1700
|
-
declare interface ChangeStreamDropIndexDocument extends ChangeStreamDocumentCommon, ChangeStreamDocumentCollectionUUID, ChangeStreamDocumentOperationDescription {
|
|
1719
|
+
declare interface ChangeStreamDropIndexDocument extends ChangeStreamDocumentCommon, ChangeStreamDocumentCollectionUUID, ChangeStreamDocumentOperationDescription, ChangeStreamDocumentWallTime {
|
|
1701
1720
|
/** Describes the type of operation represented in this change notification */
|
|
1702
1721
|
operationType: 'dropIndexes';
|
|
1703
1722
|
}
|
|
@@ -1724,7 +1743,7 @@ declare type ChangeStreamEvents<TSchema extends Document_2 = Document_2, TChange
|
|
|
1724
1743
|
* @public
|
|
1725
1744
|
* @see https://www.mongodb.com/docs/manual/reference/change-events/#insert-event
|
|
1726
1745
|
*/
|
|
1727
|
-
declare interface ChangeStreamInsertDocument<TSchema extends Document_2 = Document_2> extends ChangeStreamDocumentCommon, ChangeStreamDocumentKey<TSchema>, ChangeStreamDocumentCollectionUUID {
|
|
1746
|
+
declare interface ChangeStreamInsertDocument<TSchema extends Document_2 = Document_2> extends ChangeStreamDocumentCommon, ChangeStreamDocumentKey<TSchema>, ChangeStreamDocumentCollectionUUID, ChangeStreamDocumentWallTime {
|
|
1728
1747
|
/** Describes the type of operation represented in this change notification */
|
|
1729
1748
|
operationType: 'insert';
|
|
1730
1749
|
/** This key will contain the document being inserted */
|
|
@@ -1737,7 +1756,7 @@ declare interface ChangeStreamInsertDocument<TSchema extends Document_2 = Docume
|
|
|
1737
1756
|
* @public
|
|
1738
1757
|
* @see https://www.mongodb.com/docs/manual/reference/change-events/#invalidate-event
|
|
1739
1758
|
*/
|
|
1740
|
-
declare interface ChangeStreamInvalidateDocument extends ChangeStreamDocumentCommon {
|
|
1759
|
+
declare interface ChangeStreamInvalidateDocument extends ChangeStreamDocumentCommon, ChangeStreamDocumentWallTime {
|
|
1741
1760
|
/** Describes the type of operation represented in this change notification */
|
|
1742
1761
|
operationType: 'invalidate';
|
|
1743
1762
|
}
|
|
@@ -1828,7 +1847,7 @@ declare interface ChangeStreamRefineCollectionShardKeyDocument extends ChangeStr
|
|
|
1828
1847
|
* @public
|
|
1829
1848
|
* @see https://www.mongodb.com/docs/manual/reference/change-events/#rename-event
|
|
1830
1849
|
*/
|
|
1831
|
-
declare interface ChangeStreamRenameDocument extends ChangeStreamDocumentCommon, ChangeStreamDocumentCollectionUUID {
|
|
1850
|
+
declare interface ChangeStreamRenameDocument extends ChangeStreamDocumentCommon, ChangeStreamDocumentCollectionUUID, ChangeStreamDocumentWallTime {
|
|
1832
1851
|
/** Describes the type of operation represented in this change notification */
|
|
1833
1852
|
operationType: 'rename';
|
|
1834
1853
|
/** The new name for the `ns.coll` collection */
|
|
@@ -1844,7 +1863,7 @@ declare interface ChangeStreamRenameDocument extends ChangeStreamDocumentCommon,
|
|
|
1844
1863
|
* @public
|
|
1845
1864
|
* @see https://www.mongodb.com/docs/manual/reference/change-events/#replace-event
|
|
1846
1865
|
*/
|
|
1847
|
-
declare interface ChangeStreamReplaceDocument<TSchema extends Document_2 = Document_2> extends ChangeStreamDocumentCommon, ChangeStreamDocumentKey<TSchema
|
|
1866
|
+
declare interface ChangeStreamReplaceDocument<TSchema extends Document_2 = Document_2> extends ChangeStreamDocumentCommon, ChangeStreamDocumentKey<TSchema>, ChangeStreamDocumentWallTime {
|
|
1848
1867
|
/** Describes the type of operation represented in this change notification */
|
|
1849
1868
|
operationType: 'replace';
|
|
1850
1869
|
/** The fullDocument of a replace event represents the document after the insert of the replacement document */
|
|
@@ -1874,7 +1893,7 @@ declare interface ChangeStreamReshardCollectionDocument extends ChangeStreamDocu
|
|
|
1874
1893
|
* @public
|
|
1875
1894
|
* @see https://www.mongodb.com/docs/manual/reference/change-events/shardCollection/#mongodb-data-shardCollection
|
|
1876
1895
|
*/
|
|
1877
|
-
declare interface ChangeStreamShardCollectionDocument extends ChangeStreamDocumentCommon, ChangeStreamDocumentCollectionUUID, ChangeStreamDocumentOperationDescription {
|
|
1896
|
+
declare interface ChangeStreamShardCollectionDocument extends ChangeStreamDocumentCommon, ChangeStreamDocumentCollectionUUID, ChangeStreamDocumentOperationDescription, ChangeStreamDocumentWallTime {
|
|
1878
1897
|
/** Describes the type of operation represented in this change notification */
|
|
1879
1898
|
operationType: 'shardCollection';
|
|
1880
1899
|
}
|
|
@@ -1891,7 +1910,7 @@ declare interface ChangeStreamSplitEvent {
|
|
|
1891
1910
|
* @public
|
|
1892
1911
|
* @see https://www.mongodb.com/docs/manual/reference/change-events/#update-event
|
|
1893
1912
|
*/
|
|
1894
|
-
declare interface ChangeStreamUpdateDocument<TSchema extends Document_2 = Document_2> extends ChangeStreamDocumentCommon, ChangeStreamDocumentKey<TSchema>, ChangeStreamDocumentCollectionUUID {
|
|
1913
|
+
declare interface ChangeStreamUpdateDocument<TSchema extends Document_2 = Document_2> extends ChangeStreamDocumentCommon, ChangeStreamDocumentKey<TSchema>, ChangeStreamDocumentCollectionUUID, ChangeStreamDocumentWallTime {
|
|
1895
1914
|
/** Describes the type of operation represented in this change notification */
|
|
1896
1915
|
operationType: 'update';
|
|
1897
1916
|
/**
|
|
@@ -2443,7 +2462,7 @@ declare interface ClientEncryptionEncryptOptions {
|
|
|
2443
2462
|
/**
|
|
2444
2463
|
* The algorithm to use for encryption.
|
|
2445
2464
|
*/
|
|
2446
|
-
algorithm: 'AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic' | 'AEAD_AES_256_CBC_HMAC_SHA_512-Random' | 'Indexed' | 'Unindexed' | 'Range';
|
|
2465
|
+
algorithm: 'AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic' | 'AEAD_AES_256_CBC_HMAC_SHA_512-Random' | 'Indexed' | 'Unindexed' | 'Range' | 'TextPreview';
|
|
2447
2466
|
/**
|
|
2448
2467
|
* The id of the Binary dataKey to use for encryption
|
|
2449
2468
|
*/
|
|
@@ -2457,9 +2476,15 @@ declare interface ClientEncryptionEncryptOptions {
|
|
|
2457
2476
|
/**
|
|
2458
2477
|
* The query type.
|
|
2459
2478
|
*/
|
|
2460
|
-
queryType?: 'equality' | 'range';
|
|
2479
|
+
queryType?: 'equality' | 'range' | 'prefixPreview' | 'suffixPreview' | 'substringPreview';
|
|
2461
2480
|
/** The index options for a Queryable Encryption field supporting "range" queries.*/
|
|
2462
2481
|
rangeOptions?: RangeOptions;
|
|
2482
|
+
/**
|
|
2483
|
+
* Options for a Queryable Encryption field supporting text queries. Only valid when `algorithm` is `TextPreview`.
|
|
2484
|
+
*
|
|
2485
|
+
* @experimental Public Technical Preview: `textPreview` is an experimental feature and may break at any time.
|
|
2486
|
+
*/
|
|
2487
|
+
textOptions?: TextQueryOptions;
|
|
2463
2488
|
}
|
|
2464
2489
|
|
|
2465
2490
|
/**
|
|
@@ -2491,6 +2516,10 @@ declare interface ClientEncryptionOptions {
|
|
|
2491
2516
|
* TLS options for kms providers to use.
|
|
2492
2517
|
*/
|
|
2493
2518
|
tlsOptions?: CSFLEKMSTlsOptions;
|
|
2519
|
+
/**
|
|
2520
|
+
* Sets the expiration time for the DEK in the cache in milliseconds. Defaults to 60000. 0 means no timeout.
|
|
2521
|
+
*/
|
|
2522
|
+
keyExpirationMS?: number;
|
|
2494
2523
|
/**
|
|
2495
2524
|
* @experimental
|
|
2496
2525
|
*
|
|
@@ -2546,7 +2575,7 @@ declare interface ClientEncryptionRewrapManyDataKeyProviderOptions {
|
|
|
2546
2575
|
*
|
|
2547
2576
|
* These options are not included in the type, and are ignored if provided.
|
|
2548
2577
|
*/
|
|
2549
|
-
declare type ClientEncryptionTlsOptions = Pick<MongoClientOptions, 'tlsCAFile' | 'tlsCertificateKeyFile' | 'tlsCertificateKeyFilePassword'>;
|
|
2578
|
+
declare type ClientEncryptionTlsOptions = Pick<MongoClientOptions, 'tlsCAFile' | 'tlsCertificateKeyFile' | 'tlsCertificateKeyFilePassword' | 'secureContext'>;
|
|
2550
2579
|
|
|
2551
2580
|
/** @public */
|
|
2552
2581
|
declare interface ClientInsertOneModel<TSchema> extends ClientWriteModel {
|
|
@@ -2568,6 +2597,7 @@ declare type ClientInsertResult = {
|
|
|
2568
2597
|
|
|
2569
2598
|
/**
|
|
2570
2599
|
* @public
|
|
2600
|
+
* @deprecated This interface will be made internal in the next major release.
|
|
2571
2601
|
* @see https://github.com/mongodb/specifications/blob/master/source/mongodb-handshake/handshake.md#hello-command
|
|
2572
2602
|
*/
|
|
2573
2603
|
declare interface ClientMetadata {
|
|
@@ -2611,6 +2641,8 @@ declare interface ClientReplaceOneModel<TSchema> extends ClientWriteModel {
|
|
|
2611
2641
|
hint?: Hint;
|
|
2612
2642
|
/** When true, creates a new document if no document matches the query. */
|
|
2613
2643
|
upsert?: boolean;
|
|
2644
|
+
/** Specifies the sort order for the documents matched by the filter. */
|
|
2645
|
+
sort?: Sort;
|
|
2614
2646
|
}
|
|
2615
2647
|
|
|
2616
2648
|
/**
|
|
@@ -2632,6 +2664,7 @@ declare class ClientSession extends TypedEventEmitter<ClientSessionEvents> imple
|
|
|
2632
2664
|
explicit: boolean;
|
|
2633
2665
|
/* Excluded from this release type: owner */
|
|
2634
2666
|
defaultTransactionOptions: TransactionOptions;
|
|
2667
|
+
/** @deprecated - Will be made internal in the next major release */
|
|
2635
2668
|
transaction: Transaction;
|
|
2636
2669
|
/* Excluded from this release type: commitAttempted */
|
|
2637
2670
|
readonly snapshotEnabled: boolean;
|
|
@@ -2854,6 +2887,8 @@ declare interface ClientUpdateOneModel<TSchema> extends ClientWriteModel {
|
|
|
2854
2887
|
hint?: Hint;
|
|
2855
2888
|
/** When true, creates a new document if no document matches the query. */
|
|
2856
2889
|
upsert?: boolean;
|
|
2890
|
+
/** Specifies the sort order for the documents matched by the filter. */
|
|
2891
|
+
sort?: Sort;
|
|
2857
2892
|
}
|
|
2858
2893
|
|
|
2859
2894
|
/** @public */
|
|
@@ -2899,7 +2934,7 @@ declare interface ClientWriteModel {
|
|
|
2899
2934
|
namespace: string;
|
|
2900
2935
|
}
|
|
2901
2936
|
declare interface Closable {
|
|
2902
|
-
close(
|
|
2937
|
+
close(): Promise<void>;
|
|
2903
2938
|
suspend(): Promise<() => Promise<void>>;
|
|
2904
2939
|
}
|
|
2905
2940
|
|
|
@@ -3064,7 +3099,9 @@ declare class Collection<M extends GenericServerSideSchema = GenericServerSideSc
|
|
|
3064
3099
|
/*
|
|
3065
3100
|
Updates a single document within the collection based on the filter.
|
|
3066
3101
|
*/
|
|
3067
|
-
updateOne(filter: Document_2, update: Document_2, options?: UpdateOptions
|
|
3102
|
+
updateOne(filter: Document_2, update: Document_2, options?: UpdateOptions & {
|
|
3103
|
+
sort?: Document_2;
|
|
3104
|
+
}): UpdateResult_2 | Document_2;
|
|
3068
3105
|
/*
|
|
3069
3106
|
Compacts structured encryption data
|
|
3070
3107
|
*/
|
|
@@ -3382,7 +3419,9 @@ declare class Collection_2<TSchema extends Document_2 = Document_2> {
|
|
|
3382
3419
|
* @param update - The modifications to apply
|
|
3383
3420
|
* @param options - Optional settings for the command
|
|
3384
3421
|
*/
|
|
3385
|
-
updateOne(filter: Filter<TSchema>, update: UpdateFilter<TSchema> | Document_2[], options?: UpdateOptions
|
|
3422
|
+
updateOne(filter: Filter<TSchema>, update: UpdateFilter<TSchema> | Document_2[], options?: UpdateOptions & {
|
|
3423
|
+
sort?: Sort;
|
|
3424
|
+
}): Promise<UpdateResult<TSchema>>;
|
|
3386
3425
|
/**
|
|
3387
3426
|
* Replace a document in a collection with another document
|
|
3388
3427
|
*
|
|
@@ -3441,10 +3480,10 @@ declare class Collection_2<TSchema extends Document_2 = Document_2> {
|
|
|
3441
3480
|
*/
|
|
3442
3481
|
findOne(): Promise<WithId<TSchema> | null>;
|
|
3443
3482
|
findOne(filter: Filter<TSchema>): Promise<WithId<TSchema> | null>;
|
|
3444
|
-
findOne(filter: Filter<TSchema>, options: Omit<
|
|
3483
|
+
findOne(filter: Filter<TSchema>, options: Omit<FindOneOptions, 'timeoutMode'> & Abortable): Promise<WithId<TSchema> | null>;
|
|
3445
3484
|
findOne<T = TSchema>(): Promise<T | null>;
|
|
3446
3485
|
findOne<T = TSchema>(filter: Filter<TSchema>): Promise<T | null>;
|
|
3447
|
-
findOne<T = TSchema>(filter: Filter<TSchema>, options?: Omit<
|
|
3486
|
+
findOne<T = TSchema>(filter: Filter<TSchema>, options?: Omit<FindOneOptions, 'timeoutMode'> & Abortable): Promise<T | null>;
|
|
3448
3487
|
/**
|
|
3449
3488
|
* Creates a cursor for a filter that can be used to iterate over results from MongoDB
|
|
3450
3489
|
*
|
|
@@ -3618,6 +3657,9 @@ declare class Collection_2<TSchema extends Document_2 = Document_2> {
|
|
|
3618
3657
|
distinct<Key extends keyof WithId<TSchema>>(key: Key): Promise<Array<Flatten<WithId<TSchema>[Key]>>>;
|
|
3619
3658
|
distinct<Key extends keyof WithId<TSchema>>(key: Key, filter: Filter<TSchema>): Promise<Array<Flatten<WithId<TSchema>[Key]>>>;
|
|
3620
3659
|
distinct<Key extends keyof WithId<TSchema>>(key: Key, filter: Filter<TSchema>, options: DistinctOptions): Promise<Array<Flatten<WithId<TSchema>[Key]>>>;
|
|
3660
|
+
distinct<Key extends keyof WithId<TSchema>>(key: Key, filter: Filter<TSchema>, options: DistinctOptions & {
|
|
3661
|
+
explain: ExplainVerbosityLike | ExplainCommandOptions;
|
|
3662
|
+
}): Promise<Document_2>;
|
|
3621
3663
|
distinct(key: string): Promise<any[]>;
|
|
3622
3664
|
distinct(key: string, filter: Filter<TSchema>): Promise<any[]>;
|
|
3623
3665
|
distinct(key: string, filter: Filter<TSchema>, options: DistinctOptions): Promise<any[]>;
|
|
@@ -3920,6 +3962,7 @@ declare class CommandFailedEvent {
|
|
|
3920
3962
|
commandName: string;
|
|
3921
3963
|
failure: Error;
|
|
3922
3964
|
serviceId?: ObjectId;
|
|
3965
|
+
databaseName: string;
|
|
3923
3966
|
/* Excluded from this release type: name */
|
|
3924
3967
|
/* Excluded from this release type: __constructor */
|
|
3925
3968
|
get hasServiceId(): boolean;
|
|
@@ -3948,6 +3991,10 @@ declare interface CommandOperationOptions extends OperationOptions, WriteConcern
|
|
|
3948
3991
|
retryWrites?: boolean;
|
|
3949
3992
|
dbName?: string;
|
|
3950
3993
|
authdb?: string;
|
|
3994
|
+
/**
|
|
3995
|
+
* @deprecated
|
|
3996
|
+
* This option is deprecated and will be removed in an upcoming major version.
|
|
3997
|
+
*/
|
|
3951
3998
|
noResponse?: boolean;
|
|
3952
3999
|
}
|
|
3953
4000
|
declare class CommandResult<T = unknown> extends ShellApiValueClass {
|
|
@@ -4003,6 +4050,7 @@ declare class CommandSucceededEvent {
|
|
|
4003
4050
|
commandName: string;
|
|
4004
4051
|
reply: unknown;
|
|
4005
4052
|
serviceId?: ObjectId;
|
|
4053
|
+
databaseName: string;
|
|
4006
4054
|
/* Excluded from this release type: name */
|
|
4007
4055
|
/* Excluded from this release type: __constructor */
|
|
4008
4056
|
get hasServiceId(): boolean;
|
|
@@ -5423,7 +5471,7 @@ declare class DevtoolsConnectionState {
|
|
|
5423
5471
|
productName: string;
|
|
5424
5472
|
private stateShareClient;
|
|
5425
5473
|
private stateShareServer;
|
|
5426
|
-
constructor(options: Pick<DevtoolsConnectOptions, 'productDocsLink' | 'productName' | 'oidc' | 'parentHandle'>, logger: ConnectLogEmitter
|
|
5474
|
+
constructor(options: Pick<DevtoolsConnectOptions, 'productDocsLink' | 'productName' | 'oidc' | 'parentHandle'>, logger: ConnectLogEmitter);
|
|
5427
5475
|
getStateShareServer(): Promise<string>;
|
|
5428
5476
|
destroy(): Promise<void>;
|
|
5429
5477
|
}
|
|
@@ -5434,7 +5482,7 @@ declare interface DevtoolsConnectOptions extends MongoClientOptions {
|
|
|
5434
5482
|
parentState?: DevtoolsConnectionState;
|
|
5435
5483
|
parentHandle?: string;
|
|
5436
5484
|
proxy?: DevtoolsProxyOptions | AgentWithInitialize;
|
|
5437
|
-
applyProxyToOIDC?: boolean;
|
|
5485
|
+
applyProxyToOIDC?: boolean | DevtoolsProxyOptions | AgentWithInitialize;
|
|
5438
5486
|
}
|
|
5439
5487
|
declare interface DevtoolsProxyOptions {
|
|
5440
5488
|
proxy?: string;
|
|
@@ -5445,6 +5493,7 @@ declare interface DevtoolsProxyOptions {
|
|
|
5445
5493
|
identityKeyPassphrase?: string;
|
|
5446
5494
|
};
|
|
5447
5495
|
ca?: ConnectionOptions['ca'];
|
|
5496
|
+
caExcludeSystemCerts?: boolean;
|
|
5448
5497
|
env?: Record<string, string | undefined>;
|
|
5449
5498
|
}
|
|
5450
5499
|
|
|
@@ -6012,6 +6061,16 @@ declare interface FindOneAndUpdateOptions extends CommandOperationOptions {
|
|
|
6012
6061
|
includeResultMetadata?: boolean;
|
|
6013
6062
|
}
|
|
6014
6063
|
|
|
6064
|
+
/** @public */
|
|
6065
|
+
declare interface FindOneOptions extends FindOptions {
|
|
6066
|
+
/** @deprecated Will be removed in the next major version. User provided value will be ignored. */
|
|
6067
|
+
batchSize?: number;
|
|
6068
|
+
/** @deprecated Will be removed in the next major version. User provided value will be ignored. */
|
|
6069
|
+
limit?: number;
|
|
6070
|
+
/** @deprecated Will be removed in the next major version. User provided value will be ignored. */
|
|
6071
|
+
noCursorTimeout?: boolean;
|
|
6072
|
+
}
|
|
6073
|
+
|
|
6015
6074
|
/**
|
|
6016
6075
|
* A builder object that is returned from {@link BulkOperationBase#find}.
|
|
6017
6076
|
* Is used to build a write operation that involves a query filter.
|
|
@@ -6256,7 +6315,10 @@ declare type HostInformation = {
|
|
|
6256
6315
|
is_do_url?: boolean;
|
|
6257
6316
|
};
|
|
6258
6317
|
|
|
6259
|
-
/**
|
|
6318
|
+
/**
|
|
6319
|
+
* @public
|
|
6320
|
+
* @deprecated Use a custom `fetch` function instead
|
|
6321
|
+
*/
|
|
6260
6322
|
declare type HttpOptions = Partial<Pick<RequestOptions, 'agent' | 'ca' | 'cert' | 'crl' | 'headers' | 'key' | 'lookup' | 'passphrase' | 'pfx' | 'timeout'>>;
|
|
6261
6323
|
|
|
6262
6324
|
/**
|
|
@@ -6773,7 +6835,7 @@ declare interface KMSProviders {
|
|
|
6773
6835
|
}
|
|
6774
6836
|
|
|
6775
6837
|
/** @public */
|
|
6776
|
-
declare const LEGAL_TCP_SOCKET_OPTIONS: readonly ["autoSelectFamily", "autoSelectFamilyAttemptTimeout", "family", "hints", "localAddress", "localPort", "lookup"];
|
|
6838
|
+
declare const LEGAL_TCP_SOCKET_OPTIONS: readonly ["autoSelectFamily", "autoSelectFamilyAttemptTimeout", "keepAliveInitialDelay", "family", "hints", "localAddress", "localPort", "lookup"];
|
|
6777
6839
|
|
|
6778
6840
|
/** @public */
|
|
6779
6841
|
declare const LEGAL_TLS_SOCKET_OPTIONS: readonly ["allowPartialTrustChain", "ALPNProtocols", "ca", "cert", "checkServerIdentity", "ciphers", "crl", "ecdhCurve", "key", "minDHSize", "passphrase", "pfx", "rejectUnauthorized", "secureContext", "secureProtocol", "servername", "session"];
|
|
@@ -6964,7 +7026,7 @@ export declare class Mongo<M extends GenericServerSideSchema = GenericServerSide
|
|
|
6964
7026
|
/*
|
|
6965
7027
|
Closes a Mongo object, disposing of related resources and closing the underlying connection.
|
|
6966
7028
|
*/
|
|
6967
|
-
close(
|
|
7029
|
+
close(): Promise<void>;
|
|
6968
7030
|
_suspend(): Promise<() => Promise<void>>;
|
|
6969
7031
|
/*
|
|
6970
7032
|
Returns the ReadPreference Mode set for the connection.
|
|
@@ -7047,22 +7109,35 @@ export declare class Mongo<M extends GenericServerSideSchema = GenericServerSide
|
|
|
7047
7109
|
declare const MONGO_CLIENT_EVENTS: readonly ["connectionPoolCreated", "connectionPoolReady", "connectionPoolCleared", "connectionPoolClosed", "connectionCreated", "connectionReady", "connectionClosed", "connectionCheckOutStarted", "connectionCheckOutFailed", "connectionCheckedOut", "connectionCheckedIn", "commandStarted", "commandSucceeded", "commandFailed", "serverOpening", "serverClosed", "serverDescriptionChanged", "topologyOpening", "topologyClosed", "topologyDescriptionChanged", "error", "timeout", "close", "serverHeartbeatStarted", "serverHeartbeatSucceeded", "serverHeartbeatFailed"];
|
|
7048
7110
|
|
|
7049
7111
|
/**
|
|
7050
|
-
* The **MongoClient** class is a class that allows for making Connections to MongoDB.
|
|
7051
7112
|
* @public
|
|
7052
7113
|
*
|
|
7114
|
+
* The **MongoClient** class is a class that allows for making Connections to MongoDB.
|
|
7115
|
+
*
|
|
7116
|
+
* **NOTE:** The programmatically provided options take precedence over the URI options.
|
|
7117
|
+
*
|
|
7053
7118
|
* @remarks
|
|
7054
|
-
*
|
|
7119
|
+
*
|
|
7120
|
+
* A MongoClient is the entry point to connecting to a MongoDB server.
|
|
7121
|
+
*
|
|
7122
|
+
* It handles a multitude of features on your application's behalf:
|
|
7123
|
+
* - **Server Host Connection Configuration**: A MongoClient is responsible for reading TLS cert, ca, and crl files if provided.
|
|
7124
|
+
* - **SRV Record Polling**: A "`mongodb+srv`" style connection string is used to have the MongoClient resolve DNS SRV records of all server hostnames which the driver periodically monitors for changes and adjusts its current view of hosts correspondingly.
|
|
7125
|
+
* - **Server Monitoring**: The MongoClient automatically keeps monitoring the health of server nodes in your cluster to reach out to the correct and lowest latency one available.
|
|
7126
|
+
* - **Connection Pooling**: To avoid paying the cost of rebuilding a connection to the server on every operation the MongoClient keeps idle connections preserved for reuse.
|
|
7127
|
+
* - **Session Pooling**: The MongoClient creates logical sessions that enable retryable writes, causal consistency, and transactions. It handles pooling these sessions for reuse in subsequent operations.
|
|
7128
|
+
* - **Cursor Operations**: A MongoClient's cursors use the health monitoring system to send the request for more documents to the same server the query began on.
|
|
7129
|
+
* - **Mongocryptd process**: When using auto encryption, a MongoClient will launch a `mongocryptd` instance for handling encryption if the mongocrypt shared library isn't in use.
|
|
7130
|
+
*
|
|
7131
|
+
* There are many more features of a MongoClient that are not listed above.
|
|
7132
|
+
*
|
|
7133
|
+
* In order to enable these features, a number of asynchronous Node.js resources are established by the driver: Timers, FS Requests, Sockets, etc.
|
|
7134
|
+
* For details on cleanup, please refer to the MongoClient `close()` documentation.
|
|
7055
7135
|
*
|
|
7056
7136
|
* @example
|
|
7057
7137
|
* ```ts
|
|
7058
7138
|
* import { MongoClient } from 'mongodb';
|
|
7059
|
-
*
|
|
7060
7139
|
* // Enable command monitoring for debugging
|
|
7061
|
-
* const client = new MongoClient('mongodb://localhost:27017', { monitorCommands: true });
|
|
7062
|
-
*
|
|
7063
|
-
* client.on('commandStarted', started => console.log(started));
|
|
7064
|
-
* client.db().collection('pets');
|
|
7065
|
-
* await client.insertOne({ name: 'spot', kind: 'dog' });
|
|
7140
|
+
* const client = new MongoClient('mongodb://localhost:27017?appName=mflix', { monitorCommands: true });
|
|
7066
7141
|
* ```
|
|
7067
7142
|
*/
|
|
7068
7143
|
declare class MongoClient extends TypedEventEmitter<MongoClientEvents> implements AsyncDisposable_2 {
|
|
@@ -7074,10 +7149,15 @@ declare class MongoClient extends TypedEventEmitter<MongoClientEvents> implement
|
|
|
7074
7149
|
/**
|
|
7075
7150
|
* The consolidate, parsed, transformed and merged options.
|
|
7076
7151
|
*/
|
|
7077
|
-
readonly options: Readonly<Omit<MongoOptions, 'monitorCommands' | 'ca' | 'crl' | 'key' | 'cert'>> & Pick<MongoOptions, 'monitorCommands' | 'ca' | 'crl' | 'key' | 'cert'>;
|
|
7152
|
+
readonly options: Readonly<Omit<MongoOptions, 'monitorCommands' | 'ca' | 'crl' | 'key' | 'cert' | 'driverInfo' | 'additionalDriverInfo' | 'metadata' | 'extendedMetadata'>> & Pick<MongoOptions, 'monitorCommands' | 'ca' | 'crl' | 'key' | 'cert' | 'driverInfo' | 'additionalDriverInfo' | 'metadata' | 'extendedMetadata'>;
|
|
7078
7153
|
constructor(url: string, options?: MongoClientOptions);
|
|
7079
7154
|
/* Excluded from this release type: [Symbol.asyncDispose] */
|
|
7080
7155
|
/* Excluded from this release type: asyncDispose */
|
|
7156
|
+
/**
|
|
7157
|
+
* Append metadata to the client metadata after instantiation.
|
|
7158
|
+
* @param driverInfo - Information about the application or library.
|
|
7159
|
+
*/
|
|
7160
|
+
appendMetadata(driverInfo: DriverInfo): void;
|
|
7081
7161
|
/* Excluded from this release type: checkForNonGenuineHosts */
|
|
7082
7162
|
get serverApi(): Readonly<ServerApi | undefined>;
|
|
7083
7163
|
/* Excluded from this release type: monitorCommands */
|
|
@@ -7114,19 +7194,51 @@ declare class MongoClient extends TypedEventEmitter<MongoClientEvents> implement
|
|
|
7114
7194
|
connect(): Promise<this>;
|
|
7115
7195
|
/* Excluded from this release type: _connect */
|
|
7116
7196
|
/**
|
|
7117
|
-
* Cleans up
|
|
7118
|
-
*
|
|
7119
|
-
*
|
|
7120
|
-
*
|
|
7121
|
-
*
|
|
7122
|
-
*
|
|
7123
|
-
*
|
|
7124
|
-
*
|
|
7125
|
-
*
|
|
7126
|
-
*
|
|
7127
|
-
*
|
|
7128
|
-
|
|
7129
|
-
|
|
7197
|
+
* Cleans up resources managed by the MongoClient.
|
|
7198
|
+
*
|
|
7199
|
+
* The close method clears and closes all resources whose lifetimes are managed by the MongoClient.
|
|
7200
|
+
* Please refer to the `MongoClient` class documentation for a high level overview of the client's key features and responsibilities.
|
|
7201
|
+
*
|
|
7202
|
+
* **However,** the close method does not handle the cleanup of resources explicitly created by the user.
|
|
7203
|
+
* Any user-created driver resource with its own `close()` method should be explicitly closed by the user before calling MongoClient.close().
|
|
7204
|
+
* This method is written as a "best effort" attempt to leave behind the least amount of resources server-side when possible.
|
|
7205
|
+
*
|
|
7206
|
+
* The following list defines ideal preconditions and consequent pitfalls if they are not met.
|
|
7207
|
+
* The MongoClient, ClientSession, Cursors and ChangeStreams all support [explicit resource management](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-5-2.html).
|
|
7208
|
+
* By using explicit resource management to manage the lifetime of driver resources instead of manually managing their lifetimes, the pitfalls outlined below can be avoided.
|
|
7209
|
+
*
|
|
7210
|
+
* The close method performs the following in the order listed:
|
|
7211
|
+
* - Client-side:
|
|
7212
|
+
* - **Close in-use connections**: Any connections that are currently waiting on a response from the server will be closed.
|
|
7213
|
+
* This is performed _first_ to avoid reaching the next step (server-side clean up) and having no available connections to check out.
|
|
7214
|
+
* - _Ideal_: All operations have been awaited or cancelled, and the outcomes, regardless of success or failure, have been processed before closing the client servicing the operation.
|
|
7215
|
+
* - _Pitfall_: When `client.close()` is called and all connections are in use, after closing them, the client must create new connections for cleanup operations, which comes at the cost of new TLS/TCP handshakes and authentication steps.
|
|
7216
|
+
* - Server-side:
|
|
7217
|
+
* - **Close active cursors**: All cursors that haven't been completed will have a `killCursor` operation sent to the server they were initialized on, freeing the server-side resource.
|
|
7218
|
+
* - _Ideal_: Cursors are explicitly closed or completed before `client.close()` is called.
|
|
7219
|
+
* - _Pitfall_: `killCursors` may have to build a new connection if the in-use closure ended all pooled connections.
|
|
7220
|
+
* - **End active sessions**: In-use sessions created with `client.startSession()` or `client.withSession()` or implicitly by the driver will have their `.endSession()` method called.
|
|
7221
|
+
* Contrary to the name of the method, `endSession()` returns the session to the client's pool of sessions rather than end them on the server.
|
|
7222
|
+
* - _Ideal_: Transaction outcomes are awaited and their corresponding explicit sessions are ended before `client.close()` is called.
|
|
7223
|
+
* - _Pitfall_: **This step aborts in-progress transactions**. It is advisable to observe the outcome of a transaction before closing your client.
|
|
7224
|
+
* - **End all pooled sessions**: The `endSessions` command with all session IDs the client has pooled is sent to the server to inform the cluster it can clean them up.
|
|
7225
|
+
* - _Ideal_: No user intervention is expected.
|
|
7226
|
+
* - _Pitfall_: None.
|
|
7227
|
+
*
|
|
7228
|
+
* The remaining shutdown is of the MongoClient resources that are intended to be entirely internal but is documented here as their existence relates to the JS event loop.
|
|
7229
|
+
*
|
|
7230
|
+
* - Client-side (again):
|
|
7231
|
+
* - **Stop all server monitoring**: Connections kept live for detecting cluster changes and roundtrip time measurements are shutdown.
|
|
7232
|
+
* - **Close all pooled connections**: Each server node in the cluster has a corresponding connection pool and all connections in the pool are closed. Any operations waiting to check out a connection will have an error thrown instead of a connection returned.
|
|
7233
|
+
* - **Clear out server selection queue**: Any operations that are in the process of waiting for a server to be selected will have an error thrown instead of a server returned.
|
|
7234
|
+
* - **Close encryption-related resources**: An internal MongoClient created for communicating with `mongocryptd` or other encryption purposes is closed. (Using this same method of course!)
|
|
7235
|
+
*
|
|
7236
|
+
* After the close method completes there should be no MongoClient related resources [ref-ed in Node.js' event loop](https://docs.libuv.org/en/v1.x/handle.html#reference-counting).
|
|
7237
|
+
* This should allow Node.js to exit gracefully if MongoClient resources were the only active handles in the event loop.
|
|
7238
|
+
*
|
|
7239
|
+
* @param _force - currently an unused flag that has no effect. Defaults to `false`.
|
|
7240
|
+
*/
|
|
7241
|
+
close(_force?: boolean): Promise<void>;
|
|
7130
7242
|
private _close;
|
|
7131
7243
|
/**
|
|
7132
7244
|
* Create a new Db instance sharing the current socket connections.
|
|
@@ -7303,7 +7415,11 @@ declare interface MongoClientOptions extends BSONSerializeOptions, SupportedNode
|
|
|
7303
7415
|
minPoolSize?: number;
|
|
7304
7416
|
/** The maximum number of connections that may be in the process of being established concurrently by the connection pool. */
|
|
7305
7417
|
maxConnecting?: number;
|
|
7306
|
-
/**
|
|
7418
|
+
/**
|
|
7419
|
+
* The maximum amount of time a connection should remain idle in the connection pool before being marked idle, in milliseconds.
|
|
7420
|
+
* If specified, this must be a number greater than or equal to 0, where 0 means there is no limit. Defaults to 0. After this
|
|
7421
|
+
* time passes, the idle collection can be automatically cleaned up in the background.
|
|
7422
|
+
*/
|
|
7307
7423
|
maxIdleTimeMS?: number;
|
|
7308
7424
|
/** The maximum time in milliseconds that a thread can wait for a connection to become available. */
|
|
7309
7425
|
waitQueueTimeoutMS?: number;
|
|
@@ -7510,14 +7626,14 @@ declare interface MongoDBLogWritable {
|
|
|
7510
7626
|
/** @public */
|
|
7511
7627
|
declare class MongoDBNamespace {
|
|
7512
7628
|
db: string;
|
|
7513
|
-
collection?: string
|
|
7629
|
+
collection?: string;
|
|
7514
7630
|
/**
|
|
7515
7631
|
* Create a namespace object
|
|
7516
7632
|
*
|
|
7517
7633
|
* @param db - database name
|
|
7518
7634
|
* @param collection - collection name
|
|
7519
7635
|
*/
|
|
7520
|
-
constructor(db: string, collection?: string
|
|
7636
|
+
constructor(db: string, collection?: string);
|
|
7521
7637
|
toString(): string;
|
|
7522
7638
|
withCollection(collection: string): MongoDBCollectionNamespace;
|
|
7523
7639
|
static fromString(namespace?: string): MongoDBNamespace;
|
|
@@ -7664,6 +7780,15 @@ declare interface MongoDBOIDCLogEventsMap {
|
|
|
7664
7780
|
'mongodb-oidc-plugin:inbound-http-request': (event: {
|
|
7665
7781
|
url: string;
|
|
7666
7782
|
}) => void;
|
|
7783
|
+
'mongodb-oidc-plugin:outbound-http-request-failed': (event: {
|
|
7784
|
+
url: string;
|
|
7785
|
+
error: string;
|
|
7786
|
+
}) => void;
|
|
7787
|
+
'mongodb-oidc-plugin:outbound-http-request-completed': (event: {
|
|
7788
|
+
url: string;
|
|
7789
|
+
status: number;
|
|
7790
|
+
statusText: string;
|
|
7791
|
+
}) => void;
|
|
7667
7792
|
'mongodb-oidc-plugin:received-server-params': (event: {
|
|
7668
7793
|
params: OIDCCallbackParams_2;
|
|
7669
7794
|
}) => void;
|
|
@@ -7808,8 +7933,16 @@ declare interface MongoDBOIDCPluginOptions {
|
|
|
7808
7933
|
throwOnIncompatibleSerializedState?: boolean;
|
|
7809
7934
|
/**
|
|
7810
7935
|
* Provide custom HTTP options for individual HTTP calls.
|
|
7936
|
+
*
|
|
7937
|
+
* @deprecated Use a custom `fetch` function instead.
|
|
7811
7938
|
*/
|
|
7812
7939
|
customHttpOptions?: HttpOptions | ((url: string, options: Readonly<HttpOptions>) => HttpOptions);
|
|
7940
|
+
/**
|
|
7941
|
+
* Provide a custom `fetch` function to be used for HTTP calls.
|
|
7942
|
+
*
|
|
7943
|
+
* Any API that is compatible with the web `fetch` API can be used here.
|
|
7944
|
+
*/
|
|
7945
|
+
customFetch?: (url: string, options: Readonly<unknown>) => Promise<Response>;
|
|
7813
7946
|
/**
|
|
7814
7947
|
* Pass ID tokens in place of access tokens. For debugging/working around
|
|
7815
7948
|
* broken identity providers.
|
|
@@ -7915,8 +8048,10 @@ declare interface MongoOptions extends Required<Pick<MongoClientOptions, 'autoEn
|
|
|
7915
8048
|
compressors: CompressorName[];
|
|
7916
8049
|
writeConcern: WriteConcern;
|
|
7917
8050
|
dbName: string;
|
|
8051
|
+
/** @deprecated - Will be made internal in a future major release. */
|
|
7918
8052
|
metadata: ClientMetadata;
|
|
7919
|
-
|
|
8053
|
+
extendedMetadata: Promise<Document_2>;
|
|
8054
|
+
additionalDriverInfo: DriverInfo[];
|
|
7920
8055
|
/* Excluded from this release type: autoEncrypter */
|
|
7921
8056
|
/* Excluded from this release type: tokenCache */
|
|
7922
8057
|
proxyHost?: string;
|
|
@@ -8103,6 +8238,8 @@ declare interface OIDCCallbackParams {
|
|
|
8103
8238
|
idpInfo?: IdPInfo;
|
|
8104
8239
|
/** The refresh token, if applicable, to be used by the callback to request a new token from the issuer. */
|
|
8105
8240
|
refreshToken?: string;
|
|
8241
|
+
/** The token audience for GCP and Azure. */
|
|
8242
|
+
tokenAudience?: string;
|
|
8106
8243
|
}
|
|
8107
8244
|
|
|
8108
8245
|
/**
|
|
@@ -8170,7 +8307,6 @@ declare interface OperationOptions extends BSONSerializeOptions {
|
|
|
8170
8307
|
/** The preferred read preference (ReadPreference.primary, ReadPreference.primary_preferred, ReadPreference.secondary, ReadPreference.secondary_preferred, ReadPreference.nearest). */
|
|
8171
8308
|
readPreference?: ReadPreferenceLike;
|
|
8172
8309
|
/* Excluded from this release type: bypassPinningCheck */
|
|
8173
|
-
omitReadPreference?: boolean;
|
|
8174
8310
|
/* Excluded from this release type: omitMaxTimeMS */
|
|
8175
8311
|
/**
|
|
8176
8312
|
* @experimental
|
|
@@ -8297,6 +8433,11 @@ declare interface ProxyEventMap {
|
|
|
8297
8433
|
retryableError: boolean;
|
|
8298
8434
|
retriesLeft: number;
|
|
8299
8435
|
}) => void;
|
|
8436
|
+
'proxy:connect': (ev: {
|
|
8437
|
+
agent: AgentWithInitialize;
|
|
8438
|
+
req: ClientRequest;
|
|
8439
|
+
opts: AgentConnectOpts & Partial<SecureContextOptions>;
|
|
8440
|
+
}) => void;
|
|
8300
8441
|
}
|
|
8301
8442
|
declare interface ProxyLogEmitter {
|
|
8302
8443
|
on<K extends keyof ProxyEventMap>(event: K, listener: ProxyEventMap[K]): this;
|
|
@@ -8353,7 +8494,7 @@ declare interface Readable_2 {
|
|
|
8353
8494
|
distinct(database: string, collection: string, fieldName: string, filter?: Document_2, options?: DistinctOptions, dbOptions?: DbOptions): Promise<Document_2>;
|
|
8354
8495
|
estimatedDocumentCount(database: string, collection: string, options?: EstimatedDocumentCountOptions, dbOptions?: DbOptions): Promise<number>;
|
|
8355
8496
|
find(database: string, collection: string, filter?: Document_2, options?: FindOptions, dbOptions?: DbOptions): ServiceProviderFindCursor;
|
|
8356
|
-
|
|
8497
|
+
getTopologyDescription(): TopologyDescription_2 | undefined;
|
|
8357
8498
|
getIndexes(database: string, collection: string, options: ListIndexesOptions, dbOptions?: DbOptions): Promise<Document_2[]>;
|
|
8358
8499
|
listCollections(database: string, filter?: Document_2, options?: ListCollectionsOptions, dbOptions?: DbOptions): Promise<Document_2[]>;
|
|
8359
8500
|
readPreferenceFromOptions(options?: Omit<ReadPreferenceFromOptions, 'session'>): ReadPreferenceLike | undefined;
|
|
@@ -8560,7 +8701,7 @@ declare interface RenameOptions extends CommandOperationOptions {
|
|
|
8560
8701
|
|
|
8561
8702
|
/** @public */
|
|
8562
8703
|
declare interface ReplaceOneModel<TSchema extends Document_2 = Document_2> {
|
|
8563
|
-
/** The filter to
|
|
8704
|
+
/** The filter that specifies which document to replace. In the case of multiple matches, the first document matched is replaced. */
|
|
8564
8705
|
filter: Filter<TSchema>;
|
|
8565
8706
|
/** The document with which to replace the matched document. */
|
|
8566
8707
|
replacement: WithoutId<TSchema>;
|
|
@@ -8570,6 +8711,8 @@ declare interface ReplaceOneModel<TSchema extends Document_2 = Document_2> {
|
|
|
8570
8711
|
hint?: Hint;
|
|
8571
8712
|
/** When true, creates a new document if no document matches the query. */
|
|
8572
8713
|
upsert?: boolean;
|
|
8714
|
+
/** Specifies the sort order for the documents matched by the filter. */
|
|
8715
|
+
sort?: Sort;
|
|
8573
8716
|
}
|
|
8574
8717
|
|
|
8575
8718
|
/** @public */
|
|
@@ -8584,6 +8727,8 @@ declare interface ReplaceOptions extends CommandOperationOptions {
|
|
|
8584
8727
|
upsert?: boolean;
|
|
8585
8728
|
/** Map of parameter names and values that can be accessed using $$var (requires MongoDB 5.0). */
|
|
8586
8729
|
let?: Document_2;
|
|
8730
|
+
/** Specifies the sort order for the documents matched by the filter. */
|
|
8731
|
+
sort?: Sort;
|
|
8587
8732
|
}
|
|
8588
8733
|
export declare class ReplicaSet<M extends GenericServerSideSchema = GenericServerSideSchema, D extends GenericDatabaseSchema = GenericDatabaseSchema> extends ShellApiWithMongoClass {
|
|
8589
8734
|
_database: DatabaseWithSchema<M, D>;
|
|
@@ -8773,7 +8918,8 @@ declare type RunCommandOptions = {
|
|
|
8773
8918
|
*/
|
|
8774
8919
|
timeoutMS?: number;
|
|
8775
8920
|
/* Excluded from this release type: omitMaxTimeMS */
|
|
8776
|
-
|
|
8921
|
+
/* Excluded from this release type: bypassPinningCheck */
|
|
8922
|
+
} & BSONSerializeOptions & Abortable;
|
|
8777
8923
|
|
|
8778
8924
|
/** @public */
|
|
8779
8925
|
declare type RunCursorCommandOptions = {
|
|
@@ -8920,6 +9066,10 @@ declare class ServerDescription {
|
|
|
8920
9066
|
*/
|
|
8921
9067
|
equals(other?: ServerDescription | null): boolean;
|
|
8922
9068
|
}
|
|
9069
|
+
declare interface ServerDescription_2 {
|
|
9070
|
+
type?: ServerType;
|
|
9071
|
+
setName?: string | null;
|
|
9072
|
+
}
|
|
8923
9073
|
|
|
8924
9074
|
/**
|
|
8925
9075
|
* Emitted when server description changes, but does NOT include changes to the RTT.
|
|
@@ -9642,7 +9792,7 @@ declare class ShellInstanceState {
|
|
|
9642
9792
|
constructor(initialServiceProvider: ServiceProvider, messageBus?: any, cliOptions?: ShellCliOptions);
|
|
9643
9793
|
fetchConnectionInfo(): Promise<ConnectionInfo_2 | undefined>;
|
|
9644
9794
|
cachedConnectionInfo(): ConnectionInfo_2 | undefined;
|
|
9645
|
-
close(
|
|
9795
|
+
close(): Promise<void>;
|
|
9646
9796
|
setPreFetchCollectionAndDatabaseNames(value: boolean): void;
|
|
9647
9797
|
setDbFunc(newDb: any): DatabaseWithSchema;
|
|
9648
9798
|
setCtx(contextObject: any): void;
|
|
@@ -9762,15 +9912,24 @@ declare interface SnippetsTransformErrorEvent {
|
|
|
9762
9912
|
|
|
9763
9913
|
/** @public */
|
|
9764
9914
|
declare type Sort = string | Exclude<SortDirection, {
|
|
9765
|
-
$meta: string;
|
|
9766
|
-
}> | string
|
|
9767
|
-
[key: string]: SortDirection;
|
|
9768
|
-
} |
|
|
9915
|
+
readonly $meta: string;
|
|
9916
|
+
}> | ReadonlyArray<string> | {
|
|
9917
|
+
readonly [key: string]: SortDirection;
|
|
9918
|
+
} | ReadonlyMap<string, SortDirection> | ReadonlyArray<readonly [string, SortDirection]> | readonly [string, SortDirection];
|
|
9769
9919
|
|
|
9770
9920
|
/** @public */
|
|
9771
9921
|
declare type SortDirection = 1 | -1 | 'asc' | 'desc' | 'ascending' | 'descending' | {
|
|
9922
|
+
readonly $meta: string;
|
|
9923
|
+
};
|
|
9924
|
+
|
|
9925
|
+
/** Below stricter types were created for sort that correspond with type that the cmd takes */
|
|
9926
|
+
/** @public */
|
|
9927
|
+
declare type SortDirectionForCmd = 1 | -1 | {
|
|
9772
9928
|
$meta: string;
|
|
9773
9929
|
};
|
|
9930
|
+
|
|
9931
|
+
/** @public */
|
|
9932
|
+
declare type SortForCmd = Map<string, SortDirectionForCmd>;
|
|
9774
9933
|
declare type StandardJSONSchema = JSONSchema4;
|
|
9775
9934
|
declare interface StartLoadingCliScriptsEvent {
|
|
9776
9935
|
usesShellOption: boolean;
|
|
@@ -9859,6 +10018,8 @@ declare type SupportedNodeConnectionOptions = SupportedTLSConnectionOptions & Su
|
|
|
9859
10018
|
declare type SupportedSocketOptions = Pick<TcpNetConnectOpts & {
|
|
9860
10019
|
autoSelectFamily?: boolean;
|
|
9861
10020
|
autoSelectFamilyAttemptTimeout?: number;
|
|
10021
|
+
/** Node.JS socket option to set the time the first keepalive probe is sent on an idle socket. Defaults to 120000ms */
|
|
10022
|
+
keepAliveInitialDelay?: number;
|
|
9862
10023
|
}, (typeof LEGAL_TCP_SOCKET_OPTIONS)[number]>;
|
|
9863
10024
|
|
|
9864
10025
|
/** @public */
|
|
@@ -9874,6 +10035,39 @@ declare type TagSet = {
|
|
|
9874
10035
|
[key: string]: string;
|
|
9875
10036
|
};
|
|
9876
10037
|
|
|
10038
|
+
/**
|
|
10039
|
+
* Options for a Queryable Encryption field supporting text queries.
|
|
10040
|
+
*
|
|
10041
|
+
* @public
|
|
10042
|
+
* @experimental Public Technical Preview: `textPreview` is an experimental feature and may break at any time.
|
|
10043
|
+
*/
|
|
10044
|
+
declare interface TextQueryOptions {
|
|
10045
|
+
/** Indicates that text indexes for this field are case sensitive */
|
|
10046
|
+
caseSensitive: boolean;
|
|
10047
|
+
/** Indicates that text indexes for this field are diacritic sensitive. */
|
|
10048
|
+
diacriticSensitive: boolean;
|
|
10049
|
+
prefix?: {
|
|
10050
|
+
/** The maximum allowed query length. */
|
|
10051
|
+
strMaxQueryLength: Int32 | number;
|
|
10052
|
+
/** The minimum allowed query length. */
|
|
10053
|
+
strMinQueryLength: Int32 | number;
|
|
10054
|
+
};
|
|
10055
|
+
suffix?: {
|
|
10056
|
+
/** The maximum allowed query length. */
|
|
10057
|
+
strMaxQueryLength: Int32 | number;
|
|
10058
|
+
/** The minimum allowed query length. */
|
|
10059
|
+
strMinQueryLength: Int32 | number;
|
|
10060
|
+
};
|
|
10061
|
+
substring?: {
|
|
10062
|
+
/** The maximum allowed length to insert. */
|
|
10063
|
+
strMaxLength: Int32 | number;
|
|
10064
|
+
/** The maximum allowed query length. */
|
|
10065
|
+
strMaxQueryLength: Int32 | number;
|
|
10066
|
+
/** The minimum allowed query length. */
|
|
10067
|
+
strMinQueryLength: Int32 | number;
|
|
10068
|
+
};
|
|
10069
|
+
}
|
|
10070
|
+
|
|
9877
10071
|
/** @public
|
|
9878
10072
|
* Configuration options for timeseries collections
|
|
9879
10073
|
* @see https://www.mongodb.com/docs/manual/core/timeseries-collections/
|
|
@@ -9945,6 +10139,11 @@ declare class TopologyDescription {
|
|
|
9945
10139
|
*/
|
|
9946
10140
|
toJSON(): Document_2;
|
|
9947
10141
|
}
|
|
10142
|
+
declare interface TopologyDescription_2 {
|
|
10143
|
+
type?: TopologyType;
|
|
10144
|
+
setName?: string | null;
|
|
10145
|
+
servers?: Map<string, ServerDescription_2>;
|
|
10146
|
+
}
|
|
9948
10147
|
|
|
9949
10148
|
/**
|
|
9950
10149
|
* Emitted when topology description changes.
|
|
@@ -10019,23 +10218,32 @@ declare interface TopologyVersion {
|
|
|
10019
10218
|
|
|
10020
10219
|
/**
|
|
10021
10220
|
* @public
|
|
10221
|
+
* @deprecated - Will be made internal in a future major release.
|
|
10022
10222
|
* A class maintaining state related to a server transaction. Internal Only
|
|
10023
10223
|
*/
|
|
10024
10224
|
declare class Transaction {
|
|
10025
10225
|
/* Excluded from this release type: state */
|
|
10226
|
+
/** @deprecated - Will be made internal in a future major release. */
|
|
10026
10227
|
options: TransactionOptions;
|
|
10027
10228
|
/* Excluded from this release type: _pinnedServer */
|
|
10028
10229
|
/* Excluded from this release type: _recoveryToken */
|
|
10029
10230
|
/* Excluded from this release type: __constructor */
|
|
10030
10231
|
/* Excluded from this release type: server */
|
|
10232
|
+
/** @deprecated - Will be made internal in a future major release. */
|
|
10031
10233
|
get recoveryToken(): Document_2 | undefined;
|
|
10234
|
+
/** @deprecated - Will be made internal in a future major release. */
|
|
10032
10235
|
get isPinned(): boolean;
|
|
10033
|
-
/**
|
|
10236
|
+
/**
|
|
10237
|
+
* @deprecated - Will be made internal in a future major release.
|
|
10238
|
+
* @returns Whether the transaction has started
|
|
10239
|
+
*/
|
|
10034
10240
|
get isStarting(): boolean;
|
|
10035
10241
|
/**
|
|
10242
|
+
* @deprecated - Will be made internal in a future major release.
|
|
10036
10243
|
* @returns Whether this session is presently in a transaction
|
|
10037
10244
|
*/
|
|
10038
10245
|
get isActive(): boolean;
|
|
10246
|
+
/** @deprecated - Will be made internal in a future major release. */
|
|
10039
10247
|
get isCommitted(): boolean;
|
|
10040
10248
|
/* Excluded from this release type: transition */
|
|
10041
10249
|
/* Excluded from this release type: pinServer */
|
|
@@ -10216,7 +10424,7 @@ declare interface UpdateManyModel<TSchema extends Document_2 = Document_2> {
|
|
|
10216
10424
|
|
|
10217
10425
|
/** @public */
|
|
10218
10426
|
declare interface UpdateOneModel<TSchema extends Document_2 = Document_2> {
|
|
10219
|
-
/** The filter to
|
|
10427
|
+
/** The filter that specifies which document to update. In the case of multiple matches, the first document matched is updated. */
|
|
10220
10428
|
filter: Filter<TSchema>;
|
|
10221
10429
|
/**
|
|
10222
10430
|
* The modifications to apply. The value can be either:
|
|
@@ -10232,6 +10440,8 @@ declare interface UpdateOneModel<TSchema extends Document_2 = Document_2> {
|
|
|
10232
10440
|
hint?: Hint;
|
|
10233
10441
|
/** When true, creates a new document if no document matches the query. */
|
|
10234
10442
|
upsert?: boolean;
|
|
10443
|
+
/** Specifies the sort order for the documents matched by the filter. */
|
|
10444
|
+
sort?: Sort;
|
|
10235
10445
|
}
|
|
10236
10446
|
|
|
10237
10447
|
/** @public */
|
|
@@ -10291,6 +10501,8 @@ declare interface UpdateStatement {
|
|
|
10291
10501
|
arrayFilters?: Document_2[];
|
|
10292
10502
|
/** A document or string that specifies the index to use to support the query predicate. */
|
|
10293
10503
|
hint?: Hint;
|
|
10504
|
+
/** Specifies the sort order for the documents matched by the filter. */
|
|
10505
|
+
sort?: SortForCmd;
|
|
10294
10506
|
}
|
|
10295
10507
|
declare interface UseEvent {
|
|
10296
10508
|
db: string;
|
|
@@ -10337,7 +10549,9 @@ declare interface Writable {
|
|
|
10337
10549
|
insertOne(database: string, collection: string, doc: Document_2, options: InsertOneOptions, dbOptions?: DbOptions): Promise<InsertOneResult>;
|
|
10338
10550
|
replaceOne(database: string, collection: string, filter: Document_2, replacement: Document_2, options?: ReplaceOptions, dbOptions?: DbOptions): Promise<UpdateResult>;
|
|
10339
10551
|
updateMany(database: string, collection: string, filter: Document_2, update: Document_2, options?: UpdateOptions, dbOptions?: DbOptions): Promise<UpdateResult>;
|
|
10340
|
-
updateOne(database: string, collection: string, filter: Document_2, update: Document_2, options?: UpdateOptions
|
|
10552
|
+
updateOne(database: string, collection: string, filter: Document_2, update: Document_2, options?: UpdateOptions & {
|
|
10553
|
+
sort?: Document_2;
|
|
10554
|
+
}, dbOptions?: DbOptions): Promise<UpdateResult>;
|
|
10341
10555
|
createIndexes(database: string, collection: string, indexSpecs: Document_2[], options?: CreateIndexesOptions, dbOptions?: DbOptions): Promise<string[]>;
|
|
10342
10556
|
dropCollection(database: string, collection: string, options: DropCollectionOptions, dbOptions?: DbOptions): Promise<boolean>;
|
|
10343
10557
|
renameCollection(database: string, oldName: string, newName: string, options?: RenameOptions, dbOptions?: DbOptions): Promise<Collection_2>;
|