[SERVER-75590] db.Watch returns inconsistent updatedFields when working with arrays Created: 03/Apr/23 Updated: 31/Aug/23 Resolved: 31/Aug/23 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | 5.0.15 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | SpirIT N/A | Assignee: | Sebastien Mendez |
| Resolution: | Won't Do | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Assigned Teams: |
Query Execution
|
||||||||||||||||||||||||||||||||||||
| Operating System: | ALL | ||||||||||||||||||||||||||||||||||||
| Steps To Reproduce: |
The Output of stream:
Performing the next $push:
The Output of stream:
What to expect? In my opinion the first stream event should look like:
instead of:
|
||||||||||||||||||||||||||||||||||||
| Sprint: | QE 2023-09-18 | ||||||||||||||||||||||||||||||||||||
| Participants: |
| Description |
|
I expected to have a consistent return element inside the `updatedFields` when working with the watch and updateOne + $push functionality. When performing a coll.Watch and then a $push on an array inside the document, What to expect
What is actually returns
Sidenotes: I made sure that scores is an empty array. I'm working with Free Mongo Cloud, in case it is important my cluster: For JS this wouldn't be that of a problem, but with strictly typed languages like GOLang this is annoying to work around. |
| Comments |
| Comment by Sebastien Mendez [ 31/Aug/23 ] |
|
The output format provided by the changestreams is intentionally aligned with the oplog format and is delivered without modification. Both the oplog and the changestreams format are designed for idempotence and size efficiency. While we are open to exploring different approaches, making adjustments to the oplog would carry significant repercussions. Therefore, I regret to inform you that the proposed change is not planned in the near future. |
| Comment by Eric Sedor [ 28/Jun/23 ] |
|
Thanks for your patience stefan.binder89@gmail.com; I'm passing this to an appropriate team to consider. |