mongodb 6.8.0-dev.20240905.sha.65e0e15c → 6.8.1
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 +1 -14
- package/lib/bson.js +13 -4
- package/lib/bson.js.map +1 -1
- package/lib/bulk/common.js +21 -16
- package/lib/bulk/common.js.map +1 -1
- package/lib/bulk/ordered.js.map +1 -1
- package/lib/bulk/unordered.js.map +1 -1
- package/lib/change_stream.js +8 -10
- package/lib/change_stream.js.map +1 -1
- package/lib/client-side-encryption/auto_encrypter.js +3 -14
- package/lib/client-side-encryption/auto_encrypter.js.map +1 -1
- package/lib/client-side-encryption/client_encryption.js +7 -25
- package/lib/client-side-encryption/client_encryption.js.map +1 -1
- package/lib/client-side-encryption/crypto_callbacks.js +6 -6
- package/lib/client-side-encryption/crypto_callbacks.js.map +1 -1
- package/lib/client-side-encryption/mongocryptd_manager.js +5 -9
- package/lib/client-side-encryption/mongocryptd_manager.js.map +1 -1
- package/lib/client-side-encryption/providers/aws.js +2 -1
- package/lib/client-side-encryption/providers/aws.js.map +1 -1
- package/lib/client-side-encryption/providers/azure.js +5 -5
- package/lib/client-side-encryption/providers/azure.js.map +1 -1
- package/lib/client-side-encryption/providers/gcp.js +2 -1
- package/lib/client-side-encryption/providers/gcp.js.map +1 -1
- package/lib/client-side-encryption/providers/index.js +3 -2
- package/lib/client-side-encryption/providers/index.js.map +1 -1
- package/lib/client-side-encryption/state_machine.js +4 -9
- package/lib/client-side-encryption/state_machine.js.map +1 -1
- package/lib/cmap/auth/auth_provider.js.map +1 -1
- package/lib/cmap/auth/aws_temporary_credentials.js.map +1 -1
- package/lib/cmap/auth/gssapi.js +4 -4
- package/lib/cmap/auth/gssapi.js.map +1 -1
- package/lib/cmap/auth/mongo_credentials.js.map +1 -1
- package/lib/cmap/auth/mongocr.js.map +1 -1
- package/lib/cmap/auth/mongodb_aws.js.map +1 -1
- package/lib/cmap/auth/mongodb_oidc/automated_callback_workflow.js.map +1 -1
- package/lib/cmap/auth/mongodb_oidc/azure_machine_workflow.js.map +1 -1
- package/lib/cmap/auth/mongodb_oidc/callback_workflow.js +2 -0
- package/lib/cmap/auth/mongodb_oidc/callback_workflow.js.map +1 -1
- package/lib/cmap/auth/mongodb_oidc/command_builders.js +3 -2
- package/lib/cmap/auth/mongodb_oidc/command_builders.js.map +1 -1
- package/lib/cmap/auth/mongodb_oidc/gcp_machine_workflow.js.map +1 -1
- package/lib/cmap/auth/mongodb_oidc/human_callback_workflow.js.map +1 -1
- package/lib/cmap/auth/mongodb_oidc/machine_workflow.js +2 -0
- package/lib/cmap/auth/mongodb_oidc/machine_workflow.js.map +1 -1
- package/lib/cmap/auth/mongodb_oidc/token_cache.js.map +1 -1
- package/lib/cmap/auth/mongodb_oidc/token_machine_workflow.js.map +1 -1
- package/lib/cmap/auth/mongodb_oidc.js.map +1 -1
- package/lib/cmap/auth/plain.js.map +1 -1
- package/lib/cmap/auth/scram.js.map +1 -1
- package/lib/cmap/auth/x509.js.map +1 -1
- package/lib/cmap/command_monitoring_events.js.map +1 -1
- package/lib/cmap/commands.js +5 -62
- package/lib/cmap/commands.js.map +1 -1
- package/lib/cmap/connect.js +7 -9
- package/lib/cmap/connect.js.map +1 -1
- package/lib/cmap/connection.js +5 -3
- package/lib/cmap/connection.js.map +1 -1
- package/lib/cmap/connection_pool.js +9 -11
- package/lib/cmap/connection_pool.js.map +1 -1
- package/lib/cmap/connection_pool_events.js +3 -7
- package/lib/cmap/connection_pool_events.js.map +1 -1
- package/lib/cmap/handshake/client_metadata.js +5 -5
- package/lib/cmap/handshake/client_metadata.js.map +1 -1
- package/lib/cmap/metrics.js +1 -1
- package/lib/cmap/metrics.js.map +1 -1
- package/lib/cmap/stream_description.js.map +1 -1
- package/lib/cmap/wire_protocol/compression.js +5 -5
- package/lib/cmap/wire_protocol/compression.js.map +1 -1
- package/lib/cmap/wire_protocol/constants.js +2 -2
- package/lib/cmap/wire_protocol/on_data.js +2 -1
- package/lib/cmap/wire_protocol/on_data.js.map +1 -1
- package/lib/cmap/wire_protocol/on_demand/document.js +3 -12
- package/lib/cmap/wire_protocol/on_demand/document.js.map +1 -1
- package/lib/cmap/wire_protocol/responses.js +15 -6
- package/lib/cmap/wire_protocol/responses.js.map +1 -1
- package/lib/cmap/wire_protocol/shared.js +3 -2
- package/lib/cmap/wire_protocol/shared.js.map +1 -1
- package/lib/collection.js.map +1 -1
- package/lib/connection_string.js +5 -10
- package/lib/connection_string.js.map +1 -1
- package/lib/constants.js +0 -1
- package/lib/constants.js.map +1 -1
- package/lib/cursor/abstract_cursor.js +16 -25
- package/lib/cursor/abstract_cursor.js.map +1 -1
- package/lib/cursor/aggregation_cursor.js +2 -2
- package/lib/cursor/aggregation_cursor.js.map +1 -1
- package/lib/cursor/change_stream_cursor.js.map +1 -1
- package/lib/cursor/find_cursor.js +4 -4
- package/lib/cursor/find_cursor.js.map +1 -1
- package/lib/db.js +1 -1
- package/lib/db.js.map +1 -1
- package/lib/deps.js +8 -16
- package/lib/deps.js.map +1 -1
- package/lib/encrypter.js.map +1 -1
- package/lib/error.js +14 -19
- package/lib/error.js.map +1 -1
- package/lib/explain.js.map +1 -1
- package/lib/gridfs/download.js +4 -1
- package/lib/gridfs/download.js.map +1 -1
- package/lib/gridfs/index.js +1 -1
- package/lib/gridfs/index.js.map +1 -1
- package/lib/gridfs/upload.js +4 -0
- package/lib/gridfs/upload.js.map +1 -1
- package/lib/index.js +2 -4
- package/lib/index.js.map +1 -1
- package/lib/mongo_client.js +1 -15
- package/lib/mongo_client.js.map +1 -1
- package/lib/mongo_client_auth_providers.js.map +1 -1
- package/lib/mongo_logger.js +8 -8
- package/lib/mongo_logger.js.map +1 -1
- package/lib/mongo_types.js +0 -1
- package/lib/mongo_types.js.map +1 -1
- package/lib/operations/aggregate.js +0 -1
- package/lib/operations/aggregate.js.map +1 -1
- package/lib/operations/bulk_write.js.map +1 -1
- package/lib/operations/collections.js.map +1 -1
- package/lib/operations/command.js +1 -1
- package/lib/operations/command.js.map +1 -1
- package/lib/operations/count.js.map +1 -1
- package/lib/operations/create_collection.js.map +1 -1
- package/lib/operations/delete.js +2 -2
- package/lib/operations/delete.js.map +1 -1
- package/lib/operations/distinct.js.map +1 -1
- package/lib/operations/drop.js.map +1 -1
- package/lib/operations/estimated_document_count.js.map +1 -1
- package/lib/operations/execute_operation.js +109 -111
- package/lib/operations/execute_operation.js.map +1 -1
- package/lib/operations/find.js.map +1 -1
- package/lib/operations/find_and_modify.js +8 -2
- package/lib/operations/find_and_modify.js.map +1 -1
- package/lib/operations/get_more.js.map +1 -1
- package/lib/operations/indexes.js.map +1 -1
- package/lib/operations/insert.js.map +1 -1
- package/lib/operations/is_capped.js.map +1 -1
- package/lib/operations/kill_cursors.js.map +1 -1
- package/lib/operations/list_collections.js.map +1 -1
- package/lib/operations/list_databases.js.map +1 -1
- package/lib/operations/operation.js +5 -5
- package/lib/operations/operation.js.map +1 -1
- package/lib/operations/options_operation.js.map +1 -1
- package/lib/operations/profiling_level.js.map +1 -1
- package/lib/operations/search_indexes/drop.js.map +1 -1
- package/lib/operations/set_profiling_level.js.map +1 -1
- package/lib/operations/stats.js.map +1 -1
- package/lib/operations/update.js +2 -2
- package/lib/operations/update.js.map +1 -1
- package/lib/operations/validate_collection.js.map +1 -1
- package/lib/read_concern.js.map +1 -1
- package/lib/read_preference.js +1 -1
- package/lib/read_preference.js.map +1 -1
- package/lib/sdam/common.js +3 -3
- package/lib/sdam/common.js.map +1 -1
- package/lib/sdam/monitor.js +5 -1
- package/lib/sdam/monitor.js.map +1 -1
- package/lib/sdam/server.js +2 -2
- package/lib/sdam/server.js.map +1 -1
- package/lib/sdam/server_description.js +3 -3
- package/lib/sdam/server_description.js.map +1 -1
- package/lib/sdam/server_selection.js +5 -5
- package/lib/sdam/server_selection.js.map +1 -1
- package/lib/sdam/srv_polling.js +3 -2
- package/lib/sdam/srv_polling.js.map +1 -1
- package/lib/sdam/topology.js +1 -1
- package/lib/sdam/topology.js.map +1 -1
- package/lib/sdam/topology_description.js.map +1 -1
- package/lib/sessions.js +218 -221
- package/lib/sessions.js.map +1 -1
- package/lib/sort.js +3 -2
- package/lib/sort.js.map +1 -1
- package/lib/timeout.js +1 -0
- package/lib/timeout.js.map +1 -1
- package/lib/transactions.js +2 -2
- package/lib/transactions.js.map +1 -1
- package/lib/utils.js +51 -49
- package/lib/utils.js.map +1 -1
- package/lib/write_concern.js +2 -2
- package/lib/write_concern.js.map +1 -1
- package/mongodb.d.ts +143 -146
- package/package.json +28 -27
- package/src/bson.ts +13 -1
- package/src/bulk/common.ts +18 -18
- package/src/change_stream.ts +15 -33
- package/src/client-side-encryption/auto_encrypter.ts +82 -18
- package/src/client-side-encryption/client_encryption.ts +54 -51
- package/src/client-side-encryption/mongocryptd_manager.ts +6 -10
- package/src/client-side-encryption/state_machine.ts +6 -28
- package/src/cmap/auth/gssapi.ts +1 -1
- package/src/cmap/auth/mongodb_aws.ts +2 -2
- package/src/cmap/auth/mongodb_oidc/callback_workflow.ts +2 -2
- package/src/cmap/auth/mongodb_oidc/machine_workflow.ts +2 -2
- package/src/cmap/commands.ts +5 -70
- package/src/cmap/connect.ts +1 -3
- package/src/cmap/connection.ts +4 -3
- package/src/cmap/connection_pool.ts +9 -17
- package/src/cmap/connection_pool_events.ts +2 -34
- package/src/cmap/handshake/client_metadata.ts +1 -1
- package/src/cmap/wire_protocol/constants.ts +2 -2
- package/src/cmap/wire_protocol/on_demand/document.ts +14 -18
- package/src/cmap/wire_protocol/responses.ts +23 -5
- package/src/cmap/wire_protocol/shared.ts +2 -1
- package/src/collection.ts +15 -16
- package/src/connection_string.ts +2 -8
- package/src/constants.ts +0 -1
- package/src/cursor/abstract_cursor.ts +28 -42
- package/src/cursor/aggregation_cursor.ts +5 -7
- package/src/cursor/find_cursor.ts +1 -1
- package/src/deps.ts +1 -8
- package/src/error.ts +14 -33
- package/src/gridfs/download.ts +4 -28
- package/src/gridfs/upload.ts +6 -1
- package/src/index.ts +6 -6
- package/src/mongo_client.ts +3 -25
- package/src/mongo_logger.ts +3 -5
- package/src/mongo_types.ts +68 -69
- package/src/operations/aggregate.ts +1 -2
- package/src/operations/bulk_write.ts +2 -2
- package/src/operations/command.ts +1 -1
- package/src/operations/execute_operation.ts +131 -137
- package/src/operations/find_and_modify.ts +7 -2
- package/src/operations/insert.ts +4 -3
- package/src/operations/operation.ts +10 -7
- package/src/operations/search_indexes/drop.ts +1 -4
- package/src/sdam/monitor.ts +5 -3
- package/src/sdam/server.ts +1 -1
- package/src/sdam/server_description.ts +6 -5
- package/src/sdam/srv_polling.ts +2 -1
- package/src/sessions.ts +277 -291
- package/src/sort.ts +1 -1
- package/src/timeout.ts +1 -0
- package/src/transactions.ts +2 -1
- package/src/utils.ts +4 -9
- package/src/write_concern.ts +2 -2
- package/tsconfig.json +1 -2
- package/lib/beta.d.ts +0 -7900
- package/lib/beta.js +0 -21
- package/lib/beta.js.map +0 -1
- package/lib/operations/client_bulk_write/command_builder.js +0 -198
- package/lib/operations/client_bulk_write/command_builder.js.map +0 -1
- package/lib/operations/client_bulk_write/common.js +0 -3
- package/lib/operations/client_bulk_write/common.js.map +0 -1
- package/lib/resource_management.js +0 -58
- package/lib/resource_management.js.map +0 -1
- package/src/beta.ts +0 -22
- package/src/operations/client_bulk_write/command_builder.ts +0 -283
- package/src/operations/client_bulk_write/common.ts +0 -146
- package/src/resource_management.ts +0 -74
|
@@ -1,146 +0,0 @@
|
|
|
1
|
-
import { type Document } from '../../bson';
|
|
2
|
-
import type { Filter, OptionalId, UpdateFilter, WithoutId } from '../../mongo_types';
|
|
3
|
-
import type { CollationOptions, CommandOperationOptions } from '../../operations/command';
|
|
4
|
-
import type { Hint } from '../../operations/operation';
|
|
5
|
-
|
|
6
|
-
/** @public */
|
|
7
|
-
export interface ClientBulkWriteOptions extends CommandOperationOptions {
|
|
8
|
-
/**
|
|
9
|
-
* If true, when an insert fails, don't execute the remaining writes.
|
|
10
|
-
* If false, continue with remaining inserts when one fails.
|
|
11
|
-
* @defaultValue `true` - inserts are ordered by default
|
|
12
|
-
*/
|
|
13
|
-
ordered?: boolean;
|
|
14
|
-
/**
|
|
15
|
-
* Allow driver to bypass schema validation.
|
|
16
|
-
* @defaultValue `false` - documents will be validated by default
|
|
17
|
-
**/
|
|
18
|
-
bypassDocumentValidation?: boolean;
|
|
19
|
-
/** Map of parameter names and values that can be accessed using $$var (requires MongoDB 5.0). */
|
|
20
|
-
let?: Document;
|
|
21
|
-
/**
|
|
22
|
-
* Whether detailed results for each successful operation should be included in the returned
|
|
23
|
-
* BulkWriteResult.
|
|
24
|
-
*/
|
|
25
|
-
verboseResults?: boolean;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
/** @public */
|
|
29
|
-
export interface ClientWriteModel {
|
|
30
|
-
/** The namespace for the write. */
|
|
31
|
-
namespace: string;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
/** @public */
|
|
35
|
-
export interface ClientInsertOneModel extends ClientWriteModel {
|
|
36
|
-
name: 'insertOne';
|
|
37
|
-
/** The document to insert. */
|
|
38
|
-
document: OptionalId<Document>;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
/** @public */
|
|
42
|
-
export interface ClientDeleteOneModel extends ClientWriteModel {
|
|
43
|
-
name: 'deleteOne';
|
|
44
|
-
/**
|
|
45
|
-
* The filter used to determine if a document should be deleted.
|
|
46
|
-
* For a deleteOne operation, the first match is removed.
|
|
47
|
-
*/
|
|
48
|
-
filter: Filter<Document>;
|
|
49
|
-
/** Specifies a collation. */
|
|
50
|
-
collation?: CollationOptions;
|
|
51
|
-
/** The index to use. If specified, then the query system will only consider plans using the hinted index. */
|
|
52
|
-
hint?: Hint;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
/** @public */
|
|
56
|
-
export interface ClientDeleteManyModel extends ClientWriteModel {
|
|
57
|
-
name: 'deleteMany';
|
|
58
|
-
/**
|
|
59
|
-
* The filter used to determine if a document should be deleted.
|
|
60
|
-
* For a deleteMany operation, all matches are removed.
|
|
61
|
-
*/
|
|
62
|
-
filter: Filter<Document>;
|
|
63
|
-
/** Specifies a collation. */
|
|
64
|
-
collation?: CollationOptions;
|
|
65
|
-
/** The index to use. If specified, then the query system will only consider plans using the hinted index. */
|
|
66
|
-
hint?: Hint;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
/** @public */
|
|
70
|
-
export interface ClientReplaceOneModel extends ClientWriteModel {
|
|
71
|
-
name: 'replaceOne';
|
|
72
|
-
/**
|
|
73
|
-
* The filter used to determine if a document should be replaced.
|
|
74
|
-
* For a replaceOne operation, the first match is replaced.
|
|
75
|
-
*/
|
|
76
|
-
filter: Filter<Document>;
|
|
77
|
-
/** The document with which to replace the matched document. */
|
|
78
|
-
replacement: WithoutId<Document>;
|
|
79
|
-
/** Specifies a collation. */
|
|
80
|
-
collation?: CollationOptions;
|
|
81
|
-
/** The index to use. If specified, then the query system will only consider plans using the hinted index. */
|
|
82
|
-
hint?: Hint;
|
|
83
|
-
/** When true, creates a new document if no document matches the query. */
|
|
84
|
-
upsert?: boolean;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
/** @public */
|
|
88
|
-
export interface ClientUpdateOneModel extends ClientWriteModel {
|
|
89
|
-
name: 'updateOne';
|
|
90
|
-
/**
|
|
91
|
-
* The filter used to determine if a document should be updated.
|
|
92
|
-
* For an updateOne operation, the first match is updated.
|
|
93
|
-
*/
|
|
94
|
-
filter: Filter<Document>;
|
|
95
|
-
/**
|
|
96
|
-
* The modifications to apply. The value can be either:
|
|
97
|
-
* UpdateFilter<Document> - A document that contains update operator expressions,
|
|
98
|
-
* Document[] - an aggregation pipeline.
|
|
99
|
-
*/
|
|
100
|
-
update: UpdateFilter<Document> | Document[];
|
|
101
|
-
/** A set of filters specifying to which array elements an update should apply. */
|
|
102
|
-
arrayFilters?: Document[];
|
|
103
|
-
/** Specifies a collation. */
|
|
104
|
-
collation?: CollationOptions;
|
|
105
|
-
/** The index to use. If specified, then the query system will only consider plans using the hinted index. */
|
|
106
|
-
hint?: Hint;
|
|
107
|
-
/** When true, creates a new document if no document matches the query. */
|
|
108
|
-
upsert?: boolean;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
/** @public */
|
|
112
|
-
export interface ClientUpdateManyModel extends ClientWriteModel {
|
|
113
|
-
name: 'updateMany';
|
|
114
|
-
/**
|
|
115
|
-
* The filter used to determine if a document should be updated.
|
|
116
|
-
* For an updateMany operation, all matches are updated.
|
|
117
|
-
*/
|
|
118
|
-
filter: Filter<Document>;
|
|
119
|
-
/**
|
|
120
|
-
* The modifications to apply. The value can be either:
|
|
121
|
-
* UpdateFilter<Document> - A document that contains update operator expressions,
|
|
122
|
-
* Document[] - an aggregation pipeline.
|
|
123
|
-
*/
|
|
124
|
-
update: UpdateFilter<Document> | Document[];
|
|
125
|
-
/** A set of filters specifying to which array elements an update should apply. */
|
|
126
|
-
arrayFilters?: Document[];
|
|
127
|
-
/** Specifies a collation. */
|
|
128
|
-
collation?: CollationOptions;
|
|
129
|
-
/** The index to use. If specified, then the query system will only consider plans using the hinted index. */
|
|
130
|
-
hint?: Hint;
|
|
131
|
-
/** When true, creates a new document if no document matches the query. */
|
|
132
|
-
upsert?: boolean;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
/**
|
|
136
|
-
* Used to represent any of the client bulk write models that can be passed as an array
|
|
137
|
-
* to MongoClient#bulkWrite.
|
|
138
|
-
* @public
|
|
139
|
-
*/
|
|
140
|
-
export type AnyClientBulkWriteModel =
|
|
141
|
-
| ClientInsertOneModel
|
|
142
|
-
| ClientReplaceOneModel
|
|
143
|
-
| ClientUpdateOneModel
|
|
144
|
-
| ClientUpdateManyModel
|
|
145
|
-
| ClientDeleteOneModel
|
|
146
|
-
| ClientDeleteManyModel;
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @public
|
|
3
|
-
*/
|
|
4
|
-
export interface AsyncDisposable {
|
|
5
|
-
/**
|
|
6
|
-
* @beta
|
|
7
|
-
* @experimental
|
|
8
|
-
*/
|
|
9
|
-
[Symbol.asyncDispose](): Promise<void>;
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* @internal
|
|
13
|
-
*
|
|
14
|
-
* A method that wraps disposal semantics for a given resource in the class.
|
|
15
|
-
*/
|
|
16
|
-
asyncDispose(): Promise<void>;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
/** @internal */
|
|
20
|
-
export function configureResourceManagement(target: AsyncDisposable) {
|
|
21
|
-
Symbol.asyncDispose &&
|
|
22
|
-
Object.defineProperty(target, Symbol.asyncDispose, {
|
|
23
|
-
value: async function asyncDispose(this: AsyncDisposable) {
|
|
24
|
-
await this.asyncDispose();
|
|
25
|
-
},
|
|
26
|
-
enumerable: false,
|
|
27
|
-
configurable: true,
|
|
28
|
-
writable: true
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* @beta
|
|
34
|
-
* @experimental
|
|
35
|
-
*
|
|
36
|
-
* Attaches `Symbol.asyncDispose` methods to the MongoClient, Cursors, sessions and change streams
|
|
37
|
-
* if Symbol.asyncDispose is defined.
|
|
38
|
-
*
|
|
39
|
-
* It's usually not necessary to call this method - the driver attempts to attach these methods
|
|
40
|
-
* itself when its loaded. However, sometimes the driver may be loaded before `Symbol.asyncDispose`
|
|
41
|
-
* is defined, in which case it is necessary to call this method directly. This can happen if the
|
|
42
|
-
* application is polyfilling `Symbol.asyncDispose`.
|
|
43
|
-
*
|
|
44
|
-
* Example:
|
|
45
|
-
*
|
|
46
|
-
* ```typescript
|
|
47
|
-
* import { configureExplicitResourceManagement, MongoClient } from 'mongodb/lib/beta';
|
|
48
|
-
*
|
|
49
|
-
* Symbol.asyncDispose ??= Symbol('dispose');
|
|
50
|
-
* load();
|
|
51
|
-
*
|
|
52
|
-
* await using client = new MongoClient(...);
|
|
53
|
-
* ```
|
|
54
|
-
*/
|
|
55
|
-
export function configureExplicitResourceManagement() {
|
|
56
|
-
// We must import lazily here, because there's a circular dependency between the resource management
|
|
57
|
-
// file and each resources' file. We could move `configureResourceManagement` to a separate
|
|
58
|
-
// function, but keeping all resource-management related code together seemed preferable and I chose
|
|
59
|
-
// lazy requiring of resources instead.
|
|
60
|
-
|
|
61
|
-
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
62
|
-
const { MongoClient } = require('./mongo_client');
|
|
63
|
-
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
64
|
-
const { ClientSession } = require('./sessions');
|
|
65
|
-
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
66
|
-
const { AbstractCursor } = require('./cursor/abstract_cursor');
|
|
67
|
-
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
68
|
-
const { ChangeStream } = require('./change_stream');
|
|
69
|
-
|
|
70
|
-
configureResourceManagement(MongoClient.prototype);
|
|
71
|
-
configureResourceManagement(ClientSession.prototype);
|
|
72
|
-
configureResourceManagement(AbstractCursor.prototype);
|
|
73
|
-
configureResourceManagement(ChangeStream.prototype);
|
|
74
|
-
}
|