Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-35279

updatedFields in Change Streams documents using dot in keys

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Querying
    • None
    • Query
    • ALL

       

      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. 

       

            Assignee:
            backlog-server-query Backlog - Query Team (Inactive)
            Reporter:
            aseipel Alexander Seipel
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved: