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

Change Streams for complex nested fields

    • Type: Icon: Improvement Improvement
    • Resolution: Works as Designed
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Query Execution 2021-07-26, QE 2021-08-09, QE 2021-08-23

      Is there a way to determine what exactly was changed on the nested field of the document? 

      One of the fields in my document is "branding" (shown below). If a change occurs to a single field under "branding", the change stream will return an entire "branding" object and there is no way to know which exact sub-field was affected. 

      "branding": {
              "control_panel": {
                  "primaryFont": {
                      "name": "c713b99e-40d4-4d31-629a-6def5f7963c6.ttf",
                      "displayName": "Arial",
                      "fileType": "tff"
                  },
                  "secondaryFont": {
                      "name": "c713b99e-40d4-4d31-629a-6def5f7963c6.ttf",
                      "displayName": "Arial",
                      "fileType": "tff"
                  },
                  "companyLogo": {
                      "name": "18c0c0ef-5d4c-4a3e-b16c-a8f640c3e2be.png",
                      "displayName": "1200px-Logo_NIKE.svg",
                      "fileType": "png"
                  },
                  "backgroundImage": {
                      "name": "8d1cc393-0132-4a3f-9b2a-d5a9a68bd4e4.jpg",
                      "displayName": "s23-slams_original-web",
                      "fileType": "jpg"
                  },
                  "primaryColor": "ffffff",
                  "secondaryColor": "ffffff",
                  "primaryFontWeight": "bold",
                  "secondaryFontWeight": "regular",
                  "publishSchedule": "AUTOMATIC",
                  "publishScheduleStatus": "UNPUBLISHED",
                  "videoRecording": "DEFAULT",
                  "videoRecordingLink": null,
                  "hideVideoRecording": false,
                  "hideMeetingReplay": false
              },
              "registration_page": {
                  "openRegistration": "15",
                  "proxyWebsiteLink": null,
                  "termsAndConditionsUrl": null,
                  "title": "New Event - test copy",
                  "description": ""
              },
              "pre_event_page": {
                  "message": "",
                  "lobbyMessage": "",
                  "musicOption": "DEFAULT"
              },
              "thank_you_page": {
                  "title": "test event",
                  "description": ""
              },
              "post_event_page": {
                  "meetingDetails": ""
              }
          },
      

       This makes change streams useless unless I apply custom business logic and store all the changes and then perform JSON diff myself. 

       

      Is there a better way? 

            Assignee:
            bernard.gorman@mongodb.com Bernard Gorman
            Reporter:
            stany@q4inc.com Stan Yeshchenko
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: