Uploaded image for project: 'Compass '
  1. Compass
  2. COMPASS-4345

Compass does a replace instead of an update when documents are edited.

    • Type: Icon: Story Story
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 1.24.1
    • Affects Version/s: None
    • Component/s: None
    • None
    • 3
    • Iteration Icaco, Iteration Jackfruit, Iteration Kiwi, Iteration Lime, Iteration Maracuja
    • Needed
    • Hide

      This ticket updates the functionality of document editing. Instead of replacing a document, and possibly losing changes which occurred in the background, this change makes it so that the documents are now updated. In cases where the fields being changed do not exist in the form which they were originally shown to a user, we show a message: `Document was modified in the background or it longer exists. Do you wish to continue and possibly overwrite new changes?` If the users clicks 'update' the document is replaced, if the user clicks 'cancel', the document is returned to its original unedited state.

      With the JSON editor view, documents are still fully replaced. The table view uses the new update functionality.

      Show
      This ticket updates the functionality of document editing. Instead of replacing a document, and possibly losing changes which occurred in the background, this change makes it so that the documents are now updated. In cases where the fields being changed do not exist in the form which they were originally shown to a user, we show a message: `Document was modified in the background or it longer exists. Do you wish to continue and possibly overwrite new changes?` If the users clicks 'update' the document is replaced, if the user clicks 'cancel', the document is returned to its original unedited state. With the JSON editor view, documents are still fully replaced. The table view uses the new update functionality.

      Feedback from drew.dipalma on this:

      We’re seeing more and more issues with Compass/Data Explorer using a ‘replace’ vs. ‘update’ when changes are made – is this some that’s planned to change in the future?

      The core of what’s causing this to come up more is that it’s emerging as a common pattern to test sync with an emulator + Compass/Explorer. However, as replace is being used when someone makes a change offline on an emulator and then changes in our tools the emulator update is overwritten even if the updates were to separate fields.

      We’re still seeing the issue we talked about before around testing Triggers, but this new case is even less intuitive for users.

      Open questions

      • If we do nothing about this, will the VS Code extension have the same behavior when we implement document editing?

            Assignee:
            rhys.howell@mongodb.com Rhys Howell
            Reporter:
            massimiliano.marcon@mongodb.com Massimiliano Marcon
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: