Skip to content

Commit 0aee4aa

Browse files
authored
DRIVERS-3151 Update change stream expanded field visibility (#1780)
1 parent f354960 commit 0aee4aa

File tree

5 files changed

+19
-94
lines changed

5 files changed

+19
-94
lines changed

source/change-streams/change-streams.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ class ChangeStreamDocument {
139139

140140
/**
141141
* Only present for ops of type 'rename', 'create', 'modify', 'createIndexes', 'dropIndexes', 'shardCollection', 'reshardCollection', 'refineCollectionShardKey'.
142-
* Only present when the `showExpandedEvents` change stream option is enabled.
142+
* Prior to server version 8.2.0, only present when the `showExpandedEvents` change stream option is enabled.
143143
*
144144
* A description of the operation.
145145
*
@@ -202,7 +202,7 @@ class ChangeStreamDocument {
202202
/**
203203
* The `ui` field from the oplog entry corresponding to the change event.
204204
*
205-
* Only present when the `showExpandedEvents` change stream option is enabled and for the following events
205+
* Only present for the following events:
206206
* - 'insert'
207207
* - 'update'
208208
* - 'delete'
@@ -214,6 +214,7 @@ class ChangeStreamDocument {
214214
* - 'shardCollection'
215215
* - 'reshardCollection'
216216
* - 'refineCollectionShardKey'
217+
* Prior to server versions 8.2, only present when the `showExpandedEvents` change stream option is enabled.
217218
*
218219
* This field is a value of binary subtype 4 (UUID).
219220
*
@@ -1016,6 +1017,8 @@ There should be no backwards compatibility concerns.
10161017

10171018
## Changelog
10181019

1020+
- 2025-03-31: Update for expanded field visibility in server 8.2+
1021+
10191022
- 2025-02-24: Make `nsType` `Optional` to match other optional fields in the change stream spec.
10201023

10211024
- 2025-01-29: Add `nsType` to `ChangeStreamDocument`.

source/change-streams/tests/unified/change-streams-disambiguatedPaths.json

Lines changed: 0 additions & 64 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

source/change-streams/tests/unified/change-streams-disambiguatedPaths.yml

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -24,32 +24,6 @@ initialData:
2424
documents: []
2525

2626
tests:
27-
- description: "disambiguatedPaths is not present when showExpandedEvents is false/unset"
28-
operations:
29-
- name: insertOne
30-
object: *collection0
31-
arguments:
32-
document: { _id: 1, 'a': { '1': 1 } }
33-
- name: createChangeStream
34-
object: *collection0
35-
arguments: { pipeline: [] }
36-
saveResultAsEntity: &changeStream0 changeStream0
37-
- name: updateOne
38-
object: *collection0
39-
arguments:
40-
filter: { _id: 1 }
41-
update: { $set: { 'a.1': 2 } }
42-
- name: iterateUntilDocumentOrError
43-
object: *changeStream0
44-
expectResult:
45-
operationType: "update"
46-
ns: { db: *database0, coll: *collection0 }
47-
updateDescription:
48-
updatedFields: { $$exists: true }
49-
removedFields: { $$exists: true }
50-
truncatedArrays: { $$exists: true }
51-
disambiguatedPaths: { $$exists: false }
52-
5327
- description: "disambiguatedPaths is present on updateDescription when an ambiguous path is present"
5428
operations:
5529
- name: insertOne

source/change-streams/tests/unified/change-streams.json

Lines changed: 11 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

source/change-streams/tests/unified/change-streams.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,8 @@ tests:
115115
"field": "array",
116116
"newSize": 2
117117
}
118-
]
118+
],
119+
disambiguatedPaths: { $$unsetOrMatches: { $$exists: true } }
119120
}
120121
}
121122

@@ -722,6 +723,7 @@ tests:
722723
updatedFields: { x: 2 }
723724
removedFields: []
724725
truncatedArrays: { $$unsetOrMatches: { $$exists: true } }
726+
disambiguatedPaths: { $$unsetOrMatches: { $$exists: true } }
725727
- name: iterateUntilDocumentOrError
726728
object: *changeStream0
727729
expectResult:

0 commit comments

Comments
 (0)