mongodb 4.2.1 → 4.4.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.
Files changed (266) hide show
  1. package/README.md +2 -2
  2. package/lib/admin.js +3 -3
  3. package/lib/admin.js.map +1 -1
  4. package/lib/bson.js +16 -14
  5. package/lib/bson.js.map +1 -1
  6. package/lib/bulk/common.js +7 -7
  7. package/lib/bulk/common.js.map +1 -1
  8. package/lib/bulk/ordered.js +1 -1
  9. package/lib/bulk/ordered.js.map +1 -1
  10. package/lib/bulk/unordered.js +1 -1
  11. package/lib/bulk/unordered.js.map +1 -1
  12. package/lib/change_stream.js +6 -6
  13. package/lib/change_stream.js.map +1 -1
  14. package/lib/cmap/auth/auth_provider.js.map +1 -1
  15. package/lib/cmap/auth/gssapi.js +52 -10
  16. package/lib/cmap/auth/gssapi.js.map +1 -1
  17. package/lib/cmap/auth/mongo_credentials.js +36 -27
  18. package/lib/cmap/auth/mongo_credentials.js.map +1 -1
  19. package/lib/cmap/auth/mongocr.js +2 -2
  20. package/lib/cmap/auth/mongocr.js.map +1 -1
  21. package/lib/cmap/auth/mongodb_aws.js +6 -6
  22. package/lib/cmap/auth/mongodb_aws.js.map +1 -1
  23. package/lib/cmap/auth/plain.js +1 -1
  24. package/lib/cmap/auth/plain.js.map +1 -1
  25. package/lib/cmap/auth/providers.js +21 -0
  26. package/lib/cmap/auth/providers.js.map +1 -0
  27. package/lib/cmap/auth/scram.js +4 -4
  28. package/lib/cmap/auth/scram.js.map +1 -1
  29. package/lib/cmap/auth/x509.js +1 -1
  30. package/lib/cmap/auth/x509.js.map +1 -1
  31. package/lib/cmap/command_monitoring_events.js +3 -2
  32. package/lib/cmap/command_monitoring_events.js.map +1 -1
  33. package/lib/cmap/commands.js +14 -8
  34. package/lib/cmap/commands.js.map +1 -1
  35. package/lib/cmap/connect.js +119 -37
  36. package/lib/cmap/connect.js.map +1 -1
  37. package/lib/cmap/connection.js +36 -35
  38. package/lib/cmap/connection.js.map +1 -1
  39. package/lib/cmap/connection_pool.js +19 -30
  40. package/lib/cmap/connection_pool.js.map +1 -1
  41. package/lib/cmap/message_stream.js +3 -3
  42. package/lib/cmap/message_stream.js.map +1 -1
  43. package/lib/cmap/stream_description.js +4 -4
  44. package/lib/cmap/stream_description.js.map +1 -1
  45. package/lib/cmap/wire_protocol/compression.js +2 -1
  46. package/lib/cmap/wire_protocol/compression.js.map +1 -1
  47. package/lib/cmap/wire_protocol/shared.js +4 -3
  48. package/lib/cmap/wire_protocol/shared.js.map +1 -1
  49. package/lib/collection.js +46 -47
  50. package/lib/collection.js.map +1 -1
  51. package/lib/connection_string.js +93 -54
  52. package/lib/connection_string.js.map +1 -1
  53. package/lib/constants.js +113 -1
  54. package/lib/constants.js.map +1 -1
  55. package/lib/cursor/abstract_cursor.js +5 -5
  56. package/lib/cursor/abstract_cursor.js.map +1 -1
  57. package/lib/cursor/aggregation_cursor.js +1 -1
  58. package/lib/cursor/aggregation_cursor.js.map +1 -1
  59. package/lib/cursor/find_cursor.js +2 -1
  60. package/lib/cursor/find_cursor.js.map +1 -1
  61. package/lib/db.js +23 -13
  62. package/lib/db.js.map +1 -1
  63. package/lib/deps.js +0 -1
  64. package/lib/deps.js.map +1 -1
  65. package/lib/encrypter.js +12 -4
  66. package/lib/encrypter.js.map +1 -1
  67. package/lib/error.js +47 -24
  68. package/lib/error.js.map +1 -1
  69. package/lib/gridfs/download.js +1 -1
  70. package/lib/gridfs/download.js.map +1 -1
  71. package/lib/gridfs/index.js +3 -3
  72. package/lib/gridfs/index.js.map +1 -1
  73. package/lib/gridfs/upload.js +3 -2
  74. package/lib/gridfs/upload.js.map +1 -1
  75. package/lib/index.js +83 -81
  76. package/lib/index.js.map +1 -1
  77. package/lib/logger.js +1 -1
  78. package/lib/logger.js.map +1 -1
  79. package/lib/mongo_client.js +5 -5
  80. package/lib/mongo_client.js.map +1 -1
  81. package/lib/mongo_types.js.map +1 -1
  82. package/lib/operations/add_user.js +3 -3
  83. package/lib/operations/add_user.js.map +1 -1
  84. package/lib/operations/aggregate.js +1 -1
  85. package/lib/operations/aggregate.js.map +1 -1
  86. package/lib/operations/bulk_write.js.map +1 -1
  87. package/lib/operations/collections.js +1 -1
  88. package/lib/operations/collections.js.map +1 -1
  89. package/lib/operations/command.js +5 -6
  90. package/lib/operations/command.js.map +1 -1
  91. package/lib/operations/common_functions.js.map +1 -1
  92. package/lib/operations/connect.js +4 -13
  93. package/lib/operations/connect.js.map +1 -1
  94. package/lib/operations/count.js +1 -1
  95. package/lib/operations/count.js.map +1 -1
  96. package/lib/operations/count_documents.js.map +1 -1
  97. package/lib/operations/create_collection.js +3 -2
  98. package/lib/operations/create_collection.js.map +1 -1
  99. package/lib/operations/delete.js +3 -3
  100. package/lib/operations/delete.js.map +1 -1
  101. package/lib/operations/distinct.js +3 -3
  102. package/lib/operations/distinct.js.map +1 -1
  103. package/lib/operations/drop.js +1 -1
  104. package/lib/operations/drop.js.map +1 -1
  105. package/lib/operations/estimated_document_count.js +2 -2
  106. package/lib/operations/estimated_document_count.js.map +1 -1
  107. package/lib/operations/eval.js +2 -2
  108. package/lib/operations/eval.js.map +1 -1
  109. package/lib/operations/execute_operation.js +5 -6
  110. package/lib/operations/execute_operation.js.map +1 -1
  111. package/lib/operations/find.js +5 -5
  112. package/lib/operations/find.js.map +1 -1
  113. package/lib/operations/find_and_modify.js +2 -2
  114. package/lib/operations/find_and_modify.js.map +1 -1
  115. package/lib/operations/get_more.js.map +1 -1
  116. package/lib/operations/indexes.js +4 -4
  117. package/lib/operations/indexes.js.map +1 -1
  118. package/lib/operations/insert.js +3 -3
  119. package/lib/operations/insert.js.map +1 -1
  120. package/lib/operations/is_capped.js +1 -1
  121. package/lib/operations/is_capped.js.map +1 -1
  122. package/lib/operations/list_collections.js +3 -3
  123. package/lib/operations/list_collections.js.map +1 -1
  124. package/lib/operations/list_databases.js +1 -1
  125. package/lib/operations/list_databases.js.map +1 -1
  126. package/lib/operations/map_reduce.js +4 -3
  127. package/lib/operations/map_reduce.js.map +1 -1
  128. package/lib/operations/operation.js +1 -1
  129. package/lib/operations/operation.js.map +1 -1
  130. package/lib/operations/options_operation.js +1 -1
  131. package/lib/operations/options_operation.js.map +1 -1
  132. package/lib/operations/profiling_level.js +1 -1
  133. package/lib/operations/profiling_level.js.map +1 -1
  134. package/lib/operations/remove_user.js +1 -1
  135. package/lib/operations/remove_user.js.map +1 -1
  136. package/lib/operations/rename.js +3 -3
  137. package/lib/operations/rename.js.map +1 -1
  138. package/lib/operations/run_command.js +1 -1
  139. package/lib/operations/run_command.js.map +1 -1
  140. package/lib/operations/set_profiling_level.js +2 -2
  141. package/lib/operations/set_profiling_level.js.map +1 -1
  142. package/lib/operations/stats.js +1 -1
  143. package/lib/operations/stats.js.map +1 -1
  144. package/lib/operations/update.js +2 -2
  145. package/lib/operations/update.js.map +1 -1
  146. package/lib/operations/validate_collection.js +1 -1
  147. package/lib/operations/validate_collection.js.map +1 -1
  148. package/lib/read_preference.js +15 -5
  149. package/lib/read_preference.js.map +1 -1
  150. package/lib/sdam/events.js +4 -4
  151. package/lib/sdam/monitor.js +19 -18
  152. package/lib/sdam/monitor.js.map +1 -1
  153. package/lib/sdam/server.js +24 -31
  154. package/lib/sdam/server.js.map +1 -1
  155. package/lib/sdam/server_description.js +38 -38
  156. package/lib/sdam/server_description.js.map +1 -1
  157. package/lib/sdam/server_selection.js +2 -2
  158. package/lib/sdam/server_selection.js.map +1 -1
  159. package/lib/sdam/srv_polling.js +2 -2
  160. package/lib/sdam/srv_polling.js.map +1 -1
  161. package/lib/sdam/topology.js +32 -62
  162. package/lib/sdam/topology.js.map +1 -1
  163. package/lib/sdam/topology_description.js +3 -3
  164. package/lib/sdam/topology_description.js.map +1 -1
  165. package/lib/sessions.js +13 -28
  166. package/lib/sessions.js.map +1 -1
  167. package/lib/transactions.js +1 -1
  168. package/lib/transactions.js.map +1 -1
  169. package/lib/utils.js +46 -15
  170. package/lib/utils.js.map +1 -1
  171. package/mongodb.d.ts +205 -60
  172. package/mongodb.ts34.d.ts +230 -59
  173. package/package.json +40 -37
  174. package/src/admin.ts +9 -9
  175. package/src/bson.ts +25 -17
  176. package/src/bulk/common.ts +22 -23
  177. package/src/bulk/ordered.ts +4 -4
  178. package/src/bulk/unordered.ts +5 -5
  179. package/src/change_stream.ts +29 -28
  180. package/src/cmap/auth/auth_provider.ts +3 -3
  181. package/src/cmap/auth/gssapi.ts +65 -14
  182. package/src/cmap/auth/mongo_credentials.ts +28 -17
  183. package/src/cmap/auth/mongocr.ts +3 -2
  184. package/src/cmap/auth/mongodb_aws.ts +10 -11
  185. package/src/cmap/auth/plain.ts +1 -1
  186. package/src/cmap/auth/providers.ts +21 -0
  187. package/src/cmap/auth/scram.ts +9 -9
  188. package/src/cmap/auth/x509.ts +3 -3
  189. package/src/cmap/command_monitoring_events.ts +4 -3
  190. package/src/cmap/commands.ts +22 -14
  191. package/src/cmap/connect.ts +161 -45
  192. package/src/cmap/connection.ts +83 -63
  193. package/src/cmap/connection_pool.ts +39 -39
  194. package/src/cmap/connection_pool_events.ts +1 -1
  195. package/src/cmap/message_stream.ts +9 -8
  196. package/src/cmap/stream_description.ts +5 -5
  197. package/src/cmap/wire_protocol/compression.ts +4 -3
  198. package/src/cmap/wire_protocol/shared.ts +10 -9
  199. package/src/collection.ts +116 -93
  200. package/src/connection_string.ts +130 -59
  201. package/src/constants.ts +122 -0
  202. package/src/cursor/abstract_cursor.ts +14 -13
  203. package/src/cursor/aggregation_cursor.ts +6 -6
  204. package/src/cursor/find_cursor.ts +12 -4
  205. package/src/db.ts +44 -33
  206. package/src/deps.ts +44 -1
  207. package/src/encrypter.ts +12 -3
  208. package/src/error.ts +52 -24
  209. package/src/gridfs/download.ts +10 -8
  210. package/src/gridfs/index.ts +11 -11
  211. package/src/gridfs/upload.ts +13 -10
  212. package/src/index.ts +205 -199
  213. package/src/logger.ts +2 -1
  214. package/src/mongo_client.ts +46 -32
  215. package/src/mongo_types.ts +119 -21
  216. package/src/operations/add_user.ts +7 -6
  217. package/src/operations/aggregate.ts +5 -5
  218. package/src/operations/bulk_write.ts +5 -5
  219. package/src/operations/collections.ts +2 -2
  220. package/src/operations/command.ts +15 -9
  221. package/src/operations/common_functions.ts +4 -4
  222. package/src/operations/connect.ts +4 -14
  223. package/src/operations/count.ts +4 -4
  224. package/src/operations/count_documents.ts +3 -3
  225. package/src/operations/create_collection.ts +7 -6
  226. package/src/operations/delete.ts +5 -5
  227. package/src/operations/distinct.ts +4 -4
  228. package/src/operations/drop.ts +4 -4
  229. package/src/operations/estimated_document_count.ts +5 -5
  230. package/src/operations/eval.ts +5 -5
  231. package/src/operations/execute_operation.ts +10 -11
  232. package/src/operations/find.ts +14 -14
  233. package/src/operations/find_and_modify.ts +7 -7
  234. package/src/operations/get_more.ts +2 -2
  235. package/src/operations/indexes.ts +16 -16
  236. package/src/operations/insert.ts +9 -9
  237. package/src/operations/is_capped.ts +3 -3
  238. package/src/operations/list_collections.ts +6 -6
  239. package/src/operations/list_databases.ts +4 -4
  240. package/src/operations/map_reduce.ts +10 -9
  241. package/src/operations/operation.ts +3 -3
  242. package/src/operations/options_operation.ts +3 -3
  243. package/src/operations/profiling_level.ts +4 -4
  244. package/src/operations/remove_user.ts +4 -4
  245. package/src/operations/rename.ts +6 -6
  246. package/src/operations/run_command.ts +3 -3
  247. package/src/operations/set_profiling_level.ts +6 -5
  248. package/src/operations/stats.ts +4 -4
  249. package/src/operations/update.ts +10 -10
  250. package/src/operations/validate_collection.ts +4 -4
  251. package/src/read_preference.ts +18 -7
  252. package/src/sdam/common.ts +2 -2
  253. package/src/sdam/events.ts +5 -5
  254. package/src/sdam/monitor.ts +29 -32
  255. package/src/sdam/server.ts +64 -62
  256. package/src/sdam/server_description.ts +41 -48
  257. package/src/sdam/server_selection.ts +3 -3
  258. package/src/sdam/srv_polling.ts +3 -2
  259. package/src/sdam/topology.ts +71 -89
  260. package/src/sdam/topology_description.ts +5 -5
  261. package/src/sessions.ts +31 -48
  262. package/src/transactions.ts +4 -4
  263. package/src/utils.ts +64 -28
  264. package/lib/cmap/auth/defaultAuthProviders.js +0 -30
  265. package/lib/cmap/auth/defaultAuthProviders.js.map +0 -1
  266. package/src/cmap/auth/defaultAuthProviders.ts +0 -32
