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/mongodb.d.ts CHANGED
@@ -22,6 +22,7 @@ import { Map as Map_2 } from 'bson';
22
22
  import { MaxKey } from 'bson';
23
23
  import { MinKey } from 'bson';
24
24
  import { ObjectId } from 'bson';
25
+ import type { ObjectIdLike } from 'bson';
25
26
  import { Readable } from 'stream';
26
27
  import type { serialize as serialize_2 } from 'bson';
27
28
  import type { SerializeOptions } from 'bson';
@@ -531,9 +532,10 @@ export declare type AuthMechanism = typeof AuthMechanism[keyof typeof AuthMechan
531
532
 
532
533
  /** @public */
533
534
  export declare interface AuthMechanismProperties extends Document {
535
+ SERVICE_HOST?: string;
534
536
  SERVICE_NAME?: string;
535
537
  SERVICE_REALM?: string;
536
- CANONICALIZE_HOST_NAME?: boolean;
538
+ CANONICALIZE_HOST_NAME?: GSSAPICanonicalizationValue;
537
539
  AWS_SESSION_TOKEN?: string;
538
540
  }
539
541
 
@@ -616,6 +618,17 @@ export declare interface AutoEncryptionOptions {
616
618
  */
617
619
  endpoint?: string | undefined;
618
620
  };
621
+ /**
622
+ * Configuration options for using 'kmip' as your KMS provider
623
+ */
624
+ kmip?: {
625
+ /**
626
+ * The output endpoint string.
627
+ * The endpoint consists of a hostname and port separated by a colon.
628
+ * E.g. "example.com:123". A port is always present.
629
+ */
630
+ endpoint?: string;
631
+ };
619
632
  };
620
633
  /**
621
634
  * A map of namespaces to a local JSON schema for encryption
@@ -645,6 +658,37 @@ export declare interface AutoEncryptionOptions {
645
658
  /** Command line arguments to use when auto-spawning a mongocryptd */
646
659
  mongocryptdSpawnArgs?: string[];
647
660
  };
661
+ proxyOptions?: ProxyOptions;
662
+ /** The TLS options to use connecting to the KMS provider */
663
+ tlsOptions?: {
664
+ aws?: AutoEncryptionTlsOptions;
665
+ local?: AutoEncryptionTlsOptions;
666
+ azure?: AutoEncryptionTlsOptions;
667
+ gcp?: AutoEncryptionTlsOptions;
668
+ kmip?: AutoEncryptionTlsOptions;
669
+ };
670
+ }
671
+
672
+ /** @public */
673
+ export declare interface AutoEncryptionTlsOptions {
674
+ /**
675
+ * Specifies the location of a local .pem file that contains
676
+ * either the client's TLS/SSL certificate and key or only the
677
+ * client's TLS/SSL key when tlsCertificateFile is used to
678
+ * provide the certificate.
679
+ */
680
+ tlsCertificateKeyFile?: string;
681
+ /**
682
+ * Specifies the password to de-crypt the tlsCertificateKeyFile.
683
+ */
684
+ tlsCertificateKeyFilePassword?: string;
685
+ /**
686
+ * Specifies the location of a local .pem file that contains the
687
+ * root certificate chain from the Certificate Authority.
688
+ * This file is used to validate the certificate presented by the
689
+ * KMS provider.
690
+ */
691
+ tlsCAFile?: string;
648
692
  }
649
693
 
650
694
  /**
@@ -688,6 +732,8 @@ export { BSONRegExp }
688
732
  export declare interface BSONSerializeOptions extends Omit<SerializeOptions, 'index'>, Omit<DeserializeOptions, 'evalFunctions' | 'cacheFunctions' | 'cacheFunctionsCrc32' | 'allowObjectSmallerThanBufferSize' | 'index' | 'validation'> {
689
733
  /** Return BSON filled buffers from operations */
690
734
  raw?: boolean;
735
+ /** Enable utf8 validation when deserializing BSON documents. Defaults to true. */
736
+ enableUtf8Validation?: boolean;
691
737
  }
692
738
 
693
739
  export { BSONSymbol }
@@ -1006,7 +1052,9 @@ export declare interface ChangeStreamDocument<TSchema extends Document = Documen
1006
1052
  * this will contain all the components of the shard key in order,
1007
1053
  * followed by the _id if the _id isn’t part of the shard key.
1008
1054
  */
1009
- documentKey?: InferIdType<TSchema>;
1055
+ documentKey?: {
1056
+ _id: InferIdType<TSchema>;
1057
+ };
1010
1058
  /**
1011
1059
  * Only present for ops of type ‘update’.
1012
1060
  *
@@ -1050,9 +1098,9 @@ export declare interface ChangeStreamOptions extends AggregateOptions {
1050
1098
  fullDocument?: string;
1051
1099
  /** The maximum amount of time for the server to wait on new documents to satisfy a change stream query. */
1052
1100
  maxAwaitTimeMS?: number;
1053
- /** Allows you to start a changeStream after a specified event. See {@link https://docs.mongodb.com/master/changeStreams/#resumeafter-for-change-streams|ChangeStream documentation}. */
1101
+ /** Allows you to start a changeStream after a specified event. See {@link https://docs.mongodb.com/manual/changeStreams/#resumeafter-for-change-streams|ChangeStream documentation}. */
1054
1102
  resumeAfter?: ResumeToken;
1055
- /** Similar to resumeAfter, but will allow you to start after an invalidated event. See {@link https://docs.mongodb.com/master/changeStreams/#startafter-for-change-streams|ChangeStream documentation}. */
1103
+ /** Similar to resumeAfter, but will allow you to start after an invalidated event. See {@link https://docs.mongodb.com/manual/changeStreams/#startafter-for-change-streams|ChangeStream documentation}. */
1056
1104
  startAfter?: ResumeToken;
1057
1105
  /** Will start the changeStream after the specified operationTime. */
1058
1106
  startAtOperationTime?: OperationTime;
@@ -1312,10 +1360,10 @@ export declare class Collection<TSchema extends Document = Document> {
1312
1360
  * @param options - Optional settings for the command
1313
1361
  * @param callback - An optional callback, a Promise will be returned if none is provided
1314
1362
  */
1315
- insertOne(doc: OptionalId<TSchema>): Promise<InsertOneResult<TSchema>>;
1316
- insertOne(doc: OptionalId<TSchema>, callback: Callback<InsertOneResult<TSchema>>): void;
1317
- insertOne(doc: OptionalId<TSchema>, options: InsertOneOptions): Promise<InsertOneResult<TSchema>>;
1318
- insertOne(doc: OptionalId<TSchema>, options: InsertOneOptions, callback: Callback<InsertOneResult<TSchema>>): void;
1363
+ insertOne(doc: OptionalUnlessRequiredId<TSchema>): Promise<InsertOneResult<TSchema>>;
1364
+ insertOne(doc: OptionalUnlessRequiredId<TSchema>, callback: Callback<InsertOneResult<TSchema>>): void;
1365
+ insertOne(doc: OptionalUnlessRequiredId<TSchema>, options: InsertOneOptions): Promise<InsertOneResult<TSchema>>;
1366
+ insertOne(doc: OptionalUnlessRequiredId<TSchema>, options: InsertOneOptions, callback: Callback<InsertOneResult<TSchema>>): void;
1319
1367
  /**
1320
1368
  * Inserts an array of documents into MongoDB. If documents passed in do not contain the **_id** field,
1321
1369
  * one will be added to each of the documents missing it by the driver, mutating the document. This behavior
@@ -1325,10 +1373,10 @@ export declare class Collection<TSchema extends Document = Document> {
1325
1373
  * @param options - Optional settings for the command
1326
1374
  * @param callback - An optional callback, a Promise will be returned if none is provided
1327
1375
  */
1328
- insertMany(docs: OptionalId<TSchema>[]): Promise<InsertManyResult<TSchema>>;
1329
- insertMany(docs: OptionalId<TSchema>[], callback: Callback<InsertManyResult<TSchema>>): void;
1330
- insertMany(docs: OptionalId<TSchema>[], options: BulkWriteOptions): Promise<InsertManyResult<TSchema>>;
1331
- insertMany(docs: OptionalId<TSchema>[], options: BulkWriteOptions, callback: Callback<InsertManyResult<TSchema>>): void;
1376
+ insertMany(docs: OptionalUnlessRequiredId<TSchema>[]): Promise<InsertManyResult<TSchema>>;
1377
+ insertMany(docs: OptionalUnlessRequiredId<TSchema>[], callback: Callback<InsertManyResult<TSchema>>): void;
1378
+ insertMany(docs: OptionalUnlessRequiredId<TSchema>[], options: BulkWriteOptions): Promise<InsertManyResult<TSchema>>;
1379
+ insertMany(docs: OptionalUnlessRequiredId<TSchema>[], options: BulkWriteOptions, callback: Callback<InsertManyResult<TSchema>>): void;
1332
1380
  /**
1333
1381
  * Perform a bulkWrite operation without a fluent API
1334
1382
  *
@@ -1384,10 +1432,10 @@ export declare class Collection<TSchema extends Document = Document> {
1384
1432
  * @param options - Optional settings for the command
1385
1433
  * @param callback - An optional callback, a Promise will be returned if none is provided
1386
1434
  */
1387
- replaceOne(filter: Filter<TSchema>, replacement: TSchema): Promise<UpdateResult | Document>;
1388
- replaceOne(filter: Filter<TSchema>, replacement: TSchema, callback: Callback<UpdateResult | Document>): void;
1389
- replaceOne(filter: Filter<TSchema>, replacement: TSchema, options: ReplaceOptions): Promise<UpdateResult | Document>;
1390
- replaceOne(filter: Filter<TSchema>, replacement: TSchema, options: ReplaceOptions, callback: Callback<UpdateResult | Document>): void;
1435
+ replaceOne(filter: Filter<TSchema>, replacement: WithoutId<TSchema>): Promise<UpdateResult | Document>;
1436
+ replaceOne(filter: Filter<TSchema>, replacement: WithoutId<TSchema>, callback: Callback<UpdateResult | Document>): void;
1437
+ replaceOne(filter: Filter<TSchema>, replacement: WithoutId<TSchema>, options: ReplaceOptions): Promise<UpdateResult | Document>;
1438
+ replaceOne(filter: Filter<TSchema>, replacement: WithoutId<TSchema>, options: ReplaceOptions, callback: Callback<UpdateResult | Document>): void;
1391
1439
  /**
1392
1440
  * Update multiple documents in a collection
1393
1441
  *
@@ -1711,10 +1759,10 @@ export declare class Collection<TSchema extends Document = Document> {
1711
1759
  * @param options - Optional settings for the command
1712
1760
  * @param callback - An optional callback, a Promise will be returned if none is provided
1713
1761
  */
1714
- findOneAndReplace(filter: Filter<TSchema>, replacement: Document): Promise<ModifyResult<TSchema>>;
1715
- findOneAndReplace(filter: Filter<TSchema>, replacement: Document, callback: Callback<ModifyResult<TSchema>>): void;
1716
- findOneAndReplace(filter: Filter<TSchema>, replacement: Document, options: FindOneAndReplaceOptions): Promise<ModifyResult<TSchema>>;
1717
- findOneAndReplace(filter: Filter<TSchema>, replacement: Document, options: FindOneAndReplaceOptions, callback: Callback<ModifyResult<TSchema>>): void;
1762
+ findOneAndReplace(filter: Filter<TSchema>, replacement: WithoutId<TSchema>): Promise<ModifyResult<TSchema>>;
1763
+ findOneAndReplace(filter: Filter<TSchema>, replacement: WithoutId<TSchema>, callback: Callback<ModifyResult<TSchema>>): void;
1764
+ findOneAndReplace(filter: Filter<TSchema>, replacement: WithoutId<TSchema>, options: FindOneAndReplaceOptions): Promise<ModifyResult<TSchema>>;
1765
+ findOneAndReplace(filter: Filter<TSchema>, replacement: WithoutId<TSchema>, options: FindOneAndReplaceOptions, callback: Callback<ModifyResult<TSchema>>): void;
1718
1766
  /**
1719
1767
  * Find a document and update it in one atomic operation. Requires a write lock for the duration of the operation.
1720
1768
  *
@@ -1772,7 +1820,7 @@ export declare class Collection<TSchema extends Document = Document> {
1772
1820
  * @param options - Optional settings for the command
1773
1821
  * @param callback - An optional callback, a Promise will be returned if none is provided
1774
1822
  */
1775
- insert(docs: OptionalId<TSchema>[], options: BulkWriteOptions, callback: Callback<InsertManyResult<TSchema>>): Promise<InsertManyResult<TSchema>> | void;
1823
+ insert(docs: OptionalUnlessRequiredId<TSchema>[], options: BulkWriteOptions, callback: Callback<InsertManyResult<TSchema>>): Promise<InsertManyResult<TSchema>> | void;
1776
1824
  /**
1777
1825
  * Updates documents.
1778
1826
  *
@@ -1827,6 +1875,9 @@ export declare interface CollectionInfo extends Document {
1827
1875
 
1828
1876
  /** @public */
1829
1877
  export declare interface CollectionOptions extends BSONSerializeOptions, WriteConcernOptions, LoggerOptions {
1878
+ /**
1879
+ * @deprecated Use readPreference instead
1880
+ */
1830
1881
  slaveOk?: boolean;
1831
1882
  /** Specify a read concern for the collection. (only MongoDB 3.2 or higher supported) */
1832
1883
  readConcern?: ReadConcernLike;
@@ -2070,7 +2121,7 @@ export declare type ConnectionEvents = {
2070
2121
  };
2071
2122
 
2072
2123
  /** @public */
2073
- export declare interface ConnectionOptions extends SupportedNodeConnectionOptions, StreamDescriptionOptions {
2124
+ export declare interface ConnectionOptions extends SupportedNodeConnectionOptions, StreamDescriptionOptions, ProxyOptions {
2074
2125
  id: number | '<monitor>';
2075
2126
  generation: number;
2076
2127
  hostAddress: HostAddress;
@@ -2329,7 +2380,15 @@ export declare class Db {
2329
2380
  constructor(client: MongoClient, databaseName: string, options?: DbOptions);
2330
2381
  get databaseName(): string;
2331
2382
  get options(): DbOptions | undefined;
2383
+ /**
2384
+ * slaveOk specified
2385
+ * @deprecated Use secondaryOk instead
2386
+ */
2332
2387
  get slaveOk(): boolean;
2388
+ /**
2389
+ * Check if a secondary can be used (because the read preference is *not* set to primary)
2390
+ */
2391
+ get secondaryOk(): boolean;
2333
2392
  get readConcern(): ReadConcern | undefined;
2334
2393
  /**
2335
2394
  * The current readPreference of the Db. If not explicitly defined for
@@ -2736,9 +2795,9 @@ export declare type ExplainVerbosity = string;
2736
2795
  export declare type ExplainVerbosityLike = ExplainVerbosity | boolean;
2737
2796
 
2738
2797
  /** A MongoDB filter can be some portion of the schema or a set of operators @public */
2739
- export declare type Filter<TSchema> = {
2740
- [P in keyof WithId<TSchema>]?: Condition<WithId<TSchema>[P]>;
2741
- } & RootFilterOperators<WithId<TSchema>>;
2798
+ export declare type Filter<TSchema> = Partial<TSchema> | ({
2799
+ [Property in Join<NestedPaths<WithId<TSchema>>, '.'>]?: Condition<PropertyType<WithId<TSchema>, Property>>;
2800
+ } & RootFilterOperators<WithId<TSchema>>);
2742
2801
 
2743
2802
  /** @public */
2744
2803
  export declare type FilterOperations<T> = T extends Record<string, any> ? {
@@ -2746,7 +2805,7 @@ export declare type FilterOperations<T> = T extends Record<string, any> ? {
2746
2805
  } : FilterOperators<T>;
2747
2806
 
2748
2807
  /** @public */
2749
- export declare interface FilterOperators<TValue> extends Document {
2808
+ export declare interface FilterOperators<TValue> extends NonObjectIdLikeDocument {
2750
2809
  $eq?: TValue;
2751
2810
  $gt?: TValue;
2752
2811
  $gte?: TValue;
@@ -2797,10 +2856,16 @@ export declare class FindCursor<TSchema = Document> extends AbstractCursor<TSche
2797
2856
  map<T>(transform: (doc: TSchema) => T): FindCursor<T>;
2798
2857
  /* Excluded from this release type: _initialize */
2799
2858
  /* Excluded from this release type: _getMore */
2800
- /** Get the count of documents for this cursor */
2859
+ /**
2860
+ * Get the count of documents for this cursor
2861
+ * @deprecated Use `collection.estimatedDocumentCount` or `collection.countDocuments` instead
2862
+ */
2801
2863
  count(): Promise<number>;
2864
+ /** @deprecated Use `collection.estimatedDocumentCount` or `collection.countDocuments` instead */
2802
2865
  count(callback: Callback<number>): void;
2866
+ /** @deprecated Use `collection.estimatedDocumentCount` or `collection.countDocuments` instead */
2803
2867
  count(options: CountOptions): Promise<number>;
2868
+ /** @deprecated Use `collection.estimatedDocumentCount` or `collection.countDocuments` instead */
2804
2869
  count(options: CountOptions, callback: Callback<number>): void;
2805
2870
  /** Execute the explain for the cursor */
2806
2871
  explain(): Promise<Document>;
@@ -3036,7 +3101,7 @@ export declare interface FindOptions<TSchema extends Document = Document> extend
3036
3101
  timeout?: boolean;
3037
3102
  /** Specify if the cursor is tailable. */
3038
3103
  tailable?: boolean;
3039
- /** Specify if the cursor is a a tailable-await cursor. Requires `tailable` to be true */
3104
+ /** Specify if the cursor is a tailable-await cursor. Requires `tailable` to be true */
3040
3105
  awaitData?: boolean;
3041
3106
  /** Set the batchSize for the getMoreCommand when iterating over the query results. */
3042
3107
  batchSize?: number;
@@ -3306,12 +3371,12 @@ export declare class GridFSBucketWriteStream extends Writable implements NodeJS.
3306
3371
  * @param encoding - Optional encoding for the buffer
3307
3372
  * @param callback - Function to call when all files and chunks have been persisted to MongoDB
3308
3373
  */
3309
- end(): void;
3310
- end(chunk: Buffer): void;
3311
- end(callback: Callback<GridFSFile | void>): void;
3312
- end(chunk: Buffer, callback: Callback<GridFSFile | void>): void;
3313
- end(chunk: Buffer, encoding: BufferEncoding): void;
3314
- end(chunk: Buffer, encoding: BufferEncoding | undefined, callback: Callback<GridFSFile | void>): void;
3374
+ end(): this;
3375
+ end(chunk: Buffer): this;
3376
+ end(callback: Callback<GridFSFile | void>): this;
3377
+ end(chunk: Buffer, callback: Callback<GridFSFile | void>): this;
3378
+ end(chunk: Buffer, encoding: BufferEncoding): this;
3379
+ end(chunk: Buffer, encoding: BufferEncoding | undefined, callback: Callback<GridFSFile | void>): this;
3315
3380
  }
3316
3381
 
3317
3382
  /** @public */
@@ -3348,6 +3413,18 @@ export declare interface GridFSFile {
3348
3413
  uploadDate: Date;
3349
3414
  }
3350
3415
 
3416
+ /** @public */
3417
+ export declare const GSSAPICanonicalizationValue: Readonly<{
3418
+ readonly on: true;
3419
+ readonly off: false;
3420
+ readonly none: "none";
3421
+ readonly forward: "forward";
3422
+ readonly forwardAndReverse: "forwardAndReverse";
3423
+ }>;
3424
+
3425
+ /** @public */
3426
+ export declare type GSSAPICanonicalizationValue = typeof GSSAPICanonicalizationValue[keyof typeof GSSAPICanonicalizationValue];
3427
+
3351
3428
  /** @public */
3352
3429
  export declare interface HedgeOptions {
3353
3430
  /** Explicitly enable or disable hedged reads. */
@@ -3370,6 +3447,7 @@ export declare class HostAddress {
3370
3447
  */
3371
3448
  toString(ipv6Brackets?: boolean): string;
3372
3449
  static fromString(s: string): HostAddress;
3450
+ static fromHostPort(host: string, port: number): HostAddress;
3373
3451
  static fromSrvRecord({ name, port }: SrvRecord): HostAddress;
3374
3452
  }
3375
3453
 
@@ -3400,7 +3478,9 @@ export declare type IndexSpecification = OneOrMore<string | [string, IndexDirect
3400
3478
  /** Given an object shaped type, return the type of the _id field or default to ObjectId @public */
3401
3479
  export declare type InferIdType<TSchema> = TSchema extends {
3402
3480
  _id: infer IdType;
3403
- } ? {} extends IdType ? Exclude<IdType, {}> : unknown extends IdType ? ObjectId : IdType : ObjectId;
3481
+ } ? Record<any, never> extends IdType ? never : IdType : TSchema extends {
3482
+ _id?: infer IdType;
3483
+ } ? unknown extends IdType ? ObjectId : IdType : ObjectId;
3404
3484
 
3405
3485
  /** @public */
3406
3486
  export declare interface InsertManyResult<TSchema = Document> {
@@ -3448,6 +3528,12 @@ export declare type IntegerType = number | Int32 | Long;
3448
3528
  /** @public */
3449
3529
  export declare type IsAny<Type, ResultIfAny, ResultIfNotAny> = true extends false & Type ? ResultIfAny : ResultIfNotAny;
3450
3530
 
3531
+ /**
3532
+ * Helper types for dot-notation filter attributes
3533
+ */
3534
+ /** @public */
3535
+ 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;
3536
+
3451
3537
  /* Excluded from this release type: kBeforeHandshake */
3452
3538
 
3453
3539
  /* Excluded from this release type: kBuffer */
@@ -3504,6 +3590,8 @@ export declare type KeysOfOtherType<TSchema, Type> = {
3504
3590
 
3505
3591
  /* Excluded from this release type: kGeneration_2 */
3506
3592
 
3593
+ /* Excluded from this release type: kHello */
3594
+
3507
3595
  /* Excluded from this release type: kId */
3508
3596
 
3509
3597
  /* Excluded from this release type: KillCursor */
@@ -3512,8 +3600,6 @@ export declare type KeysOfOtherType<TSchema, Type> = {
3512
3600
 
3513
3601
  /* Excluded from this release type: kInternalClient */
3514
3602
 
3515
- /* Excluded from this release type: kIsMaster */
3516
-
3517
3603
  /* Excluded from this release type: kKilled */
3518
3604
 
3519
3605
  /* Excluded from this release type: kLastUseTime */
@@ -3799,13 +3885,13 @@ export { MinKey }
3799
3885
 
3800
3886
  /** @public */
3801
3887
  export declare interface ModifyResult<TSchema = Document> {
3802
- value: TSchema | null;
3888
+ value: WithId<TSchema> | null;
3803
3889
  lastErrorObject?: Document;
3804
3890
  ok: 0 | 1;
3805
3891
  }
3806
3892
 
3807
3893
  /** @public */
3808
- export declare const MONGO_CLIENT_EVENTS: readonly ["connectionPoolCreated", "connectionPoolClosed", "connectionCreated", "connectionReady", "connectionClosed", "connectionCheckOutStarted", "connectionCheckOutFailed", "connectionCheckedOut", "connectionCheckedIn", "connectionPoolCleared", ...("error" | "close" | "commandStarted" | "commandSucceeded" | "commandFailed" | "serverHeartbeatStarted" | "serverHeartbeatSucceeded" | "serverHeartbeatFailed" | "timeout" | "serverOpening" | "serverClosed" | "serverDescriptionChanged" | "topologyOpening" | "topologyClosed" | "topologyDescriptionChanged")[]];
3894
+ export declare const MONGO_CLIENT_EVENTS: readonly ["connectionPoolCreated", "connectionPoolClosed", "connectionCreated", "connectionReady", "connectionClosed", "connectionCheckOutStarted", "connectionCheckOutFailed", "connectionCheckedOut", "connectionCheckedIn", "connectionPoolCleared", "commandStarted", "commandSucceeded", "commandFailed", "serverOpening", "serverClosed", "serverDescriptionChanged", "topologyOpening", "topologyClosed", "topologyDescriptionChanged", "error", "timeout", "close", "serverHeartbeatStarted", "serverHeartbeatSucceeded", "serverHeartbeatFailed"];
3809
3895
 
3810
3896
  /**
3811
3897
  * An error generated when the driver API is used incorrectly
@@ -3940,8 +4026,8 @@ export declare class MongoClient extends TypedEventEmitter<MongoClientEvents> {
3940
4026
  *
3941
4027
  * @see docs.mongodb.org/manual/reference/connection-string/
3942
4028
  */
3943
- connect(): Promise<MongoClient>;
3944
- connect(callback: Callback<MongoClient>): void;
4029
+ connect(): Promise<this>;
4030
+ connect(callback: Callback<this>): void;
3945
4031
  /**
3946
4032
  * Close the db and its underlying connections
3947
4033
  *
@@ -4149,6 +4235,14 @@ export declare interface MongoClientOptions extends BSONSerializeOptions, Suppor
4149
4235
  autoEncryption?: AutoEncryptionOptions;
4150
4236
  /** Allows a wrapping driver to amend the client metadata generated by the driver to include information about the wrapping driver */
4151
4237
  driverInfo?: DriverInfo;
4238
+ /** Configures a Socks5 proxy host used for creating TCP connections. */
4239
+ proxyHost?: string;
4240
+ /** Configures a Socks5 proxy port used for creating TCP connections. */
4241
+ proxyPort?: number;
4242
+ /** Configures a Socks5 proxy username when the proxy in proxyHost requires username/password authentication. */
4243
+ proxyUsername?: string;
4244
+ /** Configures a Socks5 proxy password when the proxy in proxyHost requires username/password authentication. */
4245
+ proxyPassword?: string;
4152
4246
  /* Excluded from this release type: srvPoller */
4153
4247
  /* Excluded from this release type: connectionType */
4154
4248
  }
@@ -4190,9 +4284,9 @@ export declare class MongoCredentials {
4190
4284
  * If the authentication mechanism is set to "default", resolves the authMechanism
4191
4285
  * based on the server version and server supported sasl mechanisms.
4192
4286
  *
4193
- * @param ismaster - An ismaster response from the server
4287
+ * @param hello - A hello response from the server
4194
4288
  */
4195
- resolveAuthMechanism(ismaster?: Document): MongoCredentials;
4289
+ resolveAuthMechanism(hello?: Document): MongoCredentials;
4196
4290
  validate(): void;
4197
4291
  static merge(creds: MongoCredentials | undefined, options: Partial<MongoCredentialsOptions>): MongoCredentials;
4198
4292
  }
@@ -4442,6 +4536,10 @@ export declare interface MongoOptions extends Required<Pick<MongoClientOptions,
4442
4536
  dbName: string;
4443
4537
  metadata: ClientMetadata;
4444
4538
  autoEncrypter?: AutoEncrypter;
4539
+ proxyHost?: string;
4540
+ proxyPort?: number;
4541
+ proxyUsername?: string;
4542
+ proxyPassword?: string;
4445
4543
  /* Excluded from this release type: connectionType */
4446
4544
  /* Excluded from this release type: encrypter */
4447
4545
  /* Excluded from this release type: userSpecifiedAuthSource */
@@ -4605,6 +4703,31 @@ export declare interface MonitorOptions extends Omit<ConnectionOptions, 'id' | '
4605
4703
 
4606
4704
  /* Excluded from this release type: Msg */
4607
4705
 
4706
+ /**
4707
+ * @public
4708
+ * returns tuple of strings (keys to be joined on '.') that represent every path into a schema
4709
+ * https://docs.mongodb.com/manual/tutorial/query-embedded-documents/
4710
+ */
4711
+ export declare type NestedPaths<Type> = Type extends string | number | boolean | Date | RegExp | Buffer | Uint8Array | ((...args: any[]) => any) | {
4712
+ _bsontype: string;
4713
+ } ? [] : Type extends ReadonlyArray<infer ArrayType> ? [number, ...NestedPaths<ArrayType>] : Type extends Map<string, any> ? [string] : Type extends object ? {
4714
+ [Key in Extract<keyof Type, string>]: Type[Key] extends Type ? [Key] : Type extends Type[Key] ? [Key] : Type[Key] extends ReadonlyArray<infer ArrayType> ? Type extends ArrayType ? [Key] : ArrayType extends Type ? [Key] : [
4715
+ Key,
4716
+ ...NestedPaths<Type[Key]>
4717
+ ] : [
4718
+ Key,
4719
+ ...NestedPaths<Type[Key]>
4720
+ ];
4721
+ }[Extract<keyof Type, string>] : [];
4722
+
4723
+ /**
4724
+ * @public
4725
+ * A type that extends Document but forbids anything that "looks like" an object id.
4726
+ */
4727
+ export declare type NonObjectIdLikeDocument = {
4728
+ [key in keyof ObjectIdLike]?: never;
4729
+ } & Document;
4730
+
4608
4731
  /** It avoids using fields with not acceptable types @public */
4609
4732
  export declare type NotAcceptedFields<TSchema, FieldType> = {
4610
4733
  readonly [key in KeysOfOtherType<TSchema, FieldType>]?: never;
@@ -4657,19 +4780,25 @@ export declare type OperationTime = Timestamp;
4657
4780
  /**
4658
4781
  * Add an optional _id field to an object shaped type
4659
4782
  * @public
4783
+ */
4784
+ export declare type OptionalId<TSchema> = EnhancedOmit<TSchema, '_id'> & {
4785
+ _id?: InferIdType<TSchema>;
4786
+ };
4787
+
4788
+ /**
4789
+ * Adds an optional _id field to an object shaped type, unless the _id field is requried on that type.
4790
+ * In the case _id is required, this method continues to require_id.
4791
+ *
4792
+ * @public
4660
4793
  *
4661
4794
  * @privateRemarks
4662
4795
  * `ObjectId extends TSchema['_id']` is a confusing ordering at first glance. Rather than ask
4663
4796
  * `TSchema['_id'] extends ObjectId` which translated to "Is the _id property ObjectId?"
4664
4797
  * we instead ask "Does ObjectId look like (have the same shape) as the _id?"
4665
4798
  */
4666
- export declare type OptionalId<TSchema> = TSchema extends {
4667
- _id?: any;
4668
- } ? ObjectId extends TSchema['_id'] ? EnhancedOmit<TSchema, '_id'> & {
4669
- _id?: InferIdType<TSchema>;
4670
- } : WithId<TSchema> : EnhancedOmit<TSchema, '_id'> & {
4671
- _id?: InferIdType<TSchema>;
4672
- };
4799
+ export declare type OptionalUnlessRequiredId<TSchema> = TSchema extends {
4800
+ _id: any;
4801
+ } ? TSchema : OptionalId<TSchema>;
4673
4802
 
4674
4803
  /** @public */
4675
4804
  export declare class OrderedBulkOperation extends BulkOperationBase {
@@ -4727,6 +4856,17 @@ declare class Promise_2 {
4727
4856
  }
4728
4857
  export { Promise_2 as Promise }
4729
4858
 
4859
+ /** @public */
4860
+ export declare type PropertyType<Type, Property extends string> = string extends Property ? unknown : Property extends keyof Type ? Type[Property] : Property extends `${number}` ? Type extends ReadonlyArray<infer ArrayType> ? ArrayType : unknown : Property extends `${infer Key}.${infer Rest}` ? Key extends `${number}` ? Type extends ReadonlyArray<infer ArrayType> ? PropertyType<ArrayType, Rest> : unknown : Key extends keyof Type ? Type[Key] extends Map<string, infer MapType> ? MapType : PropertyType<Type[Key], Rest> : unknown : unknown;
4861
+
4862
+ /** @public */
4863
+ export declare interface ProxyOptions {
4864
+ proxyHost?: string;
4865
+ proxyPort?: number;
4866
+ proxyUsername?: string;
4867
+ proxyPassword?: string;
4868
+ }
4869
+
4730
4870
  /** @public */
4731
4871
  export declare type PullAllOperator<TSchema> = ({
4732
4872
  readonly [key in KeysOfAType<TSchema, ReadonlyArray<any>>]?: TSchema[key];
@@ -4850,11 +4990,16 @@ export declare class ReadPreference {
4850
4990
  */
4851
4991
  isValid(mode?: string): boolean;
4852
4992
  /**
4853
- * Indicates that this readPreference needs the "slaveOk" bit when sent over the wire
4854
- *
4993
+ * Indicates that this readPreference needs the "secondaryOk" bit when sent over the wire
4994
+ * @deprecated Use secondaryOk instead
4855
4995
  * @see https://docs.mongodb.com/manual/reference/mongodb-wire-protocol/#op-query
4856
4996
  */
4857
4997
  slaveOk(): boolean;
4998
+ /**
4999
+ * Indicates that this readPreference needs the "SecondaryOk" bit when sent over the wire
5000
+ * @see https://docs.mongodb.com/manual/reference/mongodb-wire-protocol/#op-query
5001
+ */
5002
+ secondaryOk(): boolean;
4858
5003
  /**
4859
5004
  * Check if the two ReadPreferences are equivalent
4860
5005
  *
@@ -4927,7 +5072,7 @@ export declare interface ReplaceOneModel<TSchema extends Document = Document> {
4927
5072
  /** The filter to limit the replaced document. */
4928
5073
  filter: Filter<TSchema>;
4929
5074
  /** The document with which to replace the matched document. */
4930
- replacement: TSchema;
5075
+ replacement: WithoutId<TSchema>;
4931
5076
  /** Specifies a collation. */
4932
5077
  collation?: CollationOptions;
4933
5078
  /** The index to use. If specified, then the query system will only consider plans using the hinted index. */
@@ -4958,7 +5103,7 @@ export declare interface ResumeOptions {
4958
5103
  }
4959
5104
 
4960
5105
  /**
4961
- * Represents the logical starting point for a new or resuming {@link https://docs.mongodb.com/master/changeStreams/#change-stream-resume-token| Change Stream} on the server.
5106
+ * Represents the logical starting point for a new or resuming {@link https://docs.mongodb.com/manual/changeStreams/#std-label-change-stream-resume| Change Stream} on the server.
4962
5107
  * @public
4963
5108
  */
4964
5109
  export declare type ResumeToken = unknown;
@@ -5043,7 +5188,7 @@ export declare type ServerApiVersion = typeof ServerApiVersion[keyof typeof Serv
5043
5188
  export declare class ServerCapabilities {
5044
5189
  maxWireVersion: number;
5045
5190
  minWireVersion: number;
5046
- constructor(ismaster: Document);
5191
+ constructor(hello: Document);
5047
5192
  get hasAggregationCursor(): boolean;
5048
5193
  get hasWriteCommands(): boolean;
5049
5194
  get hasTextSearch(): boolean;
@@ -5069,7 +5214,7 @@ export declare class ServerClosedEvent {
5069
5214
  }
5070
5215
 
5071
5216
  /**
5072
- * The client's view of a single server, based on the most recent ismaster outcome.
5217
+ * The client's view of a single server, based on the most recent hello outcome.
5073
5218
  *
5074
5219
  * Internal type, not meant to be directly instantiated
5075
5220
  * @public
@@ -5145,7 +5290,7 @@ export declare type ServerEvents = {
5145
5290
  } & ConnectionPoolEvents & EventEmitterWithState;
5146
5291
 
5147
5292
  /**
5148
- * Emitted when the server monitor’s ismaster fails, either with an “ok: 0” or a socket exception.
5293
+ * Emitted when the server monitor’s hello fails, either with an “ok: 0” or a socket exception.
5149
5294
  * @public
5150
5295
  * @category Event
5151
5296
  */
@@ -5160,8 +5305,8 @@ export declare class ServerHeartbeatFailedEvent {
5160
5305
  }
5161
5306
 
5162
5307
  /**
5163
- * Emitted when the server monitor’s ismaster command is started - immediately before
5164
- * the ismaster command is serialized into raw BSON and written to the socket.
5308
+ * Emitted when the server monitor’s hello command is started - immediately before
5309
+ * the hello command is serialized into raw BSON and written to the socket.
5165
5310
  *
5166
5311
  * @public
5167
5312
  * @category Event
@@ -5173,7 +5318,7 @@ export declare class ServerHeartbeatStartedEvent {
5173
5318
  }
5174
5319
 
5175
5320
  /**
5176
- * Emitted when the server monitor’s ismaster succeeds.
5321
+ * Emitted when the server monitor’s hello succeeds.
5177
5322
  * @public
5178
5323
  * @category Event
5179
5324
  */