replaceOne() also returns the replacement document?

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Major - P3
    • 3.3.3, 3.4.0
    • Affects Version/s: 3.2.5
    • Component/s: None
    • None
    • None
    • None
    • None
    • None
    • None

      I've just noticed that a call to replaceOne() also includes in the updateWriteOpResult the replacement document, in the undocumented ops array.

      Is this intended? For large replacement documents, this could be a performance problem.
      Also, this behavior becomes identical to findOneAndReplace() called with returnOriginal: false. My expectation was that replaceOne() did not return the replaced or replacement document.

      In any case, it would help to document the ops array.

            Assignee:
            Daniel Aprahamian (Inactive)
            Reporter:
            Dan Dascalescu
            None
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: