Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions source/change-streams/change-streams.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ class ChangeStreamDocument {

/**
* Only present for ops of type 'rename', 'create', 'modify', 'createIndexes', 'dropIndexes', 'shardCollection', 'reshardCollection', 'refineCollectionShardKey'.
* Prior to server version 8.2.0, only present when the `showExpandedEvents` change stream option is enabled.
* Only present when the `showExpandedEvents` change stream option is enabled.
*
* A description of the operation.
*
Expand Down Expand Up @@ -202,7 +202,7 @@ class ChangeStreamDocument {
/**
* The `ui` field from the oplog entry corresponding to the change event.
*
* Only present for the following events:
* Only present when the `showExpandedEvents` change stream option is enabled and for the following events:
* - 'insert'
* - 'update'
* - 'delete'
Expand All @@ -214,7 +214,6 @@ class ChangeStreamDocument {
* - 'shardCollection'
* - 'reshardCollection'
* - 'refineCollectionShardKey'
* Prior to server versions 8.2, only present when the `showExpandedEvents` change stream option is enabled.
*
* This field is a value of binary subtype 4 (UUID).
*
Expand Down Expand Up @@ -299,6 +298,8 @@ class UpdateDescription {
*
* In each array, all elements will be returned as strings with the exception of array indices, which will be returned as 32 bit integers.
*
* Only present when the `showExpandedEvents` change stream option is enabled.
*
* @since 6.1.0
*/
disambiguatedPaths: Optional<Document>
Expand Down Expand Up @@ -1026,6 +1027,8 @@ There should be no backwards compatibility concerns.

## Changelog

- 2025-09-09: Revert expanded field visibility change.

- 2025-09-08: Clarify resume behavior.

- 2025-03-31: Update for expanded field visibility in server 8.2+
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,41 @@ initialData:
documents: []

tests:
- description: "disambiguatedPaths is not present when showExpandedEvents is false/unset"
# skip server version 8.2.0, which emits disambiguatedPaths unconditionally
runOnRequirements:
- minServerVersion: "6.1.0"
maxServerVersion: "8.1.99"
topologies: [ replicaset, load-balanced, sharded ]
serverless: forbid
- minServerVersion: "8.2.1"
topologies: [ replicaset, load-balanced, sharded ]
serverless: forbid
operations:
- name: insertOne
object: *collection0
arguments:
document: { _id: 1, 'a': { '1': 1 } }
- name: createChangeStream
object: *collection0
arguments: { pipeline: [] }
saveResultAsEntity: &changeStream0 changeStream0
- name: updateOne
object: *collection0
arguments:
filter: { _id: 1 }
update: { $set: { 'a.1': 2 } }
- name: iterateUntilDocumentOrError
object: *changeStream0
expectResult:
operationType: "update"
ns: { db: *database0, coll: *collection0 }
updateDescription:
updatedFields: { $$exists: true }
removedFields: { $$exists: true }
truncatedArrays: { $$exists: true }
disambiguatedPaths: { $$exists: false }

- description: "disambiguatedPaths is present on updateDescription when an ambiguous path is present"
operations:
- name: insertOne
Expand Down
Loading