-
Notifications
You must be signed in to change notification settings - Fork 245
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 all 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-05-17 | ||
| :Version: 1.15 | ||
| :Last Modified: 2022-05-19 | ||
| :Version: 1.16 | ||
|
|
||
| .. 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"; | ||
|
|
||
|
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', 'create', 'modify', 'createIndexes', 'dropIndexes', 'shardCollection', 'reshardCollection', 'refineCollectionShardKey'. | ||
| * Only present when the `showExpandedEvents` change stream option is enabled. | ||
| * | ||
| * A description of the operation. | ||
| * | ||
| * @since 6.0.0 | ||
| */ | ||
| operationDescription: Optional<Document> | ||
|
|
||
| /** | ||
| * Only present for ops of type ‘insert’, ‘update’, ‘replace’, and | ||
| * ‘delete’. | ||
|
|
@@ -168,9 +192,6 @@ 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>; | ||
|
|
||
|
|
@@ -208,7 +229,29 @@ If an aggregate command with a ``$changeStream`` stage completes successfully, t | |
| * The wall time from the mongod that the change event originated from. | ||
| * Populated for server versions 6.0 and above. | ||
| */ | ||
| wallTime: Optional<Datetime>; | ||
| wallTime: Optional<DateTime>; | ||
|
|
||
| /** | ||
| * 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' | ||
| * | ||
| * This field is a value of binary subtype 4 (UUID). | ||
| * | ||
| * @since 6.0.0 | ||
| */ | ||
| collectionUUID: Optional<Binary>; | ||
| } | ||
|
|
||
| class UpdateDescription { | ||
|
|
@@ -496,6 +539,24 @@ 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 additional events included with this flag set are | ||
| * - createIndexes | ||
| * - dropIndexes | ||
| * - modify | ||
| * - create | ||
| * - shardCollection | ||
| * - reshardCollection | ||
| * - refineCollectionShardKey | ||
| * | ||
| * This flag is available in server versions greater than 6.0.0. `reshardCollection` and | ||
| * `refineCollectionShardKey` events are not available until server version 6.1.0. | ||
| * | ||
| * @note this is an option of the change stream pipeline stage | ||
| */ | ||
| showExpandedEvents: Optional<Boolean> | ||
| } | ||
|
|
||
| **NOTE:** The set of ``ChangeStreamOptions`` may grow over time. | ||
|
|
@@ -1007,3 +1068,5 @@ Changelog | |
| +------------+------------------------------------------------------------+ | ||
| | 2022-05-17 | Added ``wallTime`` to ``ChangeStreamDocument``. | | ||
| +------------+------------------------------------------------------------+ | ||
| | 2022-05-19 | Support new change stream events with showExpandedEvents. | | ||
| +------------+------------------------------------------------------------+ | ||
Uh oh!
There was an error while loading. Please reload this page.