package/src/index.ts CHANGED
@@ -1,122 +1,122 @@
1
+ import { Admin } from './admin';
2
+ import { ObjectId } from './bson';
3
+ import { Collection } from './collection';
1
4
  import { AbstractCursor } from './cursor/abstract_cursor';
2
5
  import { AggregationCursor } from './cursor/aggregation_cursor';
3
6
  import { FindCursor } from './cursor/find_cursor';
4
- import { ListIndexesCursor } from './operations/indexes';
5
- import { ListCollectionsCursor } from './operations/list_collections';
6
- import { PromiseProvider } from './promise_provider';
7
- import { Admin } from './admin';
8
- import { MongoClient } from './mongo_client';
9
7
  import { Db } from './db';
10
- import { Collection } from './collection';
11
- import { Logger } from './logger';
12
8
  import { GridFSBucket } from './gridfs';
9
+ import { Logger } from './logger';
10
+ import { MongoClient } from './mongo_client';
13
11
  import { CancellationToken } from './mongo_types';
12
+ import { ListIndexesCursor } from './operations/indexes';
13
+ import { ListCollectionsCursor } from './operations/list_collections';
14
+ import { PromiseProvider } from './promise_provider';
14
15
 
15
16
  export {
16
17
  Binary,
18
+ BSONRegExp,
19
+ BSONSymbol,
17
20
  Code,
18
21
  DBRef,
22
+ Decimal128,
19
23
  Double,
20
24
  Int32,
21
25
  Long,
22
- MinKey,
26
+ Map,
23
27
  MaxKey,
28
+ MinKey,
24
29
  ObjectId,
25
- Timestamp,
26
- Decimal128,
27
- BSONRegExp,
28
- BSONSymbol,
29
- Map
30
+ Timestamp
30
31
  } from './bson';
31
-
32
- import { ObjectId } from 'bson';
33
32
  /**
34
33
  * @public
35
34
  * @deprecated Please use `ObjectId`
36
35
  */
37
36
  export const ObjectID = ObjectId;
38
37
 
38
+ export { AnyBulkWriteOperation, BulkWriteOptions, MongoBulkWriteError } from './bulk/common';
39
39
  export {
40
- MongoError,
41
- MongoServerError,
42
- MongoDriverError,
43
40
  MongoAPIError,
41
+ MongoBatchReExecutionError,
42
+ MongoChangeStreamError,
44
43
  MongoCompatibilityError,
44
+ MongoCursorExhaustedError,
45
+ MongoCursorInUseError,
46
+ MongoDecompressionError,
47
+ MongoDriverError,
48
+ MongoError,
49
+ MongoExpiredSessionError,
50
+ MongoGridFSChunkError,
51
+ MongoGridFSStreamError,
45
52
  MongoInvalidArgumentError,
53
+ MongoKerberosError,
46
54
  MongoMissingCredentialsError,
47
55
  MongoMissingDependencyError,
48
56
  MongoNetworkError,
49
57
  MongoNetworkTimeoutError,
50
- MongoSystemError,
51
- MongoServerSelectionError,
58
+ MongoNotConnectedError,
52
59
  MongoParseError,
53
- MongoWriteConcernError,
54
60
  MongoRuntimeError,
55
- MongoChangeStreamError,
56
- MongoGridFSStreamError,
57
- MongoGridFSChunkError,
58
- MongoDecompressionError,
59
- MongoBatchReExecutionError,
60
- MongoCursorExhaustedError,
61
- MongoCursorInUseError,
62
- MongoNotConnectedError,
63
- MongoExpiredSessionError,
64
- MongoTransactionError,
65
- MongoKerberosError,
66
61
  MongoServerClosedError,
67
- MongoTopologyClosedError
62
+ MongoServerError,
63
+ MongoServerSelectionError,
64
+ MongoSystemError,
65
+ MongoTopologyClosedError,
66
+ MongoTransactionError,
67
+ MongoWriteConcernError
68
68
  } from './error';
69
- export { MongoBulkWriteError, BulkWriteOptions, AnyBulkWriteOperation } from './bulk/common';
70
69
  export {
71
- // Utils
72
- PromiseProvider as Promise,
70
+ AbstractCursor,
73
71
  // Actual driver classes exported
74
72
  Admin,
75
- MongoClient,
76
- Db,
77
- Collection,
78
- Logger,
79
- AbstractCursor,
80
73
  AggregationCursor,
74
+ CancellationToken,
75
+ Collection,
76
+ Db,
81
77
  FindCursor,
82
- ListIndexesCursor,
83
- ListCollectionsCursor,
84
78
  GridFSBucket,
85
- CancellationToken
79
+ ListCollectionsCursor,
80
+ ListIndexesCursor,
81
+ Logger,
82
+ MongoClient,
83
+ // Utils
84
+ PromiseProvider as Promise
86
85
  };
87
86
 
88
87
  // enums
89
- export { ProfilingLevel } from './operations/set_profiling_level';
90
- export { ServerType, TopologyType } from './sdam/common';
91
- export { LoggerLevel } from './logger';
92
- export { AutoEncryptionLoggerLevel } from './deps';
93
88
  export { BatchType } from './bulk/common';
94
- export { AuthMechanism } from './cmap/auth/defaultAuthProviders';
95
- export { CURSOR_FLAGS } from './cursor/abstract_cursor';
89
+ export { GSSAPICanonicalizationValue } from './cmap/auth/gssapi';
90
+ export { AuthMechanism } from './cmap/auth/providers';
96
91
  export { Compressor } from './cmap/wire_protocol/compression';
97
- export { ReturnDocument } from './operations/find_and_modify';
92
+ export { CURSOR_FLAGS } from './cursor/abstract_cursor';
93
+ export { AutoEncryptionLoggerLevel } from './deps';
98
94
  export { ExplainVerbosity } from './explain';
99
- export { ReadConcernLevel } from './read_concern';
100
- export { ReadPreferenceMode } from './read_preference';
95
+ export { LoggerLevel } from './logger';
101
96
  export { ServerApiVersion } from './mongo_client';
102
97
  export { BSONType } from './mongo_types';
98
+ export { ReturnDocument } from './operations/find_and_modify';
99
+ export { ProfilingLevel } from './operations/set_profiling_level';
100
+ export { ReadConcernLevel } from './read_concern';
101
+ export { ReadPreferenceMode } from './read_preference';
102
+ export { ServerType, TopologyType } from './sdam/common';
103
103
 
104
104
  // Helper classes
105
- export { WriteConcern } from './write_concern';
106
105
  export { ReadConcern } from './read_concern';
107
106
  export { ReadPreference } from './read_preference';
107
+ export { WriteConcern } from './write_concern';
108
108
 
109
109
  // events
110
110
  export {
111
+ CommandFailedEvent,
111
112
  CommandStartedEvent,
112
- CommandSucceededEvent,
113
- CommandFailedEvent
113
+ CommandSucceededEvent
114
114
  } from './cmap/command_monitoring_events';
115
115
  export {
116
- ConnectionCheckOutFailedEvent,
117
- ConnectionCheckOutStartedEvent,
118
116
  ConnectionCheckedInEvent,
119
117
  ConnectionCheckedOutEvent,
118
+ ConnectionCheckOutFailedEvent,
119
+ ConnectionCheckOutStartedEvent,
120
120
  ConnectionClosedEvent,
121
121
  ConnectionCreatedEvent,
122
122
  ConnectionPoolClearedEvent,
@@ -126,11 +126,11 @@ export {
126
126
  ConnectionReadyEvent
127
127
  } from './cmap/connection_pool_events';
128
128
  export {
129
- ServerHeartbeatStartedEvent,
130
- ServerHeartbeatSucceededEvent,
131
- ServerHeartbeatFailedEvent,
132
129
  ServerClosedEvent,
133
130
  ServerDescriptionChangedEvent,
131
+ ServerHeartbeatFailedEvent,
132
+ ServerHeartbeatStartedEvent,
133
+ ServerHeartbeatSucceededEvent,
134
134
  ServerOpeningEvent,
135
135
  TopologyClosedEvent,
136
136
  TopologyDescriptionChangedEvent,
@@ -140,84 +140,98 @@ export { SrvPollingEvent } from './sdam/srv_polling';
140
140
 
141
141
  // type only exports below, these are removed from emitted JS
142
142
  export type { AdminPrivate } from './admin';
143
- export type { Document, BSONSerializeOptions } from './bson';
143
+ export type { BSONSerializeOptions, Document } from './bson';
144
+ export type { deserialize, serialize } from './bson';
144
145
  export type {
146
+ BulkResult,
147
+ BulkWriteOperationError,
148
+ BulkWriteResult,
149
+ DeleteManyModel,
150
+ DeleteOneModel,
145
151
  InsertOneModel,
146
152
  ReplaceOneModel,
147
- UpdateOneModel,
148
153
  UpdateManyModel,
149
- DeleteOneModel,
150
- DeleteManyModel,
151
- BulkResult,
152
- BulkWriteResult,
153
- WriteError,
154
+ UpdateOneModel,
154
155
  WriteConcernError,
155
- BulkWriteOperationError
156
+ WriteError
156
157
  } from './bulk/common';
158
+ export type {
159
+ Batch,
160
+ BulkOperationBase,
161
+ BulkOperationPrivate,
162
+ FindOperators,
163
+ WriteConcernErrorData
164
+ } from './bulk/common';
165
+ export type { OrderedBulkOperation } from './bulk/ordered';
166
+ export type { UnorderedBulkOperation } from './bulk/unordered';
157
167
  export type {
158
168
  ChangeStream,
169
+ ChangeStreamCursor,
170
+ ChangeStreamCursorOptions,
159
171
  ChangeStreamDocument,
160
- UpdateDescription,
161
172
  ChangeStreamEvents,
162
173
  ChangeStreamOptions,
163
- ChangeStreamCursor,
164
- ResumeToken,
165
- PipeOptions,
166
- ChangeStreamCursorOptions,
167
174
  OperationTime,
168
- ResumeOptions
175
+ PipeOptions,
176
+ ResumeOptions,
177
+ ResumeToken,
178
+ UpdateDescription
169
179
  } from './change_stream';
170
180
  export type {
171
- MongoCredentials,
172
181
  AuthMechanismProperties,
182
+ MongoCredentials,
173
183
  MongoCredentialsOptions
174
184
  } from './cmap/auth/mongo_credentials';
175
185
  export type {
176
- WriteProtocolMessageType,
177
- Query,
178
186
  GetMore,
179
- Msg,
180
187
  KillCursor,
188
+ Msg,
181
189
  OpGetMoreOptions,
182
- OpQueryOptions
190
+ OpQueryOptions,
191
+ Query,
192
+ WriteProtocolMessageType
183
193
  } from './cmap/commands';
184
- export type { Stream, LEGAL_TLS_SOCKET_OPTIONS, LEGAL_TCP_SOCKET_OPTIONS } from './cmap/connect';
194
+ export type { LEGAL_TCP_SOCKET_OPTIONS, LEGAL_TLS_SOCKET_OPTIONS, Stream } from './cmap/connect';
185
195
  export type {
196
+ CommandOptions,
186
197
  Connection,
198
+ ConnectionEvents,
187
199
  ConnectionOptions,
188
200
  DestroyOptions,
189
- CommandOptions,
190
- QueryOptions,
191
201
  GetMoreOptions,
192
- ConnectionEvents
202
+ ProxyOptions,
203
+ QueryOptions
193
204
  } from './cmap/connection';
194
- export type { ConnectionPoolMetrics } from './cmap/metrics';
195
205
  export type {
196
206
  CloseOptions,
207
+ ConnectionPool,
208
+ ConnectionPoolEvents,
197
209
  ConnectionPoolOptions,
198
210
  WaitQueueMember,
199
- WithConnectionCallback,
200
- ConnectionPool,
201
- ConnectionPoolEvents
211
+ WithConnectionCallback
202
212
  } from './cmap/connection_pool';
203
213
  export type {
204
- OperationDescription,
205
214
  MessageStream,
206
- MessageStreamOptions
215
+ MessageStreamOptions,
216
+ OperationDescription
207
217
  } from './cmap/message_stream';
218
+ export type { ConnectionPoolMetrics } from './cmap/metrics';
208
219
  export type { StreamDescription, StreamDescriptionOptions } from './cmap/stream_description';
209
220
  export type { CompressorName } from './cmap/wire_protocol/compression';
210
- export type { CollectionPrivate, CollectionOptions, ModifyResult } from './collection';
211
- export type { AggregationCursorOptions } from './cursor/aggregation_cursor';
221
+ export type { CollectionOptions, CollectionPrivate, ModifyResult } from './collection';
222
+ export type { MONGO_CLIENT_EVENTS } from './constants';
212
223
  export type {
213
- CursorCloseOptions,
214
- CursorStreamOptions,
215
- AbstractCursorOptions,
216
224
  AbstractCursorEvents,
217
- CursorFlag
225
+ AbstractCursorOptions,
226
+ CursorCloseOptions,
227
+ CursorFlag,
228
+ CursorStreamOptions
218
229
  } from './cursor/abstract_cursor';
219
- export type { DbPrivate, DbOptions } from './db';
220
- export type { AutoEncryptionOptions, AutoEncrypter } from './deps';
230
+ export type { InternalAbstractCursorOptions } from './cursor/abstract_cursor';
231
+ export type { AggregationCursorOptions } from './cursor/aggregation_cursor';
232
+ export type { DbOptions, DbPrivate } from './db';
233
+ export type { AutoEncrypter, AutoEncryptionOptions, AutoEncryptionTlsOptions } from './deps';
234
+ export type { Encrypter, EncrypterOptions } from './encrypter';
221
235
  export type { AnyError, ErrorDescription, MongoNetworkErrorOptions } from './error';
222
236
  export type { Explain, ExplainOptions, ExplainVerbosityLike } from './explain';
223
237
  export type {
@@ -227,46 +241,87 @@ export type {
227
241
  GridFSBucketReadStreamPrivate,
228
242
  GridFSFile
229
243
  } from './gridfs/download';
230
- export type { GridFSBucketOptions, GridFSBucketPrivate, GridFSBucketEvents } from './gridfs/index';
244
+ export type { GridFSBucketEvents, GridFSBucketOptions, GridFSBucketPrivate } from './gridfs/index';
231
245
  export type {
232
- GridFSBucketWriteStreamOptions,
233
246
  GridFSBucketWriteStream,
247
+ GridFSBucketWriteStreamOptions,
234
248
  GridFSChunk
235
249
  } from './gridfs/upload';
236
- export type { LoggerOptions, LoggerFunction } from './logger';
250
+ export type { LoggerFunction, LoggerOptions } from './logger';
237
251
  export type {
238
- MongoClientEvents,
239
- MongoClientPrivate,
240
- MongoClientOptions,
241
- WithSessionCallback,
242
- PkFactory,
243
252
  Auth,
244
253
  DriverInfo,
254
+ MongoClientEvents,
255
+ MongoClientOptions,
256
+ MongoClientPrivate,
245
257
  MongoOptions,
258
+ PkFactory,
246
259
  ServerApi,
247
260
  SupportedNodeConnectionOptions,
261
+ SupportedSocketOptions,
248
262
  SupportedTLSConnectionOptions,
249
263
  SupportedTLSSocketOptions,
250
- SupportedSocketOptions
264
+ WithSessionCallback
251
265
  } from './mongo_client';
252
266
  export type {
253
- TypedEventEmitter,
254
- EventsDescription,
255
267
  CommonEvents,
256
- GenericListener
268
+ EventsDescription,
269
+ GenericListener,
270
+ TypedEventEmitter
271
+ } from './mongo_types';
272
+ export type {
273
+ AcceptedFields,
274
+ AddToSetOperators,
275
+ AlternativeType,
276
+ ArrayOperator,
277
+ BitwiseFilter,
278
+ BSONTypeAlias,
279
+ Condition,
280
+ EnhancedOmit,
281
+ Filter,
282
+ FilterOperations,
283
+ FilterOperators,
284
+ Flatten,
285
+ InferIdType,
286
+ IntegerType,
287
+ IsAny,
288
+ Join,
289
+ KeysOfAType,
290
+ KeysOfOtherType,
291
+ MatchKeysAndValues,
292
+ NestedPaths,
293
+ NonObjectIdLikeDocument,
294
+ NotAcceptedFields,
295
+ NumericType,
296
+ OneOrMore,
297
+ OnlyFieldsOfType,
298
+ OptionalId,
299
+ OptionalUnlessRequiredId,
300
+ Projection,
301
+ ProjectionOperators,
302
+ PropertyType,
303
+ PullAllOperator,
304
+ PullOperator,
305
+ PushOperator,
306
+ RegExpOrString,
307
+ RootFilterOperators,
308
+ SchemaMember,
309
+ SetFields,
310
+ UpdateFilter,
311
+ WithId,
312
+ WithoutId
257
313
  } from './mongo_types';
258
314
  export type { AddUserOptions, RoleSpecification } from './operations/add_user';
259
315
  export type {
260
- AggregateOptions,
261
316
  AggregateOperation,
317
+ AggregateOptions,
262
318
  DB_AGGREGATE_COLLECTION
263
319
  } from './operations/aggregate';
264
- export type { MONGO_CLIENT_EVENTS } from './operations/connect';
265
320
  export type {
266
- CommandOperationOptions,
267
- OperationParent,
321
+ CollationOptions,
268
322
  CommandOperation,
269
- CollationOptions
323
+ CommandOperationOptions,
324
+ OperationParent
270
325
  } from './operations/command';
271
326
  export type { IndexInformationOptions } from './operations/common_functions';
272
327
  export type { CountOptions } from './operations/count';
@@ -280,85 +335,85 @@ export type { DistinctOptions } from './operations/distinct';
280
335
  export type { DropCollectionOptions, DropDatabaseOptions } from './operations/drop';
281
336
  export type { EstimatedDocumentCountOptions } from './operations/estimated_document_count';
282
337
  export type { EvalOptions } from './operations/eval';
338
+ export type { ExecutionResult } from './operations/execute_operation';
283
339
  export type { FindOptions } from './operations/find';
284
- export type { Sort, SortDirection, SortDirectionForCmd, SortForCmd } from './sort';
285
340
  export type {
286
341
  FindOneAndDeleteOptions,
287
342
  FindOneAndReplaceOptions,
288
343
  FindOneAndUpdateOptions
289
344
  } from './operations/find_and_modify';
290
345
  export type {
291
- IndexSpecification,
292
346
  CreateIndexesOptions,
293
- IndexDescription,
294
347
  DropIndexesOptions,
295
- ListIndexesOptions,
296
- IndexDirection
348
+ IndexDescription,
349
+ IndexDirection,
350
+ IndexSpecification,
351
+ ListIndexesOptions
297
352
  } from './operations/indexes';
298
- export type { InsertOneResult, InsertOneOptions, InsertManyResult } from './operations/insert';
299
- export type { ListCollectionsOptions, CollectionInfo } from './operations/list_collections';
300
- export type { ListDatabasesResult, ListDatabasesOptions } from './operations/list_databases';
353
+ export type { InsertManyResult, InsertOneOptions, InsertOneResult } from './operations/insert';
354
+ export type { CollectionInfo, ListCollectionsOptions } from './operations/list_collections';
355
+ export type { ListDatabasesOptions, ListDatabasesResult } from './operations/list_databases';
301
356
  export type {
357
+ FinalizeFunction,
302
358
  MapFunction,
303
- ReduceFunction,
304
359
  MapReduceOptions,
305
- FinalizeFunction
360
+ ReduceFunction
306
361
  } from './operations/map_reduce';
307
- export type { Hint, OperationOptions, AbstractOperation } from './operations/operation';
362
+ export type { AbstractOperation, Hint, OperationOptions } from './operations/operation';
308
363
  export type { ProfilingLevelOptions } from './operations/profiling_level';
309
364
  export type { RemoveUserOptions } from './operations/remove_user';
310
365
  export type { RenameOptions } from './operations/rename';
311
366
  export type { RunCommandOptions } from './operations/run_command';
312
367
  export type { SetProfilingLevelOptions } from './operations/set_profiling_level';
313
368
  export type {
369
+ CollStats,
314
370
  CollStatsOptions,
315
371
  DbStatsOptions,
316
- CollStats,
317
372
  WiredTigerData
318
373
  } from './operations/stats';
319
374
  export type {
320
- UpdateResult,
321
- UpdateOptions,
322
375
  ReplaceOptions,
376
+ UpdateOptions,
377
+ UpdateResult,
323
378
  UpdateStatement
324
379
  } from './operations/update';
325
380
  export type { ValidateCollectionOptions } from './operations/validate_collection';
326
381
  export type { ReadConcernLike } from './read_concern';
327
382
  export type {
383
+ HedgeOptions,
384
+ ReadPreferenceFromOptions,
328
385
  ReadPreferenceLike,
329
- ReadPreferenceOptions,
330
386
  ReadPreferenceLikeOptions,
331
- ReadPreferenceFromOptions,
332
- HedgeOptions
387
+ ReadPreferenceOptions
333
388
  } from './read_preference';
334
389
  export type { ClusterTime, TimerQueue } from './sdam/common';
335
390
  export type {
336
391
  Monitor,
337
392
  MonitorEvents,
338
- MonitorPrivate,
339
393
  MonitorOptions,
394
+ MonitorPrivate,
340
395
  RTTPinger,
341
396
  RTTPingerOptions
342
397
  } from './sdam/monitor';
343
- export type { Server, ServerEvents, ServerPrivate, ServerOptions } from './sdam/server';
398
+ export type { Server, ServerEvents, ServerOptions, ServerPrivate } from './sdam/server';
344
399
  export type {
345
- TopologyVersion,
346
- TagSet,
347
400
  ServerDescription,
348
- ServerDescriptionOptions
401
+ ServerDescriptionOptions,
402
+ TagSet,
403
+ TopologyVersion
349
404
  } from './sdam/server_description';
350
405
  export type { ServerSelector } from './sdam/server_selection';
351
406
  export type { SrvPoller, SrvPollerEvents, SrvPollerOptions } from './sdam/srv_polling';
352
407
  export type {
408
+ ConnectOptions,
409
+ SelectServerOptions,
410
+ ServerCapabilities,
411
+ ServerSelectionCallback,
412
+ ServerSelectionRequest,
353
413
  Topology,
354
414
  TopologyEvents,
355
- TopologyPrivate,
356
- ServerSelectionRequest,
357
415
  TopologyOptions,
358
- ServerCapabilities,
359
- ConnectOptions,
360
- SelectServerOptions,
361
- ServerSelectionCallback
416
+ TopologyPrivate
362
417
  } from './sdam/topology';
363
418
  export type { TopologyDescription, TopologyDescriptionOptions } from './sdam/topology_description';
364
419
  export type {
@@ -366,70 +421,21 @@ export type {
366
421
  ClientSessionEvents,
367
422
  ClientSessionOptions,
368
423
  EndSessionOptions,
369
- ServerSessionPool,
370
424
  ServerSession,
371
425
  ServerSessionId,
426
+ ServerSessionPool,
372
427
  WithTransactionCallback
373
428
  } from './sessions';
374
- export type { TransactionOptions, Transaction, TxnState } from './transactions';
429
+ export type { Sort, SortDirection, SortDirectionForCmd, SortForCmd } from './sort';
430
+ export type { Transaction, TransactionOptions, TxnState } from './transactions';
375
431
  export type {
432
+ BufferPool,
376
433
  Callback,
377
434
  ClientMetadata,
378
435
  ClientMetadataOptions,
379
- MongoDBNamespace,
380
- InterruptibleAsyncInterval,
381
- BufferPool,
436
+ EventEmitterWithState,
382
437
  HostAddress,
383
- EventEmitterWithState
438
+ InterruptibleAsyncInterval,
439
+ MongoDBNamespace
384
440
  } from './utils';
385
441
  export type { W, WriteConcernOptions, WriteConcernSettings } from './write_concern';
386
- export type { ExecutionResult } from './operations/execute_operation';
387
- export type { InternalAbstractCursorOptions } from './cursor/abstract_cursor';
388
- export type {
389
- BulkOperationBase,
390
- BulkOperationPrivate,
391
- FindOperators,
392
- Batch,
393
- WriteConcernErrorData
394
- } from './bulk/common';
395
- export type { OrderedBulkOperation } from './bulk/ordered';
396
- export type { UnorderedBulkOperation } from './bulk/unordered';
397
- export type { Encrypter, EncrypterOptions } from './encrypter';
398
- export type {
399
- EnhancedOmit,
400
- WithId,
401
- OptionalId,
402
- WithoutId,
403
- UpdateFilter,
404
- Filter,
405
- Projection,
406
- InferIdType,
407
- ProjectionOperators,
408
- Flatten,
409
- SchemaMember,
410
- Condition,
411
- RootFilterOperators,
412
- AlternativeType,
413
- FilterOperators,
414
- BSONTypeAlias,
415
- BitwiseFilter,
416
- RegExpOrString,
417
- OnlyFieldsOfType,
418
- NumericType,
419
- IntegerType,
420
- MatchKeysAndValues,
421
- SetFields,
422
- PullOperator,
423
- PushOperator,
424
- PullAllOperator,
425
- AcceptedFields,
426
- NotAcceptedFields,
427
- AddToSetOperators,
428
- ArrayOperator,
429
- FilterOperations,
430
- KeysOfAType,
431
- KeysOfOtherType,
432
- IsAny,
433
- OneOrMore
434
- } from './mongo_types';
435
- export type { serialize, deserialize } from './bson';
package/src/logger.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import { format } from 'util';
2
- import { enumToString } from './utils';
2
+
3
3
  import { MongoInvalidArgumentError } from './error';
4
+ import { enumToString } from './utils';
4
5
 
5
6
  // Filters for classes
6
7
  const classFilters: any = {};