Type Definitions
-
ChangeStreamOptions
-
Options that can be passed to a ChangeStream. Note that startAfter, resumeAfter, and startAtOperationTime are all mutually exclusive, and the server will error if more than one is specified.
Properties:
Name Type Argument Default Description fullDocumentstring <optional>
'default' Allowed values: ‘default’, ‘updateLookup’. When set to ‘updateLookup’, the change stream will include both a delta describing the changes to the document, as well as a copy of the entire document that was changed from some time after the change occurred.
maxAwaitTimeMSnumber <optional>
The maximum amount of time for the server to wait on new documents to satisfy a change stream query.
resumeAfterResumeToken <optional>
Allows you to start a changeStream after a specified event. See ChangeStream documentation.
startAfterResumeToken <optional>
Similar to resumeAfter, but will allow you to start after an invalidated event. See ChangeStream documentation.
startAtOperationTimeOperationTime <optional>
Will start the changeStream after the specified operationTime.
batchSizenumber <optional>
1000 The number of documents to return per batch. See aggregation documentation.
collationobject <optional>
Specify collation settings for operation. See aggregation documentation.
readPreferenceReadPreference <optional>
The read preference. Defaults to the read preference of the database or collection. See read preference documentation.
-
DriverInfoOptionsObject
-
Configuration options for drivers wrapping the node driver.
Properties:
Name Type Argument Description namestring <optional>
The name of the driver
versionstring <optional>
The version of the driver
platformstring <optional>
Optional platform information
-
DriverInfoOptionsObject
-
Configuration options for drivers wrapping the node driver.
Properties:
Name Type Argument Description namestring <optional>
The name of the driver
versionstring <optional>
The version of the driver
platformstring <optional>
Optional platform information
-
KMSProvidersobject
-
Configuration options that are used by specific KMS providers during key generation, encryption, and decryption.
Properties:
Name Type Argument Description awsobject <optional>
Configuration options for using 'aws' as your KMS provider
Properties
Name Type Argument Description accessKeyIdstring <optional>
The access key used for the AWS KMS provider
secretAccessKeystring <optional>
The secret access key used for the AWS KMS provider
localobject <optional>
Configuration options for using 'local' as your KMS provider
Properties
Name Type Argument Description keyBuffer <optional>
The master key used to encrypt/decrypt data keys. A 96-byte long Buffer.
-
OperationTime
-
Represents a specific point in time on a server. Can be retrieved by using
Db#command -
ReadConcernObject
-
The MongoDB ReadConcern, which allows for control of the consistency and isolation properties
of the data read from replica sets and replica set shards.- See:
Properties:
Name Type Description level'local' | 'available' | 'majority' | 'linearizable' | 'snapshot' The readConcern Level
-
ReadConcernLevel'local' 'available' 'majority' 'linearizable' 'snapshot'
-
A string specifying the level of a ReadConcern
-
ResumeToken
-
Represents the logical starting point for a new or resuming
ChangeStreamon the server. -
SessionIdObject
-
A BSON document reflecting the lsid of a
ClientSession -
SessionOptionsObject
-
Options to pass when creating a Client Session
Properties:
Name Type Argument Default Description causalConsistencyboolean <optional>
true Whether causal consistency should be enabled on this session
defaultTransactionOptionsTransactionOptions <optional>
The default TransactionOptions to use for transactions started on this session.
-
TransactionOptionsObject
-
Configuration options for a transaction.
Properties:
Name Type Argument Description readConcernReadConcern <optional>
A default read concern for commands in this transaction
writeConcernWriteConcern <optional>
A default writeConcern for commands in this transaction
readPreferenceReadPreference <optional>
A default read preference for commands in this transaction
-
WithTransactionCallback(session){Promise}
-
A user provided function to be run within a transaction
Name Type Description sessionClientSession The parent session of the transaction running the operation. This should be passed into each operation within the lambda.
Returns:
resulting Promise of operations run within this transaction
-
WriteConcernObject
-
A MongoDB WriteConcern, which describes the level of acknowledgement
requested from MongoDB for write operations.- See:
Properties:
Name Type Argument Default Description wnumber | 'majority' | string <optional>
1 requests acknowledgement that the write operation has
propagated to a specified number of mongod hostsjboolean <optional>
false requests acknowledgement from MongoDB that the write operation has
been written to the journalwtimeoutnumber <optional>
a time limit, in milliseconds, for the write concern