[SERVER-35279] updatedFields in Change Streams documents using dot in keys Created: 30/May/18  Updated: 06/Dec/22  Resolved: 08/Jun/18

Status: Closed
Project: Core Server
Component/s: Querying
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Alexander Seipel Assignee: Backlog - Query Team (Inactive)
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates SERVER-21889 Oplog format for $set operations on s... Backlog
Assigned Teams:
Query
Operating System: ALL
Participants:

 Description   

 

Take the following example document:

{
   "_id": "abc123",
   "name": "Testitem",
   "item": {
      "color": "blue",
      "size": 4,
      "price": 10
   }
}

If the document is updated using:

{
   "$set": {
      "item.color": "red",
      "item.size": 5
   }
}

Then a change stream listening to updates will receive a response like this:

 

{
   "updateDescription": {
      "updatedFields": {
         "item.color": "red",
         "item.size": 5
      }
   }
}

Because the updated fields are written to updateDescription.updatedFields with a dot as a separator, it is impossible to query the updatedFields (see SERVER-30575) for example to only listen to updates if the "item.color" property changes. 

 



 Comments   
Comment by Asya Kamsky [ 01/Jun/18 ]

This is basically duplicate of SERVER-21889 (also SERVER-32782 closed as dup)

A workaround exists that's described in the same ticket.

 

Comment by Ramon Fernandez Marina [ 31/May/18 ]

Thanks for your report aseipel, this is now on the Query Team for investigation. We'll post updates to this ticket when they happen.

Regards,
Ramón.

Generated at Thu Feb 08 04:39:22 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.