-
Notifications
You must be signed in to change notification settings - Fork 247
DRIVERS-1975: Add showExpandedEvents flag and new change stream events
#1220
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 3 commits
23d4bb8
8fe1300
8dbc64d
74df404
a7f0e60
2ec068c
6064dea
3ee0aa3
7695114
9c713d2
9b70252
81449d4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,8 +9,8 @@ Change Streams | |
| :Status: Accepted | ||
| :Type: Standards | ||
| :Minimum Server Version: 3.6 | ||
| :Last Modified: 2022-04-13 | ||
| :Version: 1.14 | ||
| :Last Modified: 2022-05-17 | ||
| :Version: 1.15 | ||
|
|
||
| .. contents:: | ||
|
|
||
|
|
@@ -137,7 +137,21 @@ If an aggregate command with a ``$changeStream`` stage completes successfully, t | |
| * MUST NOT err when they encounter a new `operationType`. Unknown `operationType` | ||
| * values may be represented by "unknown" or the literal string value. | ||
| */ | ||
| operationType: "insert" | "update" | "replace" | "delete" | "invalidate" | "drop" | "dropDatabase" | "rename"; | ||
| operationType: "insert" | ||
| | "update" | ||
| | "replace" | ||
| | "delete" | ||
| | "invalidate" | ||
| | "drop" | ||
| | "dropDatabase" | ||
| | "rename" | ||
| | "createIndexes" | ||
| | "dropIndexes" | ||
| | "modify" | ||
| | "create" | ||
| | "shardCollection" | ||
| | "refineCollectionShardKey" | ||
| | "reshardCollection"; | ||
|
benjirewis marked this conversation as resolved.
|
||
|
|
||
|
Comment on lines
+153
to
155
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Gotcha. Sounds like the feature flag won't be supported until 6.1.0. I agree that we should file a follow-up ticket and add tests once the feature flag can be enabled and drivers can actually test. |
||
| /** | ||
| * Contains two fields: "db" and "coll" containing the database and | ||
|
|
@@ -155,6 +169,16 @@ If an aggregate command with a ``$changeStream`` stage completes successfully, t | |
| */ | ||
| to: Optional<Document>; | ||
|
|
||
| /** | ||
| * Only present for ops of type 'rename', 'createIndexes', 'dropIndexes', 'shardCollection', 'reshardCollection', 'refineCollectionShardKey'. | ||
|
benjirewis marked this conversation as resolved.
Outdated
|
||
| * Only present when the `showExpandedEvents` change stream option is enabled. | ||
| * | ||
| * An description of the operation. | ||
|
baileympearson marked this conversation as resolved.
Outdated
|
||
| * | ||
| * @since 6.1.0 | ||
| */ | ||
| operationDescription: Optional<Document> | ||
|
|
||
| /** | ||
| * Only present for ops of type ‘insert’, ‘update’, ‘replace’, and | ||
| * ‘delete’. | ||
|
|
@@ -168,11 +192,8 @@ If an aggregate command with a ``$changeStream`` stage completes successfully, t | |
|
|
||
| /** | ||
| * Only present for ops of type ‘update’. | ||
| * | ||
| * Contains a description of updated and removed fields in this | ||
| * operation. | ||
| */ | ||
| updateDescription: Optional<UpdateDescription>; | ||
| updateDescription: Optional<UpdateDescription | Document>; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a breaking change for the Rust driver (going from a struct to an enum in a public API); from the syntax doc, it looks like the underlying change is the addition of a
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually this change was unintentional. Originally I wrote the spec update to include the The |
||
|
|
||
| /** | ||
| * Always present for operations of type 'insert' and 'replace'. Also | ||
|
|
@@ -203,6 +224,35 @@ If an aggregate command with a ``$changeStream`` stage completes successfully, t | |
| * pre-image is unavailable, this will be explicitly set to null. | ||
| */ | ||
| fullDocumentBeforeChange: Document | null; | ||
|
|
||
| /** | ||
| * The `wall` time from the oplog entry corresponding to the change event. | ||
| * | ||
| * Only present when the `showExpandedEvents` change stream option is enabled. | ||
| * | ||
| * @since 6.0.0 | ||
| */ | ||
| wallTime: Date; | ||
|
|
||
| /** | ||
| * The `ui` field from the oplog entry corresponding to the change event. | ||
| * | ||
| * Only present when the `showExpandedEvents` change stream option is enabled and for the following events | ||
| * - 'insert' | ||
| * - 'update' | ||
| * - 'delete' | ||
| * - 'createIndexes' | ||
| * - 'dropIndexes' | ||
| * - 'modify' | ||
| * - 'drop' | ||
| * - 'create' | ||
| * - 'shardCollection' | ||
| * - 'reshardCollection' | ||
| * - 'refineCollectionShardKey' | ||
| * | ||
| * @since 6.0.0 | ||
| */ | ||
| collectionUUID: UUID; | ||
| } | ||
|
|
||
| class UpdateDescription { | ||
|
|
@@ -490,6 +540,22 @@ Driver API | |
| * @note this is an aggregation command option | ||
| */ | ||
| comment: Optional<any> | ||
|
|
||
| /** | ||
| * Enables the server to send the 'expanded' list of change stream events. | ||
| * The list of events included with this flag set are | ||
|
baileympearson marked this conversation as resolved.
Outdated
|
||
| * - createIndexes | ||
| * - dropIndexes | ||
| * - modify | ||
| * - create | ||
| * - shardCollection | ||
| * - reshardCollection | ||
| * - refineCollectionShardKey | ||
| * | ||
| * @since 6.0.0 | ||
| * @note this is an option of the change stream pipeline stage | ||
| */ | ||
| showExpandedEvents: Optional<Boolean> | ||
| } | ||
|
|
||
| **NOTE:** The set of ``ChangeStreamOptions`` may grow over time. | ||
|
|
@@ -999,3 +1065,5 @@ Changelog | |
| | 2022-04-13 | Support returning point-in-time pre and post-images with | | ||
| | | ``fullDocumentBeforeChange`` and ``fullDocument``. | | ||
| +------------+------------------------------------------------------------+ | ||
| | 2022-05-18 | Support new change stream events for C2C replication | | ||
| +------------+------------------------------------------------------------+ | ||
Uh oh!
There was an error while loading. Please reload this page.