Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-2455

Clarify the "Isolate Sequence of Operations" doc

    • Type: Icon: Task Task
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • v1.3.11, v1.3.14
    • Affects Version/s: None
    • Component/s: manual
    • Labels:
      None

      The "Isolate Sequence of Operations" document is somewhat confusing. Specifically:

      "Use the entire document as the query in the update() operation, to generalize the operation and guarantee that the original document was not modified, rather than ensuring that as single field was not changed."

      This sentence is incorrect in general, specifying the entire document as the selector in update() will continue to match the document after new fields are added.

      Solutions: (1) drop this recommendation, (2) add caveats to it, e.g., that using the entire document works if and only if all updaters only ever do in-place updates, but never add new fields and never cause field reordering, (3) much more complicated-ly, for each updater to specify $not $exists for any fields that other updaters might be adding (though this approach, while logically valid, would be insanely bad engineering).

      Probably dropping the bullet would be best.

      More generally this document is confusing: the preamble talks about multi-document isolation, but this pattern is about optimistic concurrency, not isolation.

            Assignee:
            kay.kim@mongodb.com Kay Kim (Inactive)
            Reporter:
            richard.kreuter Richard Kreuter (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:
              9 years, 26 weeks, 6 days ago