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.ts34.d.ts CHANGED
@@ -21,6 +21,7 @@ import { Map as Map_2 } from 'bson';
21
21
  import { MaxKey } from 'bson';
22
22
  import { MinKey } from 'bson';
23
23
  import { ObjectId } from 'bson';
24
+ import { ObjectIdLike } from 'bson';
24
25
  import { Readable } from 'stream';
25
26
  import { serialize as serialize_2 } from 'bson';
26
27
  import { SerializeOptions } from 'bson';
@@ -507,9 +508,10 @@ export declare const AuthMechanism: Readonly<{
507
508
  export declare type AuthMechanism = typeof AuthMechanism[keyof typeof AuthMechanism];
508
509
  /** @public */
509
510
  export declare interface AuthMechanismProperties extends Document {
511
+ SERVICE_HOST?: string;
510
512
  SERVICE_NAME?: string;
511
513
  SERVICE_REALM?: string;
512
- CANONICALIZE_HOST_NAME?: boolean;
514
+ CANONICALIZE_HOST_NAME?: GSSAPICanonicalizationValue;
513
515
  AWS_SESSION_TOKEN?: string;
514
516
  }
515
517
  /** @public */
@@ -588,6 +590,17 @@ export declare interface AutoEncryptionOptions {
588
590
  */
589
591
  endpoint?: string | undefined;
590
592
  };
593
+ /**
594
+ * Configuration options for using 'kmip' as your KMS provider
595
+ */
596
+ kmip?: {
597
+ /**
598
+ * The output endpoint string.
599
+ * The endpoint consists of a hostname and port separated by a colon.
600
+ * E.g. "example.com:123". A port is always present.
601
+ */
602
+ endpoint?: string;
603
+ };
591
604
  };
592
605
  /**
593
606
  * A map of namespaces to a local JSON schema for encryption
@@ -617,6 +630,36 @@ export declare interface AutoEncryptionOptions {
617
630
  /** Command line arguments to use when auto-spawning a mongocryptd */
618
631
  mongocryptdSpawnArgs?: string[];
619
632
  };
633
+ proxyOptions?: ProxyOptions;
634
+ /** The TLS options to use connecting to the KMS provider */
635
+ tlsOptions?: {
636
+ aws?: AutoEncryptionTlsOptions;
637
+ local?: AutoEncryptionTlsOptions;
638
+ azure?: AutoEncryptionTlsOptions;
639
+ gcp?: AutoEncryptionTlsOptions;
640
+ kmip?: AutoEncryptionTlsOptions;
641
+ };
642
+ }
643
+ /** @public */
644
+ export declare interface AutoEncryptionTlsOptions {
645
+ /**
646
+ * Specifies the location of a local .pem file that contains
647
+ * either the client's TLS/SSL certificate and key or only the
648
+ * client's TLS/SSL key when tlsCertificateFile is used to
649
+ * provide the certificate.
650
+ */
651
+ tlsCertificateKeyFile?: string;
652
+ /**
653
+ * Specifies the password to de-crypt the tlsCertificateKeyFile.
654
+ */
655
+ tlsCertificateKeyFilePassword?: string;
656
+ /**
657
+ * Specifies the location of a local .pem file that contains the
658
+ * root certificate chain from the Certificate Authority.
659
+ * This file is used to validate the certificate presented by the
660
+ * KMS provider.
661
+ */
662
+ tlsCAFile?: string;
620
663
  }
621
664
  /**
622
665
  * Keeps the state of a unordered batch so we can rewrite the results
@@ -653,6 +696,8 @@ export { BSONRegExp };
653
696
  export declare interface BSONSerializeOptions extends Pick<SerializeOptions, Exclude<keyof SerializeOptions, 'index'>>, Pick<DeserializeOptions, Exclude<keyof DeserializeOptions, 'evalFunctions' | 'cacheFunctions' | 'cacheFunctionsCrc32' | 'allowObjectSmallerThanBufferSize' | 'index' | 'validation'>> {
654
697
  /** Return BSON filled buffers from operations */
655
698
  raw?: boolean;
699
+ /** Enable utf8 validation when deserializing BSON documents. Defaults to true. */
700
+ enableUtf8Validation?: boolean;
656
701
  }
657
702
  export { BSONSymbol };
658
703
  /** @public */
@@ -954,7 +999,9 @@ export declare interface ChangeStreamDocument<TSchema extends Document = Documen
954
999
  * this will contain all the components of the shard key in order,
955
1000
  * followed by the _id if the _id isn’t part of the shard key.
956
1001
  */
957
- documentKey?: InferIdType<TSchema>;
1002
+ documentKey?: {
1003
+ _id: InferIdType<TSchema>;
1004
+ };
958
1005
  /**
959
1006
  * Only present for ops of type ‘update’.
960
1007
  *
@@ -996,9 +1043,9 @@ export declare interface ChangeStreamOptions extends AggregateOptions {
996
1043
  fullDocument?: string;
997
1044
  /** The maximum amount of time for the server to wait on new documents to satisfy a change stream query. */
998
1045
  maxAwaitTimeMS?: number;
999
- /** Allows you to start a changeStream after a specified event. See {@link https://docs.mongodb.com/master/changeStreams/#resumeafter-for-change-streams|ChangeStream documentation}. */
1046
+ /** Allows you to start a changeStream after a specified event. See {@link https://docs.mongodb.com/manual/changeStreams/#resumeafter-for-change-streams|ChangeStream documentation}. */
1000
1047
  resumeAfter?: ResumeToken;
1001
- /** 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}. */
1048
+ /** 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}. */
1002
1049
  startAfter?: ResumeToken;
1003
1050
  /** Will start the changeStream after the specified operationTime. */
1004
1051
  startAtOperationTime?: OperationTime;
@@ -1244,10 +1291,10 @@ export declare class Collection<TSchema extends Document = Document> {
1244
1291
  * @param options - Optional settings for the command
1245
1292
  * @param callback - An optional callback, a Promise will be returned if none is provided
1246
1293
  */
1247
- insertOne(doc: OptionalId<TSchema>): Promise<InsertOneResult<TSchema>>;
1248
- insertOne(doc: OptionalId<TSchema>, callback: Callback<InsertOneResult<TSchema>>): void;
1249
- insertOne(doc: OptionalId<TSchema>, options: InsertOneOptions): Promise<InsertOneResult<TSchema>>;
1250
- insertOne(doc: OptionalId<TSchema>, options: InsertOneOptions, callback: Callback<InsertOneResult<TSchema>>): void;
1294
+ insertOne(doc: OptionalUnlessRequiredId<TSchema>): Promise<InsertOneResult<TSchema>>;
1295
+ insertOne(doc: OptionalUnlessRequiredId<TSchema>, callback: Callback<InsertOneResult<TSchema>>): void;
1296
+ insertOne(doc: OptionalUnlessRequiredId<TSchema>, options: InsertOneOptions): Promise<InsertOneResult<TSchema>>;
1297
+ insertOne(doc: OptionalUnlessRequiredId<TSchema>, options: InsertOneOptions, callback: Callback<InsertOneResult<TSchema>>): void;
1251
1298
  /**
1252
1299
  * Inserts an array of documents into MongoDB. If documents passed in do not contain the **_id** field,
1253
1300
  * one will be added to each of the documents missing it by the driver, mutating the document. This behavior
@@ -1257,10 +1304,10 @@ export declare class Collection<TSchema extends Document = Document> {
1257
1304
  * @param options - Optional settings for the command
1258
1305
  * @param callback - An optional callback, a Promise will be returned if none is provided
1259
1306
  */
1260
- insertMany(docs: OptionalId<TSchema>[]): Promise<InsertManyResult<TSchema>>;
1261
- insertMany(docs: OptionalId<TSchema>[], callback: Callback<InsertManyResult<TSchema>>): void;
1262
- insertMany(docs: OptionalId<TSchema>[], options: BulkWriteOptions): Promise<InsertManyResult<TSchema>>;
1263
- insertMany(docs: OptionalId<TSchema>[], options: BulkWriteOptions, callback: Callback<InsertManyResult<TSchema>>): void;
1307
+ insertMany(docs: OptionalUnlessRequiredId<TSchema>[]): Promise<InsertManyResult<TSchema>>;
1308
+ insertMany(docs: OptionalUnlessRequiredId<TSchema>[], callback: Callback<InsertManyResult<TSchema>>): void;
1309
+ insertMany(docs: OptionalUnlessRequiredId<TSchema>[], options: BulkWriteOptions): Promise<InsertManyResult<TSchema>>;
1310
+ insertMany(docs: OptionalUnlessRequiredId<TSchema>[], options: BulkWriteOptions, callback: Callback<InsertManyResult<TSchema>>): void;
1264
1311
  /**
1265
1312
  * Perform a bulkWrite operation without a fluent API
1266
1313
  *
@@ -1316,10 +1363,10 @@ export declare class Collection<TSchema extends Document = Document> {
1316
1363
  * @param options - Optional settings for the command
1317
1364
  * @param callback - An optional callback, a Promise will be returned if none is provided
1318
1365
  */
1319
- replaceOne(filter: Filter<TSchema>, replacement: TSchema): Promise<UpdateResult | Document>;
1320
- replaceOne(filter: Filter<TSchema>, replacement: TSchema, callback: Callback<UpdateResult | Document>): void;
1321
- replaceOne(filter: Filter<TSchema>, replacement: TSchema, options: ReplaceOptions): Promise<UpdateResult | Document>;
1322
- replaceOne(filter: Filter<TSchema>, replacement: TSchema, options: ReplaceOptions, callback: Callback<UpdateResult | Document>): void;
1366
+ replaceOne(filter: Filter<TSchema>, replacement: WithoutId<TSchema>): Promise<UpdateResult | Document>;
1367
+ replaceOne(filter: Filter<TSchema>, replacement: WithoutId<TSchema>, callback: Callback<UpdateResult | Document>): void;
1368
+ replaceOne(filter: Filter<TSchema>, replacement: WithoutId<TSchema>, options: ReplaceOptions): Promise<UpdateResult | Document>;
1369
+ replaceOne(filter: Filter<TSchema>, replacement: WithoutId<TSchema>, options: ReplaceOptions, callback: Callback<UpdateResult | Document>): void;
1323
1370
  /**
1324
1371
  * Update multiple documents in a collection
1325
1372
  *
@@ -1643,10 +1690,10 @@ export declare class Collection<TSchema extends Document = Document> {
1643
1690
  * @param options - Optional settings for the command
1644
1691
  * @param callback - An optional callback, a Promise will be returned if none is provided
1645
1692
  */
1646
- findOneAndReplace(filter: Filter<TSchema>, replacement: Document): Promise<ModifyResult<TSchema>>;
1647
- findOneAndReplace(filter: Filter<TSchema>, replacement: Document, callback: Callback<ModifyResult<TSchema>>): void;
1648
- findOneAndReplace(filter: Filter<TSchema>, replacement: Document, options: FindOneAndReplaceOptions): Promise<ModifyResult<TSchema>>;
1649
- findOneAndReplace(filter: Filter<TSchema>, replacement: Document, options: FindOneAndReplaceOptions, callback: Callback<ModifyResult<TSchema>>): void;
1693
+ findOneAndReplace(filter: Filter<TSchema>, replacement: WithoutId<TSchema>): Promise<ModifyResult<TSchema>>;
1694
+ findOneAndReplace(filter: Filter<TSchema>, replacement: WithoutId<TSchema>, callback: Callback<ModifyResult<TSchema>>): void;
1695
+ findOneAndReplace(filter: Filter<TSchema>, replacement: WithoutId<TSchema>, options: FindOneAndReplaceOptions): Promise<ModifyResult<TSchema>>;
1696
+ findOneAndReplace(filter: Filter<TSchema>, replacement: WithoutId<TSchema>, options: FindOneAndReplaceOptions, callback: Callback<ModifyResult<TSchema>>): void;
1650
1697
  /**
1651
1698
  * Find a document and update it in one atomic operation. Requires a write lock for the duration of the operation.
1652
1699
  *
@@ -1704,7 +1751,7 @@ export declare class Collection<TSchema extends Document = Document> {
1704
1751
  * @param options - Optional settings for the command
1705
1752
  * @param callback - An optional callback, a Promise will be returned if none is provided
1706
1753
  */
1707
- insert(docs: OptionalId<TSchema>[], options: BulkWriteOptions, callback: Callback<InsertManyResult<TSchema>>): Promise<InsertManyResult<TSchema>> | void;
1754
+ insert(docs: OptionalUnlessRequiredId<TSchema>[], options: BulkWriteOptions, callback: Callback<InsertManyResult<TSchema>>): Promise<InsertManyResult<TSchema>> | void;
1708
1755
  /**
1709
1756
  * Updates documents.
1710
1757
  *
@@ -1757,6 +1804,9 @@ export declare interface CollectionInfo extends Document {
1757
1804
  }
1758
1805
  /** @public */
1759
1806
  export declare interface CollectionOptions extends BSONSerializeOptions, WriteConcernOptions, LoggerOptions {
1807
+ /**
1808
+ * @deprecated Use readPreference instead
1809
+ */
1760
1810
  slaveOk?: boolean;
1761
1811
  /** Specify a read concern for the collection. (only MongoDB 3.2 or higher supported) */
1762
1812
  readConcern?: ReadConcernLike;
@@ -1971,7 +2021,7 @@ export declare type ConnectionEvents = {
1971
2021
  unpinned(pinType: string): void;
1972
2022
  };
1973
2023
  /** @public */
1974
- export declare interface ConnectionOptions extends SupportedNodeConnectionOptions, StreamDescriptionOptions {
2024
+ export declare interface ConnectionOptions extends SupportedNodeConnectionOptions, StreamDescriptionOptions, ProxyOptions {
1975
2025
  id: number | '<monitor>';
1976
2026
  generation: number;
1977
2027
  hostAddress: HostAddress;
@@ -2212,7 +2262,15 @@ export declare class Db {
2212
2262
  constructor(client: MongoClient, databaseName: string, options?: DbOptions);
2213
2263
  readonly databaseName: string;
2214
2264
  readonly options: DbOptions | undefined;
2265
+ /*
2266
+ * slaveOk specified
2267
+ * @deprecated Use secondaryOk instead
2268
+ */
2215
2269
  readonly slaveOk: boolean;
2270
+ /*
2271
+ * Check if a secondary can be used (because the read preference is *not* set to primary)
2272
+ */
2273
+ readonly secondaryOk: boolean;
2216
2274
  readonly readConcern: ReadConcern | undefined;
2217
2275
  /*
2218
2276
  * The current readPreference of the Db. If not explicitly defined for
@@ -2582,15 +2640,15 @@ export declare type ExplainVerbosity = string;
2582
2640
  */
2583
2641
  export declare type ExplainVerbosityLike = ExplainVerbosity | boolean;
2584
2642
  /** A MongoDB filter can be some portion of the schema or a set of operators @public */
2585
- export declare type Filter<TSchema> = {
2586
- [P in keyof WithId<TSchema>]?: Condition<WithId<TSchema>[P]>;
2587
- } & RootFilterOperators<WithId<TSchema>>;
2643
+ export declare type Filter<TSchema> = Partial<TSchema> | ({
2644
+ [Property in Join<NestedPaths<WithId<TSchema>>, '.'>]?: Condition<PropertyType<WithId<TSchema>, Property>>;
2645
+ } & RootFilterOperators<WithId<TSchema>>);
2588
2646
  /** @public */
2589
2647
  export declare type FilterOperations<T> = T extends Record<string, any> ? {
2590
2648
  [key in keyof T]?: FilterOperators<T[key]>;
2591
2649
  } : FilterOperators<T>;
2592
2650
  /** @public */
2593
- export declare interface FilterOperators<TValue> extends Document {
2651
+ export declare interface FilterOperators<TValue> extends NonObjectIdLikeDocument {
2594
2652
  $eq?: TValue;
2595
2653
  $gt?: TValue;
2596
2654
  $gte?: TValue;
@@ -2642,10 +2700,16 @@ export declare class FindCursor<TSchema = Document> extends AbstractCursor<TSche
2642
2700
  map<T>(transform: (doc: TSchema) => T): FindCursor<T>;
2643
2701
  /* Excluded from this release type: _initialize */
2644
2702
  /* Excluded from this release type: _getMore */
2645
- /** Get the count of documents for this cursor */
2703
+ /**
2704
+ * Get the count of documents for this cursor
2705
+ * @deprecated Use `collection.estimatedDocumentCount` or `collection.countDocuments` instead
2706
+ */
2646
2707
  count(): Promise<number>;
2708
+ /** @deprecated Use `collection.estimatedDocumentCount` or `collection.countDocuments` instead */
2647
2709
  count(callback: Callback<number>): void;
2710
+ /** @deprecated Use `collection.estimatedDocumentCount` or `collection.countDocuments` instead */
2648
2711
  count(options: CountOptions): Promise<number>;
2712
+ /** @deprecated Use `collection.estimatedDocumentCount` or `collection.countDocuments` instead */
2649
2713
  count(options: CountOptions, callback: Callback<number>): void;
2650
2714
  /** Execute the explain for the cursor */
2651
2715
  explain(): Promise<Document>;
@@ -2876,7 +2940,7 @@ export declare interface FindOptions<TSchema extends Document = Document> extend
2876
2940
  timeout?: boolean;
2877
2941
  /** Specify if the cursor is tailable. */
2878
2942
  tailable?: boolean;
2879
- /** Specify if the cursor is a a tailable-await cursor. Requires `tailable` to be true */
2943
+ /** Specify if the cursor is a tailable-await cursor. Requires `tailable` to be true */
2880
2944
  awaitData?: boolean;
2881
2945
  /** Set the batchSize for the getMoreCommand when iterating over the query results. */
2882
2946
  batchSize?: number;
@@ -3133,12 +3197,12 @@ export declare class GridFSBucketWriteStream extends Writable implements NodeJS.
3133
3197
  * @param encoding - Optional encoding for the buffer
3134
3198
  * @param callback - Function to call when all files and chunks have been persisted to MongoDB
3135
3199
  */
3136
- end(): void;
3137
- end(chunk: Buffer): void;
3138
- end(callback: Callback<GridFSFile | void>): void;
3139
- end(chunk: Buffer, callback: Callback<GridFSFile | void>): void;
3140
- end(chunk: Buffer, encoding: BufferEncoding): void;
3141
- end(chunk: Buffer, encoding: BufferEncoding | undefined, callback: Callback<GridFSFile | void>): void;
3200
+ end(): this;
3201
+ end(chunk: Buffer): this;
3202
+ end(callback: Callback<GridFSFile | void>): this;
3203
+ end(chunk: Buffer, callback: Callback<GridFSFile | void>): this;
3204
+ end(chunk: Buffer, encoding: BufferEncoding): this;
3205
+ end(chunk: Buffer, encoding: BufferEncoding | undefined, callback: Callback<GridFSFile | void>): this;
3142
3206
  }
3143
3207
  /** @public */
3144
3208
  export declare interface GridFSBucketWriteStreamOptions extends WriteConcernOptions {
@@ -3172,6 +3236,16 @@ export declare interface GridFSFile {
3172
3236
  uploadDate: Date;
3173
3237
  }
3174
3238
  /** @public */
3239
+ export declare const GSSAPICanonicalizationValue: Readonly<{
3240
+ readonly on: true;
3241
+ readonly off: false;
3242
+ readonly none: "none";
3243
+ readonly forward: "forward";
3244
+ readonly forwardAndReverse: "forwardAndReverse";
3245
+ }>;
3246
+ /** @public */
3247
+ export declare type GSSAPICanonicalizationValue = typeof GSSAPICanonicalizationValue[keyof typeof GSSAPICanonicalizationValue];
3248
+ /** @public */
3175
3249
  export declare interface HedgeOptions {
3176
3250
  /** Explicitly enable or disable hedged reads. */
3177
3251
  enabled?: boolean;
@@ -3191,6 +3265,7 @@ export declare class HostAddress {
3191
3265
  */
3192
3266
  toString(ipv6Brackets?: boolean): string;
3193
3267
  static fromString(s: string): HostAddress;
3268
+ static fromHostPort(host: string, port: number): HostAddress;
3194
3269
  static fromSrvRecord({ name, port }: SrvRecord): HostAddress;
3195
3270
  }
3196
3271
  /** @public */
@@ -3222,7 +3297,9 @@ export declare type IndexSpecification = OneOrMore<string | [
3222
3297
  /** Given an object shaped type, return the type of the _id field or default to ObjectId @public */
3223
3298
  export declare type InferIdType<TSchema> = TSchema extends {
3224
3299
  _id: infer IdType;
3225
- } ? {} extends IdType ? Exclude<IdType, {}> : unknown extends IdType ? ObjectId : IdType : ObjectId;
3300
+ } ? Record<any, never> extends IdType ? never : IdType : TSchema extends {
3301
+ _id?: infer IdType;
3302
+ } ? unknown extends IdType ? ObjectId : IdType : ObjectId;
3226
3303
  /** @public */
3227
3304
  export declare interface InsertManyResult<TSchema = Document> {
3228
3305
  /** Indicates whether this write result was acknowledged. If not, then all other members of this result will be undefined */
@@ -3260,6 +3337,17 @@ export declare type IntegerType = number | Int32 | Long;
3260
3337
  /* Excluded from this release type: InterruptibleAsyncInterval */
3261
3338
  /** @public */
3262
3339
  export declare type IsAny<Type, ResultIfAny, ResultIfNotAny> = true extends false & Type ? ResultIfAny : ResultIfNotAny;
3340
+ /**
3341
+ * Helper types for dot-notation filter attributes
3342
+ */
3343
+ /** @public */
3344
+ export declare type Join<T extends unknown[], D extends string> = T extends [
3345
+ ] ? '' : T extends [
3346
+ string | number
3347
+ ] ? `${T[0]}` : T extends [
3348
+ string | number,
3349
+ ...infer R
3350
+ ] ? `${T[0]}${D}${Join<R, D>}` : string;
3263
3351
  /* Excluded from this release type: kBeforeHandshake */
3264
3352
  /* Excluded from this release type: kBuffer */
3265
3353
  /* Excluded from this release type: kBuffers */
@@ -3291,11 +3379,11 @@ export declare type KeysOfOtherType<TSchema, Type> = {
3291
3379
  /* Excluded from this release type: kFullResult */
3292
3380
  /* Excluded from this release type: kGeneration */
3293
3381
  /* Excluded from this release type: kGeneration_2 */
3382
+ /* Excluded from this release type: kHello */
3294
3383
  /* Excluded from this release type: kId */
3295
3384
  /* Excluded from this release type: KillCursor */
3296
3385
  /* Excluded from this release type: kInitialized */
3297
3386
  /* Excluded from this release type: kInternalClient */
3298
- /* Excluded from this release type: kIsMaster */
3299
3387
  /* Excluded from this release type: kKilled */
3300
3388
  /* Excluded from this release type: kLastUseTime */
3301
3389
  /* Excluded from this release type: kLength */
@@ -3544,7 +3632,7 @@ export { MaxKey };
3544
3632
  export { MinKey };
3545
3633
  /** @public */
3546
3634
  export declare interface ModifyResult<TSchema = Document> {
3547
- value: TSchema | null;
3635
+ value: WithId<TSchema> | null;
3548
3636
  lastErrorObject?: Document;
3549
3637
  ok: 0 | 1;
3550
3638
  }
@@ -3560,7 +3648,21 @@ export declare const MONGO_CLIENT_EVENTS: readonly [
3560
3648
  "connectionCheckedOut",
3561
3649
  "connectionCheckedIn",
3562
3650
  "connectionPoolCleared",
3563
- ...("error" | "close" | "commandStarted" | "commandSucceeded" | "commandFailed" | "serverHeartbeatStarted" | "serverHeartbeatSucceeded" | "serverHeartbeatFailed" | "timeout" | "serverOpening" | "serverClosed" | "serverDescriptionChanged" | "topologyOpening" | "topologyClosed" | "topologyDescriptionChanged")[]
3651
+ "commandStarted",
3652
+ "commandSucceeded",
3653
+ "commandFailed",
3654
+ "serverOpening",
3655
+ "serverClosed",
3656
+ "serverDescriptionChanged",
3657
+ "topologyOpening",
3658
+ "topologyClosed",
3659
+ "topologyDescriptionChanged",
3660
+ "error",
3661
+ "timeout",
3662
+ "close",
3663
+ "serverHeartbeatStarted",
3664
+ "serverHeartbeatSucceeded",
3665
+ "serverHeartbeatFailed"
3564
3666
  ];
3565
3667
  /**
3566
3668
  * An error generated when the driver API is used incorrectly
@@ -3691,8 +3793,8 @@ export declare class MongoClient extends TypedEventEmitter<MongoClientEvents> {
3691
3793
  *
3692
3794
  * @see docs.mongodb.org/manual/reference/connection-string/
3693
3795
  */
3694
- connect(): Promise<MongoClient>;
3695
- connect(callback: Callback<MongoClient>): void;
3796
+ connect(): Promise<this>;
3797
+ connect(callback: Callback<this>): void;
3696
3798
  /**
3697
3799
  * Close the db and its underlying connections
3698
3800
  *
@@ -3898,6 +4000,14 @@ export declare interface MongoClientOptions extends BSONSerializeOptions, Suppor
3898
4000
  autoEncryption?: AutoEncryptionOptions;
3899
4001
  /** Allows a wrapping driver to amend the client metadata generated by the driver to include information about the wrapping driver */
3900
4002
  driverInfo?: DriverInfo;
4003
+ /** Configures a Socks5 proxy host used for creating TCP connections. */
4004
+ proxyHost?: string;
4005
+ /** Configures a Socks5 proxy port used for creating TCP connections. */
4006
+ proxyPort?: number;
4007
+ /** Configures a Socks5 proxy username when the proxy in proxyHost requires username/password authentication. */
4008
+ proxyUsername?: string;
4009
+ /** Configures a Socks5 proxy password when the proxy in proxyHost requires username/password authentication. */
4010
+ proxyPassword?: string;
3901
4011
  }
3902
4012
  /* Excluded from this release type: MongoClientPrivate */
3903
4013
  /**
@@ -3934,9 +4044,9 @@ export declare class MongoCredentials {
3934
4044
  * If the authentication mechanism is set to "default", resolves the authMechanism
3935
4045
  * based on the server version and server supported sasl mechanisms.
3936
4046
  *
3937
- * @param ismaster - An ismaster response from the server
4047
+ * @param hello - A hello response from the server
3938
4048
  */
3939
- resolveAuthMechanism(ismaster?: Document): MongoCredentials;
4049
+ resolveAuthMechanism(hello?: Document): MongoCredentials;
3940
4050
  validate(): void;
3941
4051
  static merge(creds: MongoCredentials | undefined, options: Partial<MongoCredentialsOptions>): MongoCredentials;
3942
4052
  }
@@ -4167,6 +4277,10 @@ export declare interface MongoOptions extends Required<Pick<MongoClientOptions,
4167
4277
  dbName: string;
4168
4278
  metadata: ClientMetadata;
4169
4279
  autoEncrypter?: AutoEncrypter;
4280
+ proxyHost?: string;
4281
+ proxyPort?: number;
4282
+ proxyUsername?: string;
4283
+ proxyPassword?: string;
4170
4284
  /* Excluded from this release type: connectionType */
4171
4285
  /* Excluded from this release type: encrypter */
4172
4286
  /* Excluded from this release type: userSpecifiedAuthSource */
@@ -4315,6 +4429,44 @@ export declare interface MonitorOptions extends Pick<ConnectionOptions, Exclude<
4315
4429
  }
4316
4430
  /* Excluded from this release type: MonitorPrivate */
4317
4431
  /* Excluded from this release type: Msg */
4432
+ /**
4433
+ * @public
4434
+ * returns tuple of strings (keys to be joined on '.') that represent every path into a schema
4435
+ * https://docs.mongodb.com/manual/tutorial/query-embedded-documents/
4436
+ */
4437
+ export declare type NestedPaths<Type> = Type extends string | number | boolean | Date | RegExp | Buffer | Uint8Array | ((...args: any[]) => any) | {
4438
+ _bsontype: string;
4439
+ } ? [
4440
+ ] : Type extends ReadonlyArray<infer ArrayType> ? [
4441
+ number,
4442
+ ...NestedPaths<ArrayType>
4443
+ ] : Type extends Map<string, any> ? [
4444
+ string
4445
+ ] : Type extends object ? {
4446
+ [Key in Extract<keyof Type, string>]: Type[Key] extends Type ? [
4447
+ Key
4448
+ ] : Type extends Type[Key] ? [
4449
+ Key
4450
+ ] : Type[Key] extends ReadonlyArray<infer ArrayType> ? Type extends ArrayType ? [
4451
+ Key
4452
+ ] : ArrayType extends Type ? [
4453
+ Key
4454
+ ] : [
4455
+ Key,
4456
+ ...NestedPaths<Type[Key]>
4457
+ ] : [
4458
+ Key,
4459
+ ...NestedPaths<Type[Key]>
4460
+ ];
4461
+ }[Extract<keyof Type, string>] : [
4462
+ ];
4463
+ /**
4464
+ * @public
4465
+ * A type that extends Document but forbids anything that "looks like" an object id.
4466
+ */
4467
+ export declare type NonObjectIdLikeDocument = {
4468
+ [key in keyof ObjectIdLike]?: never;
4469
+ } & Document;
4318
4470
  /** It avoids using fields with not acceptable types @public */
4319
4471
  export declare type NotAcceptedFields<TSchema, FieldType> = {
4320
4472
  readonly [key in KeysOfOtherType<TSchema, FieldType>]?: never;
@@ -4355,19 +4507,24 @@ export declare type OperationTime = Timestamp;
4355
4507
  /**
4356
4508
  * Add an optional _id field to an object shaped type
4357
4509
  * @public
4510
+ */
4511
+ export declare type OptionalId<TSchema> = EnhancedOmit<TSchema, '_id'> & {
4512
+ _id?: InferIdType<TSchema>;
4513
+ };
4514
+ /**
4515
+ * Adds an optional _id field to an object shaped type, unless the _id field is requried on that type.
4516
+ * In the case _id is required, this method continues to require_id.
4517
+ *
4518
+ * @public
4358
4519
  *
4359
4520
  * @privateRemarks
4360
4521
  * `ObjectId extends TSchema['_id']` is a confusing ordering at first glance. Rather than ask
4361
4522
  * `TSchema['_id'] extends ObjectId` which translated to "Is the _id property ObjectId?"
4362
4523
  * we instead ask "Does ObjectId look like (have the same shape) as the _id?"
4363
4524
  */
4364
- export declare type OptionalId<TSchema> = TSchema extends {
4365
- _id?: any;
4366
- } ? ObjectId extends TSchema['_id'] ? EnhancedOmit<TSchema, '_id'> & {
4367
- _id?: InferIdType<TSchema>;
4368
- } : WithId<TSchema> : EnhancedOmit<TSchema, '_id'> & {
4369
- _id?: InferIdType<TSchema>;
4370
- };
4525
+ export declare type OptionalUnlessRequiredId<TSchema> = TSchema extends {
4526
+ _id: any;
4527
+ } ? TSchema : OptionalId<TSchema>;
4371
4528
  /** @public */
4372
4529
  export declare class OrderedBulkOperation extends BulkOperationBase {
4373
4530
  constructor(collection: Collection, options: BulkWriteOptions);
@@ -4416,6 +4573,15 @@ declare class Promise_2 {
4416
4573
  }
4417
4574
  export { Promise_2 as Promise };
4418
4575
  /** @public */
4576
+ 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;
4577
+ /** @public */
4578
+ export declare interface ProxyOptions {
4579
+ proxyHost?: string;
4580
+ proxyPort?: number;
4581
+ proxyUsername?: string;
4582
+ proxyPassword?: string;
4583
+ }
4584
+ /** @public */
4419
4585
  export declare type PullAllOperator<TSchema> = ({
4420
4586
  readonly [key in KeysOfAType<TSchema, ReadonlyArray<any>>]?: TSchema[key];
4421
4587
  } & NotAcceptedFields<TSchema, ReadonlyArray<any>>) & {
@@ -4529,11 +4695,16 @@ export declare class ReadPreference {
4529
4695
  */
4530
4696
  isValid(mode?: string): boolean;
4531
4697
  /**
4532
- * Indicates that this readPreference needs the "slaveOk" bit when sent over the wire
4533
- *
4698
+ * Indicates that this readPreference needs the "secondaryOk" bit when sent over the wire
4699
+ * @deprecated Use secondaryOk instead
4534
4700
  * @see https://docs.mongodb.com/manual/reference/mongodb-wire-protocol/#op-query
4535
4701
  */
4536
4702
  slaveOk(): boolean;
4703
+ /**
4704
+ * Indicates that this readPreference needs the "SecondaryOk" bit when sent over the wire
4705
+ * @see https://docs.mongodb.com/manual/reference/mongodb-wire-protocol/#op-query
4706
+ */
4707
+ secondaryOk(): boolean;
4537
4708
  /**
4538
4709
  * Check if the two ReadPreferences are equivalent
4539
4710
  *
@@ -4595,7 +4766,7 @@ export declare interface ReplaceOneModel<TSchema extends Document = Document> {
4595
4766
  /** The filter to limit the replaced document. */
4596
4767
  filter: Filter<TSchema>;
4597
4768
  /** The document with which to replace the matched document. */
4598
- replacement: TSchema;
4769
+ replacement: WithoutId<TSchema>;
4599
4770
  /** Specifies a collation. */
4600
4771
  collation?: CollationOptions;
4601
4772
  /** The index to use. If specified, then the query system will only consider plans using the hinted index. */
@@ -4623,7 +4794,7 @@ export declare interface ResumeOptions {
4623
4794
  readPreference?: ReadPreference;
4624
4795
  }
4625
4796
  /**
4626
- * 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.
4797
+ * 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.
4627
4798
  * @public
4628
4799
  */
4629
4800
  export declare type ResumeToken = unknown;
@@ -4693,7 +4864,7 @@ export declare type ServerApiVersion = typeof ServerApiVersion[keyof typeof Serv
4693
4864
  export declare class ServerCapabilities {
4694
4865
  maxWireVersion: number;
4695
4866
  minWireVersion: number;
4696
- constructor(ismaster: Document);
4867
+ constructor(hello: Document);
4697
4868
  readonly hasAggregationCursor: boolean;
4698
4869
  readonly hasWriteCommands: boolean;
4699
4870
  readonly hasTextSearch: boolean;
@@ -4716,7 +4887,7 @@ export declare class ServerClosedEvent {
4716
4887
  address: string;
4717
4888
  }
4718
4889
  /**
4719
- * The client's view of a single server, based on the most recent ismaster outcome.
4890
+ * The client's view of a single server, based on the most recent hello outcome.
4720
4891
  *
4721
4892
  * Internal type, not meant to be directly instantiated
4722
4893
  * @public
@@ -4787,7 +4958,7 @@ export declare type ServerEvents = {
4787
4958
  ended(): void;
4788
4959
  } & ConnectionPoolEvents & EventEmitterWithState;
4789
4960
  /**
4790
- * Emitted when the server monitor’s ismaster fails, either with an “ok: 0” or a socket exception.
4961
+ * Emitted when the server monitor’s hello fails, either with an “ok: 0” or a socket exception.
4791
4962
  * @public
4792
4963
  * @category Event
4793
4964
  */
@@ -4800,8 +4971,8 @@ export declare class ServerHeartbeatFailedEvent {
4800
4971
  failure: Error;
4801
4972
  }
4802
4973
  /**
4803
- * Emitted when the server monitor’s ismaster command is started - immediately before
4804
- * the ismaster command is serialized into raw BSON and written to the socket.
4974
+ * Emitted when the server monitor’s hello command is started - immediately before
4975
+ * the hello command is serialized into raw BSON and written to the socket.
4805
4976
  *
4806
4977
  * @public
4807
4978
  * @category Event
@@ -4811,7 +4982,7 @@ export declare class ServerHeartbeatStartedEvent {
4811
4982
  connectionId: string;
4812
4983
  }
4813
4984
  /**
4814
- * Emitted when the server monitor’s ismaster succeeds.
4985
+ * Emitted when the server monitor’s hello succeeds.
4815
4986
  * @public
4816
4987
  * @category Event
4817
4988
  */