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

Add data-service method to retrieve before/after documents for update preview

    • Type: Icon: Task Task
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 1.40.4
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • 1
    • Not Needed

      (Copied from tech-design, check there in case this goes out of sync.)

      In data-service, add a new method `getUpdatePreview(ns, filter, update)` that will resolve with sampled documents and those same documents with the update applied.

      Using the filter that will be run when we perform the update, limit the results to just a few documents and get their ids, then in a transaction perform the update on just those documents, read out the documents and then roll back the transaction. Resolve with the originals and the updated documents.

      We need something that will keep finding the same documents (within reason) when run repeatedly. The easiest way might just be a limit to take the first few for now.

      This operation will be debounced as the user types and consequently it will often reject with driver or database errors whenever the update is invalid.

      What to do with the “before” and “after” documents (ie. use the after as is for the preview, diff them, do some other visual comparison, display both..) is then up to another ticket.

            Assignee:
            kevin.mas@mongodb.com Kevin Mas Ruiz
            Reporter:
            leroux.bodenstein@mongodb.com Le Roux Bodenstein
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: