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.
- package/README.md +2 -2
- package/lib/admin.js +3 -3
- package/lib/admin.js.map +1 -1
- package/lib/bson.js +16 -14
- package/lib/bson.js.map +1 -1
- package/lib/bulk/common.js +7 -7
- package/lib/bulk/common.js.map +1 -1
- package/lib/bulk/ordered.js +1 -1
- package/lib/bulk/ordered.js.map +1 -1
- package/lib/bulk/unordered.js +1 -1
- package/lib/bulk/unordered.js.map +1 -1
- package/lib/change_stream.js +6 -6
- package/lib/change_stream.js.map +1 -1
- package/lib/cmap/auth/auth_provider.js.map +1 -1
- package/lib/cmap/auth/gssapi.js +52 -10
- package/lib/cmap/auth/gssapi.js.map +1 -1
- package/lib/cmap/auth/mongo_credentials.js +36 -27
- package/lib/cmap/auth/mongo_credentials.js.map +1 -1
- package/lib/cmap/auth/mongocr.js +2 -2
- package/lib/cmap/auth/mongocr.js.map +1 -1
- package/lib/cmap/auth/mongodb_aws.js +6 -6
- package/lib/cmap/auth/mongodb_aws.js.map +1 -1
- package/lib/cmap/auth/plain.js +1 -1
- package/lib/cmap/auth/plain.js.map +1 -1
- package/lib/cmap/auth/providers.js +21 -0
- package/lib/cmap/auth/providers.js.map +1 -0
- package/lib/cmap/auth/scram.js +4 -4
- package/lib/cmap/auth/scram.js.map +1 -1
- package/lib/cmap/auth/x509.js +1 -1
- package/lib/cmap/auth/x509.js.map +1 -1
- package/lib/cmap/command_monitoring_events.js +3 -2
- package/lib/cmap/command_monitoring_events.js.map +1 -1
- package/lib/cmap/commands.js +14 -8
- package/lib/cmap/commands.js.map +1 -1
- package/lib/cmap/connect.js +119 -37
- package/lib/cmap/connect.js.map +1 -1
- package/lib/cmap/connection.js +36 -35
- package/lib/cmap/connection.js.map +1 -1
- package/lib/cmap/connection_pool.js +19 -30
- package/lib/cmap/connection_pool.js.map +1 -1
- package/lib/cmap/message_stream.js +3 -3
- package/lib/cmap/message_stream.js.map +1 -1
- package/lib/cmap/stream_description.js +4 -4
- package/lib/cmap/stream_description.js.map +1 -1
- package/lib/cmap/wire_protocol/compression.js +2 -1
- package/lib/cmap/wire_protocol/compression.js.map +1 -1
- package/lib/cmap/wire_protocol/shared.js +4 -3
- package/lib/cmap/wire_protocol/shared.js.map +1 -1
- package/lib/collection.js +46 -47
- package/lib/collection.js.map +1 -1
- package/lib/connection_string.js +93 -54
- package/lib/connection_string.js.map +1 -1
- package/lib/constants.js +113 -1
- package/lib/constants.js.map +1 -1
- package/lib/cursor/abstract_cursor.js +5 -5
- package/lib/cursor/abstract_cursor.js.map +1 -1
- package/lib/cursor/aggregation_cursor.js +1 -1
- package/lib/cursor/aggregation_cursor.js.map +1 -1
- package/lib/cursor/find_cursor.js +2 -1
- package/lib/cursor/find_cursor.js.map +1 -1
- package/lib/db.js +23 -13
- package/lib/db.js.map +1 -1
- package/lib/deps.js +0 -1
- package/lib/deps.js.map +1 -1
- package/lib/encrypter.js +12 -4
- package/lib/encrypter.js.map +1 -1
- package/lib/error.js +47 -24
- package/lib/error.js.map +1 -1
- package/lib/gridfs/download.js +1 -1
- package/lib/gridfs/download.js.map +1 -1
- package/lib/gridfs/index.js +3 -3
- package/lib/gridfs/index.js.map +1 -1
- package/lib/gridfs/upload.js +3 -2
- package/lib/gridfs/upload.js.map +1 -1
- package/lib/index.js +83 -81
- package/lib/index.js.map +1 -1
- package/lib/logger.js +1 -1
- package/lib/logger.js.map +1 -1
- package/lib/mongo_client.js +5 -5
- package/lib/mongo_client.js.map +1 -1
- package/lib/mongo_types.js.map +1 -1
- package/lib/operations/add_user.js +3 -3
- package/lib/operations/add_user.js.map +1 -1
- package/lib/operations/aggregate.js +1 -1
- package/lib/operations/aggregate.js.map +1 -1
- package/lib/operations/bulk_write.js.map +1 -1
- package/lib/operations/collections.js +1 -1
- package/lib/operations/collections.js.map +1 -1
- package/lib/operations/command.js +5 -6
- package/lib/operations/command.js.map +1 -1
- package/lib/operations/common_functions.js.map +1 -1
- package/lib/operations/connect.js +4 -13
- package/lib/operations/connect.js.map +1 -1
- package/lib/operations/count.js +1 -1
- package/lib/operations/count.js.map +1 -1
- package/lib/operations/count_documents.js.map +1 -1
- package/lib/operations/create_collection.js +3 -2
- package/lib/operations/create_collection.js.map +1 -1
- package/lib/operations/delete.js +3 -3
- package/lib/operations/delete.js.map +1 -1
- package/lib/operations/distinct.js +3 -3
- package/lib/operations/distinct.js.map +1 -1
- package/lib/operations/drop.js +1 -1
- package/lib/operations/drop.js.map +1 -1
- package/lib/operations/estimated_document_count.js +2 -2
- package/lib/operations/estimated_document_count.js.map +1 -1
- package/lib/operations/eval.js +2 -2
- package/lib/operations/eval.js.map +1 -1
- package/lib/operations/execute_operation.js +5 -6
- package/lib/operations/execute_operation.js.map +1 -1
- package/lib/operations/find.js +5 -5
- package/lib/operations/find.js.map +1 -1
- package/lib/operations/find_and_modify.js +2 -2
- package/lib/operations/find_and_modify.js.map +1 -1
- package/lib/operations/get_more.js.map +1 -1
- package/lib/operations/indexes.js +4 -4
- package/lib/operations/indexes.js.map +1 -1
- package/lib/operations/insert.js +3 -3
- package/lib/operations/insert.js.map +1 -1
- package/lib/operations/is_capped.js +1 -1
- package/lib/operations/is_capped.js.map +1 -1
- package/lib/operations/list_collections.js +3 -3
- package/lib/operations/list_collections.js.map +1 -1
- package/lib/operations/list_databases.js +1 -1
- package/lib/operations/list_databases.js.map +1 -1
- package/lib/operations/map_reduce.js +4 -3
- package/lib/operations/map_reduce.js.map +1 -1
- package/lib/operations/operation.js +1 -1
- package/lib/operations/operation.js.map +1 -1
- package/lib/operations/options_operation.js +1 -1
- package/lib/operations/options_operation.js.map +1 -1
- package/lib/operations/profiling_level.js +1 -1
- package/lib/operations/profiling_level.js.map +1 -1
- package/lib/operations/remove_user.js +1 -1
- package/lib/operations/remove_user.js.map +1 -1
- package/lib/operations/rename.js +3 -3
- package/lib/operations/rename.js.map +1 -1
- package/lib/operations/run_command.js +1 -1
- package/lib/operations/run_command.js.map +1 -1
- package/lib/operations/set_profiling_level.js +2 -2
- package/lib/operations/set_profiling_level.js.map +1 -1
- package/lib/operations/stats.js +1 -1
- package/lib/operations/stats.js.map +1 -1
- package/lib/operations/update.js +2 -2
- package/lib/operations/update.js.map +1 -1
- package/lib/operations/validate_collection.js +1 -1
- package/lib/operations/validate_collection.js.map +1 -1
- package/lib/read_preference.js +15 -5
- package/lib/read_preference.js.map +1 -1
- package/lib/sdam/events.js +4 -4
- package/lib/sdam/monitor.js +19 -18
- package/lib/sdam/monitor.js.map +1 -1
- package/lib/sdam/server.js +24 -31
- package/lib/sdam/server.js.map +1 -1
- package/lib/sdam/server_description.js +38 -38
- package/lib/sdam/server_description.js.map +1 -1
- package/lib/sdam/server_selection.js +2 -2
- package/lib/sdam/server_selection.js.map +1 -1
- package/lib/sdam/srv_polling.js +2 -2
- package/lib/sdam/srv_polling.js.map +1 -1
- package/lib/sdam/topology.js +32 -62
- package/lib/sdam/topology.js.map +1 -1
- package/lib/sdam/topology_description.js +3 -3
- package/lib/sdam/topology_description.js.map +1 -1
- package/lib/sessions.js +13 -28
- package/lib/sessions.js.map +1 -1
- package/lib/transactions.js +1 -1
- package/lib/transactions.js.map +1 -1
- package/lib/utils.js +46 -15
- package/lib/utils.js.map +1 -1
- package/mongodb.d.ts +205 -60
- package/mongodb.ts34.d.ts +230 -59
- package/package.json +40 -37
- package/src/admin.ts +9 -9
- package/src/bson.ts +25 -17
- package/src/bulk/common.ts +22 -23
- package/src/bulk/ordered.ts +4 -4
- package/src/bulk/unordered.ts +5 -5
- package/src/change_stream.ts +29 -28
- package/src/cmap/auth/auth_provider.ts +3 -3
- package/src/cmap/auth/gssapi.ts +65 -14
- package/src/cmap/auth/mongo_credentials.ts +28 -17
- package/src/cmap/auth/mongocr.ts +3 -2
- package/src/cmap/auth/mongodb_aws.ts +10 -11
- package/src/cmap/auth/plain.ts +1 -1
- package/src/cmap/auth/providers.ts +21 -0
- package/src/cmap/auth/scram.ts +9 -9
- package/src/cmap/auth/x509.ts +3 -3
- package/src/cmap/command_monitoring_events.ts +4 -3
- package/src/cmap/commands.ts +22 -14
- package/src/cmap/connect.ts +161 -45
- package/src/cmap/connection.ts +83 -63
- package/src/cmap/connection_pool.ts +39 -39
- package/src/cmap/connection_pool_events.ts +1 -1
- package/src/cmap/message_stream.ts +9 -8
- package/src/cmap/stream_description.ts +5 -5
- package/src/cmap/wire_protocol/compression.ts +4 -3
- package/src/cmap/wire_protocol/shared.ts +10 -9
- package/src/collection.ts +116 -93
- package/src/connection_string.ts +130 -59
- package/src/constants.ts +122 -0
- package/src/cursor/abstract_cursor.ts +14 -13
- package/src/cursor/aggregation_cursor.ts +6 -6
- package/src/cursor/find_cursor.ts +12 -4
- package/src/db.ts +44 -33
- package/src/deps.ts +44 -1
- package/src/encrypter.ts +12 -3
- package/src/error.ts +52 -24
- package/src/gridfs/download.ts +10 -8
- package/src/gridfs/index.ts +11 -11
- package/src/gridfs/upload.ts +13 -10
- package/src/index.ts +205 -199
- package/src/logger.ts +2 -1
- package/src/mongo_client.ts +46 -32
- package/src/mongo_types.ts +119 -21
- package/src/operations/add_user.ts +7 -6
- package/src/operations/aggregate.ts +5 -5
- package/src/operations/bulk_write.ts +5 -5
- package/src/operations/collections.ts +2 -2
- package/src/operations/command.ts +15 -9
- package/src/operations/common_functions.ts +4 -4
- package/src/operations/connect.ts +4 -14
- package/src/operations/count.ts +4 -4
- package/src/operations/count_documents.ts +3 -3
- package/src/operations/create_collection.ts +7 -6
- package/src/operations/delete.ts +5 -5
- package/src/operations/distinct.ts +4 -4
- package/src/operations/drop.ts +4 -4
- package/src/operations/estimated_document_count.ts +5 -5
- package/src/operations/eval.ts +5 -5
- package/src/operations/execute_operation.ts +10 -11
- package/src/operations/find.ts +14 -14
- package/src/operations/find_and_modify.ts +7 -7
- package/src/operations/get_more.ts +2 -2
- package/src/operations/indexes.ts +16 -16
- package/src/operations/insert.ts +9 -9
- package/src/operations/is_capped.ts +3 -3
- package/src/operations/list_collections.ts +6 -6
- package/src/operations/list_databases.ts +4 -4
- package/src/operations/map_reduce.ts +10 -9
- package/src/operations/operation.ts +3 -3
- package/src/operations/options_operation.ts +3 -3
- package/src/operations/profiling_level.ts +4 -4
- package/src/operations/remove_user.ts +4 -4
- package/src/operations/rename.ts +6 -6
- package/src/operations/run_command.ts +3 -3
- package/src/operations/set_profiling_level.ts +6 -5
- package/src/operations/stats.ts +4 -4
- package/src/operations/update.ts +10 -10
- package/src/operations/validate_collection.ts +4 -4
- package/src/read_preference.ts +18 -7
- package/src/sdam/common.ts +2 -2
- package/src/sdam/events.ts +5 -5
- package/src/sdam/monitor.ts +29 -32
- package/src/sdam/server.ts +64 -62
- package/src/sdam/server_description.ts +41 -48
- package/src/sdam/server_selection.ts +3 -3
- package/src/sdam/srv_polling.ts +3 -2
- package/src/sdam/topology.ts +71 -89
- package/src/sdam/topology_description.ts +5 -5
- package/src/sessions.ts +31 -48
- package/src/transactions.ts +4 -4
- package/src/utils.ts +64 -28
- package/lib/cmap/auth/defaultAuthProviders.js +0 -30
- package/lib/cmap/auth/defaultAuthProviders.js.map +0 -1
- 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?:
|
|
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?:
|
|
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/
|
|
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/
|
|
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:
|
|
1248
|
-
insertOne(doc:
|
|
1249
|
-
insertOne(doc:
|
|
1250
|
-
insertOne(doc:
|
|
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:
|
|
1261
|
-
insertMany(docs:
|
|
1262
|
-
insertMany(docs:
|
|
1263
|
-
insertMany(docs:
|
|
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
|
|
1321
|
-
replaceOne(filter: Filter<TSchema>, replacement: TSchema
|
|
1322
|
-
replaceOne(filter: Filter<TSchema>, replacement: TSchema
|
|
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:
|
|
1647
|
-
findOneAndReplace(filter: Filter<TSchema>, replacement:
|
|
1648
|
-
findOneAndReplace(filter: Filter<TSchema>, replacement:
|
|
1649
|
-
findOneAndReplace(filter: Filter<TSchema>, replacement:
|
|
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:
|
|
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
|
-
[
|
|
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
|
|
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
|
-
/**
|
|
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
|
|
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():
|
|
3137
|
-
end(chunk: Buffer):
|
|
3138
|
-
end(callback: Callback<GridFSFile | void>):
|
|
3139
|
-
end(chunk: Buffer, callback: Callback<GridFSFile | void>):
|
|
3140
|
-
end(chunk: Buffer, encoding: BufferEncoding):
|
|
3141
|
-
end(chunk: Buffer, encoding: BufferEncoding | undefined, callback: Callback<GridFSFile | 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
|
-
} ?
|
|
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
|
-
|
|
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<
|
|
3695
|
-
connect(callback: Callback<
|
|
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
|
|
4047
|
+
* @param hello - A hello response from the server
|
|
3938
4048
|
*/
|
|
3939
|
-
resolveAuthMechanism(
|
|
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
|
|
4365
|
-
_id
|
|
4366
|
-
} ?
|
|
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 "
|
|
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/
|
|
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(
|
|
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
|
|
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
|
|
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
|
|
4804
|
-
* the
|
|
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
|
|
4985
|
+
* Emitted when the server monitor’s hello succeeds.
|
|
4815
4986
|
* @public
|
|
4816
4987
|
* @category Event
|
|
4817
4988
|
*/
|