mongodb 6.5.0 → 6.6.0-dev.20240504.sha.2609953
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -9
- package/lib/admin.js +9 -9
- package/lib/admin.js.map +1 -1
- package/lib/bson.js +33 -22
- package/lib/bson.js.map +1 -1
- package/lib/bulk/common.js +13 -12
- package/lib/bulk/common.js.map +1 -1
- package/lib/change_stream.js +28 -18
- package/lib/change_stream.js.map +1 -1
- package/lib/client-side-encryption/auto_encrypter.js +2 -2
- package/lib/client-side-encryption/auto_encrypter.js.map +1 -1
- package/lib/client-side-encryption/client_encryption.js +6 -6
- package/lib/client-side-encryption/client_encryption.js.map +1 -1
- package/lib/client-side-encryption/providers/aws.js +13 -10
- package/lib/client-side-encryption/providers/aws.js.map +1 -1
- package/lib/client-side-encryption/providers/azure.js +6 -3
- package/lib/client-side-encryption/providers/azure.js.map +1 -1
- package/lib/cmap/auth/aws_temporary_credentials.js +140 -0
- package/lib/cmap/auth/aws_temporary_credentials.js.map +1 -0
- package/lib/cmap/auth/gssapi.js +7 -6
- package/lib/cmap/auth/gssapi.js.map +1 -1
- package/lib/cmap/auth/mongodb_aws.js +8 -101
- package/lib/cmap/auth/mongodb_aws.js.map +1 -1
- package/lib/cmap/auth/mongodb_oidc/aws_service_workflow.js +1 -1
- package/lib/cmap/auth/mongodb_oidc/aws_service_workflow.js.map +1 -1
- package/lib/cmap/auth/mongodb_oidc/callback_lock_cache.js +2 -1
- package/lib/cmap/auth/mongodb_oidc/callback_lock_cache.js.map +1 -1
- package/lib/cmap/auth/mongodb_oidc/service_workflow.js +1 -1
- package/lib/cmap/auth/mongodb_oidc/service_workflow.js.map +1 -1
- package/lib/cmap/auth/scram.js +2 -2
- package/lib/cmap/auth/scram.js.map +1 -1
- package/lib/cmap/commands.js +24 -111
- package/lib/cmap/commands.js.map +1 -1
- package/lib/cmap/connect.js +4 -4
- package/lib/cmap/connect.js.map +1 -1
- package/lib/cmap/connection.js +61 -36
- package/lib/cmap/connection.js.map +1 -1
- package/lib/cmap/connection_pool.js +22 -13
- package/lib/cmap/connection_pool.js.map +1 -1
- package/lib/cmap/handshake/client_metadata.js +2 -2
- package/lib/cmap/handshake/client_metadata.js.map +1 -1
- package/lib/cmap/wire_protocol/compression.js +8 -8
- package/lib/cmap/wire_protocol/compression.js.map +1 -1
- package/lib/cmap/wire_protocol/on_demand/document.js +218 -0
- package/lib/cmap/wire_protocol/on_demand/document.js.map +1 -0
- package/lib/cmap/wire_protocol/responses.js +184 -0
- package/lib/cmap/wire_protocol/responses.js.map +1 -0
- package/lib/collection.js +42 -38
- package/lib/collection.js.map +1 -1
- package/lib/connection_string.js +4 -6
- package/lib/connection_string.js.map +1 -1
- package/lib/cursor/abstract_cursor.js +76 -43
- package/lib/cursor/abstract_cursor.js.map +1 -1
- package/lib/cursor/aggregation_cursor.js +16 -33
- package/lib/cursor/aggregation_cursor.js.map +1 -1
- package/lib/cursor/find_cursor.js +36 -18
- package/lib/cursor/find_cursor.js.map +1 -1
- package/lib/cursor/run_command_cursor.js +3 -2
- package/lib/cursor/run_command_cursor.js.map +1 -1
- package/lib/db.js +15 -19
- package/lib/db.js.map +1 -1
- package/lib/deps.js +31 -26
- package/lib/deps.js.map +1 -1
- package/lib/encrypter.js +14 -5
- package/lib/encrypter.js.map +1 -1
- package/lib/error.js +4 -3
- package/lib/error.js.map +1 -1
- package/lib/gridfs/download.js +19 -14
- package/lib/gridfs/download.js.map +1 -1
- package/lib/gridfs/index.js.map +1 -1
- package/lib/gridfs/upload.js +6 -1
- package/lib/gridfs/upload.js.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib/mongo_client.js +11 -7
- package/lib/mongo_client.js.map +1 -1
- package/lib/mongo_logger.js +3 -0
- package/lib/mongo_logger.js.map +1 -1
- package/lib/operations/aggregate.js +2 -1
- package/lib/operations/aggregate.js.map +1 -1
- package/lib/operations/command.js +1 -1
- package/lib/operations/command.js.map +1 -1
- package/lib/operations/create_collection.js +1 -1
- package/lib/operations/create_collection.js.map +1 -1
- package/lib/operations/delete.js +4 -3
- package/lib/operations/delete.js.map +1 -1
- package/lib/operations/drop.js +1 -1
- package/lib/operations/drop.js.map +1 -1
- package/lib/operations/execute_operation.js +23 -8
- package/lib/operations/execute_operation.js.map +1 -1
- package/lib/operations/find.js +4 -4
- package/lib/operations/find.js.map +1 -1
- package/lib/operations/get_more.js +2 -1
- package/lib/operations/get_more.js.map +1 -1
- package/lib/operations/indexes.js +29 -121
- package/lib/operations/indexes.js.map +1 -1
- package/lib/operations/insert.js +3 -3
- package/lib/operations/insert.js.map +1 -1
- package/lib/operations/kill_cursors.js +3 -1
- package/lib/operations/kill_cursors.js.map +1 -1
- package/lib/operations/list_collections.js +1 -1
- package/lib/operations/list_collections.js.map +1 -1
- package/lib/operations/list_databases.js +1 -1
- package/lib/operations/list_databases.js.map +1 -1
- package/lib/operations/operation.js.map +1 -1
- package/lib/operations/run_command.js +4 -2
- package/lib/operations/run_command.js.map +1 -1
- package/lib/operations/search_indexes/create.js.map +1 -1
- package/lib/operations/stats.js +1 -1
- package/lib/operations/stats.js.map +1 -1
- package/lib/operations/update.js +1 -1
- package/lib/operations/update.js.map +1 -1
- package/lib/sdam/common.js.map +1 -1
- package/lib/sdam/monitor.js +139 -42
- package/lib/sdam/monitor.js.map +1 -1
- package/lib/sdam/server.js +5 -15
- package/lib/sdam/server.js.map +1 -1
- package/lib/sdam/server_description.js +1 -0
- package/lib/sdam/server_description.js.map +1 -1
- package/lib/sdam/server_selection.js +1 -1
- package/lib/sdam/server_selection.js.map +1 -1
- package/lib/sdam/srv_polling.js +2 -1
- package/lib/sdam/srv_polling.js.map +1 -1
- package/lib/sdam/topology.js +67 -54
- package/lib/sdam/topology.js.map +1 -1
- package/lib/sdam/topology_description.js +10 -0
- package/lib/sdam/topology_description.js.map +1 -1
- package/lib/sessions.js +133 -93
- package/lib/sessions.js.map +1 -1
- package/lib/timeout.js +77 -0
- package/lib/timeout.js.map +1 -0
- package/lib/utils.js +61 -28
- package/lib/utils.js.map +1 -1
- package/mongodb.d.ts +150 -38
- package/package.json +17 -14
- package/src/admin.ts +9 -9
- package/src/bson.ts +14 -0
- package/src/bulk/common.ts +3 -2
- package/src/change_stream.ts +39 -30
- package/src/client-side-encryption/auto_encrypter.ts +2 -2
- package/src/client-side-encryption/client_encryption.ts +6 -6
- package/src/client-side-encryption/providers/aws.ts +17 -10
- package/src/client-side-encryption/providers/azure.ts +5 -3
- package/src/cmap/auth/aws_temporary_credentials.ts +169 -0
- package/src/cmap/auth/gssapi.ts +9 -11
- package/src/cmap/auth/mongodb_aws.ts +19 -126
- package/src/cmap/auth/mongodb_oidc/aws_service_workflow.ts +1 -1
- package/src/cmap/auth/mongodb_oidc/callback_lock_cache.ts +2 -1
- package/src/cmap/auth/mongodb_oidc/service_workflow.ts +1 -1
- package/src/cmap/auth/scram.ts +2 -2
- package/src/cmap/commands.ts +28 -132
- package/src/cmap/connect.ts +4 -4
- package/src/cmap/connection.ts +107 -43
- package/src/cmap/connection_pool.ts +32 -29
- package/src/cmap/handshake/client_metadata.ts +2 -5
- package/src/cmap/wire_protocol/compression.ts +11 -13
- package/src/cmap/wire_protocol/on_demand/document.ts +338 -0
- package/src/cmap/wire_protocol/responses.ts +237 -0
- package/src/collection.ts +87 -58
- package/src/connection_string.ts +9 -7
- package/src/cursor/abstract_cursor.ts +102 -38
- package/src/cursor/aggregation_cursor.ts +32 -34
- package/src/cursor/find_cursor.ts +33 -21
- package/src/cursor/list_search_indexes_cursor.ts +1 -1
- package/src/cursor/run_command_cursor.ts +3 -2
- package/src/db.ts +42 -21
- package/src/deps.ts +52 -40
- package/src/encrypter.ts +14 -5
- package/src/error.ts +9 -3
- package/src/gridfs/download.ts +19 -31
- package/src/gridfs/index.ts +2 -0
- package/src/gridfs/upload.ts +11 -8
- package/src/index.ts +13 -5
- package/src/mongo_client.ts +21 -15
- package/src/mongo_logger.ts +3 -0
- package/src/mongo_types.ts +1 -1
- package/src/operations/aggregate.ts +2 -1
- package/src/operations/command.ts +1 -1
- package/src/operations/create_collection.ts +7 -2
- package/src/operations/delete.ts +4 -3
- package/src/operations/drop.ts +1 -1
- package/src/operations/execute_operation.ts +29 -10
- package/src/operations/find.ts +13 -14
- package/src/operations/get_more.ts +9 -1
- package/src/operations/indexes.ts +103 -176
- package/src/operations/insert.ts +2 -2
- package/src/operations/kill_cursors.ts +3 -2
- package/src/operations/list_collections.ts +5 -1
- package/src/operations/list_databases.ts +1 -1
- package/src/operations/operation.ts +3 -0
- package/src/operations/run_command.ts +6 -4
- package/src/operations/search_indexes/create.ts +4 -1
- package/src/operations/stats.ts +1 -1
- package/src/operations/update.ts +7 -7
- package/src/sdam/common.ts +8 -2
- package/src/sdam/monitor.ts +178 -61
- package/src/sdam/server.ts +27 -20
- package/src/sdam/server_description.ts +8 -3
- package/src/sdam/server_selection.ts +2 -3
- package/src/sdam/srv_polling.ts +3 -2
- package/src/sdam/topology.ts +114 -117
- package/src/sdam/topology_description.ts +14 -4
- package/src/sessions.ts +168 -148
- package/src/timeout.ts +96 -0
- package/src/utils.ts +85 -32
- package/lib/operations/common_functions.js +0 -38
- package/lib/operations/common_functions.js.map +0 -1
- package/src/operations/common_functions.ts +0 -79
package/mongodb.d.ts
CHANGED
|
@@ -204,6 +204,7 @@ export declare interface AbstractCursorOptions extends BSONSerializeOptions {
|
|
|
204
204
|
*/
|
|
205
205
|
awaitData?: boolean;
|
|
206
206
|
noCursorTimeout?: boolean;
|
|
207
|
+
/* Excluded from this release type: timeoutMS */
|
|
207
208
|
}
|
|
208
209
|
|
|
209
210
|
/* Excluded from this release type: AbstractOperation */
|
|
@@ -359,6 +360,20 @@ export declare class AggregationCursor<TSchema = any> extends AbstractCursor<TSc
|
|
|
359
360
|
/* Excluded from this release type: _initialize */
|
|
360
361
|
/** Execute the explain for the cursor */
|
|
361
362
|
explain(verbosity?: ExplainVerbosityLike): Promise<Document>;
|
|
363
|
+
/** Add a stage to the aggregation pipeline
|
|
364
|
+
* @example
|
|
365
|
+
* ```
|
|
366
|
+
* const documents = await users.aggregate().addStage({ $match: { name: /Mike/ } }).toArray();
|
|
367
|
+
* ```
|
|
368
|
+
* @example
|
|
369
|
+
* ```
|
|
370
|
+
* const documents = await users.aggregate()
|
|
371
|
+
* .addStage<{ name: string }>({ $project: { name: true } })
|
|
372
|
+
* .toArray(); // type of documents is { name: string }[]
|
|
373
|
+
* ```
|
|
374
|
+
*/
|
|
375
|
+
addStage(stage: Document): this;
|
|
376
|
+
addStage<T = Document>(stage: Document): AggregationCursor<T>;
|
|
362
377
|
/** Add a group stage to the aggregation pipeline */
|
|
363
378
|
group<T = TSchema>($group: Document): AggregationCursor<T>;
|
|
364
379
|
/** Add a limit stage to the aggregation pipeline */
|
|
@@ -1065,7 +1080,7 @@ export declare class ChangeStream<TSchema extends Document = Document, TChange e
|
|
|
1065
1080
|
/**
|
|
1066
1081
|
* Only present when the `showExpandedEvents` flag is enabled.
|
|
1067
1082
|
* @public
|
|
1068
|
-
* @see https://www.mongodb.com/docs/manual/reference/change-events/
|
|
1083
|
+
* @see https://www.mongodb.com/docs/manual/reference/change-events/modify/#mongodb-data-modify
|
|
1069
1084
|
*/
|
|
1070
1085
|
export declare interface ChangeStreamCollModDocument extends ChangeStreamDocumentCommon, ChangeStreamDocumentCollectionUUID {
|
|
1071
1086
|
/** Describes the type of operation represented in this change notification */
|
|
@@ -1074,7 +1089,7 @@ export declare interface ChangeStreamCollModDocument extends ChangeStreamDocumen
|
|
|
1074
1089
|
|
|
1075
1090
|
/**
|
|
1076
1091
|
* @public
|
|
1077
|
-
* @see https://www.mongodb.com/docs/manual/reference/change-events/
|
|
1092
|
+
* @see https://www.mongodb.com/docs/manual/reference/change-events/create/#mongodb-data-create
|
|
1078
1093
|
*/
|
|
1079
1094
|
export declare interface ChangeStreamCreateDocument extends ChangeStreamDocumentCommon, ChangeStreamDocumentCollectionUUID {
|
|
1080
1095
|
/** Describes the type of operation represented in this change notification */
|
|
@@ -1084,7 +1099,7 @@ export declare interface ChangeStreamCreateDocument extends ChangeStreamDocument
|
|
|
1084
1099
|
/**
|
|
1085
1100
|
* Only present when the `showExpandedEvents` flag is enabled.
|
|
1086
1101
|
* @public
|
|
1087
|
-
* @see https://www.mongodb.com/docs/manual/reference/change-events/
|
|
1102
|
+
* @see https://www.mongodb.com/docs/manual/reference/change-events/createIndexes/#mongodb-data-createIndexes
|
|
1088
1103
|
*/
|
|
1089
1104
|
export declare interface ChangeStreamCreateIndexDocument extends ChangeStreamDocumentCommon, ChangeStreamDocumentCollectionUUID, ChangeStreamDocumentOperationDescription {
|
|
1090
1105
|
/** Describes the type of operation represented in this change notification */
|
|
@@ -1219,7 +1234,7 @@ export declare interface ChangeStreamDropDocument extends ChangeStreamDocumentCo
|
|
|
1219
1234
|
/**
|
|
1220
1235
|
* Only present when the `showExpandedEvents` flag is enabled.
|
|
1221
1236
|
* @public
|
|
1222
|
-
* @see https://www.mongodb.com/docs/manual/reference/change-events/
|
|
1237
|
+
* @see https://www.mongodb.com/docs/manual/reference/change-events/dropIndexes/#mongodb-data-dropIndexes
|
|
1223
1238
|
*/
|
|
1224
1239
|
export declare interface ChangeStreamDropIndexDocument extends ChangeStreamDocumentCommon, ChangeStreamDocumentCollectionUUID, ChangeStreamDocumentOperationDescription {
|
|
1225
1240
|
/** Describes the type of operation represented in this change notification */
|
|
@@ -1334,7 +1349,7 @@ export declare interface ChangeStreamOptions extends Omit<AggregateOptions, 'wri
|
|
|
1334
1349
|
|
|
1335
1350
|
/**
|
|
1336
1351
|
* @public
|
|
1337
|
-
* @see https://www.mongodb.com/docs/manual/reference/change-events/
|
|
1352
|
+
* @see https://www.mongodb.com/docs/manual/reference/change-events/refineCollectionShardKey/#mongodb-data-refineCollectionShardKey
|
|
1338
1353
|
*/
|
|
1339
1354
|
export declare interface ChangeStreamRefineCollectionShardKeyDocument extends ChangeStreamDocumentCommon, ChangeStreamDocumentCollectionUUID, ChangeStreamDocumentOperationDescription {
|
|
1340
1355
|
/** Describes the type of operation represented in this change notification */
|
|
@@ -1380,7 +1395,7 @@ export declare interface ChangeStreamReplaceDocument<TSchema extends Document =
|
|
|
1380
1395
|
|
|
1381
1396
|
/**
|
|
1382
1397
|
* @public
|
|
1383
|
-
* @see https://www.mongodb.com/docs/manual/reference/change-events/
|
|
1398
|
+
* @see https://www.mongodb.com/docs/manual/reference/change-events/reshardCollection/#mongodb-data-reshardCollection
|
|
1384
1399
|
*/
|
|
1385
1400
|
export declare interface ChangeStreamReshardCollectionDocument extends ChangeStreamDocumentCommon, ChangeStreamDocumentCollectionUUID, ChangeStreamDocumentOperationDescription {
|
|
1386
1401
|
/** Describes the type of operation represented in this change notification */
|
|
@@ -1389,7 +1404,7 @@ export declare interface ChangeStreamReshardCollectionDocument extends ChangeStr
|
|
|
1389
1404
|
|
|
1390
1405
|
/**
|
|
1391
1406
|
* @public
|
|
1392
|
-
* @see https://www.mongodb.com/docs/manual/reference/change-events/
|
|
1407
|
+
* @see https://www.mongodb.com/docs/manual/reference/change-events/shardCollection/#mongodb-data-shardCollection
|
|
1393
1408
|
*/
|
|
1394
1409
|
export declare interface ChangeStreamShardCollectionDocument extends ChangeStreamDocumentCommon, ChangeStreamDocumentCollectionUUID, ChangeStreamDocumentOperationDescription {
|
|
1395
1410
|
/** Describes the type of operation represented in this change notification */
|
|
@@ -1945,6 +1960,7 @@ export declare class ClientSession extends TypedEventEmitter<ClientSessionEvents
|
|
|
1945
1960
|
/* Excluded from this release type: [kSnapshotEnabled] */
|
|
1946
1961
|
/* Excluded from this release type: [kPinnedConnection] */
|
|
1947
1962
|
/* Excluded from this release type: [kTxnNumberIncrement] */
|
|
1963
|
+
/* Excluded from this release type: timeoutMS */
|
|
1948
1964
|
/* Excluded from this release type: __constructor */
|
|
1949
1965
|
/** The server id associated with this session */
|
|
1950
1966
|
get id(): ServerSessionId | undefined;
|
|
@@ -2012,18 +2028,26 @@ export declare class ClientSession extends TypedEventEmitter<ClientSessionEvents
|
|
|
2012
2028
|
/**
|
|
2013
2029
|
* Starts a transaction and runs a provided function, ensuring the commitTransaction is always attempted when all operations run in the function have completed.
|
|
2014
2030
|
*
|
|
2015
|
-
* **IMPORTANT:** This method requires the
|
|
2031
|
+
* **IMPORTANT:** This method requires the function passed in to return a Promise. That promise must be made by `await`-ing all operations in such a way that rejections are propagated to the returned promise.
|
|
2016
2032
|
*
|
|
2017
2033
|
* @remarks
|
|
2018
|
-
*
|
|
2019
|
-
* - If
|
|
2020
|
-
* - If the transaction is unable to complete or an error is thrown from within the provided function, then this function will throw an error.
|
|
2034
|
+
* - If all operations successfully complete and the `commitTransaction` operation is successful, then the provided function will return the result of the provided function.
|
|
2035
|
+
* - If the transaction is unable to complete or an error is thrown from within the provided function, then the provided function will throw an error.
|
|
2021
2036
|
* - If the transaction is manually aborted within the provided function it will not throw.
|
|
2022
|
-
* -
|
|
2037
|
+
* - If the driver needs to attempt to retry the operations, the provided function may be called multiple times.
|
|
2023
2038
|
*
|
|
2024
2039
|
* Checkout a descriptive example here:
|
|
2025
2040
|
* @see https://www.mongodb.com/blog/post/quick-start-nodejs--mongodb--how-to-implement-transactions
|
|
2026
2041
|
*
|
|
2042
|
+
* If a command inside withTransaction fails:
|
|
2043
|
+
* - It may cause the transaction on the server to be aborted.
|
|
2044
|
+
* - This situation is normally handled transparently by the driver.
|
|
2045
|
+
* - However, if the application catches such an error and does not rethrow it, the driver will not be able to determine whether the transaction was aborted or not.
|
|
2046
|
+
* - The driver will then retry the transaction indefinitely.
|
|
2047
|
+
*
|
|
2048
|
+
* To avoid this situation, the application must not silently handle errors within the provided function.
|
|
2049
|
+
* If the application needs to handle errors within, it must await all operations such that if an operation is rejected it becomes the rejection of the callback function passed into withTransaction.
|
|
2050
|
+
*
|
|
2027
2051
|
* @param fn - callback to run within a transaction
|
|
2028
2052
|
* @param options - optional settings for the transaction
|
|
2029
2053
|
* @returns A raw command response or undefined
|
|
@@ -2044,6 +2068,7 @@ export declare interface ClientSessionOptions {
|
|
|
2044
2068
|
snapshot?: boolean;
|
|
2045
2069
|
/** The default TransactionOptions to use for transactions started on this session. */
|
|
2046
2070
|
defaultTransactionOptions?: TransactionOptions;
|
|
2071
|
+
/* Excluded from this release type: defaultTimeoutMS */
|
|
2047
2072
|
/* Excluded from this release type: owner */
|
|
2048
2073
|
/* Excluded from this release type: explicit */
|
|
2049
2074
|
/* Excluded from this release type: initialClusterTime */
|
|
@@ -2068,10 +2093,16 @@ export declare interface ClusteredCollectionOptions extends Document {
|
|
|
2068
2093
|
unique: boolean;
|
|
2069
2094
|
}
|
|
2070
2095
|
|
|
2071
|
-
/**
|
|
2096
|
+
/**
|
|
2097
|
+
* @public
|
|
2098
|
+
* Gossiped in component for the cluster time tracking the state of user databases
|
|
2099
|
+
* across the cluster. It may optionally include a signature identifying the process that
|
|
2100
|
+
* generated such a value.
|
|
2101
|
+
*/
|
|
2072
2102
|
export declare interface ClusterTime {
|
|
2073
2103
|
clusterTime: Timestamp;
|
|
2074
|
-
|
|
2104
|
+
/** Used to validate the identity of a request or response's ClusterTime. */
|
|
2105
|
+
signature?: {
|
|
2075
2106
|
hash: Binary;
|
|
2076
2107
|
keyId: Long;
|
|
2077
2108
|
};
|
|
@@ -2372,13 +2403,20 @@ export declare class Collection<TSchema extends Document = Document> {
|
|
|
2372
2403
|
* @param indexes - One or more index names to check.
|
|
2373
2404
|
* @param options - Optional settings for the command
|
|
2374
2405
|
*/
|
|
2375
|
-
indexExists(indexes: string | string[], options?:
|
|
2406
|
+
indexExists(indexes: string | string[], options?: ListIndexesOptions): Promise<boolean>;
|
|
2376
2407
|
/**
|
|
2377
2408
|
* Retrieves this collections index info.
|
|
2378
2409
|
*
|
|
2379
2410
|
* @param options - Optional settings for the command
|
|
2380
2411
|
*/
|
|
2381
|
-
indexInformation(options
|
|
2412
|
+
indexInformation(options: IndexInformationOptions & {
|
|
2413
|
+
full: true;
|
|
2414
|
+
}): Promise<IndexDescriptionInfo[]>;
|
|
2415
|
+
indexInformation(options: IndexInformationOptions & {
|
|
2416
|
+
full?: false;
|
|
2417
|
+
}): Promise<IndexDescriptionCompact>;
|
|
2418
|
+
indexInformation(options: IndexInformationOptions): Promise<IndexDescriptionCompact | IndexDescriptionInfo[]>;
|
|
2419
|
+
indexInformation(): Promise<IndexDescriptionCompact>;
|
|
2382
2420
|
/**
|
|
2383
2421
|
* Gets an estimate of the count of documents in a collection using collection metadata.
|
|
2384
2422
|
* This will always run a count command on all server versions.
|
|
@@ -2437,7 +2475,14 @@ export declare class Collection<TSchema extends Document = Document> {
|
|
|
2437
2475
|
*
|
|
2438
2476
|
* @param options - Optional settings for the command
|
|
2439
2477
|
*/
|
|
2440
|
-
indexes(options
|
|
2478
|
+
indexes(options: IndexInformationOptions & {
|
|
2479
|
+
full?: true;
|
|
2480
|
+
}): Promise<IndexDescriptionInfo[]>;
|
|
2481
|
+
indexes(options: IndexInformationOptions & {
|
|
2482
|
+
full: false;
|
|
2483
|
+
}): Promise<IndexDescriptionCompact>;
|
|
2484
|
+
indexes(options: IndexInformationOptions): Promise<IndexDescriptionCompact | IndexDescriptionInfo[]>;
|
|
2485
|
+
indexes(options?: ListIndexesOptions): Promise<IndexDescriptionInfo[]>;
|
|
2441
2486
|
/**
|
|
2442
2487
|
* Find a document and delete it in one atomic operation. Requires a write lock for the duration of the operation.
|
|
2443
2488
|
*
|
|
@@ -2632,6 +2677,7 @@ export declare interface CollectionOptions extends BSONSerializeOptions, WriteCo
|
|
|
2632
2677
|
readConcern?: ReadConcernLike;
|
|
2633
2678
|
/** The preferred read preference (ReadPreference.PRIMARY, ReadPreference.PRIMARY_PREFERRED, ReadPreference.SECONDARY, ReadPreference.SECONDARY_PREFERRED, ReadPreference.NEAREST). */
|
|
2634
2679
|
readPreference?: ReadPreferenceLike;
|
|
2680
|
+
/* Excluded from this release type: timeoutMS */
|
|
2635
2681
|
}
|
|
2636
2682
|
|
|
2637
2683
|
/* Excluded from this release type: CollectionPrivate */
|
|
@@ -3121,6 +3167,8 @@ export declare const CURSOR_FLAGS: readonly ["tailable", "oplogReplay", "noCurso
|
|
|
3121
3167
|
/** @public */
|
|
3122
3168
|
export declare type CursorFlag = (typeof CURSOR_FLAGS)[number];
|
|
3123
3169
|
|
|
3170
|
+
/* Excluded from this release type: CursorResponse */
|
|
3171
|
+
|
|
3124
3172
|
/** @public */
|
|
3125
3173
|
export declare interface CursorStreamOptions {
|
|
3126
3174
|
/** A transformation method applied to each document emitted by the stream */
|
|
@@ -3335,7 +3383,14 @@ export declare class Db {
|
|
|
3335
3383
|
* @param name - The name of the collection.
|
|
3336
3384
|
* @param options - Optional settings for the command
|
|
3337
3385
|
*/
|
|
3338
|
-
indexInformation(name: string, options
|
|
3386
|
+
indexInformation(name: string, options: IndexInformationOptions & {
|
|
3387
|
+
full: true;
|
|
3388
|
+
}): Promise<IndexDescriptionInfo[]>;
|
|
3389
|
+
indexInformation(name: string, options: IndexInformationOptions & {
|
|
3390
|
+
full?: false;
|
|
3391
|
+
}): Promise<IndexDescriptionCompact>;
|
|
3392
|
+
indexInformation(name: string, options: IndexInformationOptions): Promise<IndexDescriptionCompact | IndexDescriptionInfo[]>;
|
|
3393
|
+
indexInformation(name: string): Promise<IndexDescriptionCompact>;
|
|
3339
3394
|
/**
|
|
3340
3395
|
* Create a new Change Stream, watching for new changes (insertions, updates,
|
|
3341
3396
|
* replacements, deletions, and invalidations) in this database. Will ignore all
|
|
@@ -3380,6 +3435,7 @@ export declare interface DbOptions extends BSONSerializeOptions, WriteConcernOpt
|
|
|
3380
3435
|
readConcern?: ReadConcern;
|
|
3381
3436
|
/** Should retry failed writes */
|
|
3382
3437
|
retryWrites?: boolean;
|
|
3438
|
+
/* Excluded from this release type: timeoutMS */
|
|
3383
3439
|
}
|
|
3384
3440
|
|
|
3385
3441
|
/* Excluded from this release type: DbPrivate */
|
|
@@ -4001,6 +4057,7 @@ export declare interface GridFSBucketOptions extends WriteConcernOptions {
|
|
|
4001
4057
|
chunkSizeBytes?: number;
|
|
4002
4058
|
/** Read preference to be passed to read operations */
|
|
4003
4059
|
readPreference?: ReadPreference;
|
|
4060
|
+
/* Excluded from this release type: timeoutMS */
|
|
4004
4061
|
}
|
|
4005
4062
|
|
|
4006
4063
|
/* Excluded from this release type: GridFSBucketPrivate */
|
|
@@ -4057,6 +4114,7 @@ export declare interface GridFSBucketReadStreamOptions {
|
|
|
4057
4114
|
* to be returned by the stream. `end` is non-inclusive
|
|
4058
4115
|
*/
|
|
4059
4116
|
end?: number;
|
|
4117
|
+
/* Excluded from this release type: timeoutMS */
|
|
4060
4118
|
}
|
|
4061
4119
|
|
|
4062
4120
|
/** @public */
|
|
@@ -4156,6 +4214,7 @@ export declare interface GridFSBucketWriteStreamOptions extends WriteConcernOpti
|
|
|
4156
4214
|
* @deprecated Will be removed in the next major version. Add an aliases field to the metadata document instead.
|
|
4157
4215
|
*/
|
|
4158
4216
|
aliases?: string[];
|
|
4217
|
+
/* Excluded from this release type: timeoutMS */
|
|
4159
4218
|
}
|
|
4160
4219
|
|
|
4161
4220
|
/** @public */
|
|
@@ -4250,14 +4309,44 @@ export declare interface IndexDescription extends Pick<CreateIndexesOptions, 'ba
|
|
|
4250
4309
|
} | Map<string, IndexDirection>;
|
|
4251
4310
|
}
|
|
4252
4311
|
|
|
4312
|
+
/** @public */
|
|
4313
|
+
export declare type IndexDescriptionCompact = Record<string, [name: string, direction: IndexDirection][]>;
|
|
4314
|
+
|
|
4315
|
+
/**
|
|
4316
|
+
* @public
|
|
4317
|
+
* The index information returned by the listIndexes command. https://www.mongodb.com/docs/manual/reference/command/listIndexes/#mongodb-dbcommand-dbcmd.listIndexes
|
|
4318
|
+
*/
|
|
4319
|
+
export declare type IndexDescriptionInfo = Omit<IndexDescription, 'key' | 'version'> & {
|
|
4320
|
+
key: {
|
|
4321
|
+
[key: string]: IndexDirection;
|
|
4322
|
+
};
|
|
4323
|
+
v?: IndexDescription['version'];
|
|
4324
|
+
} & Document;
|
|
4325
|
+
|
|
4253
4326
|
/** @public */
|
|
4254
4327
|
export declare type IndexDirection = -1 | 1 | '2d' | '2dsphere' | 'text' | 'geoHaystack' | 'hashed' | number;
|
|
4255
4328
|
|
|
4256
4329
|
/** @public */
|
|
4257
|
-
export declare interface IndexInformationOptions {
|
|
4330
|
+
export declare interface IndexInformationOptions extends ListIndexesOptions {
|
|
4331
|
+
/**
|
|
4332
|
+
* When `true`, an array of index descriptions is returned.
|
|
4333
|
+
* When `false`, the driver returns an object that with keys corresponding to index names with values
|
|
4334
|
+
* corresponding to the entries of the indexes' key.
|
|
4335
|
+
*
|
|
4336
|
+
* For example, the given the following indexes:
|
|
4337
|
+
* ```
|
|
4338
|
+
* [ { name: 'a_1', key: { a: 1 } }, { name: 'b_1_c_1' , key: { b: 1, c: 1 } }]
|
|
4339
|
+
* ```
|
|
4340
|
+
*
|
|
4341
|
+
* When `full` is `true`, the above array is returned. When `full` is `false`, the following is returned:
|
|
4342
|
+
* ```
|
|
4343
|
+
* {
|
|
4344
|
+
* 'a_1': [['a', 1]],
|
|
4345
|
+
* 'b_1_c_1': [['b', 1], ['c', 1]],
|
|
4346
|
+
* }
|
|
4347
|
+
* ```
|
|
4348
|
+
*/
|
|
4258
4349
|
full?: boolean;
|
|
4259
|
-
readPreference?: ReadPreference;
|
|
4260
|
-
session?: ClientSession;
|
|
4261
4350
|
}
|
|
4262
4351
|
|
|
4263
4352
|
/** @public */
|
|
@@ -4322,6 +4411,8 @@ export declare type IsAny<Type, ResultIfAny, ResultIfNotAny> = true extends fals
|
|
|
4322
4411
|
/** @public */
|
|
4323
4412
|
export declare type Join<T extends unknown[], D extends string> = T extends [] ? '' : T extends [string | number] ? `${T[0]}` : T extends [string | number, ...infer R] ? `${T[0]}${D}${Join<R, D>}` : string;
|
|
4324
4413
|
|
|
4414
|
+
/* Excluded from this release type: JSTypeOf */
|
|
4415
|
+
|
|
4325
4416
|
/* Excluded from this release type: kBeforeHandshake */
|
|
4326
4417
|
|
|
4327
4418
|
/* Excluded from this release type: kBuiltOptions */
|
|
@@ -4504,8 +4595,6 @@ export declare interface KMSProviders {
|
|
|
4504
4595
|
|
|
4505
4596
|
/* Excluded from this release type: kProcessingWaitQueue */
|
|
4506
4597
|
|
|
4507
|
-
/* Excluded from this release type: kRoundTripTime */
|
|
4508
|
-
|
|
4509
4598
|
/* Excluded from this release type: kServer */
|
|
4510
4599
|
|
|
4511
4600
|
/* Excluded from this release type: kServer_2 */
|
|
@@ -4594,10 +4683,7 @@ export declare class ListIndexesCursor extends AbstractCursor {
|
|
|
4594
4683
|
}
|
|
4595
4684
|
|
|
4596
4685
|
/** @public */
|
|
4597
|
-
export declare
|
|
4598
|
-
/** The batchSize for the returned command cursor or if pre 2.8 the systems batch collection */
|
|
4599
|
-
batchSize?: number;
|
|
4600
|
-
}
|
|
4686
|
+
export declare type ListIndexesOptions = AbstractCursorOptions;
|
|
4601
4687
|
|
|
4602
4688
|
/** @public */
|
|
4603
4689
|
export declare class ListSearchIndexesCursor extends AggregationCursor<{
|
|
@@ -4607,7 +4693,7 @@ export declare class ListSearchIndexesCursor extends AggregationCursor<{
|
|
|
4607
4693
|
}
|
|
4608
4694
|
|
|
4609
4695
|
/** @public */
|
|
4610
|
-
export declare type ListSearchIndexesOptions = AggregateOptions
|
|
4696
|
+
export declare type ListSearchIndexesOptions = Omit<AggregateOptions, 'readConcern' | 'writeConcern'>;
|
|
4611
4697
|
|
|
4612
4698
|
/* Excluded from this release type: Log */
|
|
4613
4699
|
|
|
@@ -4694,7 +4780,9 @@ export declare class MongoAWSError extends MongoRuntimeError {
|
|
|
4694
4780
|
*
|
|
4695
4781
|
* @public
|
|
4696
4782
|
**/
|
|
4697
|
-
constructor(message: string
|
|
4783
|
+
constructor(message: string, options?: {
|
|
4784
|
+
cause?: Error;
|
|
4785
|
+
});
|
|
4698
4786
|
get name(): string;
|
|
4699
4787
|
}
|
|
4700
4788
|
|
|
@@ -5339,6 +5427,10 @@ export declare class MongoDBNamespace {
|
|
|
5339
5427
|
static fromString(namespace?: string): MongoDBNamespace;
|
|
5340
5428
|
}
|
|
5341
5429
|
|
|
5430
|
+
/* Excluded from this release type: MongoDBResponse */
|
|
5431
|
+
|
|
5432
|
+
/* Excluded from this release type: MongoDBResponseConstructor */
|
|
5433
|
+
|
|
5342
5434
|
/**
|
|
5343
5435
|
* An error generated when the driver fails to decompress
|
|
5344
5436
|
* data received from the server.
|
|
@@ -5604,6 +5696,9 @@ export declare class MongoMissingCredentialsError extends MongoAPIError {
|
|
|
5604
5696
|
* @category Error
|
|
5605
5697
|
*/
|
|
5606
5698
|
export declare class MongoMissingDependencyError extends MongoAPIError {
|
|
5699
|
+
dependencyName: string;
|
|
5700
|
+
/** @remarks This property is assigned in the `Error` constructor. */
|
|
5701
|
+
cause: Error;
|
|
5607
5702
|
/**
|
|
5608
5703
|
* **Do not use this constructor!**
|
|
5609
5704
|
*
|
|
@@ -5615,8 +5710,9 @@ export declare class MongoMissingDependencyError extends MongoAPIError {
|
|
|
5615
5710
|
*
|
|
5616
5711
|
* @public
|
|
5617
5712
|
**/
|
|
5618
|
-
constructor(message: string, options
|
|
5619
|
-
cause
|
|
5713
|
+
constructor(message: string, options: {
|
|
5714
|
+
cause: Error;
|
|
5715
|
+
dependencyName: string;
|
|
5620
5716
|
});
|
|
5621
5717
|
get name(): string;
|
|
5622
5718
|
}
|
|
@@ -5784,6 +5880,7 @@ export declare interface MongoOptions extends Required<Pick<MongoClientOptions,
|
|
|
5784
5880
|
/* Excluded from this release type: __index */
|
|
5785
5881
|
/* Excluded from this release type: mongoLoggerOptions */
|
|
5786
5882
|
/* Excluded from this release type: mongodbLogPath */
|
|
5883
|
+
/* Excluded from this release type: timeoutMS */
|
|
5787
5884
|
}
|
|
5788
5885
|
|
|
5789
5886
|
/**
|
|
@@ -6155,11 +6252,13 @@ export declare type OIDCRefreshFunction = (info: IdPServerInfo, context: OIDCCal
|
|
|
6155
6252
|
*/
|
|
6156
6253
|
export declare type OIDCRequestFunction = (info: IdPServerInfo, context: OIDCCallbackContext) => Promise<IdPServerResponse>;
|
|
6157
6254
|
|
|
6255
|
+
/* Excluded from this release type: OnDemandDocument */
|
|
6256
|
+
|
|
6158
6257
|
/** @public */
|
|
6159
6258
|
export declare type OneOrMore<T> = T | ReadonlyArray<T>;
|
|
6160
6259
|
|
|
6161
6260
|
/** @public */
|
|
6162
|
-
export declare type OnlyFieldsOfType<TSchema, FieldType = any, AssignableType = FieldType> = IsAny<TSchema[keyof TSchema], Record<string, FieldType>, AcceptedFields<TSchema, FieldType, AssignableType> & NotAcceptedFields<TSchema, FieldType> & Record<string, AssignableType>>;
|
|
6261
|
+
export declare type OnlyFieldsOfType<TSchema, FieldType = any, AssignableType = FieldType> = IsAny<TSchema[keyof TSchema], AssignableType extends FieldType ? Record<string, FieldType> : Record<string, AssignableType>, AcceptedFields<TSchema, FieldType, AssignableType> & NotAcceptedFields<TSchema, FieldType> & Record<string, AssignableType>>;
|
|
6163
6262
|
|
|
6164
6263
|
/* Excluded from this release type: OpCompressedRequest */
|
|
6165
6264
|
|
|
@@ -6172,6 +6271,7 @@ export declare interface OperationOptions extends BSONSerializeOptions {
|
|
|
6172
6271
|
readPreference?: ReadPreferenceLike;
|
|
6173
6272
|
/* Excluded from this release type: bypassPinningCheck */
|
|
6174
6273
|
omitReadPreference?: boolean;
|
|
6274
|
+
/* Excluded from this release type: timeoutMS */
|
|
6175
6275
|
}
|
|
6176
6276
|
|
|
6177
6277
|
/* Excluded from this release type: OperationParent */
|
|
@@ -6193,9 +6293,7 @@ export declare type OperationTime = Timestamp;
|
|
|
6193
6293
|
|
|
6194
6294
|
/* Excluded from this release type: OpQueryRequest */
|
|
6195
6295
|
|
|
6196
|
-
/* Excluded from this release type:
|
|
6197
|
-
|
|
6198
|
-
/* Excluded from this release type: OpResponseOptions */
|
|
6296
|
+
/* Excluded from this release type: OpReply */
|
|
6199
6297
|
|
|
6200
6298
|
/**
|
|
6201
6299
|
* Add an optional _id field to an object shaped type
|
|
@@ -6535,6 +6633,8 @@ export declare interface RootFilterOperators<TSchema> extends Document {
|
|
|
6535
6633
|
|
|
6536
6634
|
/* Excluded from this release type: RTTPingerOptions */
|
|
6537
6635
|
|
|
6636
|
+
/* Excluded from this release type: RTTSampler */
|
|
6637
|
+
|
|
6538
6638
|
/** @public */
|
|
6539
6639
|
export declare class RunCommandCursor extends AbstractCursor {
|
|
6540
6640
|
readonly command: Readonly<Record<string, any>>;
|
|
@@ -6598,11 +6698,13 @@ export declare type SchemaMember<T, V> = {
|
|
|
6598
6698
|
/**
|
|
6599
6699
|
* @public
|
|
6600
6700
|
*/
|
|
6601
|
-
export declare interface SearchIndexDescription {
|
|
6701
|
+
export declare interface SearchIndexDescription extends Document {
|
|
6602
6702
|
/** The name of the index. */
|
|
6603
6703
|
name?: string;
|
|
6604
6704
|
/** The index definition. */
|
|
6605
6705
|
definition: Document;
|
|
6706
|
+
/** The type of the index. Currently `search` or `vectorSearch` are supported. */
|
|
6707
|
+
type?: string;
|
|
6606
6708
|
}
|
|
6607
6709
|
|
|
6608
6710
|
/** @public */
|
|
@@ -6613,6 +6715,7 @@ export declare interface SelectServerOptions {
|
|
|
6613
6715
|
session?: ClientSession;
|
|
6614
6716
|
operationName: string;
|
|
6615
6717
|
previousServer?: ServerDescription;
|
|
6718
|
+
/* Excluded from this release type: timeout */
|
|
6616
6719
|
}
|
|
6617
6720
|
|
|
6618
6721
|
export { serialize }
|
|
@@ -6700,6 +6803,8 @@ export declare class ServerDescription {
|
|
|
6700
6803
|
minWireVersion: number;
|
|
6701
6804
|
maxWireVersion: number;
|
|
6702
6805
|
roundTripTime: number;
|
|
6806
|
+
/** The minimum measurement of the last 10 measurements of roundTripTime that have been collected */
|
|
6807
|
+
minRoundTripTime: number;
|
|
6703
6808
|
lastUpdateTime: number;
|
|
6704
6809
|
lastWriteDate: number;
|
|
6705
6810
|
me: string | null;
|
|
@@ -7036,7 +7141,7 @@ export declare type TagSet = {
|
|
|
7036
7141
|
[key: string]: string;
|
|
7037
7142
|
};
|
|
7038
7143
|
|
|
7039
|
-
/* Excluded from this release type:
|
|
7144
|
+
/* Excluded from this release type: Timeout */
|
|
7040
7145
|
|
|
7041
7146
|
/* Excluded from this release type: TimerQueue */
|
|
7042
7147
|
|
|
@@ -7097,7 +7202,7 @@ export declare class TopologyDescription {
|
|
|
7097
7202
|
constructor(topologyType: TopologyType, serverDescriptions?: Map<string, ServerDescription> | null, setName?: string | null, maxSetVersion?: number | null, maxElectionId?: ObjectId | null, commonWireVersion?: number | null, options?: TopologyDescriptionOptions | null);
|
|
7098
7203
|
/* Excluded from this release type: updateFromSrvPollingEvent */
|
|
7099
7204
|
/* Excluded from this release type: update */
|
|
7100
|
-
get error():
|
|
7205
|
+
get error(): MongoError | null;
|
|
7101
7206
|
/**
|
|
7102
7207
|
* Determines if the topology description has any known servers
|
|
7103
7208
|
*/
|
|
@@ -7107,6 +7212,13 @@ export declare class TopologyDescription {
|
|
|
7107
7212
|
*/
|
|
7108
7213
|
get hasDataBearingServers(): boolean;
|
|
7109
7214
|
/* Excluded from this release type: hasServer */
|
|
7215
|
+
/**
|
|
7216
|
+
* Returns a JSON-serializable representation of the TopologyDescription. This is primarily
|
|
7217
|
+
* intended for use with JSON.stringify().
|
|
7218
|
+
*
|
|
7219
|
+
* This method will not throw.
|
|
7220
|
+
*/
|
|
7221
|
+
toJSON(): Document;
|
|
7110
7222
|
}
|
|
7111
7223
|
|
|
7112
7224
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mongodb",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.6.0-dev.20240504.sha.2609953",
|
|
4
4
|
"description": "The official MongoDB driver for Node.js",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"files": [
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"@mongodb-js/saslprep": "^1.1.5",
|
|
29
|
-
"bson": "^6.
|
|
29
|
+
"bson": "^6.7.0",
|
|
30
30
|
"mongodb-connection-string-url": "^3.0.0"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
@@ -65,19 +65,19 @@
|
|
|
65
65
|
"@aws-sdk/credential-providers": "^3.515.0",
|
|
66
66
|
"@iarna/toml": "^2.2.5",
|
|
67
67
|
"@istanbuljs/nyc-config-typescript": "^1.0.2",
|
|
68
|
-
"@microsoft/api-extractor": "^7.
|
|
68
|
+
"@microsoft/api-extractor": "^7.43.1",
|
|
69
69
|
"@microsoft/tsdoc-config": "^0.16.2",
|
|
70
70
|
"@mongodb-js/zstd": "^1.2.0",
|
|
71
|
-
"@octokit/core": "^
|
|
72
|
-
"@types/chai": "^4.3.
|
|
71
|
+
"@octokit/core": "^6.1.2",
|
|
72
|
+
"@types/chai": "^4.3.14",
|
|
73
73
|
"@types/chai-subset": "^1.3.5",
|
|
74
74
|
"@types/express": "^4.17.21",
|
|
75
75
|
"@types/kerberos": "^1.1.5",
|
|
76
76
|
"@types/mocha": "^10.0.6",
|
|
77
|
-
"@types/node": "^20.
|
|
77
|
+
"@types/node": "^20.12.7",
|
|
78
78
|
"@types/saslprep": "^1.0.3",
|
|
79
|
-
"@types/semver": "^7.5.
|
|
80
|
-
"@types/sinon": "^
|
|
79
|
+
"@types/semver": "^7.5.8",
|
|
80
|
+
"@types/sinon": "^17.0.3",
|
|
81
81
|
"@types/sinon-chai": "^3.2.12",
|
|
82
82
|
"@types/whatwg-url": "^11.0.4",
|
|
83
83
|
"@typescript-eslint/eslint-plugin": "^5.62.0",
|
|
@@ -87,28 +87,30 @@
|
|
|
87
87
|
"chalk": "^4.1.2",
|
|
88
88
|
"eslint": "^8.56.0",
|
|
89
89
|
"eslint-config-prettier": "^8.10.0",
|
|
90
|
+
"eslint-plugin-github": "^4.10.2",
|
|
90
91
|
"eslint-plugin-import": "^2.29.1",
|
|
92
|
+
"eslint-plugin-mocha": "^10.4.1",
|
|
91
93
|
"eslint-plugin-prettier": "^4.2.1",
|
|
92
94
|
"eslint-plugin-simple-import-sort": "^10.0.0",
|
|
93
95
|
"eslint-plugin-tsdoc": "^0.2.17",
|
|
94
96
|
"eslint-plugin-unused-imports": "^2.0.0",
|
|
95
|
-
"express": "^4.
|
|
97
|
+
"express": "^4.19.2",
|
|
96
98
|
"gcp-metadata": "^5.3.0",
|
|
97
99
|
"js-yaml": "^4.1.0",
|
|
98
|
-
"mocha": "^10.
|
|
100
|
+
"mocha": "^10.4.0",
|
|
99
101
|
"mocha-sinon": "^2.1.2",
|
|
100
102
|
"mongodb-client-encryption": "^6.0.0",
|
|
101
103
|
"mongodb-legacy": "^6.0.1",
|
|
102
104
|
"nyc": "^15.1.0",
|
|
103
105
|
"prettier": "^2.8.8",
|
|
104
106
|
"semver": "^7.6.0",
|
|
105
|
-
"sinon": "^
|
|
107
|
+
"sinon": "^17.0.1",
|
|
106
108
|
"sinon-chai": "^3.7.0",
|
|
107
109
|
"snappy": "^7.2.2",
|
|
108
110
|
"socks": "^2.8.1",
|
|
109
111
|
"source-map-support": "^0.5.21",
|
|
110
112
|
"ts-node": "^10.9.2",
|
|
111
|
-
"tsd": "^0.
|
|
113
|
+
"tsd": "^0.31.0",
|
|
112
114
|
"typescript": "5.0",
|
|
113
115
|
"typescript-cached-transpile": "^0.0.6",
|
|
114
116
|
"v8-heapsnapshot": "^1.3.1",
|
|
@@ -143,7 +145,7 @@
|
|
|
143
145
|
"check:test": "mocha --config test/mocha_mongodb.json test/integration",
|
|
144
146
|
"check:unit": "mocha test/unit",
|
|
145
147
|
"check:ts": "node ./node_modules/typescript/bin/tsc -v && node ./node_modules/typescript/bin/tsc --noEmit",
|
|
146
|
-
"check:atlas": "mocha --config test/manual/mocharc.json test/manual/atlas_connectivity.test.
|
|
148
|
+
"check:atlas": "mocha --config test/manual/mocharc.json test/manual/atlas_connectivity.test.ts",
|
|
147
149
|
"check:drivers-atlas-testing": "mocha --config test/mocha_mongodb.json test/atlas/drivers_atlas_testing.test.ts",
|
|
148
150
|
"check:adl": "mocha --config test/mocha_mongodb.json test/manual/atlas-data-lake-testing",
|
|
149
151
|
"check:aws": "nyc mocha --config test/mocha_mongodb.json test/integration/auth/mongodb_aws.test.ts",
|
|
@@ -156,6 +158,7 @@
|
|
|
156
158
|
"check:socks5": "mocha --config test/manual/mocharc.json test/manual/socks5.test.ts",
|
|
157
159
|
"check:csfle": "mocha --config test/mocha_mongodb.json test/integration/client-side-encryption",
|
|
158
160
|
"check:snappy": "mocha test/unit/assorted/snappy.test.js",
|
|
161
|
+
"check:x509": "mocha test/manual/x509_auth.test.ts",
|
|
159
162
|
"fix:eslint": "npm run check:eslint -- --fix",
|
|
160
163
|
"prepare": "node etc/prepare.js",
|
|
161
164
|
"preview:docs": "ts-node etc/docs/preview.ts",
|
|
@@ -172,4 +175,4 @@
|
|
|
172
175
|
"moduleResolution": "node"
|
|
173
176
|
}
|
|
174
177
|
}
|
|
175
|
-
}
|
|
178
|
+
}
|
package/src/admin.ts
CHANGED
|
@@ -73,7 +73,7 @@ export class Admin {
|
|
|
73
73
|
* @param options - Optional settings for the command
|
|
74
74
|
*/
|
|
75
75
|
async command(command: Document, options?: RunCommandOptions): Promise<Document> {
|
|
76
|
-
return executeOperation(
|
|
76
|
+
return await executeOperation(
|
|
77
77
|
this.s.db.client,
|
|
78
78
|
new RunAdminCommandOperation(command, {
|
|
79
79
|
...resolveBSONOptions(options),
|
|
@@ -89,7 +89,7 @@ export class Admin {
|
|
|
89
89
|
* @param options - Optional settings for the command
|
|
90
90
|
*/
|
|
91
91
|
async buildInfo(options?: CommandOperationOptions): Promise<Document> {
|
|
92
|
-
return this.command({ buildinfo: 1 }, options);
|
|
92
|
+
return await this.command({ buildinfo: 1 }, options);
|
|
93
93
|
}
|
|
94
94
|
|
|
95
95
|
/**
|
|
@@ -98,7 +98,7 @@ export class Admin {
|
|
|
98
98
|
* @param options - Optional settings for the command
|
|
99
99
|
*/
|
|
100
100
|
async serverInfo(options?: CommandOperationOptions): Promise<Document> {
|
|
101
|
-
return this.command({ buildinfo: 1 }, options);
|
|
101
|
+
return await this.command({ buildinfo: 1 }, options);
|
|
102
102
|
}
|
|
103
103
|
|
|
104
104
|
/**
|
|
@@ -107,7 +107,7 @@ export class Admin {
|
|
|
107
107
|
* @param options - Optional settings for the command
|
|
108
108
|
*/
|
|
109
109
|
async serverStatus(options?: CommandOperationOptions): Promise<Document> {
|
|
110
|
-
return this.command({ serverStatus: 1 }, options);
|
|
110
|
+
return await this.command({ serverStatus: 1 }, options);
|
|
111
111
|
}
|
|
112
112
|
|
|
113
113
|
/**
|
|
@@ -116,7 +116,7 @@ export class Admin {
|
|
|
116
116
|
* @param options - Optional settings for the command
|
|
117
117
|
*/
|
|
118
118
|
async ping(options?: CommandOperationOptions): Promise<Document> {
|
|
119
|
-
return this.command({ ping: 1 }, options);
|
|
119
|
+
return await this.command({ ping: 1 }, options);
|
|
120
120
|
}
|
|
121
121
|
|
|
122
122
|
/**
|
|
@@ -126,7 +126,7 @@ export class Admin {
|
|
|
126
126
|
* @param options - Optional settings for the command
|
|
127
127
|
*/
|
|
128
128
|
async removeUser(username: string, options?: RemoveUserOptions): Promise<boolean> {
|
|
129
|
-
return executeOperation(
|
|
129
|
+
return await executeOperation(
|
|
130
130
|
this.s.db.client,
|
|
131
131
|
new RemoveUserOperation(this.s.db, username, { dbName: 'admin', ...options })
|
|
132
132
|
);
|
|
@@ -142,7 +142,7 @@ export class Admin {
|
|
|
142
142
|
collectionName: string,
|
|
143
143
|
options: ValidateCollectionOptions = {}
|
|
144
144
|
): Promise<Document> {
|
|
145
|
-
return executeOperation(
|
|
145
|
+
return await executeOperation(
|
|
146
146
|
this.s.db.client,
|
|
147
147
|
new ValidateCollectionOperation(this, collectionName, options)
|
|
148
148
|
);
|
|
@@ -154,7 +154,7 @@ export class Admin {
|
|
|
154
154
|
* @param options - Optional settings for the command
|
|
155
155
|
*/
|
|
156
156
|
async listDatabases(options?: ListDatabasesOptions): Promise<ListDatabasesResult> {
|
|
157
|
-
return executeOperation(this.s.db.client, new ListDatabasesOperation(this.s.db, options));
|
|
157
|
+
return await executeOperation(this.s.db.client, new ListDatabasesOperation(this.s.db, options));
|
|
158
158
|
}
|
|
159
159
|
|
|
160
160
|
/**
|
|
@@ -163,6 +163,6 @@ export class Admin {
|
|
|
163
163
|
* @param options - Optional settings for the command
|
|
164
164
|
*/
|
|
165
165
|
async replSetGetStatus(options?: CommandOperationOptions): Promise<Document> {
|
|
166
|
-
return this.command({ replSetGetStatus: 1 }, options);
|
|
166
|
+
return await this.command({ replSetGetStatus: 1 }, options);
|
|
167
167
|
}
|
|
168
168
|
}
|