summaryrefslogtreecommitdiff
path: root/src/mongo/db/pipeline/document_source_change_stream.idl
diff options
context:
space:
mode:
authorJonathan Reams <jbreams@mongodb.com>2020-02-10 10:16:59 +0100
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-02-10 13:08:24 +0000
commit1a8fea4b5a2fe7ec14d88d1ce4e7c8a1eaaa03cd (patch)
tree2c15f4dc5129ffa398ff4f07938754b62bbfb8a8 /src/mongo/db/pipeline/document_source_change_stream.idl
parent6c9c0b19d5980f065e1ff2ad624bb8d18bb88fe5 (diff)
downloadmongo-1a8fea4b5a2fe7ec14d88d1ce4e7c8a1eaaa03cd.tar.gz
SERVER-45807 Add change stream stage to fetch pre-image for update/replace/delete events
create mode 100644 jstests/change_streams/lookup_pre_image.js create mode 100644 jstests/noPassthrough/change_stream_pre_image_lookup_whole_db_whole_cluster.js create mode 100644 jstests/noPassthrough/change_stream_preimages_fail_on_mongos.js create mode 100644 src/mongo/db/pipeline/document_source_lookup_change_pre_image.cpp create mode 100644 src/mongo/db/pipeline/document_source_lookup_change_pre_image.h
Diffstat (limited to 'src/mongo/db/pipeline/document_source_change_stream.idl')
-rw-r--r--src/mongo/db/pipeline/document_source_change_stream.idl33
1 files changed, 32 insertions, 1 deletions
diff --git a/src/mongo/db/pipeline/document_source_change_stream.idl b/src/mongo/db/pipeline/document_source_change_stream.idl
index 410e5ab9f15..485a42cef9e 100644
--- a/src/mongo/db/pipeline/document_source_change_stream.idl
+++ b/src/mongo/db/pipeline/document_source_change_stream.idl
@@ -51,6 +51,19 @@ types:
serializer: ResumeToken::toBSON_do_not_use
deserializer: ResumeToken::parse
+enums:
+ FullDocumentBeforeChangeMode:
+ description: Possible modes for the 'fullDocumentBeforeChange' parameter of the
+ $changeStream stage.
+ type: string
+ values:
+ # Do not supply pre-images.
+ kOff: "off"
+ # Supply a pre-image if available. Otherwise, omit the output field.
+ kWhenAvailable: "whenAvailable"
+ # Pre-images are required. Throw an exception if not available.
+ kRequired: "required"
+
structs:
ResumeTokenClusterTime:
description: The IDL type of cluster time
@@ -86,12 +99,28 @@ structs:
description: The operation time after which we should start reporting changes.
Only one of resumeAfter, _resumeAfterClusterTimeDeprecated, and
startAtOperationTime should be specified.
+
fullDocument:
cpp_name: fullDocument
type: string
default: '"default"'
description: A string '"updateLookup"' or '"default"', indicating whether or not we
should return a full document or just changes for an update.
+
+ fullDocumentBeforeChange:
+ cpp_name: fullDocumentBeforeChange
+ type: FullDocumentBeforeChangeMode
+ default: kOff
+ description: Valid values are "off", "whenAvailable", or "required". If set to
+ "off", the "fullDocumentBeforeChange" field of the output document
+ is always omitted. If set to "whenAvailable", the
+ "fullDocumentBeforeChange" field will be populated with the
+ pre-image of the document modified by the current change event if
+ such a pre-image is available, and will be omitted otherwise. If
+ set to "required", then the "fullDocumentBeforeChange" field is
+ always populated and an exception is thrown if the pre-image is not
+ available.
+
allChangesForCluster:
cpp_name: allChangesForCluster
type: bool
@@ -99,6 +128,7 @@ structs:
description: A flag indicating whether the stream should report all changes that
occur on the deployment, aside from those on internal databases or
collections.
+
showMigrationEvents:
cpp_name: showMigrationEvents
type: bool
@@ -109,6 +139,7 @@ structs:
deletes may appear that do not reflect actual deletions or insertions
of data. Instead they reflect this data moving from one shard to
another.
+
allowToRunOnConfigDB:
cpp_name: allowToRunOnConfigDB
type: bool
@@ -116,4 +147,4 @@ structs:
description: A flag indicating whether the change stream may be opened on the
'config' database, which is usually banned. This flag is used
internally to allow mongoS to open a stream on 'config.shards', in
- order to monitor for the addition of new shards to the cluster. \ No newline at end of file
+ order to monitor for the addition of new shards to the cluster.